Skip to content

[infra] Preserve clean version metadata in Docker builds#59

Open
vikuznetsov-nvidia wants to merge 2 commits into
mainfrom
vikuznetsov/nightly-version-provenance-tooling
Open

[infra] Preserve clean version metadata in Docker builds#59
vikuznetsov-nvidia wants to merge 2 commits into
mainfrom
vikuznetsov/nightly-version-provenance-tooling

Conversation

@vikuznetsov-nvidia

@vikuznetsov-nvidia vikuznetsov-nvidia commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Configure Git LFS consistently and verify wheel provenance so clean builds cannot be mislabeled as modified.

Summary by CodeRabbit

  • New Features
    • Added optional Ubuntu package mirror support for containerized builds.
    • Added Git LFS setup during container builds to ensure required assets are available.
    • Added optional gating to require a clean source tree before creating release artifacts.
    • Added enhanced release/nightly provenance verification for expected version and source revision.
  • Bug Fixes
    • Nightly artifacts now reject modified builds and mismatched version provenance.
    • Nightly version reporting is now enforced to exclude the “-modified” suffix when provenance is valid.

Configure Git LFS consistently and verify wheel provenance so clean builds cannot be mislabeled as modified.
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Nightly build documentation, Docker setup, build orchestration, and wheel verification now preserve Git/LFS version provenance, enforce clean tracked sources, and validate embedded versions against the checked-out revision.

Changes

Nightly version provenance

Layer / File(s) Summary
Documented provenance contract
cuvslam-skills/cuvslam-ci/SKILL.md, cuvslam-skills/cuvslam-ci/reference.md
Documents nightly version formatting, Git/LFS requirements, clean-source enforcement, and rejection of modified or mismatched artifacts.
Container Git/LFS and clean-source controls
scripts/Dockerfile, scripts/ubuntu-ports-mirror.conf, scripts/build_cuvslam_in_docker.sh, build_release.sh
Adds optional Ubuntu ports mirror support, installs and configures Git LFS, forwards clean-source settings, and checks tracked files before building.
Wheel provenance verification
scripts/verify_pycuvslam_wheel_in_docker.sh
Accepts expected version and SHA values, then validates the runtime version prefix, rejects -modified, and checks the embedded revision.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant BuildScript
  participant DockerImage
  participant GitLFS
  participant ReleaseBuild
  participant WheelVerifier

  BuildScript->>DockerImage: pass mirror and clean-source settings
  DockerImage->>GitLFS: install and configure system filters
  BuildScript->>ReleaseBuild: pass clean-source requirement
  ReleaseBuild->>ReleaseBuild: check tracked source state
  WheelVerifier->>WheelVerifier: validate wheel version and Git SHA provenance
Loading

Suggested reviewers: hrabeti-nvidia, slepichev

🚥 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 accurately summarizes the main change: keeping Docker build version metadata clean and provenance-aware.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch vikuznetsov/nightly-version-provenance-tooling

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

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

Test Results

Status Platform Language Total Passed Failed Errors Skipped
Orin C++ 16 16 0 0 0
Orin Python 68 67 0 0 1
Thor C++ 16 16 0 0 0
Thor Python 68 67 0 0 1
x86_64 C++ 16 16 0 0 0
x86_64 Python 68 67 0 0 1

cuVSLAM Evaluation KPIs

Config Dataset ATE,% ARE,º/m Kabsch, Losts, diff ATE,% diff ARE,º/m diff Kabsch, diff Losts, FPS,Hz
x86_64-cuda12.6.3-ubuntu24.04 KITTI-STEREO_ODOM 0.8455 0.0023 2.8606 0 NA NA NA NA 305.5
x86_64-cuda12.6.3-ubuntu24.04 KITTI-STEREO_SLAM 0.754 0.0019 1.9326 0 NA NA NA NA 177.6

Artifacts

Comment thread scripts/build_cuvslam_in_docker.sh Outdated
-e CUVSLAM_REQUIRE_CLEAN_SOURCE="$REQUIRE_CLEAN_SOURCE" \
-e EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS:-}" \
cuvslam:local /cuvslam/build_release.sh --build_type="$BUILD_TYPE" "${JOBS_ARG[@]}"
cuvslam:local bash -c '

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.

why not modify the scritp itself instead of passing an inline script?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I wanted to keep build_release.sh as is, but you are right, done

Comment thread scripts/Dockerfile Outdated
'Acquire::IndexTargets::deb::DEP-11-icons-small::DefaultEnabled "false";' \
'Acquire::IndexTargets::deb::DEP-11-icons::DefaultEnabled "false";' \
'Acquire::IndexTargets::deb::DEP-11-icons-hidpi::DefaultEnabled "false";' \
> /etc/apt/apt.conf.d/99-nvidia-ubuntu-ports-mirror; \

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.

should this be a fixture file that gets copied over at build time? guard it with the same condition argument.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I just moved it here from nightly.yml where Dockerfile was patched on the fly, but a fixture file is a better idea, done

Keep clean-source validation in the build entrypoint and move static apt settings into a reviewable fixture.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/Dockerfile`:
- Line 21: Escape UBUNTU_PORTS_MIRROR for sed replacement syntax before the sed
invocation in the Dockerfile command, handling &, #, and backslashes so
arbitrary mirror URLs cannot alter or break the expression. Use the escaped
value in the existing replacement while preserving the current URL substitution
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 7069007b-51fc-43f1-af07-94c9c83d49cd

📥 Commits

Reviewing files that changed from the base of the PR and between 726c2a1 and a12c37a.

📒 Files selected for processing (4)
  • build_release.sh
  • scripts/Dockerfile
  • scripts/build_cuvslam_in_docker.sh
  • scripts/ubuntu-ports-mirror.conf

Comment thread scripts/Dockerfile
RUN if [ -n "${UBUNTU_PORTS_MIRROR}" ]; then \
set -eux; \
find /etc/apt -type f \( -name '*.list' -o -name '*.sources' \) \
-exec sed -Ei "s#https?://ports\\.ubuntu\\.com/ubuntu-ports#${UBUNTU_PORTS_MIRROR}#g" {} +; \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Escape the mirror before using it as a sed replacement.

UBUNTU_PORTS_MIRROR is interpolated directly into the replacement expression. A URL containing & is treated as a back-reference, while # or backslashes can corrupt the expression, producing malformed APT sources or a failed build. Escape the replacement before invoking sed.

Suggested fix
+      mirror_escaped="$(printf '%s' "$UBUNTU_PORTS_MIRROR" | sed 's/[\\&#]/\\&/g')"; \
       find /etc/apt -type f \( -name '*.list' -o -name '*.sources' \) \
-          -exec sed -Ei "s#https?://ports\\.ubuntu\\.com/ubuntu-ports#${UBUNTU_PORTS_MIRROR}`#g`" {} +; \
+          -exec sed -Ei "s#https?://ports\\.ubuntu\\.com/ubuntu-ports#${mirror_escaped}`#g`" {} +; \
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
-exec sed -Ei "s#https?://ports\\.ubuntu\\.com/ubuntu-ports#${UBUNTU_PORTS_MIRROR}#g" {} +; \
mirror_escaped="$(printf '%s' "$UBUNTU_PORTS_MIRROR" | sed 's/[\\&#]/\\&/g')"; \
find /etc/apt -type f \( -name '*.list' -o -name '*.sources' \) \
-exec sed -Ei "s#https?://ports\\.ubuntu\\.com/ubuntu-ports#${mirror_escaped}`#g`" {} +; \
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/Dockerfile` at line 21, Escape UBUNTU_PORTS_MIRROR for sed
replacement syntax before the sed invocation in the Dockerfile command, handling
&, #, and backslashes so arbitrary mirror URLs cannot alter or break the
expression. Use the escaped value in the existing replacement while preserving
the current URL substitution behavior.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants