Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that the sandbox has started before taking a filesystem snapshot #2765

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

thecodingwizard
Copy link
Contributor

Previously, if you tried to take a filesystem snapshot of a sandbox that hasn't been started yet, it would fail with an error:

import modal

app = modal.App.lookup("my-app", create_if_missing=True)


with modal.enable_output():
    sb = modal.Sandbox.create(app=app, gpu="H100")
    sb.terminate()

    img = sb.snapshot_filesystem()
    print(img)

This PR fixes this issue by blocking until the sandbox has started (or at least until it has been picked up by a worker) before executing the snapshot request.

Copy link
Member

@pawalt pawalt left a comment

Choose a reason for hiding this comment

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

I thought you were planning on moving this logic into the RPC?

@thecodingwizard
Copy link
Contributor Author

Yeah, but this RPC has a timeout property, and I didn't want that timeout to be the time for both sandbox startup and snapshotting. Otherwise if it takes a very long time for the sandbox to start up, then the snapshot only has a small amount of time to complete.

@thecodingwizard thecodingwizard merged commit 6608b5d into main Jan 16, 2025
23 checks passed
@thecodingwizard thecodingwizard deleted the nathan/sandbox branch January 16, 2025 15:34
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