Skip to content

ci: enable sccache for sidecar image builds - #16360

Closed
devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/ops-8922-ci-enable-sccache-for-sidecar-builds
Closed

devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/ops-8922-ci-enable-sccache-for-sidecar-builds

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Overview:

dynamo-sidecar / Build multi-arch cpu spends about 23m per arch in an uncached cargo RUN. Its Build and Push Image step has a p50 of about 26m. This PR enables the S3-backed sccache that the EPP and wheel builds already use, for the sidecar build only.

The release profile, LTO, codegen-units and cargo build --release are unchanged, so runtime performance is unaffected.

Details:

  • lib/sidecar/Dockerfile (sidecar-builder stage):
    • Adds the EPP-style USE_SCCACHE/SCCACHE_BUCKET/SCCACHE_REGION ARGs and gated ENV, and installs sccache with container/use-sccache.sh.
    • Adds the IRSA secret mounts to the existing single cargo RUN.
    • sccache uses its own prefix, SCCACHE_S3_KEY_PREFIX=rust-sidecar-${TARGETARCH}, rather than rust-epp-*.
    • setup-env runs after cargo install cargo-cyclonedx, so the tool install is not wrapped.
    • The RUN prints show-stats at the end, so the hit rate shows up in CI logs.
    • The separate per-package cargo build -p calls stay. There is no target-dir cache, and rm -rf target stays (see 6e74933).
  • .github/workflows/shared-build-sidecar.yml:
    • Sets use_sccache: true and passes sccache_s3_bucket, and declares the optional SCCACHE_S3_BUCKET secret.
    • The extract-binaries docker buildx build and compliance-extract now pass the same sccache build-args and IRSA secrets as the main build. The new ARG/ENV are part of the sidecar-builder cache key, so without matching args both would rerun the full cargo build.
  • pr.yaml, post-merge-ci.yml, nightly-ci.yml: add secrets: inherit to the sidecar-build call, as the other build jobs do. Without it the bucket secret is empty and nothing is cached.

Expected effect: about 7m per arch when the cache is warm.

  • Each binary's final crate and its thin-LTO link (about 16m of the 23m) can't be cached.
  • The first run populates rust-sidecar-*, so it will be cold.

Validation

  • pre-commit run on the 5 changed files: passed.
  • docker buildx build --check -f lib/sidecar/Dockerfile .: no warnings.
  • To do: one cold CI run, which populates the bucket, plus a warm re-run. For each, compare the Build and Push Image step time against the 26m p50 and read the sccache --show-stats hit rate in the build log.

Where should the reviewer start?

lib/sidecar/Dockerfile (the cargo RUN), then the extract step in .github/workflows/shared-build-sidecar.yml.

Related Issues

  • Closes OPS-8922

Link to Devin session: https://nvidia-cloud.devinenterprise.com/sessions/5e379d9599114d9aba833da5a5b10605
Open in Devin Desktop: https://nvidia-cloud.devinenterprise.com/desktop/session/5e379d9599114d9aba833da5a5b10605?variant=devin

nv-tusharma and others added 2 commits October 13, 2026 21:48
Closes OPS-8922

Signed-off-by: Tushar Sharma <[email protected]>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Signed-off-by: Tushar Sharma <[email protected]>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot requested a review from a team as a code owner October 13, 2026 21:49
@copy-pr-bot

copy-pr-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions github-actions Bot added ci Issues/PRs that reference CI build/test actions labels Oct 13, 2026
# Forward IRSA secrets as compliance-extract does, for a cache-missed rebuild.
SECRET_ARGS=""
if [ -n "${SCCACHE_S3_BUCKET:-}" ]; then
TOKEN_FILE="${AWS_WEB_IDENTITY_TOKEN_FILE:-}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the same sccache steps we follow for our frontend builds?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly yes. Two of the sidecar sccache steps are identical to the frontend path in shared-build-image.yml, and this extract step is new because the frontend has no equivalent.

Same as frontend:

  • Main build: docker-remote-build with sccache_s3_bucket: ${{ secrets.SCCACHE_S3_BUCKET }}, as in shared-build-image.yml L494. The action adds USE_SCCACHE/SCCACHE_BUCKET/SCCACHE_REGION build-args and the IRSA secrets.
  • Compliance extract: sccache_bucket and sccache_region, the same lines as shared-build-image.yml L600-601.
  • Dockerfile side: copied from the EPP Dockerfile, which the frontend job builds. That covers the ARGs, the gated ENV, use-sccache.sh install/setup-env/show-stats, and the two --mount=type=secret IRSA mounts. The only change is the prefix, rust-sidecar-${TARGETARCH} instead of rust-epp-*.

This step (extract sidecar binaries) is sidecar-only. The frontend has no plain docker buildx build --target ... extract. It passes the same 3 build-args as docker-remote-build, because they are now part of the sidecar-builder layer's cache key; without them this step would rerun the full cargo build. It forwards the IRSA secrets with the same conditional as compliance-extract/action.yml.

One intentional difference from the frontend's EPP step (shared-build-image.yml L419-427):

  • The EPP step drops all sccache args when IRSA is missing.
  • This step always passes USE_SCCACHE=true plus the bucket and region, because docker-remote-build always does when use_sccache: true, and the values must match for the cache hit.
  • Only the secrets are conditional. If IRSA is missing, use-sccache.sh setup-env can't start the server and the build compiles without sccache.

Written by Devin

@nv-tusharma

Copy link
Copy Markdown
Collaborator

/ok to test c02340c

…ble-sccache-for-sidecar-builds

Signed-off-by: Tushar Sharma <[email protected]>
Comment thread lib/sidecar/Dockerfile
ARG SCCACHE_BUCKET=""
ARG SCCACHE_REGION=""

# Install sccache using the shared helper

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment just narrates the immediately following COPY/RUN of container/use-sccache.sh; the helper name and install invocation already say the same thing, and it does not preserve a lasting constraint.

🤖 AI Fix

Remove this comment.

@devin-ai-integration

devin-ai-integration Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author

❌ Dynamo PR CI failed — run 38608965402 (attempt 1) on 2da2ec5b69

Gate checks: ❌ backend-status-check · ✅ deploy-status-check · ✅ dynamo-status-check

Framework 1-GPU amd64 Multi-GPU amd64
vLLM ✅ 1 ❌ 1
SGLang ❌ 1 ✅ 1

Failure details

2 jobs failed, both in Initialize containers before any test ran: the self-hosted K8s runner's container hook failed to start the job container. This is a runner infrastructure failure; rerunning the failed jobs is likely enough.

❌ sglang-runtime / Test cuda13.0, amd64: runner container hook failed (Initialize containers)

Job: sglang-runtime / Test cuda13.0, amd64 · Failed step: Initialize containers · Logs: gh run view --job 116011331063 -R ai-dynamo/dynamo --log-failed

Velonix runner admission allowed repository=ai-dynamo/dynamo event=push ref=refs/heads/pull-request/16360
##[group]Run '/home/runner/k8s-novolume/index.js'
(node:125) [DEP0005] DeprecationWarning: Buffer() is deprecated ...
##[error]Executing the custom container implementation failed. Please contact your self hosted runner administrator.

The runner's k8s container hook (k8s-novolume/index.js) failed while creating the job container, so no tests executed. Infrastructure signature (self-hosted runner / pod setup); a rerun of failed jobs is likely enough.

❌ vllm-runtime / 2-GPU Test cuda13.0, amd64: runner container hook failed (Initialize containers)

Job: vllm-runtime / 2-GPU Test cuda13.0, amd64 · Failed step: Initialize containers · Logs: gh run view --job 116013421514 -R ai-dynamo/dynamo --log-failed

Velonix runner admission allowed repository=ai-dynamo/dynamo event=push ref=refs/heads/pull-request/16360
##[group]Run '/home/runner/k8s-novolume/index.js'
(node:118) [DEP0005] DeprecationWarning: Buffer() is deprecated ...
##[error]Executing the custom container implementation failed. Please contact your self hosted runner administrator.

The runner's k8s container hook (k8s-novolume/index.js) failed while creating the job container, so no tests executed. Infrastructure signature (self-hosted runner / pod setup); a rerun of failed jobs is likely enough.

For agents
{"pr": 16360, "run_id": 38608965402, "run_attempt": 1, "head_sha": "2da2ec5b69812e6fec7553a6ca9cb4faad213b23", "failures": [{"job": "sglang-runtime / Test cuda13.0, amd64", "job_id": 116011331063, "failed_step": "Initialize containers", "signature": "Executing the custom container implementation failed", "tests": [], "log_cmd": "gh run view --job 116011331063 -R ai-dynamo/dynamo --log-failed"}, {"job": "vllm-runtime / 2-GPU Test cuda13.0, amd64", "job_id": 116013421514, "failed_step": "Initialize containers", "signature": "Executing the custom container implementation failed", "tests": [], "log_cmd": "gh run view --job 116013421514 -R ai-dynamo/dynamo --log-failed"}]}

Posted automatically by Devin for run 38608965402. Updated on every full-CI run of this PR.

@nv-tusharma

Copy link
Copy Markdown
Collaborator

/ok to test 2da2ec5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

actions ci Issues/PRs that reference CI build/test size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant