Modern ephemeral environment management for Apache Superset using circus tent emoji labels
Superset Showtime is a CLI tool designed primarily for GitHub Actions to manage Apache Superset ephemeral environments. It uses circus tent emoji labels as a visual state management system and depends on Superset's existing build infrastructure.
Create an ephemeral environment:
- Go to your PR in GitHub
- Add label:
πͺ β‘ showtime-trigger-start - Watch the magic happen - labels will update automatically
- When you see
πͺ π¦ {sha} running, your environment is ready! - Get URL from
πͺ π {sha} {ip}βhttp://{ip}:8080 - Every new commit automatically deploys a fresh environment (zero-downtime)
To test a specific commit without auto-updates:
- Add label:
πͺ π§ showtime-freeze(prevents auto-sync on new commits)
Clean up when done:
# Add this label:
πͺ π showtime-trigger-stop
# All circus labels disappear, AWS resources cleaned upπͺ GitHub labels become a visual state machine:
# User adds trigger label in GitHub UI:
πͺ β‘ showtime-trigger-start
# System responds with state labels:
πͺ abc123f π¦ building # Environment abc123f is building
πͺ π― abc123f # abc123f is the active environment
πͺ abc123f π
2024-01-15T14-30 # Created timestamp
πͺ abc123f β 24h # Time-to-live policy
πͺ abc123f π€‘ maxime # Requested by maxime (clown emoji!)
# When ready:
πͺ abc123f π¦ running # Environment is now running
πͺ abc123f π 52-1-2-3 # Available at http://52.1.2.3:8080flowchart TD
A[User adds πͺ β‘ trigger-start] --> B[GitHub Actions: sync]
B --> C{Current state?}
C -->|No environment| D[π Claim: Remove trigger + Set building]
C -->|Running + new SHA| E[π Claim: Remove trigger + Set building]
C -->|Already building| F[β Exit: Another job active]
C -->|No triggers| G[β Exit: Nothing to do]
D --> H[π State: building]
E --> H
H --> I[π³ Docker build]
I -->|Success| J[π State: built]
I -->|Fail| K[π State: failed]
J --> L[π State: deploying]
L --> M[βοΈ AWS Deploy]
M -->|Success| N[π State: running]
M -->|Fail| O[π State: failed]
N --> P[πͺ Environment ready!]
Q[User adds πͺ π trigger-stop] --> R[π§Ή Cleanup AWS + Remove labels]
Install CLI for debugging:
pip install superset-showtime
export GITHUB_TOKEN=your_tokenMonitor and debug:
showtime list # See all active environments
showtime status 1234 # Debug specific environment
showtime labels # Complete label referenceTesting/development:
showtime sync 1234 --dry-run-aws --dry-run-docker # Test without costs
showtime cleanup --dry-run --older-than 1h # Test cleanup logicArchitecture: This CLI implements ACID-style atomic transactions with direct Docker integration. It handles complete environment lifecycle from Docker build to AWS deployment with race condition prevention.
| Label | Action | Result |
|---|---|---|
πͺ β‘ showtime-trigger-start |
Create environment | Builds and deploys ephemeral environment with blue-green deployment |
πͺ π showtime-trigger-stop |
Destroy environment | Cleans up AWS resources and removes all labels |
πͺ π§ showtime-freeze |
Freeze environment | Prevents auto-sync on new commits (for testing specific SHAs) |
| Label Pattern | Meaning | Example |
|---|---|---|
πͺ {sha} π¦ {status} |
Environment status | πͺ abc123f π¦ running |
πͺ π― {sha} |
Active environment pointer | πͺ π― abc123f |
πͺ ποΈ {sha} |
Building environment pointer | πͺ ποΈ def456a |
πͺ {sha} π
{timestamp} |
Creation time | πͺ abc123f π
2024-01-15T14-30 |
πͺ {sha} π {ip:port} |
Environment URL | πͺ abc123f π 52.1.2.3:8080 |
πͺ {sha} β {ttl} |
Time-to-live policy | πͺ abc123f β 24h |
πͺ {sha} π€‘ {username} |
Who requested | πͺ abc123f π€‘ maxime |
Approach: Modify configuration directly in your PR code, then trigger environment.
Workflow:
- Modify
superset_config.pywith your changes - Push commit β Creates new SHA (e.g.,
def456a) - Add
πͺ β‘ showtime-trigger-startβ Deploys with your config - Test environment reflects your exact code changes
This approach creates traceable, reviewable changes that are part of your git history.
- Add trigger label in GitHub UI:
πͺ β‘ showtime-trigger-start - Watch state labels appear:
πͺ abc123f π¦ building β Environment is building πͺ π― abc123f β This is the active environment πͺ abc123f π 2024-01-15T14-30 β Started building at this time - Wait for completion:
πͺ abc123f π¦ running β Now ready! πͺ abc123f π 52.1.2.3:8080 β Visit http://52.1.2.3:8080
- Add freeze label:
πͺ π§ showtime-freeze - Result: Environment won't auto-update on new commits
- Use case: Test specific SHA while continuing development
- Override: Add
πͺ β‘ showtime-trigger-startto force update despite freeze
When you push new commits, Showtime automatically:
- Detects new commit via GitHub webhook
- Builds new environment alongside old one
- Switches traffic when new environment is ready
- Cleans up old environment
You'll see:
# During update:
πͺ abc123f π¦ running # Old environment still serving
πͺ def456a π¦ building # New environment building
πͺ π― abc123f # Traffic still on old
πͺ ποΈ def456a # New one being prepared
# After update:
πͺ def456a π¦ running # New environment live
πͺ π― def456a # Traffic switched
πͺ def456a π 52-4-5-6 # New IP address
# All abc123f labels removed automatically- β Superset maintainers (with write access) can add trigger labels
- β External contributors cannot trigger environments (no write access to add labels)
- π Secure by design - only trusted users can create expensive AWS resources
π― Live Workflow: showtime-trigger.yml
How it works:
- Triggers on PR label changes, commits, and closures
- Installs
superset-showtimefrom PyPI (trusted code, not PR code) - Runs
showtime syncto handle trigger processing and deployments - Supports manual testing via
workflow_dispatchwith specific SHA override
Commands used:
showtime sync PR_NUMBER --check-only # Determine build_needed + target_sha
showtime sync PR_NUMBER --sha SHA # Execute atomic claim + build + deployThe CLI is primarily used by GitHub Actions, but available for debugging and advanced users:
pip install superset-showtime
export GITHUB_TOKEN=your_token
# Core commands:
showtime sync PR_NUMBER # Sync to desired state (main command)
showtime start PR_NUMBER # Create new environment
showtime stop PR_NUMBER # Delete environment
showtime status PR_NUMBER # Show current state
showtime list # List all environments
showtime cleanup --older-than 48h # Clean up expired environmentsTest with real PRs safely:
# Test full workflow without costs:
showtime sync YOUR_PR_NUMBER --dry-run-aws --dry-run-docker
# Test cleanup logic:
showtime cleanup --dry-run --older-than 24hgit clone https://github.com/mistercrunch/superset-showtime
cd superset-showtime
# Using uv (recommended):
uv pip install -e ".[dev]"
make pre-commit
make test
# Traditional pip:
pip install -e ".[dev]"
pre-commit install
pytestApache License 2.0 - same as Apache Superset.
πͺ "Ladies and gentlemen, welcome to Superset Showtime - where ephemeral environments are always under the big top!" πͺπ€‘β¨