Skip to content

docs: add sandbox-runtime install step to deployment guide#526

Closed
ColeMurray wants to merge 1 commit intomainfrom
docs/fix-modal-deploy-sandbox-runtime-521
Closed

docs: add sandbox-runtime install step to deployment guide#526
ColeMurray wants to merge 1 commit intomainfrom
docs/fix-modal-deploy-sandbox-runtime-521

Conversation

@ColeMurray
Copy link
Copy Markdown
Owner

@ColeMurray ColeMurray commented Apr 21, 2026

Summary

  • Adds uv sync --frozen --extra dev step to Prerequisites and Phase 1 deployment instructions in GETTING_STARTED.md
  • Adds dedicated troubleshooting entry for the No module named 'sandbox_runtime' error

The deployment guide was missing the Python dependency installation step for Modal. Users following the guide would install modal via pipx (isolated env) but never install sandbox_runtime, which is a sibling package required at deploy time (deploy.py → src.app → sandbox_runtime). This caused terraform apply to fail with ModuleNotFoundError.

The CI workflow already handles this correctly (pip install -e packages/sandbox-runtime in terraform.yml), but the gap was in the manual deployment docs.

Closes #521

Test plan

  • Follow the GETTING_STARTED.md guide from scratch and verify terraform apply succeeds for Modal deployment
  • Verify uv sync --frozen --extra dev in packages/modal-infra resolves sandbox_runtime via the [tool.uv.sources] path dependency

Summary by CodeRabbit

  • Documentation
    • Updated prerequisites with new installation steps for dependencies.
    • Reorganized deployment instructions to clarify the correct workflow sequence.
    • Added troubleshooting section addressing deployment failure scenarios and resolution steps.

The getting started guide was missing the Python dependency installation
step for Modal deployment. Users following the guide would hit
"No module named 'sandbox_runtime'" during terraform apply because
sandbox-runtime is a sibling package that must be installed separately.

Closes #521
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

📝 Walkthrough

Walkthrough

Documentation updates clarifying prerequisite Python dependency installation for Modal deployment and adding troubleshooting guidance for missing sandbox_runtime module errors during Terraform deployment.

Changes

Cohort / File(s) Summary
Documentation
docs/GETTING_STARTED.md
Added instructions to run uv sync --frozen --extra dev in packages/modal-infra before deployment, clarified dependency installation ordering prior to Terraform, and included troubleshooting section for sandbox_runtime module import failures.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

📚 When docs say "sync before you deploy,"
The rabbit hops with newfound joy!
No missing modules shall cause dismay,
Just follow the guide—it'll light the way! 🐰✨

🚥 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 describes the main change: adding documentation for installing sandbox-runtime dependencies in the deployment guide.
Linked Issues check ✅ Passed The PR successfully addresses all coding requirements from issue #521: it documents the necessary uv sync --frozen --extra dev step in Prerequisites and Phase 1, adds troubleshooting for the ModuleNotFoundError, and ensures manual deployments match CI behavior.
Out of Scope Changes check ✅ Passed All changes in GETTING_STARTED.md are directly scoped to resolving the deployment documentation gap identified in issue #521; no unrelated modifications are present.
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
  • Commit unit tests in branch docs/fix-modal-deploy-sandbox-runtime-521

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.

Comment thread docs/GETTING_STARTED.md
modal setup

# Install Python dependencies for Modal deployment
cd packages/modal-infra && uv sync --frozen --extra dev && cd -
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.

This new command appears in the "Required Tools" block before the repo has been cloned, so does not exist yet. Could we move this step to after /, or reword this section so the command is only introduced once the reader is inside the repository?

Comment thread docs/GETTING_STARTED.md
```

This installs all Modal deployment dependencies including `sandbox_runtime` (resolved via
`[tool.uv.sources]` in `pyproject.toml`). If you installed Modal via `pipx install modal` alone, it
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.

The troubleshooting text says is sufficient even when Modal was installed via , but Terraform still invokes plain from . That command will continue to use the pipx-managed CLI unless we also document , activate the project virtualenv, or change the deploy script to call the virtualenv's . As written, the guide may still reproduce the same .

Copy link
Copy Markdown
Contributor

@open-inspect open-inspect Bot left a comment

Choose a reason for hiding this comment

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

Summary

This PR updates docs/GETTING_STARTED.md to add a Modal Python dependency installation step and a troubleshooting note for sandbox_runtime import failures. The goal is good, but the current instructions introduce one impossible step and one place where the documented fix still does not line up with the actual deploy path.

  • PR Title and number: docs: add sandbox-runtime install step to deployment guide (#526)
  • Author: @ColeMurray
  • Files changed count, additions/deletions: 1 file, +22/-2

Critical Issues

  • [Functionality] docs/GETTING_STARTED.md:65 - The new uv sync command is added in the "Required Tools" section before the repository has been cloned, so packages/modal-infra does not exist yet. This makes the guide fail for a reader following it top-to-bottom. Move this command to a post-clone step or reword the section so it only lists globally installable tooling.
  • [Functionality] docs/GETTING_STARTED.md:438 and docs/GETTING_STARTED.md:774 - The docs now say uv sync --frozen --extra dev fixes the sandbox_runtime import problem even when Modal was installed with pipx, but Terraform still calls plain modal deploy from terraform/modules/modal-app/scripts/deploy.sh. That deploy path will continue to use the pipx-managed CLI unless the docs also tell readers to run through the project virtualenv (for example uv run modal ... or an activated .venv) or the deploy script is updated accordingly.

Suggestions

  • None beyond the blocking issues above.

Nitpicks

  • None.

Positive Feedback

  • The troubleshooting section is targeting a real failure mode and explains the missing sibling dependency clearly.
  • Calling out sandbox_runtime and the pyproject.toml source mapping makes the root cause easier to understand than a generic install note would.

Questions

  • None.

Verdict

Request Changes: the documentation changes are directionally correct, but they currently do not give a reliable end-to-end deployment flow.

Copy link
Copy Markdown

@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

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

Inline comments:
In `@docs/GETTING_STARTED.md`:
- Around line 64-65: Remove the premature Modal dependency installation from the
Prerequisites section: delete the command "cd packages/modal-infra && uv sync
--frozen --extra dev && cd -" (currently in GETTING_STARTED.md Prerequisites) so
it doesn't run before the repo is cloned; the dependency installation already
exists later in Phase 1 after the clone, so keep that placement instead (or if
you prefer, move the command and add a clear note to run it only after
completing Step 1/cloning the repository).
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: d49d6cd1-fec5-4888-bb0f-13169c389aed

📥 Commits

Reviewing files that changed from the base of the PR and between 3359f4f and ce25cf3.

📒 Files selected for processing (1)
  • docs/GETTING_STARTED.md

Comment thread docs/GETTING_STARTED.md
Comment on lines +64 to +65
# Install Python dependencies for Modal deployment
cd packages/modal-infra && uv sync --frozen --extra dev && cd -
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Remove this step from Prerequisites—repository doesn't exist yet.

This command runs cd packages/modal-infra, but the repository hasn't been cloned until Step 1 (line 73). Users following the Prerequisites section sequentially will hit a "No such file or directory" error.

The command is correctly placed later in Phase 1 (lines 437-438) after the repository exists. Consider either:

  1. Removing lines 64-65 entirely (recommended), or
  2. Adding a note that this step should be run after cloning the repository in Step 1
📝 Suggested fix

Remove the Modal dependency installation from Prerequisites:

 # Python 3.12+, uv, and Modal CLI
 brew install python@3.12 uv
 pipx install modal
 modal setup
-
-# Install Python dependencies for Modal deployment
-cd packages/modal-infra && uv sync --frozen --extra dev && cd -

 # Wrangler CLI (for initial R2 bucket setup)
 npm install -g wrangler

The installation step is already correctly positioned in Phase 1 (line 437-438) after the repository is cloned.

📝 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
# Install Python dependencies for Modal deployment
cd packages/modal-infra && uv sync --frozen --extra dev && cd -
# Python 3.12+, uv, and Modal CLI
brew install python@3.12 uv
pipx install modal
modal setup
# Wrangler CLI (for initial R2 bucket setup)
npm install -g wrangler
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/GETTING_STARTED.md` around lines 64 - 65, Remove the premature Modal
dependency installation from the Prerequisites section: delete the command "cd
packages/modal-infra && uv sync --frozen --extra dev && cd -" (currently in
GETTING_STARTED.md Prerequisites) so it doesn't run before the repo is cloned;
the dependency installation already exists later in Phase 1 after the clone, so
keep that placement instead (or if you prefer, move the command and add a clear
note to run it only after completing Step 1/cloning the repository).

@kadams54
Copy link
Copy Markdown

A quick comment on this: #509 closes #521. I did try manually running uv sync --frozen --extra dev in packages/modal-infra (before posting the issue) but that did not resolve the problem I was running into in #521. Just putting this out there for clarity.

@ColeMurray ColeMurray closed this Apr 21, 2026
@ColeMurray ColeMurray deleted the docs/fix-modal-deploy-sandbox-runtime-521 branch April 21, 2026 18:00
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.

Errors during initial deployment

2 participants