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 environment + label cleanup
showtime cleanup-labels # Preview stale repo label definitionsArchitecture: 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 --force # Clean up expired envs, closed PR labels, and stale labels
showtime cleanup-labels --no-dry-run --force # Prune unattached per-SHA labels onlyTest 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 24h
showtime cleanup-labels # dry-run by defaultgit 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!" 🎪🤡✨