๐ช Apache Superset ephemeral environment management with circus tent emoji state tracking
Project description
๐ช Superset Showtime
Modern ephemeral environment management for Apache Superset using circus tent emoji labels
๐ฏ What is Showtime?
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.
๐ Quick Start for Superset Contributors
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
๐ช How It Works
๐ช 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:8080
๐ For Maintainers (CLI Operations)
Note: CLI is mainly for debugging or developing Showtime itself. Primary interface is GitHub labels above.
Install CLI for debugging:
pip install superset-showtime
export GITHUB_TOKEN=your_token
Monitor and debug:
showtime list # See all active environments
showtime status 1234 # Debug specific environment
showtime labels # Complete label reference
Testing/development:
showtime start 1234 --dry-run-aws # Test without AWS costs
showtime test-lifecycle 1234 # Full workflow simulation
Dependency: This CLI coordinates with Superset's existing GitHub Actions build infrastructure. It orchestrates environments but relies on Superset's build workflows for container creation.
๐ช Complete Label Reference
๐ฏ Trigger Labels (Add These to Your PR)
| 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) |
๐ State Labels (Automatically Managed)
| 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 |
๐ง Testing Configuration Changes
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.
๐ Complete Workflows
Creating Your First Environment
- 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
Testing Specific Commits
- 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
Rolling Updates (Automatic!)
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
๐ Security & Permissions
Who Can Use This?
- โ 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
GitHub Actions Integration
Showtime is designed to be called by Superset's GitHub Actions workflows:
# .github/workflows/showtime.yml - Integrates with Superset's existing build workflows
on:
pull_request_target:
types: [labeled, unlabeled, synchronize]
jobs:
showtime-handler:
if: contains(github.event.label.name, '๐ช')
steps:
- name: Install Showtime from PyPI
run: pip install superset-showtime
- name: Process circus triggers
run: python -m showtime handle-trigger ${{ github.event.pull_request.number }}
Integration approach:
- Coordinates with Superset builds - Uses existing container build workflows
- Runs trusted code (from PyPI, not PR code)
- Simple orchestration logic (install CLI and run commands)
- Leverages existing infrastructure - Same AWS resources and permissions
๐ ๏ธ Installation & Setup
For Contributors (GitHub Labels Only)
No installation needed! Just use GitHub labels to trigger environments.
For Maintainers (Manual CLI Operations)
Install CLI for debugging/testing:
pip install superset-showtime
export GITHUB_TOKEN=your_personal_access_token
Manual operations:
showtime list # Monitor all active environments
showtime status 1234 # Debug specific environment
showtime labels # Reference complete label system
For Repository Integration (GitHub Actions)
1. Install GitHub workflows:
Copy workflows-reference/showtime-trigger.yml and workflows-reference/showtime-cleanup.yml to Superset's .github/workflows/.
2. Configure secrets (already exist in Superset):
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYGITHUB_TOKEN
3. Dependencies: Showtime coordinates with Superset's existing build infrastructure - no additional setup needed.
๐ CLI Reference (For Development/Debugging)
Primary Interface: Use GitHub labels in PR interface. CLI is mainly for maintainers debugging or developing Showtime itself.
Debugging Commands
showtime list # Monitor all environments
showtime status 1234 # Debug specific environment
showtime labels # Complete label reference
showtime test-lifecycle 1234 # Full workflow simulation
Manual Operations (Advanced)
showtime start 1234 # Manually create environment
showtime start 1234 --sha abc123f # Create environment (specific SHA)
showtime stop 1234 # Manually delete environment
showtime sync 1234 # Force sync to desired state
showtime cleanup --respect-ttl # Manual cleanup
GitHub Actions Commands
showtime handle-trigger 1234 # Process trigger labels (called by GHA)
showtime cleanup --older-than 48h # Scheduled cleanup (called by GHA)
๐ช Benefits for Superset
For Contributors
- ๐ฏ Simple workflow - Just add/remove GitHub labels
- ๐ Visual feedback - See environment status in PR labels
- โก Automatic updates - New commits update environments automatically
- ๐ง Configuration testing - Test config changes through code commits
For Maintainers
- ๐ Complete visibility -
showtime listshows all environments - ๐งน Easy cleanup - Automatic expired environment cleanup
- ๐ Better debugging - Clear state in labels, comprehensive CLI
- ๐ฐ Cost savings - No duplicate environments, proper cleanup
For Operations
- ๐ Simpler workflows - Replace complex GHA scripts with simple CLI calls
- ๐ Same security model - No new permissions needed
- ๐ฏ Deterministic - Predictable AWS resource naming
- ๐จ Monitoring ready - 48h maximum lifetime, scheduled cleanup
๐๏ธ Architecture
State Management
All state lives in GitHub labels - no external databases needed:
- Trigger labels (
๐ช trigger-*) - Commands that get processed and removed - State labels (
๐ช ๐ฆ *) - Current environment status, managed by CLI
AWS Resources
Deterministic naming enables reliable cleanup:
- ECS Service:
pr-{pr_number}-{sha}(e.g.,pr-1234-abc123f) - ECR Image:
pr-{pr_number}-{sha}-ci(e.g.,pr-1234-abc123f-ci)
Rolling Updates
Zero-downtime updates by running multiple environments:
- Keep old environment serving traffic
- Build new environment in parallel
- Switch traffic when new environment is healthy
- Clean up old environment
๐ค Contributing
Testing Your Changes
Test with real PRs safely:
# Test label management without AWS costs:
showtime start YOUR_PR_NUMBER --dry-run-aws --aws-sleep 10
# Test full lifecycle:
showtime test-lifecycle YOUR_PR_NUMBER --real-github
Development Setup
git 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
pytest
๐ License
Apache License 2.0 - same as Apache Superset.
๐ช "Ladies and gentlemen, welcome to Superset Showtime - where ephemeral environments are always under the big top!" ๐ช๐คกโจ
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file superset_showtime-0.2.7.tar.gz.
File metadata
- Download URL: superset_showtime-0.2.7.tar.gz
- Upload date:
- Size: 42.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11789d5480bf56908fd422b198e4007f934ef7f17b38c3f94332abf739f8bc9e
|
|
| MD5 |
2d798c0e4964f98e02042866457fe92a
|
|
| BLAKE2b-256 |
47d6923208834d8ee125ea27071735af751ed855f00bfa89b5ce3283c2d70ea9
|
File details
Details for the file superset_showtime-0.2.7-py3-none-any.whl.
File metadata
- Download URL: superset_showtime-0.2.7-py3-none-any.whl
- Upload date:
- Size: 38.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68f2d4c6f3602626a59847087df5027481604d06d80425185b0901c90b7295eb
|
|
| MD5 |
58d3508f32884629df9e5dc5e1f64348
|
|
| BLAKE2b-256 |
58fecf73489b012a4c90ec53f6683d5d68e11383afab9e580e25b1e460ac0091
|