Support shim v2 e.g. for Kata Containers 2.0
/kind feature
Description
Adding support for the shimv2 interface https://alibaba-cloud.medium.com/cri-and-shimv2-a-new-idea-for-kubernetes-integrating-container-runtime-ab8d22f5716b, useful for example for Kata Containers version 2.0 which no longer supports the earlier CRI interface (see https://github.com/kata-containers/kata-containers/issues/1133#issuecomment-731153881).
Steps to reproduce the issue:
podman run -it --runtime kata fedora bash
That works with kata being kata-runtime (Kata Containers version 1.0) but not with containerd-shim-kata-v2 (Kata Containers version 2.0).
Output of podman version:
Version: 2.1.1
API Version: 2.0.0
Go Version: go1.15.2
Built: Wed Oct 7 18:21:20 2020
OS/Arch: linux/amd64
Output of podman info --debug:
host:
arch: amd64
buildahVersion: 1.16.1
cgroupManager: systemd
cgroupVersion: v2
conmon:
package: Unknown
path: /usr/libexec/podman/conmon
version: 'conmon version 2.0.11-dev, commit: 77f4a5131bfc344ab4485cd3f1e4644bfa2122e2'
cpus: 12
distribution:
distribution: fedora
version: "33"
eventLogger: journald
hostname: turbo.dinechin.lan
idMappings:
gidmap: null
uidmap: null
kernel: 5.9.8-200.fc33.x86_64
linkmode: dynamic
memFree: 1521201152
memTotal: 33522884608
ociRuntime:
name: crun
package: crun-0.15.1-1.fc33.x86_64
path: /usr/bin/crun
version: |-
crun version 0.15.1
commit: eb0145e5ad4d8207e84a327248af76663d4e50dd
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
os: linux
remoteSocket:
path: /run/podman/podman.sock
rootless: false
slirp4netns:
executable: ""
package: ""
version: ""
swapFree: 99739828224
swapTotal: 103846764544
uptime: 72h 44m 18.82s (Approximately 3.00 days)
registries:
search:
- registry.fedoraproject.org
- registry.access.redhat.com
- registry.centos.org
- docker.io
store:
configFile: /etc/containers/storage.conf
containerStore:
number: 1
paused: 0
running: 1
stopped: 0
graphDriverName: overlay
graphOptions:
overlay.mountopt: nodev,metacopy=on
graphRoot: /var/lib/containers/storage
graphStatus:
Backing Filesystem: extfs
Native Overlay Diff: "false"
Supports d_type: "true"
Using metacopy: "true"
imageStore:
number: 5
runRoot: /var/run/containers/storage
volumePath: /var/lib/containers/storage/volumes
version:
APIVersion: 2.0.0
Built: 1602087680
BuiltTime: Wed Oct 7 18:21:20 2020
GitCommit: ""
GoVersion: go1.15.2
OsArch: linux/amd64
Version: 2.1.1
Package info (e.g. output of rpm -q podman or apt list podman):
podman-2.1.1-12.fc33.x86_64
Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
No (but I don't expect the latest has the fix, not having seen a mention of "shim v2" in the issues)
Additional environment details (AWS, VirtualBox, physical, etc.):
Physical with Kata
Note
Kata Containers is considering doing the opposite, which is to restore the original CLI commands, see https://github.com/kata-containers/kata-containers/issues/722. However, that would lead to a more inefficient setup (multiple shims), so the shimv2 interface remains interesting in the long run.
Interested in opening a PR to fix. I am not sure if this would be easy unless we have a small wrapper OCI that would do the magic for us. Making the changes for podman to connect to a socket, would be a lot more invasive.
Doing this properly would be a pretty significant endeavour - we do have an OCI runtime abstraction but some aspects of our current pattern (e.g. Conmon) are baked deeply into parts of Libpod, including the aforementioned abstraction interface.
A friendly reminder that this issue had no activity for 30 days.
A friendly reminder that this issue had no activity for 30 days.
A friendly reminder that this issue had no activity for 30 days.
BTW, the alternative is to get crio supported in nerdctl.
A friendly reminder that this issue had no activity for 30 days.
If this is still wanted and can be added, I would like to give it a try. Based on the comments it seems it is not an easy task, so it might take me some time to understand and get the required changes, but if that's not a problem I'm ok with start doing something here.
If you’re willing to take a shot, go for it! We can probably do this in pieces, migrate support in parts (stuff like attach handling is especially hard to get right, for example)
On Sat, May 8, 2021 at 14:00 Eduardo Vega @.***> wrote:
If this is still wanted and can be added, I would like to give it a try. Based on the comments it seems it is not an easy task, so it might take me some time to understand and get the required changes, but if that's not a problem I'm ok with start doing something here.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/containers/podman/issues/8579#issuecomment-835450195, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3AOCEPIEVZMP7KHCBOIMDTMV3Z7ANCNFSM4UMDU45Q .
@mheon understood.
So the idea would be to implement a shimv2 client, so that shims like containerd-shim-kata-v2 can be used with podman.
podman -> OCI wrapper -> shimv2 -> ctrs
In this case conmon wouldn't be part of this, since the shim should take care of the container?
For the initial work, what would you consider can be a good start ? I was thinking to start with a very simple create / start operation
I hope this makes sense.
Sure. This sounds reasonable. It should give us an idea of how complex this could get.
On Tue, May 11, 2021 at 20:37 Eduardo Vega @.***> wrote:
@mheon https://github.com/mheon understood.
So the idea would be to implement a shimv2 client, so that shims like containerd-shim-kata-v2 can be used with podman.
podman -> OCI wrapper -> shimv2 -> ctrs
In this case conmon wouldn't be part of this, since the shim should take care of the container?
For the initial work, what would you consider can be a good start ? I was thinking to start with a very simple create / start operation
I hope this makes sense.
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/containers/podman/issues/8579#issuecomment-839337204, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3AOCAO6MZZSAIRAF6RGGDTNHEV5ANCNFSM4UMDU45Q .
A friendly reminder that this issue had no activity for 30 days.
Still working on this. I've been able to get some progress and now trying to get a minimal attach workflow working (podman run without -d flag)
A friendly reminder that this issue had no activity for 30 days.
@EduardoVega What is going on with this?
@rhatdan I haven't been able to get any progress for the last weeks due to the lack of time, but I should be able to start working on this and finalize what I have done so far for the initial PoC
$ kata-runtime --help
NAME:
kata-runtime - kata-runtime runtime
kata-runtime is a command line program for running applications packaged
according to the Open Container Initiative (OCI).
USAGE:
kata-runtime [global options] command [command options] [arguments...]
VERSION:
kata-runtime : 2.1.1
commit : 4198b524c828f75eb164b2160d7b676d1c537f4b
OCI specs: 1.0.1-dev
COMMANDS:
version display version details
check, kata-check tests if system can run Kata Containers
env, kata-env display settings. Default to TOML
exec Enter into guest by debug console
metrics gather metrics associated with infrastructure used to run a sandbox
factory manage vm factory
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--config value, --kata-config value Kata Containers config file path
--log value set the log file path where internal debug information is written (default: "/dev/null")
--log-format value set the format used by logs ('text' (default), or 'json') (default: "text")
--root value root directory for storage of container state (this should be located in tmpfs) (default: "/var/run/kata-containers")
--rootless value ignore cgroup permission errors ('true', 'false', or 'auto') (default: "auto")
--show-default-config-paths, --kata-show-default-config-paths show config file paths that will be checked for (in order)
--systemd-cgroup enable systemd cgroup support, expects cgroupsPath to be of form "slice:prefix:name" for e.g. "system.slice:runc:434234"
--help, -h show help
--version, -v print the version
NOTES:
- Commands starting "kata-" and options starting "--kata-" are Kata Containers extensions.
URL:
The canonical URL for this project is: https://github.com/kata-containers
kata's OCI is deprecated?
A friendly reminder that this issue had no activity for 30 days.
Still WIP
@EduardoVega anything you can share with us? Thanks.