Skip to content

Ephemeral Sandbox Orchestration System#628

Open
deslawson wants to merge 1 commit into
Smartdevs17:mainfrom
deslawson:main
Open

Ephemeral Sandbox Orchestration System#628
deslawson wants to merge 1 commit into
Smartdevs17:mainfrom
deslawson:main

Conversation

@deslawson

Copy link
Copy Markdown

Implemented per-user Docker-based sandbox instances with full lifecycle management. The system provisions isolated containers on demand via the Docker API, pre-seeds them with test data (5 plans, 10 subscribers, 20 invoices), and auto-cleans up after a configurable TTL (1h default, extendable to 4h). Key components: containerManager.ts orchestrates Docker Compose stacks with resource limits (512MB RAM, 1 CPU, 2GB disk); CleanupWorker runs a cron loop checking for idle timeouts (30min) and TTL expiry; sandboxLifecycleController.ts exposes REST endpoints for provision, teardown, TTL extension, and idle-timer reset; SandboxManagementPage.tsx provides the developer-portal UI with provision button, per-sandbox cards, and extend/destroy controls; seed.sql auto-initializes the database with realistic test data; and Stellar friendbot funding runs automatically on provision. Edge cases handled: max 3 concurrent sandboxes (returns 429 with wait estimate), single 2h TTL extension cap, and idle timeout warnings.

Pull Request Checklist

Quality Gates (All must pass before merge)

  • Lint: Code passes ESLint and Prettier checks
  • Type Check: TypeScript compilation succeeds
  • Tests: All tests pass
  • Build: Project builds successfully
  • Rust Format: Smart contract formatting is correct
  • Rust Clippy: Smart contract linting passes
  • Rust Tests: All smart contract tests pass
  • Rust Build: Smart contracts compile successfully

Additional Requirements

  • New code has appropriate TypeScript types
  • No hardcoded secrets or credentials
  • New features have corresponding tests
  • Documentation updated if needed

Reviewers

  • At least 1 approval required for merge
  • All CI checks must be green

This PR will not be mergeable until all quality gates pass.
closes #583

Implemented per-user Docker-based sandbox instances with full lifecycle management. The system provisions isolated containers on demand via the Docker API, pre-seeds them with test data (5 plans, 10 subscribers, 20 invoices), and auto-cleans up after a configurable TTL (1h default, extendable to 4h). Key components: containerManager.ts orchestrates Docker Compose stacks with resource limits (512MB RAM, 1 CPU, 2GB disk); CleanupWorker runs a cron loop checking for idle timeouts (30min) and TTL expiry; sandboxLifecycleController.ts exposes REST endpoints for provision, teardown, TTL extension, and idle-timer reset; SandboxManagementPage.tsx provides the developer-portal UI with provision button, per-sandbox cards, and extend/destroy controls; seed.sql auto-initializes the database with realistic test data; and Stellar friendbot funding runs automatically on provision. Edge cases handled: max 3 concurrent sandboxes (returns 429 with wait estimate), single 2h TTL extension cap, and idle timeout warnings.

closes Smartdevs17#583
@drips-wave

drips-wave Bot commented Jun 23, 2026

Copy link
Copy Markdown

@deslawson Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Redesign sandbox environment to containerized per-user ephemeral instances

1 participant