-
Notifications
You must be signed in to change notification settings - Fork 61
ch-run: run oci bundles #1870
base: master
Are you sure you want to change the base?
ch-run: run oci bundles #1870
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work.
I’d like to also see documentation for this. In particular, as written, the PR ignores config.json
. We’ll need to justify this choice. Looking briefly over the config.json
spec, I do see a lot of things that correspond to ch-run
arguments, as well as a lot of stuff that we can’t support, e.g. complex UID/GID mappings. We’ll need to decide what to do with all that.
There are quite a few JSON libraries for C, so we could consider those. A Python wrapper to process config.json
would also be a reasonable choice.
e.g. this one is BSD licensed and recommends “just drop |
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 |
Python may offer the path of the least resistance. Aside from that, not really. |
42284d1
to
a50d23b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Krishna, great work here! I think we might want to alter the approach a bit, and some suggestions in-line on that, but this is a solid start that avoids some common pitfalls.
…ough JSON files using cJSON library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice progress! Discussed offline.
TO DO:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solid! Looks like the actual logic isn’t too complicated.
The major missing feature might be priority (defaults, environment variables, cmd line, now config.json
). One way to approach that might be to create an arguments struct for each of those, then merge.
I think the path forward on this might be to table it for a little while until my CDI stuff is merged — there’s some duplicate code.
@@ -0,0 +1,872 @@ | |||
# Makefile.in generated by automake 1.16.5 from Makefile.am. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makefile
s are generated, so shouldn’t include in commit.
case 'o': // --oci | ||
args->c.type = IMG_OCI_BUNDLE; | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We’ll want to auto-detect that it’s a bundle rather than adding an option. In image_type()
I think it would be a straightforward addition to the directory case.
If option
--oci
or--o
is provided/enabled and the image path is the path to an OCI bundle containing a directory namedrootfs
and a spec fileconfig.json
then parse the JSON file and distribute the arguments to the corresponding Charliecloud container arguments.Example:
closes #1754