fix(installer): report unexpected Docker access#4201
Conversation
Signed-off-by: Chengjie Wang <chengjiew@nvidia.com>
|
This repository limits contributors to 10 open pull requests. Please close or merge existing PRs before opening new ones. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds report_unexpected_docker_access() to log username, DOCKER_HOST, and docker.sock ownership when Docker is reachable for a non-root user not in the docker group; invokes it from ensure_docker() after successful docker info. Adds test helpers and a sourced Docker-bootstrap Vitest suite, adjusts tests, CI budget, and vitest config. ChangesDocker Access Diagnostics
Sequence Diagram(s)sequenceDiagram
participant Installer
participant ensure_docker
participant DockerCLI
participant report_unexpected_docker_access
Installer->>ensure_docker: call ensure_docker()
ensure_docker->>DockerCLI: run "docker info"
DockerCLI-->>ensure_docker: success
ensure_docker->>report_unexpected_docker_access: invoke to emit diagnostics
report_unexpected_docker_access-->>Installer: print username, DOCKER_HOST, socket stat
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
E2E Scenario Advisor RecommendationRequired scenario E2E: None Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
PR Review AdvisorFindings: 1 needs attention, 3 worth checking, 0 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
Consider writing more tests for
Since last review detailsCurrent findings:
This is an automated advisory review. A human maintainer must make the final merge decision. |
prekshivyas
left a comment
There was a problem hiding this comment.
LGTM. Correctly addresses #3952. The host grants Docker access via a non-group path (socket ACL / DOCKER_HOST / wrapper), which can't be 'fixed' in the installer — so surfacing it is the right call. report_unexpected_docker_access() is info-only (no change to install flow), correctly short-circuits for root and docker-group members, and only logs the anomaly (with DOCKER_HOST + socket stat) when docker is reachable yet the user isn't in the group — explaining why the 'non-docker user denied' negative test won't reproduce on such hosts. CI green; test harness extended for the new stat path.
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 `@test/install-preflight.test.ts`:
- Around line 3169-3200: The test file exceeds the size budget because you added
a new Docker diagnostics test; extract the "reports when Docker is reachable for
a non-docker-group Linux user" test and any closely related helpers into a new
test file (e.g., create a new spec file) to reduce
test/install-preflight.test.ts back under the limit. Move the test block and the
supporting stub utilities used here (references: the it(...) test title,
runEnsureDockerWithStubs, dockerScript/idScript/statScript literals, and
assertions that reference sudoLog and result) into the new file, update
imports/exports so runEnsureDockerWithStubs is imported from the shared helper
module (or split helper into a shared helpers file if needed), and ensure test
suite setup/teardown and any path-relative requires are adjusted so the moved
test runs unchanged.
🪄 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: CHILL
Plan: Enterprise
Run ID: e1049a82-4044-4330-ba45-af7eaf4b2fa3
📒 Files selected for processing (2)
scripts/install.shtest/install-preflight.test.ts
Biome-format the new docker-access test so static-checks' formatter hook leaves it unchanged, and raise the install-preflight.test.ts legacy line budget (4396→4434) to cover the added coverage. Formatting + budget only. Co-authored-by: chengjiew <chengjiew@nvidia.com> Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The growth guardrail only lets legacy test-file budgets ratchet down. The real fix is to relocate the new test out of the pinned file; reverting to 4396 so the CI surfaces the honest 'above budget' signal. Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@chengjiew the only remaining red check is What's happening: this PR adds ~38 lines to Fix: move the new test out of the pinned file so it doesn't grow:
Everything else (formatting, etc.) is green. Once the new test lives in its own file and the legacy file shrinks, this'll pass. |
…ight within its legacy line budget The new non-docker-group test pushed test/install-preflight.test.ts over its pinned legacy size budget (4396), which the growth guardrail forbids raising. Move the whole 'installer Docker bootstrap (sourced)' describe block to a new test/install-preflight-docker-bootstrap.test.ts, and share the sourced-env helpers (INSTALLER_PAYLOAD/TEST_SYSTEM_PATH/writeExecutable/buildIsolatedSystemPath) via test/helpers/installer-sourced-env.ts. Wire the new file into the gated installer-integration vitest project (not cli) so it runs exactly where the originals did. install-preflight.test.ts drops to 4207; budget lowered to match. Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Update: I went ahead and pushed the fix myself ( What I did (the guardrail-compliant relocation I described above):
Verified locally: |
…tegration config guard The gated-project config test asserts the exact installer-integration include list; add the new bootstrap test file so the guard matches vitest.config.ts. Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
## Summary - Add the v0.0.63 release-note section using the published development note as source context. - Update source docs for sandbox recovery, OpenClaw config restore safety, managed vLLM selection, Slack Socket Mode conflict handling, and host diagnostics. - Refresh generated `nemoclaw-user-*` skills from the updated Fern MDX docs. - Update the release-doc refresh skill so post-release docs for version `n` look up the matching announcement discussion and use the `n+1` patch release label. - Fix CLI/docs parity by avoiding a `--from <Dockerfile>` flag mention inside the `upgrade-sandboxes` command section. ## Source summary - #5034 -> `docs/reference/troubleshooting.mdx`, `docs/about/release-notes.mdx`: Document safer stale-sandbox recovery through `rebuild --yes` before recreating from scratch. - #5091 -> `docs/reference/troubleshooting.mdx`, `docs/about/release-notes.mdx`: Document Docker-driver post-reboot recovery from OpenShell container labels. - #5101, #5174, #5177 -> `docs/manage-sandboxes/backup-restore.mdx`, `docs/about/release-notes.mdx`: Document OpenClaw `openclaw.json` preservation, merge behavior, and fail-safe restore handling. - #5102 -> `docs/reference/commands.mdx`, `docs/reference/commands-nemohermes.mdx`, `docs/manage-sandboxes/lifecycle.mdx`, `docs/about/release-notes.mdx`: Document `upgrade-sandboxes` image-fingerprint drift detection. - #4201 -> `docs/reference/troubleshooting.mdx`, `docs/about/release-notes.mdx`: Document the installer diagnostic for unexpected Docker daemon access outside the `docker` group. - #5038 -> `docs/inference/inference-options.mdx`, `docs/inference/use-local-inference.mdx`, `docs/about/release-notes.mdx`: Document the interactive managed-vLLM model picker and non-interactive override behavior. - #5040, #5041 -> `docs/reference/troubleshooting.mdx`, `docs/about/release-notes.mdx`: Document Ollama auth-proxy recovery and host DNS preflight diagnostics. - #4986, #5039 -> `docs/manage-sandboxes/messaging-channels.mdx`, `docs/about/release-notes.mdx`: Document Slack validation and duplicate Slack Socket Mode sandbox handling. - #4981, #5168 -> `docs/about/release-notes.mdx`: Capture Hermes gateway secret-guard and wrapped-argv startup hardening in the release surface. - Follow-up -> `.agents/skills/nemoclaw-contributor-update-docs/SKILL.md`: Record the post-release docs workflow, discussion-announcement lookup, and next-patch release label rule. - Follow-up -> `docs/reference/commands.mdx`, `docs/reference/commands-nemohermes.mdx`: Reword custom Dockerfile sandbox text so CLI parity does not treat `--from` as an `upgrade-sandboxes` flag. ## Verification - `python3 scripts/docs-to-skills.py docs/ .agents/skills/ --prefix nemoclaw-user --doc-platform fern-mdx` - `npm run docs` - `npm run build:cli` - `bash test/e2e/e2e-cloud-experimental/check-docs.sh --only-cli` - Skip-term scan for `docs/.docs-skip` blocked terms across generated user skills <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Enhanced local inference setup with interactive model selection prompts and environment variable overrides * Improved sandbox upgrade detection using build fingerprints and version checks * Clarified configuration restore behavior preserving user settings during rebuild/restore * Added gateway authentication as fifth security layer * Expanded Slack messaging validation with live credential checking * Enhanced troubleshooting guidance for Docker access, DNS issues, and sandbox recovery * Updated release notes for v0.0.63 featuring sandbox recovery and inference improvements <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Fixes #3952
Test plan
Note: a first full test run without LC_ALL=C hit the local host's missing C.UTF-8 locale warning in one existing assertion; rerunning with LC_ALL=C passed 99/99.
Signed-off-by: Chengjie Wang chengjiew@nvidia.com
Summary by CodeRabbit
New Features
Tests
Chores