Repository navigation
Run the incremental build as a non-root user - #5707
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
What changed in this PR
Updates the incremental build GitHub Actions workflow to run the job container as a non-root user (host jenkins uid/gid), aligning container permissions with the ownership of host-mounted build volumes and improving isolation.
Changes:
- Switches the container runtime user from
rootto123951:123951for the incremental build job. - Documents the rationale (host volume ownership and preventing out-of-scope writes) inline in the workflow.
| File | Description |
|---|---|
| .github/workflows/incremental-build.yml | Runs the job container as the host’s non-root jenkins uid/gid to match mounted volume ownership and restrict write scope. |
Review effort: Lite
| container: # Define the Docker container for the job. All subsequent steps run inside it. | ||
| image: nrel/openstudio-cmake-tools:noble-main | ||
| options: -u root # These options are passed to the 'docker run' command internally | ||
| options: -u 123951:123951 # the runner host's jenkins user, which owns the build volumes and _work (#5698); not root, so a job can't write outside what it owns |
There was a problem hiding this comment.
Keeping the hard-coded uid on purpose. This job already belongs to one host: it targets the linux-openstudio-2 runner and mounts that host's /srv/data/jenkins/... paths, so the uid is the same kind of host fact as those paths. Putting it in a repo variable would hide it from this file without making the workflow work on another runner. If the host is rebuilt, its runner config has to change anyway (tracked in NatLabRockies/cbci_jenkins_libs infra/github-runner). One portable option for later is to have the host's container hook set the user, so the workflow doesn't name a uid at all.
… accurate comment - CMP0206 NEW: CMake >= 4.3 then writes uid/gid 0 in CPack archives instead of the build user's uid (123951 on the self-hosted runner) - the job now owns the clone, so git's ownership check passes without safe.directory * - the user comment no longer claims the job can't write shared build state

Closes #5698. Part of #5696.
The job container now runs as uid/gid 123951 (the
jenkinsuser onlinux-openstudio-2) instead of root.nrel/openstudio-cmake-tools:noble-mainas that uid with the job's mounts: git fetch, ccache, conan remotes and profile, ruby, cmake, ninja, and writes to the build dir all work. Nothing else in the workflow needs root.-prcopies of the build dir and conan cache (host-side, NatLabRockies/cbci_jenkins_libs runner hook), so this file doesn't change for that.Note: conan.openstudio.net's certificate expired 2026-11-12 13:58 UTC. With #5706's TLS verification, the conan step fails until it is renewed.