[infra] Preserve clean version metadata in Docker builds#59
[infra] Preserve clean version metadata in Docker builds#59vikuznetsov-nvidia wants to merge 2 commits into
Conversation
Configure Git LFS consistently and verify wheel provenance so clean builds cannot be mislabeled as modified.
📝 WalkthroughWalkthroughNightly 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. ChangesNightly version provenance
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
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Test Results
cuVSLAM Evaluation KPIs
Artifacts |
| -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 ' |
There was a problem hiding this comment.
why not modify the scritp itself instead of passing an inline script?
There was a problem hiding this comment.
I wanted to keep build_release.sh as is, but you are right, done
| '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; \ |
There was a problem hiding this comment.
should this be a fixture file that gets copied over at build time? guard it with the same condition argument.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
📒 Files selected for processing (4)
build_release.shscripts/Dockerfilescripts/build_cuvslam_in_docker.shscripts/ubuntu-ports-mirror.conf
| 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" {} +; \ |
There was a problem hiding this comment.
🎯 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.
| -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.
Configure Git LFS consistently and verify wheel provenance so clean builds cannot be mislabeled as modified.
Summary by CodeRabbit