oracle / railcar

RailCar: Rust implementation of the Open Containers Initiative oci-runtime
Other
1.12k stars 101 forks source link

failure on systemd cgroup flag #41

Open vbatts opened 6 years ago

vbatts commented 6 years ago
[root@infra0 ~]# docker run -it --runtime=railcar alpine 
docker: Error response from daemon: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/551ea273e14d5adda4ca2ae3632721b6a4926a498b319a2d14eeddd62a5eb0c3/log.json: no such file or directory): /usr/local/bin/railcar did not terminate sucessfully: error: Found argument '--systemd-cgroup' which wasn't expected, or isn't valid in this context

USAGE:
    railcar --log <log> --log-format <log-format> --root <r> <SUBCOMMAND>

For more information try --help
: unknown.

Versions:

[root@infra0 ~]# railcar --version
Railcar 1.0.4
[root@infra0 ~]# docker --version
Docker version 18.06.1-ce, build e68fc7a
[root@infra0 ~]# uname -r
3.10.0-862.11.6.el7.x86_64
vishvananda commented 6 years ago

looks like a new parameter got added in this version of docker. Thanks for the report

vishvananda commented 6 years ago

so i don't get this error with my install of 18.06.1-ce. I do have a newer kernel version and i'm runing on ubuntu artful so that may make a difference. We do have a todo about handling systemd style cgroup paths:

// TODO: handle systemd-style cgroup_path

runc has a global flag for this but I've never seen docker/containerd pass it. Any thoughts why it might be passing it in your case?

vbatts commented 6 years ago

I have a /etc/docker/daemon.json that looks like

{
  "hosts": [
    "unix://var/run/docker.sock"
  ],
  "exec-opts": [
    "native.cgroupdriver=systemd"
  ],
  "selinux-enabled": true,
  "dns": [
    "192.168.0.1"
  ],
  "dns-opts": [],
  "dns-search": [],
  "debug": true,
  "registry-mirrors": [],
  "seccomp-profile": "",
  "insecure-registries": [],
  "no-new-privileges": true,
  "default-runtime": "runc",
  "runtimes": {
    "railcar": {
      "path": "/usr/local/bin/railcar"
    }
  }
}

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Tuesday, September 25, 2018 4:22 PM, Vish (Ishaya) Abrams notifications@github.com wrote:

so i don't get this error with my install of 18.06.1-ce. I do have a newer kernel version and i'm runing on ubuntu artful so that may make a difference. We do have a todo about handling systemd style cgroup paths:

// TODO: handle systemd-style cgroup_path

runc has a global flag for this but I've never seen docker/containerd pass it. Any thoughts why it might be passing it in your case?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

vishvananda commented 6 years ago

ah that looks like it:

"exec-opts": [
    "native.cgroupdriver=systemd"
  ],

Ok I so I'll experiment with adding that and getting systemd cgroups to work.

drahnr commented 5 years ago

Any news? Are there any actionable items one can do?

Side note: The default docker.service on Fedora 29 does add a runtime and a default runtime via cli flags- and docker does not allow mixing field entries between daemon.json and cli flags and bails with

Nov 25 08:01:38 machine dockerd-current[26491]: unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: runtimes: (from flag: [oci], from file: map[railcar:map[path:/home/bernhard/.cargo/bin/railcar runtimeArgs:[]]])

Make the docker service system specific by copying /usr/lib/docker/system/docker.service to /etc/systemd/docker.service and adjusting as needed.

Note2: it also specifies --exec-opt native.cgroupdriver=systemd as additional flag, so this error is popping up when trying to use railcar with docker on fedora in the default configuration.