containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.43k stars 2.38k forks source link

Podman v3.0 requires crun which might not be present #8687

Closed TomSweeneyRedHat closed 3 years ago

TomSweeneyRedHat commented 3 years ago

This is probably aimed at @lsm5 and hopefully already taken care of. I just built Podman v3.0 for the first time from GitHub on one of my older VM's (F30). When I went to run it, I got:

# podman version
Error: default OCI runtime "crun" not found: invalid argument

So I changed my runtime entry from runc to crun in containers.conf, and still the same error. The issue was crun was not installed on the system, a simple dnf -y install crun solved the problem.

Two questions:

  1. Is crun a required install with Podman v3.0 as far as the Podman rpm is concerned?
  2. I think we need to add "crun" to the Build and Run Dependencies on the install.md file on podman.io.
mheon commented 3 years ago

We need to fix this. crun should be default only if present.

rhatdan commented 3 years ago

We had the same problem with runc. We could add something to containers/common to set the default based on whether it can find crun or runc. Or leave it blank otherwise.

afbjorklund commented 3 years ago

The ubuntu package uses cri-o-runc | runc (the default is CRI-O). With an optional recommendation of crun

The only difference is that the cri-o-runc's runc might be newer, like rc92 instead of rc10 (for Ubuntu 20.04 LTS).

$ /usr/sbin/runc --version
runc version spec: 1.0.1-dev
$ /usr/lib/cri-o-runc/sbin/runc --version
runc version spec: 1.0.2-dev

Same experience with latest:

$ ./bin/podman --version
ERRO[0000] The storage 'driver' option must be set in /etc/containers/storage.conf, guarantee proper operation. 
podman version 3.0.0-dev
$ ./bin/podman version
ERRO[0000] The storage 'driver' option must be set in /etc/containers/storage.conf, guarantee proper operation. 
Error: default OCI runtime "crun" not found: invalid argument

As compared with system:

$ podman --version
podman version 2.2.1
$ podman version
Version:      2.2.1
API Version:  2.1.0
Go Version:   go1.15.2
Built:        Thu Jan  1 01:00:00 1970
OS/Arch:      linux/amd64

Ironically it then goes on to use the /usr/bin/runc (from Docker) anyway, but I suppose it's the same version (rc92)

You also get a similar issue with "kata", but I suppose it is only shown in the debugging log and only as a warning.

DEBU[0000] using runtime "/usr/bin/runc"                
WARN[0000] Error initializing configured OCI runtime crun: no valid executable found for OCI runtime crun: invalid argument 
WARN[0000] Error initializing configured OCI runtime kata: no valid executable found for OCI runtime kata: invalid argument 
yufeifly commented 3 years ago

Hi, I want to ask what configurations should I do to use runc instead of crun?

rhatdan commented 3 years ago

create a /etc/containers/containers.conf or $HOME/.config/containers/containers.conf that looks like

[engine] runtime="runc"

rhatdan commented 3 years ago

The latest podman 3.0 in main now has the change to look for the ociruntime rather then hard coding it to crun. So if crun is not installed it should fail over to runc, if it can find it.

mheon commented 3 years ago

@yufeifly At this point, I'm just going to recommend crun for everything - it's very mature and generally speaking more capable than runc.

afbjorklund commented 3 years ago

Seems like "crun" will have the same missing-on-Ubuntu-18.04-LTS issue as "fuse-overlayfs" (#8560) and "slirp4netns" (#8684)

Podman will still "work", but it will use runc - running on vfs storage and host network

As stated in the other issues, it's "only" a packaging problem - not a development problem


EDIT: Actually, it will install both cri-o-runc and crun - sorry about the noise

The following additional packages will be installed:
  catatonit conmon containernetworking-plugins containers-common containers-golang containers-image cri-o-runc crun dmsetup iptables libdevmapper1.02.1
  libglib2.0-0 libglib2.0-data libgpgme11 libicu60 libip4tc0 libip6tc0 libiptc0 libmnl0 libnetfilter-conntrack3 libnfnetlink0 libxml2 libxtables12 libyajl2
  multiarch-support podman-plugins shared-mime-info uidmap varlink xdg-user-dirs
Suggested packages:
  kmod
Recommended packages:
  slirp4netns
cri-o-runc | 1.0.0~rc92.3 | https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_18.04  Packages

      crun |     0.16~2 | https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_18.04  Packages
imperialguy commented 3 years ago

podman 3.0

Are there plans to release podman runtime on Windows/Mac anytime soon?

rhatdan commented 3 years ago

No Podman launches Linux containers, Linux containers require a Linux Kernel. Neither Windows or Mac use Linux kernels, so you need to run a VM or work with a remote linux machine. Windows supports WSL2 which is really just a VM running Linux, so podman will work within WSL2.

mheon commented 3 years ago

Worth noting that we do support a remote client for OS X and Windows right now that is capable of managing containers on a Linux machine (usually a VM on the system).