Skip to content

Cache prepare image#31

Merged
jsk11235 merged 5 commits intomainfrom
cache-prepare-image-id
Feb 5, 2026
Merged

Cache prepare image#31
jsk11235 merged 5 commits intomainfrom
cache-prepare-image-id

Conversation

@jsk11235
Copy link
Copy Markdown
Collaborator

@jsk11235 jsk11235 commented Feb 4, 2026

No description provided.

jacobkirmayer-imbue and others added 5 commits February 4, 2026 14:51
- Add --cached flag to skip prepare if .offload-image-cache exists
- Write image_id to .offload-image-cache after successful prepare
- Add cache file to .gitignore

Usage: uv run modal_sandbox.py prepare --cached [dockerfile]
On first run, builds image and caches ID. On subsequent runs with
--cached, returns cached ID instantly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reads patterns from .dockerignore and passes them to Modal's
add_local_dir(ignore=...) to skip uploading target/, .git/, etc.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The temp sandbox was created just to "materialize" the image_id,
but image.object_id is available directly after image.build(app).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Needed to materialize the image_id.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Enables fast test runs by skipping image rebuild when cache exists.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jsk11235 jsk11235 merged commit a1e6aa3 into main Feb 5, 2026
2 checks passed
@jsk11235 jsk11235 deleted the cache-prepare-image-id branch February 5, 2026 00:47
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