-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
oci: allow to define multiple OCI runtimes #2079
oci: allow to define multiple OCI runtimes #2079
Conversation
56a29fb
to
47ef665
Compare
"/sbin/runc", | ||
"/bin/runc", | ||
"/usr/lib/cri-o-runc/sbin/runc" | ||
] |
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.
Is there an extra space before the first entry /usr/bin/runc/
?
Should we add paths for kata? gVisor? |
@@ -64,7 +64,7 @@ Default state dir is configured in /etc/containers/storage.conf. | |||
|
|||
**--runtime**=**value** | |||
|
|||
Path to the OCI compatible binary used to run containers | |||
Name of the OCI runtime as specified in libpod.conf or absolute path to the OCI compatible binary used to run containers. |
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.
I think I'd not add the new bit, or maybe just "Absolute path" and the ending period. The names in the conf file are absolute paths anyway. When I first read this, I was looking for some kind of key value, i.e. "runc" vs "/usr/bin/runc"
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.
yes, you can specify an absolute path instead of a runtime name. if it is an absolute path like "/foo/bar" then it is not looked up in the config file but used directly.
"/sbin/runc", | ||
"/bin/runc", | ||
"/usr/lib/cri-o-runc/sbin/runc", | ||
}, |
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.
Anyway to use the values from libpod.conf here?
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.
how? This is used only if libpod.conf doesn't override the default specified here
@giuseppe Can you add the name of the runtime a container was created with to its config? We don't have to do anything with it yet, but once we flesh this out more I'd like to be able to let containers decide what runtime to use based on that. |
(If we don't have a name, I think "" is fine - we'll just let the container use whatever the default is) |
47ef665
to
888bc99
Compare
☔ The latest upstream changes (presumably #2090) made this pull request unmergeable. Please resolve the merge conflicts. |
888bc99
to
87587a4
Compare
added a patch to store it to the container configuration. |
I don't see them in Fedora yet |
I think @lsm5 started looking at packaging them. But not sure if it went forward. |
most of the packages have been added (in rawhide, and built for others but not submitted yet) but there's still some kernel config changes that we need to get resolved. |
If you are fine with it, let's add them once we have on Fedora and we can test them |
4590b55
to
3523887
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mheon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
☔ The latest upstream changes (presumably #2105) made this pull request unmergeable. Please resolve the merge conflicts. |
Needs rebase. |
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.
Overall LGTM, just a minor potential issue regarding absolute paths and keys in the map.
Looks like I missed creating the comment. My concern was that a user could specify an absolute path as a key in the |
This deprecates the libpod.conf variable of `runtime_path=`, and now has `runtimes=`, like a map for naming the runtime, preparing for a `--runtime` flag to `podman run` (i.e. runc, kata, etc.) Reference: containers#1750 Signed-off-by: Vincent Batts <[email protected]>
we can define multiple OCI runtimes that can be chosen with --runtime. in libpod.conf is possible to specify them with: [runtimes] foo = [ "/usr/bin/foo", "/usr/sbin/foo", ] bar = [ "/usr/bin/foo", "/usr/sbin/foo", ] If the argument to --runtime is an absolute path then it is used directly without any lookup in the configuration. Closes: containers#1750 Signed-off-by: Giuseppe Scrivano <[email protected]>
Signed-off-by: Giuseppe Scrivano <[email protected]>
3523887
to
3b37101
Compare
the config map should not contain any '/'. When the specified runtime starts with '/' then it is treated differently and no lookup is done |
foundRuntime = true | ||
runtime.ociRuntimePath = path | ||
break | ||
runtime.ociRuntimePath = OCIRuntimePath{Name: filepath.Base(runtime.config.OCIRuntime), Paths: []string{runtime.config.OCIRuntime}} |
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.
Should we check here if the path exists and return an error?
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 check for it later, if I try:
$ podman --runtime /foo/bar run alpine echo hi
error creating libpod runtime: could not find a working binary (configured options: [/foo/bar]): invalid argument
/lgtm |
we can define multiple OCI runtimes that can be chosen with --runtime.
in libpod.conf is possible to specify them with:
If the argument to --runtime is an absolute path then it is used directly without any lookup in the configuration.
Closes: #1750
Signed-off-by: Giuseppe Scrivano [email protected]