Skip to content

docs: add suspend, resume & snapshot documentation#754

Merged
james-rl merged 3 commits into
mainfrom
james/snp
Mar 24, 2026
Merged

docs: add suspend, resume & snapshot documentation#754
james-rl merged 3 commits into
mainfrom
james/snp

Conversation

@james-rl

@james-rl james-rl commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

User description

⚠️ PR Title Must Follow Conventional Commits

Format: feat[optional scope]: <description>

Examples: feat: add new SDK method · feat(storage): support file uploads · feat!: breaking API change


Description

Add suspend, resume & snapshot examples.

Motivation

Changes

Testing

  • Unit tests added
  • Integration tests added
  • Smoke Tests added/updated
  • Tested locally

Breaking Changes

Checklist

  • PR title follows Conventional Commits format (feat: or feat(scope):)
  • Documentation updated (if needed)
  • Breaking changes documented (if applicable)

CodeAnt-AI Description

Add a runnable example for devbox snapshots, suspend, resume, and restore

What Changed

  • Added a new example that shows a file surviving suspend and resume on the same devbox
  • Demonstrates creating a disk snapshot, restoring two new devboxes from it, and changing each copy without affecting the others
  • Added the new example to the examples list and referenced it in the main guides

Impact

✅ Clearer snapshot workflows
✅ Easier devbox recovery from a saved state
✅ Safer testing of isolated devbox copies

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@codeant-ai

codeant-ai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Mar 24, 2026
@codeant-ai

codeant-ai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Sequence Diagram

This PR adds a new runnable example that demonstrates the full snapshot lifecycle for devboxes. The flow shows creating a baseline on a source devbox, suspending and resuming it, branching multiple devboxes from a snapshot, and cleaning up all resources.

sequenceDiagram
    participant Example as Example Script
    participant API as Runloop API
    participant Source as Source Devbox
    participant Snapshot as Disk Snapshot
    participant Clones as Cloned Devboxes

    Example->>API: Create source devbox
    API-->>Example: Source devbox ready
    Example->>Source: Upload file and write baseline contents
    Example->>Source: Suspend then resume
    Example->>Source: Create disk snapshot
    Source-->>Example: Snapshot created
    Example->>Snapshot: Restore two devboxes from snapshot
    Snapshot-->>Example: Cloned devboxes ready
    Example->>Clones: Mutate file independently in each devbox
    Example->>API: Shutdown devboxes and delete snapshot
Loading

Generated by CodeAnt AI

@james-rl
james-rl requested a review from dines-rl March 24, 2026 00:34
Comment thread examples/devbox-snapshots.ts Outdated
@codeant-ai

codeant-ai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

CodeAnt AI finished reviewing your PR.

Comment thread examples/devbox-snapshots.ts Outdated
name: uniqueName('snapshot-clone-a'),
launch_parameters: {
resource_size_request: 'X_SMALL',
keep_alive_time_seconds: 60 * 5,

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.

maybe not this? might send the wrong message

Comment thread examples/devbox-snapshots.ts Outdated
name: uniqueName('snapshot-clone-b'),
launch_parameters: {
resource_size_request: 'X_SMALL',
keep_alive_time_seconds: 60 * 5,

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.

same here

Comment thread examples/devbox-snapshots.ts Outdated
name: uniqueName('snapshot-source'),
launch_parameters: {
resource_size_request: 'X_SMALL',
keep_alive_time_seconds: 60 * 5,

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 one tooo

@james-rl
james-rl merged commit 0295cc6 into main Mar 24, 2026
8 checks passed
@james-rl
james-rl deleted the james/snp branch March 24, 2026 00:45
@stainless-app stainless-app Bot mentioned this pull request Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants