Skip to content

feat: container builds on release - #553

Merged
binaryaaron merged 2 commits into
mainfrom
docker-build-doohickey/mck
Jun 9, 2026
Merged

feat: container builds on release#553
binaryaaron merged 2 commits into
mainfrom
docker-build-doohickey/mck

Conversation

@mckornfield

@mckornfield mckornfield commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Pre-Review Checklist

Ensure that the following pass:

  • make format && make check or via prek validation.
  • make test passes locally
  • make test-e2e passes locally
  • make test-ci-container passes locally (recommended)
  • GPU CI status check passes -- comment /sync on this PR to trigger a run (auto-triggers on ready-for-review)

Pre-Merge Checklist

  • New or updated tests for any fix or new behavior
  • Updated documentation for new features and behaviors, including docstrings for API docs.

Other Notes

  • Closes #

Summary by CodeRabbit

  • New Features

    • GPU CUDA container now supports configurable CUDA variants (cu129, cu130) via build parameters instead of fixed base images.
    • Added GitHub Actions workflow for automated container builds and publishing.
  • Documentation

    • Updated build instructions and Docker documentation to reflect new GPU container parameterization.
    • Updated GPU prerequisites and verification steps.
  • Chores

    • Reorganized GPU container build stages for improved reproducibility and flexibility.

@mckornfield
mckornfield requested a review from a team as a code owner June 3, 2026 18:27
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR refactors the GPU Docker container build from CUDA-base image selection to a Python-slim-based, uv-centric multistage architecture where CUDA support is selected via dependency extras. It introduces parameterized builds via CONTAINER_EXTRA and CONTAINER_VARIANT, adds a GitHub Actions workflow for automated builds and GHCR publishing, updates Mise tasks with the new build args, and provides comprehensive documentation across developer and user guides.

Changes

GPU Container Build Refactor

Layer / File(s) Summary
Dockerfile.cuda: uv-based multistage refactor
containers/Dockerfile.cuda
Introduces dedicated uv, deps, runtime, and dev stages; adds PYTHON_IMAGE and UV_IMAGE build args; implements layered uv sync installs driven by CONTAINER_EXTRA/CONTAINER_VARIANT (default cu129); updates runtime environment variables and OCI labels to reflect selected CUDA extra.
Mise: build-arg parameterization
.mise/tasks/container/build/gpu, gpu-dev, gpu-multiarch
Adds CONTAINER_EXTRA, CONTAINER_VARIANT, and PACKAGE_VERSION Docker build args to GPU runtime, dev, and multiarch build tasks with environment-variable defaults and cu129 fallback.
GitHub Actions: container-build.yml workflow
.github/workflows/container-build.yml
New workflow that computes package version from tag or SHA, sets up buildx and conditional GHCR login, generates metadata tags/labels with event-driven filters, builds runtime target with parameterized build args, and pushes with variant-scoped caching; triggers on v* tag pushes, path-filtered PRs, and dispatch.
Workflow documentation
.github/workflows/README.md
Documents new container-build.yml in workflows table and extends Mermaid diagram to include Container Build subgraph and GHCR publishing path.
Containers README: parameterized-build documentation
containers/README.md
Explains CONTAINER_EXTRA/CONTAINER_VARIANT parameterization with examples, describes three build stages and entrypoint behavior, condenses Quick Start examples, rewrites key flags, replaces build-arg table with extra/variant parameters, adds override tips, and refocuses multi-arch guidance on --platform and wheel availability.
Developer guide: comprehensive docker.md refactor
docs/developer-guide/docker.md
Explains uv-based stage layout, variant-to-extra mapping, updated build args, reproducible uv settings, stepwise multi-pass uv sync sequence, simplified NVIDIA env vars, refreshed build/publish rules, multi-architecture wheel expectations, and updated Mise task references.
User guide: docker.md GPU build updates
docs/user-guide/docker.md
Specifies host NVIDIA driver compatibility with cu129, updates GPU verification example to CUDA 12.9.1 base, and updates build-from-source example to use new CONTAINER_EXTRA/CONTAINER_VARIANT overrides.
Supporting changes
.dockerignore
Removes THIRD_PARTY.md from .dockerignore to include it in Docker build context.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • NVIDIA-NeMo/Safe-Synthesizer#481: Both PRs modify containers/Dockerfile.cuda, changing container build stages and ARGs to alter Python/CUDA dependency provisioning; one migrates to mise-driven setup while this one restructures to uv with parameterized CUDA extras.

Suggested labels

feature

Suggested reviewers

  • kendrickb-nvidia
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'feat: container builds on release' is vague and does not clearly convey the scope of changes, which includes comprehensive Dockerfile reorganization, workflow additions, and documentation updates. Clarify the title to better describe the main changes, such as 'feat: restructure GPU container build with uv and add release workflow' or similar.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docker-build-doohickey/mck

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added the feature New feature or request label Jun 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (3)
docs/developer-guide/docker.md (2)

4-20: ⚡ Quick win

Add a ## Prerequisites section near the top of the page.

This page currently starts directly with architecture details, but docs guidelines require prerequisites before main content. Add a short prerequisites block (for example: Docker/Buildx, Make targets, registry auth expectations) right after the intro.

As per coding guidelines, docs pages must list prerequisites at the top before main content.


197-209: ⚡ Quick win

Finish the page with a ## Next steps section.

The document currently ends without the required Next steps links. Please add a final ## Next steps section with related docs links to keep navigation consistent.

As per coding guidelines, documentation pages should end with a Next steps section containing links to related content.

containers/Dockerfile.cuda (1)

143-143: 💤 Low value

Consider documenting the intentional root user for dev stage.

Trivy flags USER root without a subsequent switch to non-root. This is appropriate for interactive development but adding a brief comment clarifies intent and addresses static analysis noise.

📝 Suggested comment
+# Dev stage runs as root for interactive development (bind-mount at runtime).
 USER root

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 39133ab4-b8b3-4333-a587-1ede3f42079a

📥 Commits

Reviewing files that changed from the base of the PR and between cf97e74 and 9f8045e.

📒 Files selected for processing (9)
  • .dockerignore
  • .github/workflows/README.md
  • .github/workflows/container-build.yml
  • Makefile
  • STYLE_GUIDE.md
  • containers/Dockerfile.cuda
  • containers/README.md
  • docs/developer-guide/docker.md
  • docs/user-guide/docker.md
💤 Files with no reviewable changes (1)
  • .dockerignore
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Unit Tests (3.11)
  • GitHub Check: Unit Tests (3.13)
  • GitHub Check: Unit Tests (3.12)
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{md,markdown,py}

📄 CodeRabbit inference engine (.cursor/rules/agent-markdown-style.mdc)

**/*.{md,markdown,py}: Avoid decorative bold (**text**) in list items, body text, and docstrings; use structural cues (headers, list markers, colons, backticks) for emphasis instead
Use backticks for code identifiers, paths, and CLI commands in markdown and docstrings

Files:

  • STYLE_GUIDE.md
  • docs/user-guide/docker.md
  • docs/developer-guide/docker.md
  • containers/README.md
**/*.{md,markdown}

📄 CodeRabbit inference engine (.cursor/rules/agent-markdown-style.mdc)

**/*.{md,markdown}: Bold is acceptable only in markdown tables where it's the conventional way to mark header-like cells in the body
Use ## headers to segment markdown sections instead of bold text
Use -- (em-dash) instead of - (hyphen) for asides in markdown

Files:

  • STYLE_GUIDE.md
  • docs/user-guide/docker.md
  • docs/developer-guide/docker.md
  • containers/README.md
**/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

All Markdown files require SPDX copyright headers, automatically added by make format

Use American English spelling: 'initialize' not 'initialise', 'recognize' not 'recognise', 'color' not 'colour'.

Avoid decorative **bold** in body text, list items, or docstrings. Use headers, list markers, colons, and backticks for structure. Bold is acceptable in table header-like cells and MkDocs Material card grid titles.

Use -- (em-dash) for asides, not - (hyphen).

Use single backticks for code identifiers, paths, and CLI commands in markdown.

Ensure newline at end of file with no trailing whitespace.

Files:

  • STYLE_GUIDE.md
  • docs/user-guide/docker.md
  • docs/developer-guide/docker.md
  • containers/README.md
**/*

⚙️ CodeRabbit configuration file

**/*: Review as a senior maintainer for NeMo Safe Synthesizer. Prioritize issues that can change behavior, break user workflows, weaken privacy guarantees, hide failures, make tests unreliable, or create maintenance risk. Avoid generic style commentary unless it points to a concrete project convention that automated tools will not catch.
Comment only when the finding is actionable and tied to changed code. For each finding, state the impact, the condition that triggers it, and the smallest practical fix. Prefer one precise comment over broad advice. Do not ask for refactors outside the PR scope unless the changed code creates the problem.
Review type guidance: - Potential issue: use for correctness bugs, data loss, privacy leaks,
security risks, broken public APIs, invalid config behavior, missing
validation, hidden failures, nondeterministic tests, or CI breakage.

  • Refactor suggestion: use for local maintainability problems introduced
    by the diff when they have clear future cost, such as duplicated setup,
    unclear boundaries, over-mocking, avoidable complexity, or opaque test
    helpers.
  • Nitpick: avoid in chill mode. Do not emit formatting, import-order,
    wording, or style-only comments unless automated tools cannot catch the
    issue and it affects maintainability.

Severity guidance: - Critical: security/privacy leaks, data loss, training/test/holdout
contamination, or broken release/package/core pipeline execution.

  • Major: incorrect generation/training/evaluation behavior, broken
    CLI/SDK public API, invalid config defaults or validators, or GPU/vLLM
    cleanup and process-isolation bugs likely to fail CI or production
    runs.
  • Minor: localized bugs, missing focused tests for changed behavior, or
    bad test patterns that weaken regression coverage.
  • Trivial: small cleanup with no behavior impact. Usually suppress in
    chill mode.
  • Info: context only. Avoid unless it helps reviewers understand risk.
    Safe-Synthesizer-specific review focus: - Data ...

Files:

  • STYLE_GUIDE.md
  • docs/user-guide/docker.md
  • docs/developer-guide/docker.md
  • containers/README.md
  • Makefile
  • containers/Dockerfile.cuda
.github/**

⚙️ CodeRabbit configuration file

Review GitHub configuration for branch protection expectations, CODEOWNERS alignment, least privilege permissions, pinned actions where practical, and consistency with CONTRIBUTING.md.

Files:

  • .github/workflows/README.md
  • .github/workflows/container-build.yml
docs/**/*.md

📄 CodeRabbit inference engine (.cursor/rules/writing-docs.mdc)

docs/**/*.md: Classify documentation content using the Diataxis framework (TUTORIAL, HOW-TO, EXPLANATION, or REFERENCE) and ensure each page fits ONE type only
Use MkDocs Material admonition syntax (!!! note, !!! warning, ??? tip) for callouts and collapsible content
Use MkDocs Material tab syntax (=== "Tab Name") to present multiple variations or language-specific examples
Include code block metadata in MkDocs Material format: use title attribute for filenames and hl_lines for syntax highlighting of specific lines
Use Mermaid diagram syntax for flowcharts and visual representations in documentation
List prerequisites at the top of each documentation page before main content
End documentation pages with 'Next steps' section containing links to related content

docs/**/*.md: Documentation pages must follow Diataxis framework organization: getting-started/ for tutorials, user-guide/ for how-tos and reference, architecture/ for explanations, reference/ for API docs (auto-generated), dev-notes/ for release notes
Add new documentation pages to the nav: section of mkdocs.yml for sidebar appearance
Use MkDocs Material Markdown extensions including admonitions (!!! note, !!! warning), content tabs (===), code blocks with syntax highlighting, mermaid diagrams, task lists, footnotes, and definition lists

Classify documentation pages as tutorial, how-to, explanation, or reference per the Diataxis framework. Use MkDocs Material syntax: admonitions (!!! note), tabs (===), code blocks with titles and highlights.

Use Mermaid diagrams with no spaces in node IDs, quote labels with special characters, and no explicit colors or styles.

Files:

  • docs/user-guide/docker.md
  • docs/developer-guide/docker.md
docs/**

⚙️ CodeRabbit configuration file

Review documentation as MkDocs Material content. Check Diataxis fit, accurate commands, internal links, code fences, and markdown style from STYLE_GUIDE.md.

Files:

  • docs/user-guide/docker.md
  • docs/developer-guide/docker.md
.github/workflows/**/*.{yaml,yml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

CI/CD workflows must enforce required approvals (1), code owner review, signed commits, required status checks, linear history, and block force pushes and deletions on main branch

Files:

  • .github/workflows/container-build.yml
containers/**

⚙️ CodeRabbit configuration file

Review container changes against STYLE_GUIDE.md and containers/README.md. Check cache mounts, uv usage, non-root runtime behavior, CUDA settings, and copy order.

Files:

  • containers/README.md
  • containers/Dockerfile.cuda
Makefile

📄 CodeRabbit inference engine (CONTRIBUTING.md)

The Makefile is the single source of truth for how CI checks run; use make targets instead of running ruff, ty, or other tools directly

Use target help format target-name: ## Description to enable make help auto-generation in Makefiles.

Use tab indentation (standard Makefile requirement) in Makefiles.

Place .PHONY declaration directly above each target it applies to in Makefiles.

Include a ### CONFIGURATION ### section in Makefiles for variable definitions.

Files:

  • Makefile

⚙️ CodeRabbit configuration file

Treat Makefile targets as the validation source of truth. Check that new targets are documented with target-name: ## Description, declared .PHONY where appropriate, and use uv/mise conventions.

Files:

  • Makefile
containers/Dockerfile*

📄 CodeRabbit inference engine (STYLE_GUIDE.md)

Use multi-stage builds for production images.

Copy uv from ghcr.io/astral-sh/uv:<version> in Dockerfiles.

Use --mount=type=cache for pip/uv caches and APT (/var/cache/apt, /var/lib/apt/lists) in Dockerfiles. Prefer cache mounts over rm -rf /var/lib/apt/lists/*.

Set ENV UV_LINK_MODE=copy when using cache mounts in Dockerfiles (hardlinks into cache layers vanish after unmount).

Use --no-install-recommends on all apt-get install invocations in Dockerfiles.

Use a non-root user (appuser) with NVIDIA_VISIBLE_DEVICES=all for GPU access in production Dockerfiles.

Use tini or --init for proper PID 1 signal handling in batch containers.

Order COPY directives in Dockerfiles for cache efficiency (deps before source code).

Include comments in Dockerfiles explaining cache invalidation points.

Files:

  • containers/Dockerfile.cuda
🧠 Learnings (19)
📓 Common learnings
Learnt from: binaryaaron
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 481
File: containers/Dockerfile.cuda:100-106
Timestamp: 2026-06-01T18:47:21.036Z
Learning: In `containers/Dockerfile.cuda` (tools stage), `uv`/`uvx` are installed via `mise run setup` with the version pinned in `mise.lock`, and then copied to `/usr/local/bin/` via `cp "$(mise which uv)" /usr/local/bin/uv`. This is the intentional and reproducible approach — there is no need for a separate `FROM ghcr.io/astral-sh/uv:<version>` stage. The `PATH="/usr/local/bin:/mise/shims:${PATH}"` addition is required (not a noop) because `tools/install-mise.sh` installs the `mise` binary at `/usr/local/bin/mise`, so it must be on PATH before the shims are available for subsequent `mise trust` and `mise run setup` calls.
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-05-20T22:25:01.000Z
Learning: GPU tests run on NVIDIA self-hosted A100 runners via `gpu-tests.yml` workflow with smoke tests and end-to-end tests; manual dispatch available with `gh workflow run` command
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer

Timestamp: 2026-06-03T18:29:10.729Z
Learning: Be consistent with local code conventions. If the code around you follows a convention, follow it too -- even if the style guide says otherwise. Local consistency matters more than global rules.
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer

Timestamp: 2026-06-03T18:29:10.729Z
Learning: When touching legacy code, migrate toward these conventions where practical rather than perpetuating old patterns.
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer

Timestamp: 2026-06-03T18:29:10.729Z
Learning: Tools enforce what they can (ruff, ty, pre-commit). This guide covers what tools cannot enforce.
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer

Timestamp: 2026-06-03T18:29:10.729Z
Learning: Some rules are aspirational -- legacy code is being migrated. New code must follow these conventions; existing deviations are tolerated during migration.
📚 Learning: 2026-05-14T17:03:10.291Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: STYLE_GUIDE.md:0-0
Timestamp: 2026-05-14T17:03:10.291Z
Learning: Applies to containers/Dockerfile* : Use multi-stage builds for production images.

Applied to files:

  • STYLE_GUIDE.md
  • docs/user-guide/docker.md
  • docs/developer-guide/docker.md
  • containers/README.md
  • containers/Dockerfile.cuda
📚 Learning: 2026-06-01T18:47:21.036Z
Learnt from: binaryaaron
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 481
File: containers/Dockerfile.cuda:100-106
Timestamp: 2026-06-01T18:47:21.036Z
Learning: In `containers/Dockerfile.cuda` (tools stage), `uv`/`uvx` are installed via `mise run setup` with the version pinned in `mise.lock`, and then copied to `/usr/local/bin/` via `cp "$(mise which uv)" /usr/local/bin/uv`. This is the intentional and reproducible approach — there is no need for a separate `FROM ghcr.io/astral-sh/uv:<version>` stage. The `PATH="/usr/local/bin:/mise/shims:${PATH}"` addition is required (not a noop) because `tools/install-mise.sh` installs the `mise` binary at `/usr/local/bin/mise`, so it must be on PATH before the shims are available for subsequent `mise trust` and `mise run setup` calls.

Applied to files:

  • STYLE_GUIDE.md
  • docs/user-guide/docker.md
  • docs/developer-guide/docker.md
  • containers/README.md
  • Makefile
  • containers/Dockerfile.cuda
📚 Learning: 2026-05-14T17:03:10.291Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: STYLE_GUIDE.md:0-0
Timestamp: 2026-05-14T17:03:10.291Z
Learning: Applies to containers/Dockerfile* : Create a non-root user (`appuser`) with `NVIDIA_VISIBLE_DEVICES=all` for GPU access.

Applied to files:

  • STYLE_GUIDE.md
  • docs/user-guide/docker.md
  • docs/developer-guide/docker.md
  • containers/README.md
  • Makefile
  • containers/Dockerfile.cuda
📚 Learning: 2026-05-14T21:47:20.140Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: tests/TESTING.md:0-0
Timestamp: 2026-05-14T21:47:20.140Z
Learning: Applies to tests/**/tests/e2e/**/test_*.py : For e2e tests requiring GPU, use staged Make targets (`test-e2e-default` and `test-e2e-dp`) with single-process execution (`-n 0`).

Applied to files:

  • STYLE_GUIDE.md
  • docs/developer-guide/docker.md
  • containers/README.md
  • Makefile
📚 Learning: 2026-05-14T17:03:10.291Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: STYLE_GUIDE.md:0-0
Timestamp: 2026-05-14T17:03:10.291Z
Learning: Applies to containers/Dockerfile* : Include comments explaining cache invalidation points.

Applied to files:

  • STYLE_GUIDE.md
  • containers/README.md
  • containers/Dockerfile.cuda
📚 Learning: 2026-05-20T22:25:01.000Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-05-20T22:25:01.000Z
Learning: GPU tests run on NVIDIA self-hosted A100 runners via `gpu-tests.yml` workflow with smoke tests and end-to-end tests; manual dispatch available with `gh workflow run` command

Applied to files:

  • .github/workflows/README.md
  • docs/user-guide/docker.md
  • .github/workflows/container-build.yml
  • docs/developer-guide/docker.md
  • containers/README.md
  • Makefile
  • containers/Dockerfile.cuda
📚 Learning: 2026-05-20T22:25:01.000Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-05-20T22:25:01.000Z
Learning: Applies to **/*.py : Run `make check` to verify all CI checks including format-check, lint, typecheck, and copyright headers before submitting PRs

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2026-05-20T22:25:01.000Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-05-20T22:25:01.000Z
Learning: Applies to .github/workflows/**/*.{yaml,yml} : CI/CD workflows must enforce required approvals (1), code owner review, signed commits, required status checks, linear history, and block force pushes and deletions on main branch

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2026-05-20T22:25:01.000Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-05-20T22:25:01.000Z
Learning: Applies to **/*.py : All commits merged to main must follow Conventional Commits specification with format `<type>(<scope>): <description>` where type is one of: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2026-05-14T21:46:37.073Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-14T21:46:37.073Z
Learning: The canonical `uv sync` command for a full GPU/dev environment is: `uv sync --frozen --extra cu129 --extra engine --group dev`

Applied to files:

  • docs/user-guide/docker.md
  • docs/developer-guide/docker.md
  • containers/README.md
  • Makefile
  • containers/Dockerfile.cuda
📚 Learning: 2026-05-14T17:03:10.291Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: STYLE_GUIDE.md:0-0
Timestamp: 2026-05-14T17:03:10.291Z
Learning: Applies to containers/Dockerfile* : Copy uv from `ghcr.io/astral-sh/uv:<version>`.

Applied to files:

  • docs/developer-guide/docker.md
  • containers/README.md
  • containers/Dockerfile.cuda
📚 Learning: 2026-05-14T17:03:10.291Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: STYLE_GUIDE.md:0-0
Timestamp: 2026-05-14T17:03:10.291Z
Learning: Applies to containers/Dockerfile* : Set `ENV UV_LINK_MODE=copy` when using cache mounts (hardlinks into cache layers vanish after unmount).

Applied to files:

  • docs/developer-guide/docker.md
  • containers/Dockerfile.cuda
📚 Learning: 2026-05-14T17:03:10.291Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: STYLE_GUIDE.md:0-0
Timestamp: 2026-05-14T17:03:10.291Z
Learning: Applies to containers/Dockerfile* : Use `--mount=type=cache` for pip/uv caches and APT (`/var/cache/apt`, `/var/lib/apt/lists`). Prefer cache mounts over `rm -rf /var/lib/apt/lists/*`.

Applied to files:

  • docs/developer-guide/docker.md
📚 Learning: 2026-05-14T21:46:37.073Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-14T21:46:37.073Z
Learning: Use `uv` for everything -- never `pip` or raw `python`

Applied to files:

  • docs/developer-guide/docker.md
📚 Learning: 2026-05-20T22:25:01.000Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-05-20T22:25:01.000Z
Learning: Applies to .mise.toml : Tool versions including uv, ruff, ty, gh, and mise itself are pinned in `.mise.toml` and locked in `mise.lock` for reproducible developer toolchains across systems

Applied to files:

  • docs/developer-guide/docker.md
📚 Learning: 2026-05-20T22:25:01.000Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-05-20T22:25:01.000Z
Learning: Install development tools via `mise` using `make setup` and bootstrap Python dependencies using appropriate `make bootstrap-nss` target (cpu, cuda, engine, or dev)

Applied to files:

  • containers/README.md
📚 Learning: 2026-05-20T22:25:01.000Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-05-20T22:25:01.000Z
Learning: Applies to Makefile : The Makefile is the single source of truth for how CI checks run; use `make` targets instead of running ruff, ty, or other tools directly

Applied to files:

  • containers/README.md
📚 Learning: 2026-05-14T21:46:37.073Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-14T21:46:37.073Z
Learning: Always use Make targets or wrapper scripts in `tools/` instead of running `ruff` or `ty` directly

Applied to files:

  • containers/README.md
🪛 LanguageTool
docs/developer-guide/docker.md

[uncategorized] ~62-~62: The official name of this software platform is spelled with a capital “H”.
Context: ...erate uv.lock. 3. Add a matrix row to .github/workflows/container-build.yml. 4. Buil...

(GITHUB)

🪛 Trivy (0.69.3)
containers/Dockerfile.cuda

[error] 143-143: Image user should not be 'root'

Last USER command in Dockerfile should not be 'root'

Rule: DS-0002

Learn more

(IaC/Dockerfile)

🔇 Additional comments (12)
STYLE_GUIDE.md (1)

766-766: LGTM!

containers/Dockerfile.cuda (4)

27-34: LGTM!


36-83: LGTM!


85-133: LGTM!


145-181: LGTM!

Makefile (3)

341-348: LGTM!


380-396: LGTM!


398-439: LGTM!

.github/workflows/container-build.yml (2)

95-110: LGTM!


1-13: ⚡ Quick win

Confirm CI won’t require the SPDX one-liner for .github/workflows/container-build.yml
make format-check runs tools/codestyle/copyright_fixer.py --check ., but .copyrightignore excludes the entire .github/ directory, so this workflow file is not checked for SPDX header formatting. Additionally, the checker only looks for copyright markers (e.g., Copyright (c)) rather than enforcing an exact SPDX line format.

.github/workflows/README.md (2)

16-16: LGTM!


91-94: LGTM!

Also applies to: 108-108

Comment on lines +84 to +93
tags: |
type=raw,value=${{ matrix.variant }},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=raw,value=latest-${{ matrix.variant }},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=sha,prefix=sha-,suffix=-${{ matrix.variant }}
type=semver,pattern={{version}}-${{ matrix.variant }}
type=semver,pattern={{major}}.{{minor}}-${{ matrix.variant }}
labels: |
org.opencontainers.image.version=${{ steps.package-version.outputs.version }}
com.nvidia.nemo.safe-synthesizer.extra=${{ matrix.extra }}
com.nvidia.nemo.safe-synthesizer.variant=${{ matrix.variant }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

docker/metadata-action prerelease handling type=raw vs type=semver floating tags

💡 Result:

In the docker/metadata-action, the choice between type=raw and type=semver significantly impacts how pre-release versions are handled, particularly regarding tag floating, prefix stripping, and automatic 'latest' tag generation [1][2]. Type=semver The semver type is designed for automated versioning based on SemVer-compliant Git tags [1]. It includes opinionated, built-in logic for pre-release handling [1]. - Pre-release behavior: When a pre-release (e.g., v1.2.3-alpha) is detected, the action intentionally limits tag generation [1][3]. It will typically only produce the full version string ({{version}} or {{raw}}) and avoids creating broader, mutable 'floating' tags like the major (e.g., v1) or minor (e.g., v1.2) identifiers [1][2]. This is by design to prevent unstable pre-release code from overriding stable production tags [1]. - Prefix handling: By default, type=semver strips the 'v' prefix from tags [4][2]. To preserve the 'v', you should use the prefix attribute (e.g., type=semver,pattern={{version}},prefix=v) rather than hardcoding it into the pattern [4][2]. - Latest tag: For pre-releases, the implicit 'latest' tag generation (if flavor.latest=auto is used) is automatically disabled [5]. Type=raw The raw type provides a way to output custom, explicit tag values [1]. - Pre-release behavior: It does not inherently understand SemVer or distinguish between releases and pre-releases [1]. It simply outputs exactly what is provided in the value attribute [1]. - Floating tags: If you use type=raw to manually create 'floating' tags (e.g., naming your image 'my-app:1'), the action will create these tags regardless of whether the source tag is a pre-release [6]. You must implement your own conditional logic using the enable attribute if you wish to prevent pre-release versions from overriding these tags [3][6]. - Usage: This type is best suited for scenarios where you need full control over the tag naming convention and do not want the action's opinionated semver logic applied [1]. Summary Table Feature | type=semver | type=raw --- | --- | --- Automatic Pre-release Logic | Yes (Limits output to prevent overriding) [1] | No (Literal output) [1] Prefix Handling | Automatically strips 'v' (configurable) [4][2] | None (Literal) [1] Implicit 'latest' Tag | Automatically disabled for pre-releases [5] | Not influenced (can lead to conflicts) [5] Control | Opinionated/Automated [1] | Manual/Explicit [1] To maintain safety during pre-release cycles, prefer type=semver to benefit from the built-in safeguards that prevent unstable builds from inadvertently updating 'latest' or major/minor floating tags [1][5]. Use type=raw only when you have specific, non-standard naming requirements and are prepared to manually manage the conditional logic for when those tags should be applied [6].

Citations:


Prevent RC tags from overwriting the floating cu129 / latest-cu129 tags

In .github/workflows/container-build.yml (lines 84-93), the type=raw tags for value=${{ matrix.variant }} and value=latest-${{ matrix.variant }} are enabled for any refs/tags/v*. Since type=raw doesn’t have prerelease awareness, RC tags (per the repo’s vX.Y.ZrcN scheme) will also generate/overwrite the floating “stable” tags for that variant.

Gate these type=raw entries to exclude prereleases (e.g., tags containing rc):

🔧 Possible approach (exclude RC prereleases from the raw floating tags)
-            type=raw,value=${{ matrix.variant }},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
-            type=raw,value=latest-${{ matrix.variant }},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
+            type=raw,value=${{ matrix.variant }},enable=${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, 'rc') }}
+            type=raw,value=latest-${{ matrix.variant }},enable=${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, 'rc') }}

manual --> ci & gpu
pr --> ci & conventional & secrets
tag[Tag push v[0-9]*] --> release
tag[Tag push v[0-9]*] --> release & containers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Quote the Mermaid node label -- nested brackets will break the diagram.

tag[Tag push v[0-9]*] contains [ and ] inside the node text. Mermaid terminates the label at the first ], leaving *] to cause a parse/render error. Wrap the label in quotes.

📝 Proposed fix
-    tag[Tag push v[0-9]*] --> release & containers
+    tag["Tag push v[0-9]*"] --> release & containers

As per coding guidelines: "Use Mermaid diagrams with no spaces in node IDs, quote labels with special characters".

Comment thread containers/README.md
Comment on lines +20 to +23
| Variant | Extra | Status |
|---------|-------|--------|
| `cu129` | `cu129` | Built today |
| `cu130` | `cu130` | Add after the CUDA 13.0 dependency extra lands |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Replace time-relative variant status with a stable state label.

Built today will become stale and ambiguous quickly in reference docs. Use a stable status like Enabled or Supported to avoid misleading users about current variant support.

As per coding guidelines, containers/README.md should stay synchronized with container build inputs/outputs, so status wording should remain durable.

@coderabbitai coderabbitai Bot added docs Documentation-only change and removed feature New feature or request labels Jun 3, 2026
@greptile-apps

greptile-apps Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces the nvidia/cuda+mise multistage Dockerfile with a leaner python:slim-bookworm+uv approach where CUDA libraries are delivered entirely through Python package extras (cu129, cu130, etc.), and introduces a new GitHub Actions workflow (container-build.yml) that builds and publishes the runtime image to GHCR on release tags.

  • Dockerfile.cuda is reduced from four stages (tools/deps/runtime/dev) to three (uv/runtime/dev). The runtime stage uses layered uv sync calls (base → engine → CUDA closure → FlashInfer → PyTorch → vLLM → project) so the largest dependency families land in separate Docker layers for better registry cache reuse.
  • container-build.yml triggers on v* tag pushes and workflow_dispatch; only tag-push events authenticate to GHCR and push images or write the buildcache-<variant> registry cache. The matrix currently contains only cu129; adding cu130 requires a new pyproject.toml extra and a second matrix row.
  • mise tasks (container/build/gpu, gpu-dev, gpu-multiarch) gain the three new build args (CONTAINER_EXTRA, CONTAINER_VARIANT, PACKAGE_VERSION) with cu129 defaults.

Confidence Score: 5/5

Safe to merge; the architectural change is well-structured and the issues found are minor correctness nits with no runtime impact.

The Dockerfile refactor correctly moves CUDA delivery into Python extras, the layered sync strategy is sound, and the workflow security posture (pinned SHAs, least-privilege token, no uncontrolled inputs) is solid. The two findings — a duplicate /opt/venv/bin PATH entry and missing registry cache for manual builds — have no impact on correctness or security.

containers/Dockerfile.cuda (duplicate PATH ENV) and .github/workflows/container-build.yml (cold-start manual builds)

Important Files Changed

Filename Overview
.github/workflows/container-build.yml New workflow that builds and pushes the GPU container image on release tags and manual dispatch; push-only events get cache read+write while workflow_dispatch builds start cold (no cache-from).
containers/Dockerfile.cuda Major refactor: replaces nvidia/cuda+mise+deps multistage with python:slim-bookworm+uv+runtime; introduces layered uv sync steps for Docker layer caching, but PATH is set twice in the runtime stage resulting in a duplicate /opt/venv/bin entry.
.mise/tasks/container/build/gpu Adds three new build-args (CONTAINER_EXTRA, CONTAINER_VARIANT, PACKAGE_VERSION) to match the refactored Dockerfile; defaults align with the cu129 variant.
.dockerignore Removes THIRD_PARTY.md exclusion so the Dockerfile can COPY it into the runtime image alongside LICENSE and README.md.
containers/README.md Updated to document the new variant/extra parameterization model, updated build arg table, and removed now-invalid CUDA base image references.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    uvImage["ghcr.io/astral-sh/uv:0.9.30"]
    pythonBase["python:PYTHON_VERSION-slim-bookworm"]

    subgraph stages [Dockerfile.cuda Build Stages]
        uvStage["uv\nCopies /uv and /uvx binaries"]
        runtime["runtime\nuv sync base deps\nuv sync +engine\nuv sync +engine +CONTAINER_EXTRA omit-flashinfer omit-torch omit-vllm\nuv sync +engine +CONTAINER_EXTRA omit-torch omit-vllm\nuv sync +engine +CONTAINER_EXTRA omit-vllm\nuv sync +engine +CONTAINER_EXTRA\nuv sync --no-editable project install\nNon-root appuser / tini + entrypoint.sh"]
        dev["dev\nExtends runtime\nuv + make + build-essential\nuv sync --group dev\nRoot user"]
    end

    uvImage --> uvStage
    pythonBase --> runtime
    uvStage -->|"COPY uv binaries"| runtime
    runtime --> dev
    uvStage -->|"COPY uv binaries"| dev

    subgraph ci [container-build.yml]
        tagPush["Tag push v*"]
        dispatch["workflow_dispatch"]
        buildPush["Build and push image\ncache-from + cache-to GHCR"]
        buildOnly["Build image only\nno cache"]
        ghcr["GHCR\nghcr.io/nvidia-nemo/safe-synthesizer"]
    end

    tagPush --> buildPush
    dispatch --> buildOnly
    buildPush -->|"push=true"| ghcr
Loading

Reviews (8): Last reviewed commit: "chore: remove PR builds" | Re-trigger Greptile

Comment thread .github/workflows/container-build.yml
Comment on lines +63 to +64
persist-credentials: false
fetch-depth: 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 fetch-depth: 0 fetches the full repository history, but nothing in this workflow consumes it. The version is resolved purely from GITHUB_REF/GITHUB_REF_NAME/GITHUB_SHA (no git describe or similar), and the Docker build context excludes .git/ via .dockerignore. On large repos this meaningfully slows the checkout step.

Suggested change
persist-credentials: false
fetch-depth: 0
persist-credentials: false
fetch-depth: 1

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@kendrickb-nvidia kendrickb-nvidia left a comment

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.

Looks reasonable to me, but will defer to Aaron and how this interacts with the cuda 13 PR and mise PR on ordering.

Comment thread .github/workflows/container-build.yml
@coderabbitai coderabbitai Bot added feature New feature or request docs Documentation-only change and removed docs Documentation-only change feature New feature or request labels Jun 3, 2026
@mckornfield
mckornfield force-pushed the docker-build-doohickey/mck branch from 15ae98e to 0742a4e Compare June 4, 2026 17:57
@coderabbitai coderabbitai Bot added feature New feature or request and removed docs Documentation-only change labels Jun 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
containers/Dockerfile.cuda (1)

195-233: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Dev image runs as root by default.

Line 195 switches to root, and the dev stage never switches back. Impact: commands run against bind mounts can create root-owned files on the host and reduce container isolation. Trigger: building/running --target dev. Smallest fix: switch back to appuser before final WORKDIR/CMD.

Suggested fix
 RUN git config --global --add safe.directory /workspace
 
+USER appuser
 WORKDIR /workspace
 ENTRYPOINT []
 CMD ["/bin/bash"]

As per coding guidelines: containers/Dockerfile*: Use non-root user (appuser) with NVIDIA_VISIBLE_DEVICES=all for GPU access.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9d296b2e-16c0-495b-aaae-d0edd6fd36cc

📥 Commits

Reviewing files that changed from the base of the PR and between 15ae98e and 0742a4e.

📒 Files selected for processing (10)
  • .dockerignore
  • .github/workflows/README.md
  • .github/workflows/container-build.yml
  • .mise/tasks/container/build/gpu
  • .mise/tasks/container/build/gpu-dev
  • .mise/tasks/container/build/gpu-multiarch
  • containers/Dockerfile.cuda
  • containers/README.md
  • docs/developer-guide/docker.md
  • docs/user-guide/docker.md
💤 Files with no reviewable changes (1)
  • .dockerignore
✅ Files skipped from review due to trivial changes (2)
  • docs/user-guide/docker.md
  • containers/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/container-build.yml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (10)
.github/**

⚙️ CodeRabbit configuration file

Review GitHub configuration for branch protection expectations, CODEOWNERS alignment, least privilege permissions, pinned actions where practical, and consistency with CONTRIBUTING.md.

Files:

  • .github/workflows/README.md
containers/Dockerfile*

📄 CodeRabbit inference engine (STYLE_GUIDE.md)

containers/Dockerfile*: Use multi-stage builds for production images.
Copy uv from ghcr.io/astral-sh/uv:<version>.
Use --mount=type=cache for pip/uv caches and APT (/var/cache/apt, /var/lib/apt/lists). Prefer cache mounts over rm -rf /var/lib/apt/lists/*.
Set ENV UV_LINK_MODE=copy when using cache mounts (hardlinks into cache layers vanish after unmount).
Use --no-install-recommends on all apt-get install invocations.
Use non-root user (appuser) with NVIDIA_VISIBLE_DEVICES=all for GPU access.
Use tini or --init for proper PID 1 signal handling in batch containers.
Order COPY directives for cache efficiency (deps before source).
Include comments explaining cache invalidation points.

Files:

  • containers/Dockerfile.cuda
**/*

📄 CodeRabbit inference engine (STYLE_GUIDE.md)

Include a newline at end of file, with no trailing whitespace.

Files:

  • containers/Dockerfile.cuda
  • docs/developer-guide/docker.md

⚙️ CodeRabbit configuration file

**/*: Review as a senior maintainer for NeMo Safe Synthesizer. Prioritize issues that can change behavior, break user workflows, weaken privacy guarantees, hide failures, make tests unreliable, or create maintenance risk. Avoid generic style commentary unless it points to a concrete project convention that automated tools will not catch.
Comment only when the finding is actionable and tied to changed code. For each finding, state the impact, the condition that triggers it, and the smallest practical fix. Prefer one precise comment over broad advice. Do not ask for refactors outside the PR scope unless the changed code creates the problem.
Review type guidance: - Potential issue: use for correctness bugs, data loss, privacy leaks,
security risks, broken public APIs, invalid config behavior, missing
validation, hidden failures, nondeterministic tests, or CI breakage.

  • Refactor suggestion: use for local maintainability problems introduced
    by the diff when they have clear future cost, such as duplicated setup,
    unclear boundaries, over-mocking, avoidable complexity, or opaque test
    helpers.
  • Nitpick: avoid in chill mode. Do not emit formatting, import-order,
    wording, or style-only comments unless automated tools cannot catch the
    issue and it affects maintainability.

Severity guidance: - Critical: security/privacy leaks, data loss, training/test/holdout
contamination, or broken release/package/core pipeline execution.

  • Major: incorrect generation/training/evaluation behavior, broken
    CLI/SDK public API, invalid config defaults or validators, or GPU/vLLM
    cleanup and process-isolation bugs likely to fail CI or production
    runs.
  • Minor: localized bugs, missing focused tests for changed behavior, or
    bad test patterns that weaken regression coverage.
  • Trivial: small cleanup with no behavior impact. Usually suppress in
    chill mode.
  • Info: context only. Avoid unless it helps reviewers understand risk.
    Safe-Synthesizer-specific review focus: - Data ...

Files:

  • containers/Dockerfile.cuda
  • docs/developer-guide/docker.md
containers/**

⚙️ CodeRabbit configuration file

Review container changes against STYLE_GUIDE.md and containers/README.md. Check cache mounts, uv usage, non-root runtime behavior, CUDA settings, and copy order.

Files:

  • containers/Dockerfile.cuda
**/*.{md,markdown,py}

📄 CodeRabbit inference engine (.cursor/rules/agent-markdown-style.mdc)

**/*.{md,markdown,py}: Avoid decorative bold (**text**) in list items, body text, and docstrings; use structural cues (headers, list markers, colons, backticks) for emphasis instead
Use backticks for code identifiers, paths, and CLI commands in markdown and docstrings

Files:

  • docs/developer-guide/docker.md
**/*.{md,markdown}

📄 CodeRabbit inference engine (.cursor/rules/agent-markdown-style.mdc)

**/*.{md,markdown}: Bold is acceptable only in markdown tables where it's the conventional way to mark header-like cells in the body
Use ## headers to segment markdown sections instead of bold text
Use -- (em-dash) instead of - (hyphen) for asides in markdown

Files:

  • docs/developer-guide/docker.md
**/*.md

📄 CodeRabbit inference engine (STYLE_GUIDE.md)

**/*.md: Use American English spelling: 'initialize' not 'initialise', 'recognize' not 'recognise', 'color' not 'colour'.
No decorative **bold** in body text, list items, or docstrings. Use headers, list markers, colons, and backticks for structure. Bold is acceptable in table headers and MkDocs Material card grid titles.
Use -- (em-dash) for asides, not - (hyphen).
Use single backticks for code identifiers, paths, and CLI commands in Markdown.
Use Mermaid diagrams with no spaces in node IDs, quote labels with special characters, and no explicit colors or styles.
Include SPDX copyright headers with HTML comments (<!-- SPDX-... -->) for markdown files without YAML frontmatter.
For Markdown files that start with YAML frontmatter (---), use hash-comment headers inside the frontmatter block instead of HTML comments.
Use single space between sentences, never two.

Files:

  • docs/developer-guide/docker.md
docs/**/*.md

📄 CodeRabbit inference engine (STYLE_GUIDE.md)

Classify documentation pages as tutorial, how-to, explanation, or reference per the Diataxis framework. Use MkDocs Material syntax: admonitions (!!! note), tabs (===), code blocks with titles and highlights.

Use MkDocs Material Markdown extensions for documentation: admonitions, content tabs, code blocks, Mermaid diagrams, task lists, footnotes, definition lists

docs/**/*.md: Use MkDocs Material admonition syntax (!!! note, !!! warning, ??? tip) for highlighting important information and collapsible sections in documentation
Use MkDocs Material tabs syntax (=== "Label") to present alternative views or language-specific examples in documentation
Use code block syntax with title and highlight line parameters (title="filename", hl_lines="2 3") for code examples in documentation
Use Mermaid diagram syntax (```mermaid flowchart, etc.) for visualizations in documentation

Files:

  • docs/developer-guide/docker.md
**/*.{py,sh,yaml,yml,md}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

All source files (.py, .sh, .yaml, .yml, .md) must include SPDX copyright headers

Files:

  • docs/developer-guide/docker.md
docs/**

⚙️ CodeRabbit configuration file

Review documentation as MkDocs Material content. Check Diataxis fit, accurate commands, internal links, code fences, and markdown style from STYLE_GUIDE.md.

Files:

  • docs/developer-guide/docker.md
🧠 Learnings (16)
📓 Common learnings
Learnt from: binaryaaron
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 481
File: containers/Dockerfile.cuda:100-106
Timestamp: 2026-06-01T18:47:21.036Z
Learning: In `containers/Dockerfile.cuda` (tools stage), `uv`/`uvx` are installed via `mise run setup` with the version pinned in `mise.lock`, and then copied to `/usr/local/bin/` via `cp "$(mise which uv)" /usr/local/bin/uv`. This is the intentional and reproducible approach — there is no need for a separate `FROM ghcr.io/astral-sh/uv:<version>` stage. The `PATH="/usr/local/bin:/mise/shims:${PATH}"` addition is required (not a noop) because `tools/install-mise.sh` installs the `mise` binary at `/usr/local/bin/mise`, so it must be on PATH before the shims are available for subsequent `mise trust` and `mise run setup` calls.
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: STYLE_GUIDE.md:0-0
Timestamp: 2026-06-03T23:08:14.151Z
Learning: Applies to containers/Dockerfile* : Use multi-stage builds for production images.
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: STYLE_GUIDE.md:0-0
Timestamp: 2026-06-03T23:08:14.151Z
Learning: Applies to containers/Dockerfile* : Use non-root user (`appuser`) with `NVIDIA_VISIBLE_DEVICES=all` for GPU access.
📚 Learning: 2026-06-03T23:08:14.151Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: STYLE_GUIDE.md:0-0
Timestamp: 2026-06-03T23:08:14.151Z
Learning: Applies to containers/Dockerfile* : Use non-root user (`appuser`) with `NVIDIA_VISIBLE_DEVICES=all` for GPU access.

Applied to files:

  • .mise/tasks/container/build/gpu
  • .mise/tasks/container/build/gpu-dev
  • .mise/tasks/container/build/gpu-multiarch
  • containers/Dockerfile.cuda
  • docs/developer-guide/docker.md
📚 Learning: 2026-06-01T18:47:21.036Z
Learnt from: binaryaaron
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 481
File: containers/Dockerfile.cuda:100-106
Timestamp: 2026-06-01T18:47:21.036Z
Learning: In `containers/Dockerfile.cuda` (tools stage), `uv`/`uvx` are installed via `mise run setup` with the version pinned in `mise.lock`, and then copied to `/usr/local/bin/` via `cp "$(mise which uv)" /usr/local/bin/uv`. This is the intentional and reproducible approach — there is no need for a separate `FROM ghcr.io/astral-sh/uv:<version>` stage. The `PATH="/usr/local/bin:/mise/shims:${PATH}"` addition is required (not a noop) because `tools/install-mise.sh` installs the `mise` binary at `/usr/local/bin/mise`, so it must be on PATH before the shims are available for subsequent `mise trust` and `mise run setup` calls.

Applied to files:

  • .mise/tasks/container/build/gpu
  • .mise/tasks/container/build/gpu-dev
  • .mise/tasks/container/build/gpu-multiarch
  • .github/workflows/README.md
  • containers/Dockerfile.cuda
  • docs/developer-guide/docker.md
📚 Learning: 2026-06-03T23:06:56.798Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-03T23:06:56.798Z
Learning: Use `uv sync --frozen --extra cu129 --extra engine --group dev` for a full GPU/dev environment setup

Applied to files:

  • .mise/tasks/container/build/gpu-dev
  • containers/Dockerfile.cuda
  • docs/developer-guide/docker.md
📚 Learning: 2026-06-03T23:08:14.151Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: STYLE_GUIDE.md:0-0
Timestamp: 2026-06-03T23:08:14.151Z
Learning: Applies to **/*.md : Use `Mermaid` diagrams with no spaces in node IDs, quote labels with special characters, and no explicit colors or styles.

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2026-06-03T23:09:13.516Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: .cursor/rules/writing-docs.mdc:0-0
Timestamp: 2026-06-03T23:09:13.516Z
Learning: Applies to docs/**/*.md : Use Mermaid diagram syntax (```mermaid flowchart, etc.) for visualizations in documentation

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2026-06-03T23:08:14.151Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: STYLE_GUIDE.md:0-0
Timestamp: 2026-06-03T23:08:14.151Z
Learning: Applies to containers/Dockerfile* : Use multi-stage builds for production images.

Applied to files:

  • .github/workflows/README.md
  • containers/Dockerfile.cuda
  • docs/developer-guide/docker.md
📚 Learning: 2026-06-03T23:08:50.142Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: tests/TESTING.md:0-0
Timestamp: 2026-06-03T23:08:50.142Z
Learning: Run tests using `mise run test` for unit tests (excludes slow, e2e, and smoke), `mise run test:unit-slow` for slow unit tests, `mise run test:smoke` for CPU smoke tests, `mise run test:smoke:gpu` for GPU smoke tests, `mise run test:e2e` for end-to-end tests, or `mise run test:ci` for CI unit tests with coverage

Applied to files:

  • .github/workflows/README.md
  • docs/developer-guide/docker.md
📚 Learning: 2026-06-03T23:08:32.341Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-06-03T23:08:32.341Z
Learning: Applies to **/*.py : Use ruff for linting and formatting checks; run via mise run check for read-only local quality checks

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2026-06-03T23:08:32.341Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-06-03T23:08:32.341Z
Learning: Use mise tasks (mise run <task>) instead of running ruff, ty, or pytest directly to ensure pinned tool versions from .mise.toml are used

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2026-06-03T23:06:56.798Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-03T23:06:56.798Z
Learning: Use mise tasks or wrapper scripts in `tools/` instead of running `ruff` or `ty` directly

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2026-06-03T23:08:32.341Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-06-03T23:08:32.341Z
Learning: Applies to **/*.py : Use ty (Pyright) for type checking; run via mise run check

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2026-06-03T23:08:32.341Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-06-03T23:08:32.341Z
Learning: Applies to tests/**/*.py : Run mise run test to execute unit tests (excludes slow unit tests, smoke and e2e)

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2026-06-03T23:08:14.151Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: STYLE_GUIDE.md:0-0
Timestamp: 2026-06-03T23:08:14.151Z
Learning: Applies to containers/Dockerfile* : Copy uv from `ghcr.io/astral-sh/uv:<version>`.

Applied to files:

  • containers/Dockerfile.cuda
  • docs/developer-guide/docker.md
📚 Learning: 2026-06-03T23:08:14.151Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: STYLE_GUIDE.md:0-0
Timestamp: 2026-06-03T23:08:14.151Z
Learning: Applies to containers/Dockerfile* : Include comments explaining cache invalidation points.

Applied to files:

  • containers/Dockerfile.cuda
📚 Learning: 2026-06-03T23:08:14.151Z
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer PR: 0
File: STYLE_GUIDE.md:0-0
Timestamp: 2026-06-03T23:08:14.151Z
Learning: Applies to containers/Dockerfile* : Set `ENV UV_LINK_MODE=copy` when using cache mounts (hardlinks into cache layers vanish after unmount).

Applied to files:

  • containers/Dockerfile.cuda
🪛 LanguageTool
.github/workflows/README.md

[uncategorized] ~154-~154: The official name of this software platform is spelled with a capital “H”.
Context: ... workflow/action changes. GPU jobs use .github/actions/setup-gpu-test-env for shared ...

(GITHUB)

docs/developer-guide/docker.md

[uncategorized] ~65-~65: The official name of this software platform is spelled with a capital “H”.
Context: ...erate uv.lock. 3. Add a matrix row to .github/workflows/container-build.yml. 4. Buil...

(GITHUB)


[style] ~132-~132: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...-no-install-package ... --no-group dev` installs the CUDA dependency closure while omitt...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🪛 Trivy (0.69.3)
containers/Dockerfile.cuda

[error] 195-195: Image user should not be 'root'

Last USER command in Dockerfile should not be 'root'

Rule: DS-0002

Learn more

(IaC/Dockerfile)

🔇 Additional comments (6)
.github/workflows/README.md (2)

105-105: Quote the Mermaid node label with special characters.

tag[Tag push v[0-9]*] should quote the label to avoid Mermaid parse/render failures.

As per coding guidelines, "Use Mermaid diagrams with no spaces in node IDs, quote labels with special characters, and no explicit colors or styles."


16-16: LGTM!

Also applies to: 91-95, 104-104, 108-108, 117-117, 119-119, 124-125, 127-127, 136-139, 154-154

docs/developer-guide/docker.md (1)

6-7: LGTM!

Also applies to: 17-19, 23-30, 33-40, 42-48, 52-67, 70-84, 89-97, 102-105, 114-114, 119-125, 128-140, 142-153, 156-180, 183-220, 225-225, 229-235, 238-240, 249-252, 264-266, 270-270, 273-273, 287-287, 314-320

.mise/tasks/container/build/gpu (1)

1-22: LGTM!

.mise/tasks/container/build/gpu-dev (1)

1-22: LGTM!

.mise/tasks/container/build/gpu-multiarch (1)

1-35: LGTM!

@mckornfield
mckornfield force-pushed the docker-build-doohickey/mck branch from 0742a4e to 87a88c0 Compare June 4, 2026 21:58
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mckornfield
mckornfield force-pushed the docker-build-doohickey/mck branch from 87a88c0 to 870e3bf Compare June 4, 2026 23:08
Signed-off-by: Matt Kornfield <mkornfield@nvidia.com>
@mckornfield
mckornfield force-pushed the docker-build-doohickey/mck branch from 870e3bf to e0abe06 Compare June 8, 2026 16:30
binaryaaron
binaryaaron previously approved these changes Jun 8, 2026

@binaryaaron binaryaaron left a comment

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.

seems good; will update the multiple-cuda versions pr as it hits this too, but that can just make multiple container tags

Signed-off-by: Matt Kornfield <mkornfield@nvidia.com>
@binaryaaron
binaryaaron added this pull request to the merge queue Jun 9, 2026
Merged via the queue into main with commit 24dc21a Jun 9, 2026
19 checks passed
@binaryaaron
binaryaaron deleted the docker-build-doohickey/mck branch June 9, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:build-dist area:ci area:dev-ex Affects build or dev experience area:docs feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants