Skip to content

ci: set an explicit PATH for job containers - #834

Merged
aborovsky merged 3 commits into
nextfrom
ci/container-default-path
Nov 26, 2026
Merged

aborovsky merged 3 commits into
nextfrom
ci/container-default-path

Conversation

@aborovsky

@aborovsky aborovsky commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem

E2E runs now fail on every job that runs in a rockylinux:9 container: npm (ubuntu-latest, 24), npm (ubuntu-latest, 26) and executables (ubuntu-latest, rockylinux:9, …). Each one fails on the first shell: bash step after setup-node (npm ci -q):

OCI runtime exec failed: exec failed: unable to start container process: exec: "bash": executable file not found in $PATH

Example: https://github.com/BrightSec/bright-cli/actions/runs/45585928242. The nested E2E run of the v13.18.0-next.1 deploy fails the same way.

Cause

On 2026-11-17 Docker Hub moved rockylinux:9 from 9.3.20231119 (sha256:d7be1c09…, Dockerfile-built) to 9.9.20261112 (sha256:03303863…, KIWI-built). The old image config set PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin. The new one only sets container=oci. bash is still in the image at /usr/bin/bash.

The runner reads the container's PATH from docker inspect and prepends the paths that actions add to it. After setup-node, the step PATH therefore holds only the Node.js directory. Steps before setup-node don't pass a PATH, so they still work (for example, the dnf step with shell: sh).

Change

  • test-cli.yml (executables, npm): container becomes a mapping with image: ${{ matrix.container }} and an explicit env.PATH.
  • deploy.yml (generate-binary): the same env.PATH for the redhat/ubi8 Linux executable build. The current ubi8 image still sets PATH, so this only prevents the same breakage if it drops it later.

Matrix entries without a container (macOS, Windows, host ubuntu-latest) keep running on the host, because the runner treats an empty container image as no container (PipelineTemplateConverter.ConvertToJobContainer). For ubuntu:*, rockylinux:8 and redhat/ubi8, the value is the same as the PATH already baked into those images.

Validation

rockylinux:9 now resolves to the KIWI-built 9.9 image, whose config sets
no PATH. The runner prepends tool paths (e.g. from setup-node) to the
container's PATH, so after setup-node the step PATH holds only the
Node.js directory and every `shell: bash` step fails with
`exec: "bash": executable file not found in $PATH`.

Pass the standard PATH via container.env in the e2e `executables` and
`npm` jobs, and in `generate-binary` so the Linux executable build does
not break the same way if redhat/ubi8 drops PATH. Matrix entries without
a container keep running on the host: the runner treats an empty
container image as no container.
Runs deploy.yml's build and generate-binary steps without publishing,
to exercise the new container block. To be removed before merge.
@aborovsky

Copy link
Copy Markdown
Contributor Author

Verified the deploy.yml change without cutting a release.

Commit 1d96066 added a temporary push-triggered workflow. It copied build and generate-binary from deploy.yml with the same matrix, runs-on and container block, and dropped publishing, release uploads and Windows code signing. It also ran the built binary (./bin/cli version) in a shell: bash step. Run: https://github.com/BrightSec/bright-cli/actions/runs/45637529271, all 4 jobs green.

  • Linux (redhat/ubi8, sha256:432e88be…): docker create received both --user root and -e "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin". The executable built and ran.
  • macOS and Windows: no job container was started, so they ran on the host as before. Both executables and the unsigned MSI built.

Commit 0e27159 removed the temporary workflow. The PR diff is back to deploy.yml and test-cli.yml only.

@aborovsky
aborovsky marked this pull request as ready for review November 26, 2026 09:06
@aborovsky
aborovsky merged commit 262687a into next Nov 26, 2026
11 checks passed
@aborovsky
aborovsky deleted the ci/container-default-path branch November 26, 2026 09:19
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.

2 participants