Note: The UR Client is being actively developed. Please consider joining the UOR Community to participate!
Please join us in the discussion forum and feel free to ask questions about the UOR-Framework or UR Client.
The Universal Runtime Client interacts with UOR artifacts and is aware of the runtime instruction embedded in UOR artifacts.
To learn more about Universal Runtime visit the UOR Framework website at https://uor-framework.github.io.
WARNING: The repository is under active development and the API is subject to change.
go
version 1.17+
make
./bin/uor-client-go -h
make test-unit
uor-client-go version
- Create a directory with artifacts to publish to a registry as an OCI artifact. If the files reference each other, the client will replace the in-content linked files with the content address.
WARNING: Currently, only JSON is supported for link replacement.
- Use the
uor-client-go build
command to build the workspace as an OCI artifact in build-cache The default location is ~/.uor/cache. It an be set with theUOR_CACHE
environment variable`. - Use the
uor-client-go push
command to publish to a registry as an OCI artifact. - Use the
uor-client-go pull
command to pull the artifact back to a local workspace. - Use the
uor-client-go inspect
command to inspect the build to list information about references.
uor-client-go build my-workspace localhost:5000/myartifacts:latest
# Optionally with dsconfig
uor-client-go build my-workspace localhost:5000/myartifacts:latest --dsconfig dataset-config.yaml
uor-client-go push my-workspace localhost:5000/myartifacts:latest
uor-client-go pull localhost:5000/myartifacts:latest -o my-output-directory
uor-client-go pull localhost:5000/myartifacts:latest -o my-output-directory --attributes key=value
- Create a new directory.
- Add the content to be uploaded in the directory (can be files of any content types).
- Create a json doc where the value of each kv pair is the path to each file within the directory. Multiple json docs can be used to create deep graphs, but a graph must only have one root. Multiple json docs in a build directory is for advanced use cases. Most use cases do not need more than one json doc.
Example json doc:
{
"fish": "fish.jpg",
"text": "subdir1/file.txt",
"fish2": "subdir1/fish2.jpg"
}
- Create a dataset-config.yaml outside of the content directory that references the relative paths from within the content directory to each file. Add user defined key value pairs as subkeys to the
annotations
section. Each file should have as many attributes as possible. Multiple files can be referenced by using the*
wildcard.
Example dataset-config.yaml:
kind: DataSetConfiguration
apiVersion: client.uor-framework.io/v1alpha1
files:
- file: fish.jpg
attributes:
animal: fish
habitat: ocean
size: small
color: blue
- file: subdir1/file.txt
attributes:
fiction: true
genre: science fiction
- file: *.jpg
attributes:
custom: customval
- Run the UOR client build command referencing the dataset config, the content directory, and the destination registry location.
uor-client-go build my-workspace localhost:5000/test/dataset:latest --dsconfig dataset-config.yaml
- Run the UOR push command to publish
uor-client-go push localhost:5000/test/dataset:latest
-
Optionally inspect the OCI manifest of the dataset:
curl -H "Accept: application/vnd.oci.image.manifest.v1+json" <servername>:<port>/v2/<namespace>/<repo>/manifests/<digest or tag>
-
Optionally inspect the cache:
uor-client-go inspect
-
Optionally pull the collection back down to verify the content with
uor-client-go pull
:uor-client-go pull localhost:5000/test/dataset:latest -o my-output-directory
-
Optionally pull a subset of the collection back down to verify the content with
uor-client-go pull
:uor-client-go pull localhost:5000/test/dataset:latest -o my-output-directory --attributes "fiction=true"
collection
: a collection of linked files represented as on OCI artifact