Git Product home page Git Product logo

oras-csi's Introduction

CSI ORAS Driver

This repository is a test to create a CSI driver into one that uses ORAS to generate a cluster-level cache of artifacts. Read about the use cases or jump in!

	██████╗ ██████╗  █████╗ ███████╗       ██████╗███████╗██╗
	██╔═══██╗██╔══██╗██╔══██╗██╔════╝      ██╔════╝██╔════╝██║
	██║   ██║██████╔╝███████║███████╗█████╗██║     ███████╗██║
	██║   ██║██╔══██╗██╔══██║╚════██║╚════╝██║     ╚════██║██║
	╚██████╔╝██║  ██║██║  ██║███████║      ╚██████╗███████║██║
	 ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝       ╚═════╝╚══════╝╚═╝

Background

A CSI or "Container storage interface" is a standard plugin that we can instantiate to make it easy for others to use it in their Kubernetes clusters. At least, this is my current level of understanding. What I want to get working is an emphemeral, inline plugin that sits alongside a node and can keep a local cache of artifacts (e.g., containers or data) to be used between different pod runs (e.g., an indexed job).

For documentation, see our early docs folder.

TODO

  • add more kubernetes app labels?
  • test with kind, write up tutorial (https issue too)
  • add concept of cleanup (on level of CSIDriver and pod?)
  • what about more customization to pull (e.g., pull if newer?)
  • everything must be tested, with tested examples
  • custom naming / locations for mount? Or should be handled by app?
  • better levels / control for logging

Planning

These are ideas / features that would be nice to have:

  • standards for defining assets and actions to take (e.g., copy this binary here, this directory here, get this annotation and do X, name this file Y)
  • in addition to namespace, some other permissions / security features?
  • ability to add pull secrets to artifacts
  • an ability to specify conditions for cleaning up an artifact when the kubernetes pod / object is deleted
  • Allow predictable naming for an artifact

This is a pretty good start for a quick prototype!

Thanks

I looked at a lot of examples to figure out the basic architecture I wanted to use. Here are the ones that I liked the design for:

  • csi-inline-volume
  • moosefs-csi is what I used to learn and template the design here, also under an Apache 2.0 license. This is Copyright of Saglabs SA.

License

HPCIC DevTools is distributed under the terms of the MIT license. All new contributions must be made under this license.

See LICENSE, COPYRIGHT, and NOTICE for details.

SPDX-License-Identifier: (MIT)

LLNL-CODE- 842614

oras-csi's People

Contributors

sajayantony avatar vsoch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

oras-csi's Issues

Enable k8s labels that align CSI for grouping logging

Grouping the labels enables us to query for all pods from components that might be a part of the CSI driver.

For e.g.

kubectl logs --follow $(kubectl get pods -l 'app.kubernetes.io/name=csi-hostpathplugin' --all-namespaces -o jsonpath='{.items[*].metadata.name}')

Basically update the chart/deployments to componentized labels.

  labels:
    app.kubernetes.io/instance: csi.oras.land 
    app.kubernetes.io/part-of: csi-driver-oras
    app.kubernetes.io/name: csi.oras.land
    app.kubernetes.io/component: oras-csi-driver

See - main...sajayantony:oras-csi:labels#diff-a8700dba16974edcf2b009ae853444d94109db94d7538ea2038d72ae2966f68b

TODOs

Basic level of acceptability for new project

  • writeup of use cases we are interested in addressing #7
  • an ability to specify conditions for cleaning up an artifact when the kubernetes pod / object is deleted
  • Some testing of the CSI I didn't add the sanity-test (want to better understand this) but I added and end to end test for creating a v pod.
  • helm chart

Larger goals

  • standards for defining assets and actions to take (e.g., copy this binary here, this directory here, get this annotation and do X, name this file Y)
  • an ability to specify and enforce some permissions namespace for the artifacts (e.g., for multi-tenant cluster)
    • enforceNamespace option for driver
  • Allow predictable naming for an artifact
  • More proper docs / branding
    • convert README into docs folder #7

[Question] PV volume path canonicalization.

The pv datapath currently has : if there is a port or a digest form. Good news is that deployments from digest tags works. :)

I don't know if this is an issue but most likely need to consider if we should sanitize this further.

Preparing to pull from remote repository: kind-registry:5000/java-app"
Plain http: true"
Found digest: sha256:4fe6f3e48881647c22bea5c5ca02872b6f5d9ff75931a692e00c50f59de3f429 for sha256:4fe6f3e48881647c22bea5c5ca02872b6f5d9ff75931a692e00c50f59de3f429"
Pulling sha256:514fd93c4f9d875fc5c98532f2399a740d4e02a8eefe4a71155e8d92c69e14fb, 0 of 1"
OCI: Writing sha256:514fd93c4f9d875fc5c98532f2399a740d4e02a8eefe4a71155e8d92c69e14fb to /pv_data/default/kind-registry:5000-java-app-sha256:4fe6f3e48881647c22bea5c5ca02872b6f5d9ff75931a692e00c50f59de3f429/HelloWorldServer.jar"
Oras artifact root: /pv_data/default/kind-registry:5000-java-app-sha256:4fe6f3e48881647c22bea5c5ca02872b6f5d9ff75931a692e00c50f59de3f429"

If this isn't important let's close the issue.

feature: cleanup options

It might be the case that we want an artifact to be cleaned up after the fact, or I can see some kind of cleanup logic implemented on the level of the driver itself. Thus, we should brainstorm an ability to specify conditions for cleaning up an artifact when the kubernetes pod / object is deleted, both on the level of the pod and the driver itself.

testing of csi driver with kind

I'm not actually sure this will work given the need to make binds - my early tests produced weird bugs, and I didn't want to have to distinguish them resulting from an issue with the driver vs. using kind so I stepped back and decided to come back to this later.

spec for defining actions and assets

This might be another project, but arguably I should be able to selectively pick blobs from an ORAS artifact, and then specify where I want them in my container. E.g.,:

  • take the aws-cli binary and put in /usr/local/bin
  • move this entire config directory here
  • get the annotation XYZ and turn it into a file here

Since these actions need to happen inside the container, we likely can't rely on making many mounts, but rather there could be a binary that is injected into the container by the driver, and then the binary takes a manifest of instructions (akin to the above) and a path to the mounted directory, and does the operations for the mount.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.