Skip to content

fix(slurm): make bootstrap container-safe#635

Merged
zywind merged 7 commits into
mainfrom
yunzhang/slurm-bootstrap
Jul 16, 2026
Merged

fix(slurm): make bootstrap container-safe#635
zywind merged 7 commits into
mainfrom
yunzhang/slurm-bootstrap

Conversation

@zywind

@zywind zywind commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a Slurm-specific bootstrap that installs Python and caches under Lustre using the repo-pinned uv
  • validate the prebuilt repo environment before submission and preserve submitted job variables through Pyxis
  • document the repeatable repo-mode and PyPI-mode setup paths

Test plan

  • Run shell syntax and staged whitespace checks
  • Run MISE_LOCKED=1 mise run bootstrap-nss-slurm cu129 twice, including an idempotent rerun
  • Submit Slurm smoke job 30081933; container startup, token loading, repo venv activation, and Adult dataset loading passed

Summary by CodeRabbit

  • New Features
    • Added a Slurm-specific bootstrap workflow to create a container-visible Python virtual environment on Lustre, install managed Python, and sync dependency profiles.
    • Added a reusable dependency-sync helper to install the correct extras/groups for a selected usage profile.
  • Bug Fixes
    • Improved PyPI-mode preflight to fail fast when the cached uv environment is missing.
    • Improved container execution safety by restricting which host environment variables can override container defaults.
  • Documentation
    • Updated Slurm setup, run instructions, and troubleshooting to use the new Slurm bootstrap and direct virtualenv binary entrypoints.

@zywind
zywind requested a review from a team as a code owner July 10, 2026 15:04
@github-actions github-actions Bot added area:dev-ex Affects build or dev experience area:tests labels Jul 10, 2026
@coderabbitai

coderabbitai Bot commented Jul 10, 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

Adds a Slurm-specific Lustre virtualenv bootstrap, centralizes NSS dependency synchronization, updates Slurm submission and container environment handling, and documents the new setup and execution commands.

Changes

Slurm Lustre bootstrap

Layer / File(s) Summary
Shared dependency synchronization
.mise/tasks/_lib.sh, .mise/tasks/bootstrap-nss, .agents/skills/uv-build/SKILL.md
Adds profile validation and centralized frozen uv sync handling, then documents and reuses it from the standard bootstrap task.
Lustre virtualenv bootstrap
.mise/tasks/bootstrap-nss-slurm, script/slurm/README.md
Creates a Lustre-backed Python environment, validates interpreter visibility and the CLI, and documents the Slurm bootstrap and execution flow.
Slurm execution integration
script/slurm/submit_slurm_jobs.sh, script/slurm/slurm_nss_matrix.sh, script/slurm/slurm_srun.sh
Uses the new bootstrap during submission, validates the resulting interpreter, checks PyPI uv setup, and passes selected environment variables into containers.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested labels: bug

Suggested reviewers: nina-xu

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: a Slurm bootstrap flow hardened for container-safe execution.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yunzhang/slurm-bootstrap

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

@coderabbitai coderabbitai Bot added bug Defects in shipped behavior feature New feature or request labels Jul 10, 2026
@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes the Slurm bootstrap container-safe by introducing a new bootstrap-nss-slurm mise task that pins the Python interpreter, uv caches, and the project virtualenv entirely under a Lustre-visible directory, replacing the previous ad-hoc uv sync call in prebuild_repo_venv. It also strengthens the runtime by adding a --container-env allowlist to slurm_srun.sh (so Pyxis cannot shadow submitted variables with stale container-image defaults) and adds a PyPI-mode preflight check that exits before apt-get runs if uv is missing from Lustre.

  • New bootstrap-nss-slurm task: validates LUSTRE_DIR, installs the pinned Python there, asserts the resolved executable is under Lustre before touching .venv, conditionally recreates .venv when its interpreter points outside Lustre, runs the frozen dependency sync via the new sync_nss_dependencies library function, and verifies the entry point is functional.
  • slurm_srun.sh container-env list: explicitly forwards all job-critical variables so a cached image built by another user cannot redirect paths or outputs; the accompanying comment documents the Pyxis allowlist behaviour.
  • slurm_nss_matrix.sh PyPI preflight: checks for ${LUSTRE_DIR}/.uv/bin/env before running apt-get, and moves the source .uv/bin/env call inside the PyPI branch so repo-mode jobs no longer require a Lustre-local uv installation.

Confidence Score: 5/5

Safe to merge; the new bootstrap task has correct guard ordering (Lustre-path assertions before venv creation), the container-env allowlist is documented, and the PyPI preflight prevents a late failure after apt-get.

All three changed runtime paths — bootstrap on the login node, venv validation in prebuild_repo_venv, and the matrix script inside the container — have consistent path assertions and fail-fast guards. No defects were found in the new logic.

submit_slurm_jobs.sh: the hardcoded cu129 profile in prebuild_repo_venv is worth revisiting if the cluster ever needs a different profile.

Important Files Changed

Filename Overview
.mise/tasks/bootstrap-nss-slurm New Slurm-specific bootstrap: validates LUSTRE_DIR, installs managed Python, verifies it resolves under Lustre before venv creation, and runs frozen dependency sync; logic is sound with correct guard ordering.
.mise/tasks/_lib.sh Adds sync_nss_dependencies helper extracted from bootstrap-nss; uses NSS_UV_BIN for explicit uv binary selection; clean refactoring.
script/slurm/submit_slurm_jobs.sh prebuild_repo_venv now calls bootstrap-nss-slurm instead of bare uv sync, with a post-build Lustre path check; the cu129 profile is hardcoded regardless of cluster configuration.
script/slurm/slurm_srun.sh Adds --container-env with an explicit variable allowlist and a comment documenting the Pyxis allowlist behavior; comment acknowledges the synchronization requirement.
script/slurm/slurm_nss_matrix.sh Adds PyPI-mode preflight check before apt-get runs; moves uv sourcing inside the PyPI branch, eliminating the unconditional source that broke repo mode.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant User as Login Node
    participant Submit as submit_slurm_jobs.sh
    participant Bootstrap as bootstrap-nss-slurm
    participant Lustre as Lustre FS
    participant Slurm as Slurm sbatch
    participant Pyxis as Pyxis Container
    participant Matrix as slurm_nss_matrix.sh

    User->>Submit: submit with configs
    Submit->>Submit: source env_variables.sh
    Submit->>Bootstrap: mise run bootstrap-nss-slurm cu129 (flock)
    Bootstrap->>Lustre: mkdir caches under LUSTRE_DIR
    Bootstrap->>Lustre: uv python install to UV_PYTHON_INSTALL_DIR
    Bootstrap->>Bootstrap: assert python_bin resolves under lustre_real
    Bootstrap->>Lustre: uv venv recreate if wrong interpreter
    Bootstrap->>Lustre: uv sync frozen deps
    Bootstrap->>Bootstrap: verify safe-synthesizer entrypoint
    Bootstrap-->>Submit: exit 0
    Submit->>Submit: assert .venv/bin/python under Lustre
    Submit->>Slurm: sbatch slurm_srun.sh
    Slurm->>Pyxis: srun with container-env allowlist
    Pyxis->>Matrix: bash slurm_nss_matrix.sh
    alt PyPI mode
        Matrix->>Lustre: check .uv/bin/env exists
        Matrix->>Matrix: source uv env, create versioned venv
    else Repo mode
        Matrix->>Lustre: check .venv/bin/safe-synthesizer
        Matrix->>Matrix: activate prebuilt venv
    end
    Matrix->>Matrix: safe-synthesizer run
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant User as Login Node
    participant Submit as submit_slurm_jobs.sh
    participant Bootstrap as bootstrap-nss-slurm
    participant Lustre as Lustre FS
    participant Slurm as Slurm sbatch
    participant Pyxis as Pyxis Container
    participant Matrix as slurm_nss_matrix.sh

    User->>Submit: submit with configs
    Submit->>Submit: source env_variables.sh
    Submit->>Bootstrap: mise run bootstrap-nss-slurm cu129 (flock)
    Bootstrap->>Lustre: mkdir caches under LUSTRE_DIR
    Bootstrap->>Lustre: uv python install to UV_PYTHON_INSTALL_DIR
    Bootstrap->>Bootstrap: assert python_bin resolves under lustre_real
    Bootstrap->>Lustre: uv venv recreate if wrong interpreter
    Bootstrap->>Lustre: uv sync frozen deps
    Bootstrap->>Bootstrap: verify safe-synthesizer entrypoint
    Bootstrap-->>Submit: exit 0
    Submit->>Submit: assert .venv/bin/python under Lustre
    Submit->>Slurm: sbatch slurm_srun.sh
    Slurm->>Pyxis: srun with container-env allowlist
    Pyxis->>Matrix: bash slurm_nss_matrix.sh
    alt PyPI mode
        Matrix->>Lustre: check .uv/bin/env exists
        Matrix->>Matrix: source uv env, create versioned venv
    else Repo mode
        Matrix->>Lustre: check .venv/bin/safe-synthesizer
        Matrix->>Matrix: activate prebuilt venv
    end
    Matrix->>Matrix: safe-synthesizer run
Loading

Reviews (7): Last reviewed commit: "Merge branch 'main' into yunzhang/slurm-..." | Re-trigger Greptile

Comment thread script/slurm/slurm_srun.sh Outdated
Comment thread .mise/tasks/bootstrap-nss-slurm

@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.

🧹 Nitpick comments (1)
script/slurm/slurm_srun.sh (1)

18-27: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Manually maintained security whitelist -- easy to silently drift.

CONTAINER_ENV_VARS is a hardcoded list protecting submitted job config from being overridden by variables baked into a cached container image. Cross-checked against current usages in slurm_nss_matrix.sh and bootstrap-nss-slurm and it looks complete today, but there's no mechanism tying this list to the variables scripts actually rely on -- a future addition to env_variables.sh or the matrix/bootstrap scripts that isn't also added here would silently reintroduce the exact override risk this change fixes.

Consider a short comment noting that new job-critical env vars must be added to this list, or centralizing the variable names alongside env_variables.sh so the two can't drift.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 579f96ac-520f-4e9e-969b-2d5d94b08e6e

📥 Commits

Reviewing files that changed from the base of the PR and between 1eb318c and d46fe96.

📒 Files selected for processing (8)
  • .agents/skills/uv-build/SKILL.md
  • .mise/tasks/_lib.sh
  • .mise/tasks/bootstrap-nss
  • .mise/tasks/bootstrap-nss-slurm
  • script/slurm/README.md
  • script/slurm/slurm_nss_matrix.sh
  • script/slurm/slurm_srun.sh
  • script/slurm/submit_slurm_jobs.sh
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: CodeRabbit / Review
  • GitHub Check: Unit Tests (3.13)
  • GitHub Check: Unit Tests (3.12)
  • GitHub Check: Unit Tests (3.11)
  • GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (11)
.mise/tasks/**/*

📄 CodeRabbit inference engine (STYLE_GUIDE.md)

Keep shared shell helpers in .mise/tasks/_lib.sh, and make it non-executable so Mise does not list it as a task.

Files:

  • .mise/tasks/bootstrap-nss
  • .mise/tasks/_lib.sh
  • .mise/tasks/bootstrap-nss-slurm
**/*.{sh,bash}

📄 CodeRabbit inference engine (AGENTS.md)

Never use ~ inside double-quoted strings in shell scripts -- use $HOME or an absolute path instead

Files:

  • script/slurm/slurm_srun.sh
  • script/slurm/slurm_nss_matrix.sh
  • script/slurm/submit_slurm_jobs.sh
**/*.{py,sh,yaml,yml,md}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

All source files (.py, .sh, .yaml, .yml, .md) require SPDX copyright headers; mise run format adds them automatically

Files:

  • script/slurm/slurm_srun.sh
  • script/slurm/slurm_nss_matrix.sh
  • script/slurm/README.md
  • script/slurm/submit_slurm_jobs.sh
**/*

📄 CodeRabbit inference engine (STYLE_GUIDE.md)

**/*: Every source file must include the required SPDX copyright and license header; use HTML comments for Markdown, hash comments for .py, .sh, .yaml, and .yml, and hash-comment headers inside YAML frontmatter for Markdown files with frontmatter.
Ensure files end with a newline and have no trailing whitespace; use a single space between sentences.

Files:

  • script/slurm/slurm_srun.sh
  • script/slurm/slurm_nss_matrix.sh
  • script/slurm/README.md
  • script/slurm/submit_slurm_jobs.sh

⚙️ 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:

  • script/slurm/slurm_srun.sh
  • script/slurm/slurm_nss_matrix.sh
  • script/slurm/README.md
  • script/slurm/submit_slurm_jobs.sh
**

⚙️ CodeRabbit configuration file

**:

AGENTS.md

Guide for AI agents (Cursor, Windsurf, Claude Code, etc.) working in the Safe-Synthesizer repo.

This project loads local developer preferences from @AGENTS.local.md. You MUST read this file if it exists and give its instructions top priority.

Skills

Repo-specific skills live in .agents/skills/; see .agents/README.md for the catalog. Read a skill when the task matches its scope instead of copying workflow details into this file.

Durable implementation guidance belongs with the code it describes: function and class docstrings for public contracts and source comments for local invariants. Test-suite guidance belongs in tests/TESTING.md.

Repo Conventions

See STYLE_GUIDE.md for detailed code style conventions (Python, markdown, Dockerfiles, shell scripts, testing, config files, docstrings).

Use uv for everything -- never pip or raw python. Python 3.11–3.13 with modern syntax (X | Y, list[str], Self). Python 3.14+ is not supported.

Common commands: mise run test (unit tests), mise run format (auto-fix formatting + lint + copyright), mise run check (read-only local quality checks), mise run validate (pre-PR quality, lock, and CI unit checks), mise run typecheck (ty only). Always use mise tasks or the wrapper scripts in tools/ instead of running ruff or ty directly. Use uv run for Python execution. When in doubt, inspect mise tasks and pytest --markers.

The canonical uv sync command for a full GPU/dev environment is:

uv sync --frozen --extra cu129 --extra engine --group dev

Bare uv sync --frozen (without extras) installs an incomplete environment -- ty, import checks, and GPU tests will fail.

Feature branches off main. Branch names often include an issue number prefix (e.g., <author>/123-short-name).

Do ...

Files:

  • script/slurm/slurm_srun.sh
  • script/slurm/slurm_nss_matrix.sh
  • script/slurm/README.md
  • script/slurm/submit_slurm_jobs.sh
script/**

⚙️ CodeRabbit configuration file

Review standalone scripts for reproducibility and operational safety. Check argument validation, quoting, repo-root detection, environment variables, generated artifacts, external commands, GPU/cluster assumptions, and whether the script should be wired through Makefile or documented in README/docs.

Files:

  • script/slurm/slurm_srun.sh
  • script/slurm/slurm_nss_matrix.sh
  • script/slurm/README.md
  • script/slurm/submit_slurm_jobs.sh
**/*.sh

⚙️ CodeRabbit configuration file

Review shell scripts for #!/usr/bin/env bash, set -euo pipefail where appropriate, quoting, repo root detection, and shellcheck compliance.

Files:

  • script/slurm/slurm_srun.sh
  • script/slurm/slurm_nss_matrix.sh
  • script/slurm/submit_slurm_jobs.sh
**/*.{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:

  • script/slurm/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:

  • script/slurm/README.md
**/*.md

📄 CodeRabbit inference engine (STYLE_GUIDE.md)

**/*.md: Use single backticks for code identifiers, paths, and CLI commands in Markdown, and use -- for asides rather than a hyphen.
Do not use decorative bold in Markdown body text or list items; bold is acceptable only in table-header-like cells and MkDocs Material card-grid titles.
For Mermaid diagrams, avoid spaces in node IDs, quote labels containing special characters, and do not use explicit colors or styles.

Files:

  • script/slurm/README.md
.agents/skills/**

📄 CodeRabbit inference engine (.cursor/rules/repo-navigation.mdc)

Store skills in canonical location .agents/skills/ with each skill containing a SKILL.md file and optional references/

Files:

  • .agents/skills/uv-build/SKILL.md
🪛 markdownlint-cli2 (0.22.1)
script/slurm/README.md

[warning] 38-38: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above

(MD022, blanks-around-headings)


[warning] 97-97: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🪛 Shellcheck (0.11.0)
script/slurm/slurm_nss_matrix.sh

[info] 118-118: Not following: ./.uv/bin/env was not specified as input (see shellcheck -x).

(SC1091)

🔇 Additional comments (10)
.mise/tasks/_lib.sh (1)

41-64: LGTM!

.mise/tasks/bootstrap-nss (1)

10-16: LGTM!

.mise/tasks/bootstrap-nss-slurm (2)

1-13: LGTM!

Also applies to: 18-53, 56-71, 76-89


14-17: 🎯 Functional Correctness

No action needed: the venv path matches downstream .venv expectations

resolve_venv_path() defaults to ${MISE_CONFIG_ROOT}/.venv, and bootstrap-nss-slurm sets NSS_DIR="${MISE_CONFIG_ROOT}", so the created venv is the same ${NSS_DIR}/.venv that downstream scripts use. ``

			> Likely an incorrect or invalid review comment.
.agents/skills/uv-build/SKILL.md (1)

25-36: LGTM!

script/slurm/README.md (2)

37-38: 📐 Maintainability & Code Quality | ⚡ Quick win

Add blank lines around heading and fence per markdownlint.

markdownlint-cli2 flags both spots: the #### Bootstrap the Slurm Python environment heading (line 38) needs a blank line above it (MD022), and the ```bash fence (line 97) needs a blank line above it (MD031).

📝 Proposed fix
 cd Safe-Synthesizer

Bootstrap the Slurm Python environment


```diff
   - This is optional for bootstrap, but avoids exporting the submission user in every shell.
+
 ```bash
 export USER_NAME="<your slurm user name>"

Also applies to: 96-97

Source: Linters/SAST tools


16-22: LGTM!

Also applies to: 39-95, 98-99, 275-275

script/slurm/submit_slurm_jobs.sh (1)

139-181: LGTM!

script/slurm/slurm_nss_matrix.sh (1)

107-118: LGTM!

Also applies to: 135-135

script/slurm/slurm_srun.sh (1)

36-36: LGTM!

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot removed the feature New feature or request label Jul 10, 2026
zywind added 3 commits July 13, 2026 16:28
Signed-off-by: Yunfeng Zhang <yunzhang@nvidia.com>
Signed-off-by: Yunfeng Zhang <yunzhang@nvidia.com>
Signed-off-by: Yunfeng Zhang <yunzhang@nvidia.com>
@zywind
zywind force-pushed the yunzhang/slurm-bootstrap branch from b89b155 to e72faee Compare July 13, 2026 20:29

@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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 28d39821-7d3b-478a-a2ea-18ed20d9e34a

📥 Commits

Reviewing files that changed from the base of the PR and between b89b155 and e72faee.

📒 Files selected for processing (8)
  • .agents/skills/uv-build/SKILL.md
  • .mise/tasks/_lib.sh
  • .mise/tasks/bootstrap-nss
  • .mise/tasks/bootstrap-nss-slurm
  • script/slurm/README.md
  • script/slurm/slurm_nss_matrix.sh
  • script/slurm/slurm_srun.sh
  • script/slurm/submit_slurm_jobs.sh
🚧 Files skipped from review as they are similar to previous changes (6)
  • .mise/tasks/_lib.sh
  • .mise/tasks/bootstrap-nss
  • .agents/skills/uv-build/SKILL.md
  • script/slurm/submit_slurm_jobs.sh
  • script/slurm/README.md
  • .mise/tasks/bootstrap-nss-slurm
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: Unit Tests (3.12)
  • GitHub Check: Unit Tests (3.11)
  • GitHub Check: Unit Tests (3.13)
  • GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{sh,bash}

📄 CodeRabbit inference engine (AGENTS.md)

Never use ~ inside double-quoted strings in shell scripts -- use $HOME or an absolute path instead

Files:

  • script/slurm/slurm_nss_matrix.sh
  • script/slurm/slurm_srun.sh
**/*

📄 CodeRabbit inference engine (STYLE_GUIDE.md)

**/*: Every source file requires the SPDX copyright and license header appropriate to its file format.
End files with a newline, remove trailing whitespace, use one space between sentences, and keep code, comments, and docstrings within 120 characters.

**/*: All merged commits must use Conventional Commits format: <type>(<scope>): <description> or <type>: <description>, with a lowercase valid type and a description no longer than 100 characters.
All contributions require a DCO Signed-off-by trailer and a cryptographic commit signature.
Before submitting a pull request, run formatting, checks, and tests using mise run format, mise run check, and mise run test.
Branches other than main must use lowercase author-prefixed names in one of the documented forms, optionally including an issue ID and category.
Release tags must use a v prefix and PEP 440 stable or release-candidate versions, such as v1.0.0 or v0.1.0rc0; alpha versions and dashed -rc suffixes are not used.
Do not move a published release tag; create and validate a new release candidate when code changes.
Use mise run <task> for project tasks; the Makefile only bootstraps mise and provides deprecated compatibility messages.

Files:

  • script/slurm/slurm_nss_matrix.sh
  • script/slurm/slurm_srun.sh

⚙️ 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:

  • script/slurm/slurm_nss_matrix.sh
  • script/slurm/slurm_srun.sh
**/*.{py,sh,yaml,yml,md}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

All source files with .py, .sh, .yaml, .yml, or .md extensions must include SPDX copyright headers, except files listed in .copyrightignore.

Files:

  • script/slurm/slurm_nss_matrix.sh
  • script/slurm/slurm_srun.sh
script/**

⚙️ CodeRabbit configuration file

Review standalone scripts for reproducibility and operational safety. Check argument validation, quoting, repo-root detection, environment variables, generated artifacts, external commands, GPU/cluster assumptions, and whether the script should be wired through Makefile or documented in README/docs.

Files:

  • script/slurm/slurm_nss_matrix.sh
  • script/slurm/slurm_srun.sh
**/*.sh

⚙️ CodeRabbit configuration file

Review shell scripts for #!/usr/bin/env bash, set -euo pipefail where appropriate, quoting, repo root detection, and shellcheck compliance.

Files:

  • script/slurm/slurm_nss_matrix.sh
  • script/slurm/slurm_srun.sh
🪛 Shellcheck (0.11.0)
script/slurm/slurm_nss_matrix.sh

[info] 118-118: Not following: ./.uv/bin/env was not specified as input (see shellcheck -x).

(SC1091)

🔇 Additional comments (1)
script/slurm/slurm_srun.sh (1)

38-38: LGTM!

Comment thread script/slurm/slurm_nss_matrix.sh Outdated
Comment thread script/slurm/slurm_nss_matrix.sh Outdated
Comment thread script/slurm/slurm_srun.sh Outdated

@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.

Generally looks good and helps make setup more consistent now without the larger lift of building an image for each slurm experiment.

Are there any one time actions to do for those of us with existing slurm setups using the old instructions? Thinking especially about the weekly triggered runs via gitlab, or we'll find out the Friday after this is merged. CC @nina-xu.

Comment thread script/slurm/README.md
Comment thread .mise/tasks/bootstrap-nss-slurm
Comment thread script/slurm/README.md
Signed-off-by: Yunfeng Zhang <yunzhang@nvidia.com>
Signed-off-by: Yunfeng Zhang <yunzhang@nvidia.com>
@zywind

zywind commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@kendrickb-nvidia Existing Slurm checkouts need a one-time bootstrap after pulling this change. Scheduled launch environments, including GitLab jobs, must expose ${HOME}/.local/bin on PATH before running submit_slurm_jobs.sh; repo-mode submission then builds or repairs the Lustre-backed .venv. Existing Python and uv installs under /home do not need to be removed. This is documented in 8731c5c0, and db6d47a9 makes the bootstrap use each caller’s configured LUSTRE_DIR instead of assuming the nemotron_data_dev project.

@zywind
zywind enabled auto-merge July 15, 2026 19:06
@zywind
zywind disabled auto-merge July 15, 2026 19:07
@zywind
zywind enabled auto-merge July 15, 2026 19:10
Signed-off-by: Yunfeng Zhang <yunzhang@nvidia.com>
@zywind
zywind requested a review from binaryaaron July 15, 2026 19:10
Comment thread .agents/skills/uv-build/SKILL.md

@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.

Be sure to make a slack post with the one time instructions once this merges so folks using slurm internally will know the updates to make.

@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

@zywind
zywind removed the request for review from nina-xu July 16, 2026 18:44
@zywind
zywind disabled auto-merge July 16, 2026 18:45
@zywind
zywind added this pull request to the merge queue Jul 16, 2026
@zywind
zywind requested a review from nina-xu July 16, 2026 18:45
Merged via the queue into main with commit 0fddfb1 Jul 16, 2026
24 of 36 checks passed
@zywind
zywind deleted the yunzhang/slurm-bootstrap branch July 16, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-ex Affects build or dev experience area:tests bug Defects in shipped behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants