Skip to content

feat: add lockfiles for reproducible sandbox builds#1231

Closed
gwarmstrong wants to merge 1 commit intoNVIDIA-NeMo:mainfrom
gwarmstrong:georgea/sandbox-lockfiles
Closed

feat: add lockfiles for reproducible sandbox builds#1231
gwarmstrong wants to merge 1 commit intoNVIDIA-NeMo:mainfrom
gwarmstrong:georgea/sandbox-lockfiles

Conversation

@gwarmstrong
Copy link
Collaborator

@gwarmstrong gwarmstrong commented Feb 11, 2026

Summary

  • Add requirements/sandbox-core.lock and requirements/sandbox.lock for pinned sandbox dependency installation
  • Switch Dockerfile.sandbox from pip install to uv pip install from lockfiles for reproducible builds
  • Add flask and gunicorn to requirements/code_execution.txt
  • Add dependency locking instructions to Dockerfile header

Split from #1226 — this PR handles lockfile infrastructure only; gunicorn migration follows in a separate PR.

Summary by CodeRabbit

  • Chores
    • Refactored the Python dependency installation process for improved build efficiency.
    • Updated Python dependencies with new packages to support application infrastructure.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

PATH="/root/.local/bin:${PATH}"

# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Piping curl to shell (curl | sh) downloads and executes remote code without verification. Consider downloading the script first, verifying its checksum, then executing it for better security.

Suggested change
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
RUN curl -LsSf https://astral.sh/uv/install.sh -o /tmp/uv-install.sh && \
sh /tmp/uv-install.sh && rm /tmp/uv-install.sh

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!

… builds

Add sandbox-core.lock and sandbox.lock for pinned dependency installation.
Switch Dockerfile.sandbox from pip install to uv install from lockfiles.
Add flask and gunicorn to code_execution.txt requirements.

Signed-off-by: George Armstrong <georgea@nvidia.com>
@gwarmstrong gwarmstrong force-pushed the georgea/sandbox-lockfiles branch from 4d02820 to a5997c4 Compare February 11, 2026 21:01
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

📝 Walkthrough

Walkthrough

The Dockerfile.sandbox is refactored to replace per-file Python dependency setup with a lock-file-driven installation flow using two lock files (sandbox-core.lock and sandbox.lock), introduces uv package manager, and applies conditional logic for non-CI and non-arm64 installations. The code_execution.txt gains flask and gunicorn dependencies.

Changes

Cohort / File(s) Summary
Dockerfile Build System Refactoring
dockerfiles/Dockerfile.sandbox
Replaced individual requirements file installation with lock-file-driven approach; introduced uv package manager, added conditional installation logic for CI/non-CI and arm64 targets, consolidated WORKDIR directives, and removed explicit STEM installation steps.
Code Execution Dependencies
requirements/code_execution.txt
Added flask and gunicorn packages to support web framework and application server functionality.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding lockfiles for reproducible sandbox builds, which is the central objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@dockerfiles/Dockerfile.sandbox`:
- Around line 82-83: Add a pinned UV version ARG and use it in the existing uv
install RUN command: introduce an ARG named UV_VERSION (set to the uv version
used to generate the lock files) near the top of Dockerfile.sandbox and change
the existing RUN curl -LsSf https://astral.sh/uv/install.sh | sh invocation to
use https://astral.sh/uv/${UV_VERSION}/install.sh so the RUN line that installs
uv is reproducible; reference the ARG name UV_VERSION and the RUN command that
currently installs uv to locate the change.
🧹 Nitpick comments (3)
requirements/code_execution.txt (1)

18-19: Infrastructure dependencies mixed with LLM-accessible packages.

The file header (line 16) describes this as "requirements for code execution — put all packages that LLM should have access to in here." flask and gunicorn are server infrastructure dependencies, not packages an LLM would typically use during code execution. Consider adding a brief inline comment (e.g., # server infrastructure) to distinguish them from the data-science packages, or split them into a separate requirements file that the lockfile compilation also consumes.

dockerfiles/Dockerfile.sandbox (2)

101-104: Inconsistent package manager: pip install gdown vs uv pip install elsewhere.

The rest of the Dockerfile now uses uv pip install, but this line still uses bare pip. Consider switching to uv pip install gdown for consistency.

Proposed fix
-RUN mkdir -p /data && pip install gdown && \
+RUN mkdir -p /data && uv pip install --system gdown && \

152-153: Duplicate ENV LISTEN_PORT=6000.

LISTEN_PORT is set to 6000 on both line 153 and line 165. One of these can be removed.

Also applies to: 165-165

Comment on lines +82 to +83
# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

uv install script version pinning astral.sh

💡 Result:

To pin a specific uv version when using Astral’s install scripts, put the version in the URL path:

  • macOS/Linux (sh):
    curl -LsSf https://astral.sh/uv/0.10.0/install.sh | sh
  • Windows (PowerShell):
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/0.10.0/install.ps1 | iex"

[1]

For Docker, pin the installer URL the same way (or pin the Docker image tag / digest):

ADD https://astral.sh/uv/0.10.0/install.sh /uv-installer.sh

[2]

If you also need reproducible install behavior (path, no PATH modification, etc.), the installer supports environment variables like UV_INSTALL_DIR, UV_NO_MODIFY_PATH, and UV_UNMANAGED_INSTALL. [3]


🏁 Script executed:

# Look for any version hints in lock files or documentation
fd -type f \( -name "uv.lock" -o -name "uv.toml" -o -name "pyproject.toml" -o -name "requirements*.txt" \) | head -20

Repository: NVIDIA-NeMo/Skills

Length of output: 232


🏁 Script executed:

# Check the Dockerfile context for other version pins or version references
cat -n dockerfiles/Dockerfile.sandbox | head -100

Repository: NVIDIA-NeMo/Skills

Length of output: 5242


🏁 Script executed:

# Look for CI/CD files and setup configurations that may specify uv version
fd -name "*.yml" -o -name "*.yaml" -o -name ".github" | head -20

Repository: NVIDIA-NeMo/Skills

Length of output: 292


🏁 Script executed:

# Search for uv version references in the entire repo
rg "uv.*[0-9]+\.[0-9]+" --max-count 10

Repository: NVIDIA-NeMo/Skills

Length of output: 523


🏁 Script executed:

# Check the lock files themselves for version info
fd -name "*.lock" -type f

Repository: NVIDIA-NeMo/Skills

Length of output: 292


🏁 Script executed:

# Find lock files and CI files
git ls-files | grep -E "(\.lock|\.yml|\.yaml|pyproject\.toml)" | head -30

Repository: NVIDIA-NeMo/Skills

Length of output: 1318


🏁 Script executed:

# Search for uv version references more carefully
rg "uv" --type py --type txt --type toml | grep -i "version\|0\.[0-9]" | head -20

Repository: NVIDIA-NeMo/Skills

Length of output: 374


🏁 Script executed:

# Check if there's a pyproject.toml with uv config
fd "pyproject.toml" -type f

Repository: NVIDIA-NeMo/Skills

Length of output: 232


🏁 Script executed:

# Find lock files more simply
find . -name "*.lock" -type f 2>/dev/null | head -20

Repository: NVIDIA-NeMo/Skills

Length of output: 122


🏁 Script executed:

# Check the GitHub workflow files for uv version pins
cat .github/workflows/tests.yml | head -100

Repository: NVIDIA-NeMo/Skills

Length of output: 3631


🏁 Script executed:

# Look for any mentions of uv version in the codebase
rg "astral.*uv" --max-count 10

Repository: NVIDIA-NeMo/Skills

Length of output: 464


🏁 Script executed:

# Check Dockerfile.nemo-rl to see what UV_VERSION is set to
cat -n dockerfiles/Dockerfile.nemo-rl | grep -A 5 -B 5 "UV_VERSION"

Repository: NVIDIA-NeMo/Skills

Length of output: 576


🏁 Script executed:

# Look for ARG UV_VERSION or ENV UV_VERSION definitions
rg "UV_VERSION" -B 2 -A 2

Repository: NVIDIA-NeMo/Skills

Length of output: 525


Pin the uv version for reproducible builds.

The whole point of this PR is reproducible sandbox builds, but uv itself is installed without a version pin. Future uv releases could change behavior or introduce incompatibilities. Pin the version in the install URL using an ARG (following the pattern already established in Dockerfile.nemo-rl).

Dockerfile.nemo-rl correctly pins this with:

ARG UV_VERSION=0.9.7
RUN curl -LsSf https://astral.sh/uv/${UV_VERSION}/install.sh | sh

Apply the same pattern to Dockerfile.sandbox, using the uv version that was used to generate the lock files.

🤖 Prompt for AI Agents
In `@dockerfiles/Dockerfile.sandbox` around lines 82 - 83, Add a pinned UV version
ARG and use it in the existing uv install RUN command: introduce an ARG named
UV_VERSION (set to the uv version used to generate the lock files) near the top
of Dockerfile.sandbox and change the existing RUN curl -LsSf
https://astral.sh/uv/install.sh | sh invocation to use
https://astral.sh/uv/${UV_VERSION}/install.sh so the RUN line that installs uv
is reproducible; reference the ARG name UV_VERSION and the RUN command that
currently installs uv to locate the change.

@gwarmstrong
Copy link
Collaborator Author

Recreating from origin branch to fix CI auth

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant