charliecloud
charliecloud copied to clipboard
ch-run: run oci bundles
If option --oci
or --o
is provided/enabled and the image path is the path to an OCI bundle containing a directory named rootfs
and a spec file config.json
then parse the JSON file and distribute the arguments to the corresponding Charliecloud container arguments.
Example:
kchilleri@dev:/usr/local/src/charliecloud$ ls ~/examples/redis
config.json rootfs
kchilleri@dev:/usr/local/src/charliecloud$ ls ~/examples/redis/rootfs/
bin boot data dev etc home lib media mnt opt proc root run sbin srv sys tmp usr var
kchilleri@dev:/usr/local/src/charliecloud$ cat ~/examples/redis/config.json
{
"ociVersion": "1.0.2-dev",
"process": {
"terminal": true,
"user": {},
"args": [
"sh", "redis-server", "--bind", "0.0.0.0"
],
"env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"TERM=xterm"
],
"cwd": "/",
"capabilities": {
"bounding": [
"CAP_AUDIT_WRITE",
"CAP_KILL",
"CAP_NET_BIND_SERVICE"
],
...
kchilleri@dev:/usr/local/src/charliecloud$ ch-run --oci ~/examples/redis -- true
closes #1754
e.g. this one is BSD licensed and recommends “just drop json.c
and json.h
into your project”.
this one similarly
FWIW, we should embrace JSON parsing sooner, rather than later. I suspect it would be very useful for things like oci-hooks for GPU injection.
@j-ogas do you have an opinion on whether it lives in ch-run
or a Python wrapper?
@j-ogas do you have an opinion on whether it lives in
ch-run
or a Python wrapper?
Python may offer the path of the least resistance. Aside from that, not really.
TO DO:
- Add documentation
- Perhaps more error checking