Skip to content

Add comprehensive API features documentation #21

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

Merged
merged 1 commit into from
Jun 4, 2025

Conversation

codegen-sh[bot]
Copy link
Contributor

@codegen-sh codegen-sh bot commented Jun 4, 2025

This PR adds a comprehensive API features documentation (API_FEATURES.md) that explains the Grainchain interface, snapshotting capabilities, and custom Docker support as requested in CG-18637.

📋 What's Included

Core API Interface Documentation

  • Unified Sandbox class - Main interface for all sandbox operations
  • Core methods - execute(), file operations, state management
  • Configuration options - Resource limits, environment variables, provider-specific settings
  • Type-safe examples - Comprehensive code examples with proper typing

Snapshotting Capabilities Deep Dive

  • Memory vs Filesystem Snapshotting - Clear explanation of the differences
    • Memory snapshots (Morph): Instant <250ms snapshots preserving running processes
    • Filesystem snapshots (E2B, Local, Daytona, Modal): Portable environment state
  • Provider-specific support matrix - Which providers support what features
  • Advanced workflows - Snapshot chains, terminate/wake-up cycles

Custom Docker Support Analysis

  • Current state across all providers:
    • E2B: Full custom Docker via e2b.Dockerfile
    • Morph: Custom base images via image_id
    • Modal: Custom images via programmatic building
    • Local: No Docker (runs directly on host)
    • 🚧 Docker provider: Coming soon
  • Configuration examples for each provider
  • Dockerfile examples and template creation

Provider Comparison & Selection Guide

  • Feature support matrix - Complete comparison of capabilities
  • Performance characteristics - Startup times, snapshot speeds
  • Decision tree - Help users choose the right provider
  • Use case recommendations - CI/CD, development, production scenarios

🎯 Key Insights

  1. Snapshotting is not uniform - Morph offers unique memory snapshots while others do filesystem snapshots
  2. Docker support varies significantly - E2B and Modal offer full custom Docker, Morph has curated base images
  3. Provider specialization - Each provider is optimized for different use cases
  4. Migration is seamless - The unified API allows switching providers with minimal code changes

🔗 Related Issues

  • Addresses CG-18637: Explain API features
  • Related to CG-18511: Grain chain project context
  • Related to CG-18626: Epic improve grain chain benchmarking flow

📁 Files Modified

  • API_FEATURES.md - New comprehensive documentation file

💻 View my workAbout Codegen

- Document unified sandbox interface and core methods
- Explain snapshotting capabilities (memory vs filesystem)
- Detail custom Docker support across providers
- Include provider comparison matrix and selection guide
- Add practical usage examples and workflows

Addresses CG-18637: Explain API features
@jayhack jayhack marked this pull request as ready for review June 4, 2025 03:01
@jayhack jayhack merged commit 12919d7 into main Jun 4, 2025
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.

1 participant