-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supporting config.json generation for non-Linux OCI images #364
Comments
The issue is that I will need to look into how the OCI runtime-spec has been used by FreeBSD containers to figure out how the |
Hi @cyphar, |
Hi @cyphar, I have just learned about this project that provides runtime for FreeBSD: https://github.com/samuelkarp/runj |
Okay, I'll cook something up then. |
@cyphar I'm happy to help here if you want any. Edit: I'm currently using a significantly trimmed-down config in runj, with any unknown fields (most of them!) ignored. The example config (generated by |
To move this forward for me I created trimmed-down config for FreeBSD: runhyve@759dccf |
Hi @cyphar, There's now a #freebsd channel in OCI's Slack. |
I was hoping to use umoci for managing (unpack specifically) OCI images created with buildah. The images are created for an RTOS, not Linux. I ran into the issues reported here, as well as other issues related to mounts, namespaces, etc - all strongly tied to Linux images. Any plans for improving the platform/OS abstraction in umoci to better support non-Linux OCI images? |
I would be happy to do it, though I would need some guidance as to what the right conversions are for images to runtime-specs for each individual platform. My guess is that most of them can be copied as they are normally, but we'd need to have a good source of defaults for non-Linux platforms (the current defaults for Linux are based on runc which only supports Linux). Do you know of a good source of runtime-spec defaults for non-Linux platforms? (One issue is that a lot of runc implementations for other platforms re-use the "linux" namespace when they're not running on Linux, so it's unclear what is the best thing to do for such platforms.) |
Just for the record, extraction of the rootfs works fine. The problem is only with the generation of the config.json. A few notes: the process is always an application, not the shell (in the example, it's a python application). The mounts are always specified explicitly by the image (there are no defaults), and are typically "iodev" type, such as the one in the example. The format is:
There can be a few optional parameters specified; for example, in the Dockerfile:
which results in the config.json:
We can certainly discuss the details later, this is just an intro to give an idea of the scope. |
By the way, please let me know if you prefer that I open a new issue. I just started commenting here because it is a similar topic - support for non-Linux platform. |
Since you have an example config, I guess there are programs which generate these configs already? If so we can probably just use their defaults (assuming they're Apache-2.0-compatibly licensed ofc) -- how did you generate the config? And yeah it's perfectly okay to comment here, non-Linux configs is sort of the point of this issue (I'll update the title). |
There is unpack capability implemented in C, building on the RTOS APIs (and proprietary commercial license). There is also not much in terms of default, it is all created by interpreting the image content. So I don't really think there is much that could be reused for umoci. While experimenting with similar changes that Mateusz made for BSD, I came up with something like this:
I also had to disable Linux specific code from UnpackRuntimeJSON(). And finally I modified MutateRuntimeSpec() to parse volume info from image instead of hard-coded values:
I have not found a way to parse and generate the proprietary LABEL values (see rtpPriority and rtpStackSize) above. |
Is there any expected time frame this issue may get addressed? Or perhaps info on prioritization relative to other open issues? TIA. |
I still need some kind of spec or other documentation explaining what the relevant fields and labels are so we can convert them. By the way, I also am slightly concerned about the All-in-all, without having access to this RTOS system (or at least some images from it), I'm not entirely sure how many things need to be changed. But I can take a look at this again next week. |
Hello,
When creating image on FreeBSD I have to temporarily mark image as Linux to workaround this error:
I think this error message can be disabled. The whole procedure of creating image on FreeBSD is documented here:
https://gitlab.com/runhyve/jailer/-/snippets/2089767
The text was updated successfully, but these errors were encountered: