๐ช 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
๐ Showtime Workflow
flowchart 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_token
Monitor and debug:
showtime list # See all active environments
showtime status 1234 # Debug specific environment
showtime labels # Complete label reference
Testing/development:
showtime sync 1234 --dry-run-aws --dry-run-docker # Test without costs
showtime cleanup --dry-run --older-than 1h # Test cleanup logic
Architecture: 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.
๐ช 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
๐ฏ 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 + deploy
๐ ๏ธ CLI Usage
The 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 environments
๐ค Contributing
Testing Your Changes
Test 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
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.6.12.tar.gz.
File metadata
- Download URL: superset_showtime-0.6.12.tar.gz
- Upload date:
- Size: 76.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d125a35fe8438770818ff741802f03252c3bbd61d093ac10b418ed39c6ac70a1
|
|
| MD5 |
cdbb6f6e5ec5f0c5c38b48e09f54283b
|
|
| BLAKE2b-256 |
59541d382f6e8b80873a7532fc1fa58376096fba990b99f0ee49691e0b4caafd
|
File details
Details for the file superset_showtime-0.6.12-py3-none-any.whl.
File metadata
- Download URL: superset_showtime-0.6.12-py3-none-any.whl
- Upload date:
- Size: 54.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ace1d66e84db01412c6adc48fc8e137cefb979bbc299aa301114740ef434fb4
|
|
| MD5 |
b38faaa511e18baf8c0a6a55cc81be64
|
|
| BLAKE2b-256 |
10a76258efaf63e823bb48c4a83402209b076e97bc741fa29137d6054c730190
|