Skip to content

fix(install): simplify DGX Spark setup, remove cgroup v2 workaround - #1394

Closed
zyang-dev wants to merge 3 commits into
mainfrom
fix/spark-remove-cgroup-workaround
Closed

fix(install): simplify DGX Spark setup, remove cgroup v2 workaround#1394
zyang-dev wants to merge 3 commits into
mainfrom
fix/spark-remove-cgroup-workaround

Conversation

@zyang-dev

@zyang-dev zyang-dev commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove obsolete cgroup v2 cgroupns=host workaround from setup-spark.sh (handled by OpenShell directly since PR OpenShell#329)
  • Simplify spark-install.md Quick Start to two curl commands
  • Keep docker group check in setup-spark.sh

Related Issue

Changes

  • scripts/setup-spark.sh: Remove cgroup v2 daemon.json workaround and Docker restart logic. Keep docker group setup only.
  • spark-install.md: Replace multi-step Quick Start with two curl commands. Update troubleshooting and architecture sections to reflect the cgroup fix is now in OpenShell.

Type of Change

  • Code change for a new feature, bug fix, or refactor.
  • Code change with doc updates.
  • Doc only. Prose changes without code sample modifications.
  • Doc only. Includes code sample changes.

Testing

  • npx prek run --all-files passes (or equivalently make check).
  • npm test passes.
  • make docs builds without warnings. (for doc-only changes)

Checklist

General

Code Changes

  • Formatters applied — npx prek run --all-files auto-fixes formatting (or make format for targeted runs).
  • Tests added or updated for new or changed behavior.
  • No secrets, API keys, or credentials committed.
  • Doc pages updated for any user-facing behavior changes (new commands, changed defaults, new features, bug fixes that contradict existing docs).

Doc Changes

  • Follows the style guide. Try running the update-docs agent skill to draft changes while complying with the style guide. For example, prompt your agent with "/update-docs catch up the docs for the new changes I made in this PR."
  • New pages include SPDX license header and frontmatter, if creating a new page.
  • Cross-references and links verified.

Signed-off-by: zyang-dev 267119621+zyang-dev@users.noreply.github.com

Summary by CodeRabbit

  • Chores

    • Simplified setup process by removing Docker daemon configuration steps. Users now only need to add their user to the Docker group; a prompt will indicate if a new terminal session is required.
  • Documentation

    • Updated installation instructions with streamlined setup flow.
    • Refined cgroup troubleshooting guidance and updated architecture documentation to reflect current system behavior.

Signed-off-by: zyang-dev <267119621+zyang-dev@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The pull request simplifies Docker configuration in the setup script by removing manual daemon.json modifications and Docker restart operations. Instead of handling cgroup namespace settings through Docker's daemon configuration, responsibility shifts to OpenShell's gateway container. Documentation is updated accordingly to reflect the streamlined setup process and architectural changes.

Changes

Cohort / File(s) Summary
Setup Script Simplification
scripts/setup-spark.sh
Removed 81 lines of daemon.json configuration logic, including JSON read/modify/create operations and Docker restart handling. Replaced with simplified user group addition and terminal warning message.
Documentation Updates
spark-install.md
Removed standalone OpenShell install and local build steps; replaced with single hosted script command. Updated troubleshooting guidance to attribute cgroup issues to recent OpenShell versions handling cgroupns internally. Removed manual daemon.json fix workaround and updated architecture diagram.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A script once complex, now light as a feather,
No daemon tweaks needed, we work things together!
OpenShell takes the reins, simplicity wins,
The rabbit hops forward—let Docker be thin! 🐰✨

🚥 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 changes: simplifying Spark setup and removing the cgroup v2 workaround, which are the primary objectives reflected in both the script and documentation changes.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/spark-remove-cgroup-workaround

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

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/setup-spark.sh`:
- Around line 64-69: The script prints a final success message even when the
earlier warn path for DOCKER_GROUP_ADDED was triggered; update the tailing
conditional so the info("DGX Spark Docker configuration complete.") is only
emitted when DOCKER_GROUP_ADDED is not true (i.e., when no warning was
previously issued/when the docker-group was already present or configuration
actually completed), and ensure the same DOCKER_GROUP_ADDED flag used earlier is
checked here so the warn branch cannot fall through to the info branch
(reference DOCKER_GROUP_ADDED, warn, and info).

In `@spark-install.md`:
- Around line 18-24: The Quick Start sequence runs setup-spark.sh then
immediately runs the NemoClaw installer, but if setup-spark.sh added your user
to the docker group the new group membership may not be active in the current
shell causing Docker permission errors; update the docs around the
setup-spark.sh step to add a short note instructing the user to open a new
terminal or run newgrp docker (or otherwise refresh their shell) if the script
reports they were added to the docker group before running the NemoClaw install
curl command.
🪄 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: Pro

Run ID: 46854f3f-62b3-421a-984d-b243e8303815

📥 Commits

Reviewing files that changed from the base of the PR and between 6386bf8 and 0776f97.

📒 Files selected for processing (2)
  • scripts/setup-spark.sh
  • spark-install.md

Comment thread scripts/setup-spark.sh
Comment on lines +64 to 69
echo ""
if [ "${DOCKER_GROUP_ADDED:-}" = true ]; then
warn "Docker group was just added. You must open a new terminal (or run 'newgrp docker') before continuing."
else
info "Creating Docker daemon config with cgroupns=host..."
mkdir -p "$(dirname "$DAEMON_JSON")"
echo '{ "default-cgroupns-mode": "host" }' >"$DAEMON_JSON"
NEEDS_RESTART=true
info "DGX Spark Docker configuration complete."
fi

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.

⚠️ Potential issue | 🟡 Minor

Avoid reporting full success when no non-root user was detected

If the warning path at Line 45 is hit, Line 68 still reports completion even though no docker-group configuration was applied. That can create a false-success path before install.

Suggested patch
 echo ""
-if [ "${DOCKER_GROUP_ADDED:-}" = true ]; then
+if [ -z "$REAL_USER" ]; then
+  warn "Setup finished, but no non-root user was detected; docker group was not configured."
+elif [ "${DOCKER_GROUP_ADDED:-}" = true ]; then
   warn "Docker group was just added. You must open a new terminal (or run 'newgrp docker') before continuing."
 else
   info "DGX Spark Docker configuration complete."
 fi
📝 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
echo ""
if [ "${DOCKER_GROUP_ADDED:-}" = true ]; then
warn "Docker group was just added. You must open a new terminal (or run 'newgrp docker') before continuing."
else
info "Creating Docker daemon config with cgroupns=host..."
mkdir -p "$(dirname "$DAEMON_JSON")"
echo '{ "default-cgroupns-mode": "host" }' >"$DAEMON_JSON"
NEEDS_RESTART=true
info "DGX Spark Docker configuration complete."
fi
echo ""
if [ -z "$REAL_USER" ]; then
warn "Setup finished, but no non-root user was detected; docker group was not configured."
elif [ "${DOCKER_GROUP_ADDED:-}" = true ]; then
warn "Docker group was just added. You must open a new terminal (or run 'newgrp docker') before continuing."
else
info "DGX Spark Docker configuration complete."
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/setup-spark.sh` around lines 64 - 69, The script prints a final
success message even when the earlier warn path for DOCKER_GROUP_ADDED was
triggered; update the tailing conditional so the info("DGX Spark Docker
configuration complete.") is only emitted when DOCKER_GROUP_ADDED is not true
(i.e., when no warning was previously issued/when the docker-group was already
present or configuration actually completed), and ensure the same
DOCKER_GROUP_ADDED flag used earlier is checked here so the warn branch cannot
fall through to the info branch (reference DOCKER_GROUP_ADDED, warn, and info).

Comment thread spark-install.md
Comment on lines 18 to 24
```bash
# Install OpenShell:
curl -LsSf https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install.sh | sh

# Clone NemoClaw:
git clone https://github.com/NVIDIA/NemoClaw.git
cd NemoClaw

# Spark-specific setup (fixes cgroup v2 and Docker permissions — see Troubleshooting for details)
sudo ./scripts/setup-spark.sh
# Spark-specific setup (requires sudo)
curl -fsSL https://raw.githubusercontent.com/NVIDIA/NemoClaw/main/scripts/setup-spark.sh | sudo bash

# Install NemoClaw:
./install.sh

# Alternatively, you can use the hosted install script:
# Install NemoClaw
curl -fsSL https://www.nvidia.com/nemoclaw.sh | bash
```

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.

⚠️ Potential issue | 🟠 Major

Add an explicit shell-refresh note between Quick Start commands

After Line 20, docker group membership may not be active in the current shell yet. Running Line 23 immediately (especially via full-block paste) can fail with Docker permission errors.

Suggested doc tweak (keeps Quick Start to the same two commands)
 ```bash
 # Spark-specific setup (requires sudo)
 curl -fsSL https://raw.githubusercontent.com/NVIDIA/NemoClaw/main/scripts/setup-spark.sh | sudo bash
-
-# Install NemoClaw
-curl -fsSL https://www.nvidia.com/nemoclaw.sh | bash

+If setup-spark.sh reports your user was just added to the docker group, open a new terminal (or run newgrp docker) before continuing.
+
+bash +# Install NemoClaw +curl -fsSL https://www.nvidia.com/nemoclaw.sh | bash +

</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **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.

```suggestion

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@spark-install.md` around lines 18 - 24, The Quick Start sequence runs
setup-spark.sh then immediately runs the NemoClaw installer, but if
setup-spark.sh added your user to the docker group the new group membership may
not be active in the current shell causing Docker permission errors; update the
docs around the setup-spark.sh step to add a short note instructing the user to
open a new terminal or run newgrp docker (or otherwise refresh their shell) if
the script reports they were added to the docker group before running the
NemoClaw install curl command.

@zyang-dev

Copy link
Copy Markdown
Contributor Author

Closing — the equivalent changes were merged in #1368.

@zyang-dev zyang-dev closed this Apr 3, 2026
@zyang-dev
zyang-dev deleted the fix/spark-remove-cgroup-workaround branch April 3, 2026 17:45
@wscurran wscurran added bug-fix PR fixes a bug or regression platform: dgx-spark Affects DGX Spark hardware or workflows and removed priority: high labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression platform: dgx-spark Affects DGX Spark hardware or workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants