Repository navigation
Run the self-hosted incremental build without --privileged #5682
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,7 @@ jobs: | |
|
|
||
| container: # Define the Docker container for the job. All subsequent steps run inside it. | ||
| image: nrel/openstudio-cmake-tools:noble-main | ||
| options: --privileged -u root -e "LANG=en_US.UTF-8" # These options are passed to the 'docker run' command internally | ||
| options: -u root -e "LANG=en_US.UTF-8" # These options are passed to the 'docker run' command internally | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That branch has its own copy of this workflow: develop hasn't been merged into
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test plan: adding the label won't start a run.
So you need a push, or a close/reopen, after adding the label. Until then
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the fallback in the description ("the failing step will say which, and we can add that one capability"): A denial in an unprivileged container is usually a bare
Those need
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit (optional, probably better as a follow-up): the image already sets |
||
| volumes: # envs don't work in volume definition for containers | ||
| - "/srv/data/jenkins/docker-volumes/conan-data-gha/.conan2:/github/home/.conan2" # Conan cache, separate from the Jenkins builds on this host (the conan cache is not safe for concurrent use) | ||
| - "/srv/data/jenkins/docker-volumes/ubuntu-2404:/github/home/Ubuntu" | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Every later job on it" still holds, with no privilege needed. The job runs as root with read-write access to state that later runs reuse as-is:
Anything one run's build writes there carries into the next PR, push or dispatch run, and into the packages those runs upload. None of this depends on Separately, the |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropping
--privilegeddoesn't close the host-takeover path by itself.The runner adds
-v "/var/run/docker.sock":"/var/run/docker.sock"to every Linux job container, though this workflow never asks for it. It's in thedocker createline under "Initialize containers" in the last run, and it comes fromContainerInfo.csinactions/runner. With-u root, any step can still reach the host Docker daemon and ask it for a new container with whatever privileges and host mounts it likes. The earlier--privilegedruns started without--userns=host, so the daemon isn't using userns-remap: unless it runs rootless, container root is host root.Nothing in
options:orvolumes:can remove that mount: a second mount at the same path failsdocker create. Closing it takes a runner-side change, for example:ACTIONS_RUNNER_CONTAINER_HOOKS) that create the job container without the socket and as a non-root user (the image's default user isubuntu;-u rootis what makes the job uid 0)The change is still worth having: seccomp and AppArmor come back on, and host devices and
/sysare no longer exposed. But the description overstates what it fixes.