blablacar / dgr

Container build and runtime tool
Apache License 2.0
248 stars 21 forks source link

Build in a container with rkt 1.7 fails #170

Closed nyodas closed 8 years ago

nyodas commented 8 years ago
13:28:54 DEBUG         d/a/bin-run/builder.go:220 Running external command                     command=/var/lib/rkt/pods/run/7fcdb47e-d851-45e1-901a-9964eb82dff6/stage1/rootfs/dgr/usr/lib/ld-linux-x86-64.so.2   /var/lib/rkt/pods/run/7fcdb47e-d851-45e1-901a-9964eb82dff6/stage1/rootfs/dgr/usr/bin/systemd-nspawn \
                              --register=no -q \
                              --link-journal=auto \
                              --uuid=7fcdb47e-d851-45e1-901a-9964eb82dff6 \
                              --machine=dgr7fcdb47e-d851-45e1-901a-9964eb82dff6 \
                              --setenv=CATCH_ON_ERROR=true \
                              --setenv=CATCH_ON_STEP=false \
                              --setenv=DGR_VERSION=69 \
                              --setenv=LOG_LEVEL=INFO \
                              --setenv=ACI_PATH=/data/buildbot/aci-base \
                              --setenv=CATCH_ON_ERROR=true \
                              --setenv=CATCH_ON_STEP=false \
                              --setenv=ACI_VERSION=29 \
                              --setenv=ACI_NAME=aci-base \
                              --setenv=ACI_EXEC='/bin/bash' \
                              --setenv=ROOTFS=/opt/stage2/aci-base/rootfs \
                              --capability=all \
                              --directory=/var/lib/rkt/pods/run/7fcdb47e-d851-45e1-901a-9964eb82dff6/stage1/rootfs \
                              --bind=/data/buildbot/aci-base/:/dgr/aci-home \
                              --bind=/data/buildbot/aci-base/target/:/dgr/aci-target /dgr/command/build
Failed to determine whether the unified cgroups hierarchy is used: No such file or directory
nyodas commented 8 years ago

The success of it depends on the version of the stage1 for the first container (the one that we are in when we run DGR) ie: The dgr build will work in. rkt --stage1-name=coreos.com/rkt/stage1-coreos:1.2.1 run /target/aci-buildbot/image.aci --exec /bin/bash --interactive --net=local --no-overlay The dgr build won't in. rkt --stage1-name=coreos.com/rkt/stage1-coreos:1.7.0 run /target/aci-buildbot/image.aci --exec /bin/bash --interactive --net=local --no-overlay

nyodas commented 8 years ago

Possible link to this #1757

alban commented 8 years ago

The cgroup filesystems must be mounted in /sys/fs/cgroup/ to start rkt or systemd-nspawn. If you are running rkt inside rkt, /sys/fs/cgroup needs to be mounted manually because rkt does not do it anymore after https://github.com/coreos/rkt/pull/2681.

There is an open issue about documenting rkt in rkt: https://github.com/coreos/rkt/issues/2158

The message "Failed to determine whether the unified cgroups hierarchy is used" is from systemd-nspawn when it tries to detect how the cgroup filesystems are mounted (unified or not unified). As a workaround, you could export this variable before running rkt:

export UNIFIED_CGROUP_HIERARCHY=no

But it will likely fail a bit later when it tries to use the cgroups.

I don't think it is related to https://github.com/coreos/rkt/issues/1757

/cc @iaguis @lucab

nyodas commented 8 years ago

Thx @alban for the information. Took me a bit of time to come back to this. After using your cgroup.sh referenced by the issue of rkt-in-rkt https://github.com/coreos/rkt/issues/2158

It works \o/ . Thanks