Skip to content
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

Dockerfile: update to runc v1.2.0-rc.1 #47666

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

thaJeztah
Copy link
Member

release notes: https://github.com/opencontainers/runc/releases/tag/v1.2.0-rc.1

Breaking changes and deprecations are included below;

Breaking changes:

Several aspects of how mount options work has been adjusted in a way that could theoretically break users that have very strange mount option strings. This was necessary to fix glaring issues in how mount options were being treated. The key changes are:

  • Mount options on bind-mounts that clear a mount flag are now always applied. Previously, if a user requested a bind-mount with only clearing options (such as rw,exec,dev) the options would be ignored and the original bind-mount options would be set. Unfortunately this also means that container configurations which specified only clearing mount options will now actually get what they asked for, which could break existing containers (though it seems unlikely that a user who requested a specific mount option would consider it "broken" to get the mount options they asked foruser who requested a specific mount option would consider it "broken" to get the mount options they asked for). This also allows us to silently add locked mount flags the user did not explicitly request to be cleared in rootless mode, allowing for easier use of bind-mounts for rootless containers.
  • Container configurations using bind-mounts with superblock mount flags (i.e. filesystem-specific mount flags, referred to as "data" in mount(2), as opposed to VFS generic mount flags like MS_NODEV) will now return an error. This is because superblock mount flags will also affect the host mount (as the superblock is shared when bind-mounting), which is obviously not acceptable. Previously, these flags were silently ignored so this change simply tells users that runc cannot fulfil their request rather than just ignoring it.

Deprecated

  • runc option --criu is now ignored (with a warning), and the option will be removed entirely in a future release. Users who need a non-standard criu binary should rely on the standard way of looking up binaries in $PATH.
  • runc kill option -a is now deprecated. Previously, it had to be specified to kill a container (with SIGKILL) which does not have its own private PID namespace (so that runc would send SIGKILL to all processes). Now, this is done automatically.
  • github.com/opencontainers/runc/libcontainer/user is now deprecated, please use github.com/moby/sys/user instead. It will be removed in a future release.

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah
Copy link
Member Author

Hm... something broke with the way we compile runc on non-x86

 > [runc-build 3/3] RUN --mount=from=runc-src,src=/usr/src/runc,rw     --mount=type=cache,target=/root/.cache/go-build,id=runc-build-linux/arm/v6 <<EOT (set -e...):
0.415 rm -f libcontainer/dmz/binary/runc-dmz
0.417 go generate -tags "seccomp urfave_cli_no_docs " ./libcontainer/dmz
0.420 make[1]: Entering directory '/go/src/github.com/opencontainers/runc/libcontainer/dmz'
0.427 gcc -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib -lgcc -static -o binary/runc-dmz _dmz.c
0.554 strip -gs binary/runc-dmz
0.556 make[1]: Leaving directory '/go/src/github.com/opencontainers/runc/libcontainer/dmz'
0.557 go build -trimpath   -tags "seccomp urfave_cli_no_docs  netgo osusergo" -ldflags "-X main.gitCommit=v1.2.0-rc.1-0-g275e6d8 -X main.version=1.2.0-rc.1 -extldflags -static " -o runc .
7.518 # runtime/cgo
7.518 gcc: error: unrecognized command-line option '-marm'; did you mean '-mabm'?
37.89 make: *** [Makefile:98: static-bin] Error 1
------
Dockerfile:305
--------------------
 304 |     ARG DOCKER_STATIC
 305 | >>> RUN --mount=from=runc-src,src=/usr/src/runc,rw \
 306 | >>>     --mount=type=cache,target=/root/.cache/go-build,id=runc-build-$TARGETPLATFORM <<EOT
 307 | >>>   set -e
 308 | >>>   xx-go --wrap
 309 | >>>   CGO_ENABLED=1 make "$([ "$DOCKER_STATIC" = "1" ] && echo "static" || echo "runc")"
 310 | >>>   xx-verify $([ "$DOCKER_STATIC" = "1" ] && echo "--static") runc
 311 | >>>   mkdir /build
 312 | >>>   mv runc /build/
 313 | >>> EOT
 314 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c   set -e\n  xx-go --wrap\n  CGO_ENABLED=1 make \"$([ \"$DOCKER_STATIC\" = \"1\" ] && echo \"static\" || echo \"runc\")\"\n  xx-verify $([ \"$DOCKER_STATIC\" = \"1\" ] && echo \"--static\") runc\n  mkdir /build\n  mv runc /build/\n" did not complete successfully: exit code: 2
Error: buildx bake failed with: ERROR: failed to solve: process "/bin/sh -c   set -e\n  xx-go --wrap\n  CGO_ENABLED=1 make \"$([ \"$DOCKER_STATIC\" = \"1\" ] && echo \"static\" || echo \"runc\")\"\n  xx-verify $([ \"$DOCKER_STATIC\" = \"1\" ] && echo \"--static\") runc\n  mkdir /build\n  mv runc /build/\n" did not complete successfully: exit code: 2

@rata
Copy link
Contributor

rata commented Apr 8, 2024

@thaJeztah can you try using the buildtag runc_nodmz when compiling runc?

We want to fix the issue, of course, but knowing that can help to narrow it down.

@thaJeztah
Copy link
Member Author

@rata oh! Yes, I can update later today. In all honesty, I'm quite behind on my runc notifications, and for these updates, I didn't have time yet to spend any time investigating 🙈 (also need to look at the vendor update in my other PR 🙈🙈 ). Will give it a try!

release notes: https://github.com/opencontainers/runc/releases/tag/v1.2.0-rc.1

Breaking changes and deprecations are included below;

Breaking changes:

Several aspects of how mount options work has been adjusted in a way that
could theoretically break users that have very strange mount option strings.
This was necessary to fix glaring issues in how mount options were being
treated. The key changes are:

- Mount options on bind-mounts that clear a mount flag are now always
  applied. Previously, if a user requested a bind-mount with only clearing
  options (such as rw,exec,dev) the options would be ignored and the
  original bind-mount options would be set. Unfortunately this also means
  that container configurations which specified only clearing mount options
  will now actually get what they asked for, which could break existing
  containers (though it seems unlikely that a user who requested a specific
  mount option would consider it "broken" to get the mount options they
  asked foruser who requested a specific mount option would consider it
  "broken" to get the mount options they asked for). This also allows us to
  silently add locked mount flags the user did not explicitly request to be
  cleared in rootless mode, allowing for easier use of bind-mounts for
  rootless containers.
- Container configurations using bind-mounts with superblock mount flags
  (i.e. filesystem-specific mount flags, referred to as "data" in
  mount(2), as opposed to VFS generic mount flags like MS_NODEV) will
  now return an error. This is because superblock mount flags will also
  affect the host mount (as the superblock is shared when bind-mounting),
  which is obviously not acceptable. Previously, these flags were silently
  ignored so this change simply tells users that runc cannot fulfil their
  request rather than just ignoring it.

Deprecated

- runc option --criu is now ignored (with a warning), and the option will
  be removed entirely in a future release. Users who need a non-standard
  criu binary should rely on the standard way of looking up binaries in
  $PATH.
- runc kill option -a is now deprecated. Previously, it had to be specified
  to kill a container (with SIGKILL) which does not have its own private PID
  namespace (so that runc would send SIGKILL to all processes). Now, this is
  done automatically.
- github.com/opencontainers/runc/libcontainer/user is now deprecated, please
  use github.com/moby/sys/user instead. It will be removed in a future
  release.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@rata
Copy link
Contributor

rata commented Apr 29, 2024

@thaJeztah I was checking this, I'm not sure I understand what is happening here. Do you know any simple way to run it locally, so I can help to debug this?

The linux/arm/v6 and v7 builds fail with:

7.156 gcc: error: unrecognized command-line option '-marm'; did you mean '-mabm'?

In the runc repo, -marm only matches this file vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go, which seems for netbsd and not linux. Maybe some platform setting is not being honored or not passed at some step (and for some reason that step didn't need the platform before)? Just from github logs is hard to be sure if that is the issue, though.

The other failing builds might be due to the wrong platform used too, though (operand size mismatch, instruction not recognized, etc.).

Runc main is using version 0.18 of golang.org/x/sys and 0.19 is available, but the same -marm is used still in the latest version (https://cs.opensource.google/go/x/sys/+/master:unix/zerrors_netbsd_arm.go;l=7). runc 1.1 is using 0.19, though.

@thaJeztah Do you have any pointers on what to check? Or how to run this locally? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants