Skip to main content

๐ŸŽช Superset Showtime

Modern ephemeral environment management for Apache Superset using circus tent emoji labels

PyPI version Python 3.8+

๐ŸŽฏ 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:

  1. Go to your PR in GitHub
  2. Add label: ๐ŸŽช โšก showtime-trigger-start
  3. Watch the magic happen - labels will update automatically
  4. When you see ๐ŸŽช ๐Ÿšฆ {sha} running, your environment is ready!
  5. Get URL from ๐ŸŽช ๐ŸŒ {sha} {ip} โ†’ http://{ip}:8080
  6. 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 environment + label cleanup
showtime cleanup-labels                         # Preview stale repo label definitions

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:

  1. Modify superset_config.py with your changes
  2. Push commit โ†’ Creates new SHA (e.g., def456a)
  3. Add ๐ŸŽช โšก showtime-trigger-start โ†’ Deploys with your config
  4. 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

  1. Add trigger label in GitHub UI: ๐ŸŽช โšก showtime-trigger-start
  2. 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
    
  3. Wait for completion:
    ๐ŸŽช abc123f ๐Ÿšฆ running       โ† Now ready!
    ๐ŸŽช abc123f ๐ŸŒ 52.1.2.3:8080  โ† Visit http://52.1.2.3:8080
    

Testing Specific Commits

  1. Add freeze label: ๐ŸŽช ๐ŸงŠ showtime-freeze
  2. Result: Environment won't auto-update on new commits
  3. Use case: Test specific SHA while continuing development
  4. Override: Add ๐ŸŽช โšก showtime-trigger-start to force update despite freeze

Rolling Updates (Automatic!)

When you push new commits, Showtime automatically:

  1. Detects new commit via GitHub webhook
  2. Builds new environment alongside old one
  3. Switches traffic when new environment is ready
  4. 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-showtime from PyPI (trusted code, not PR code)
  • Runs showtime sync to handle trigger processing and deployments
  • Supports manual testing via workflow_dispatch with 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 --force    # Clean up expired envs, closed PR labels, and stale labels
showtime cleanup-labels --no-dry-run --force  # Prune unattached per-SHA labels only

๐Ÿค 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
showtime cleanup-labels  # dry-run by default

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!" ๐ŸŽช๐Ÿคกโœจ

Metadata

Release files for superset-showtime 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for superset-showtime 0.7.1
File Size Uploaded
superset_showtime-0.7.1.tar.gz 89.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for superset-showtime 0.7.1
File Interpreter ABI Platform
superset_showtime-0.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 148.6 kB

Release files / superset_showtime-0.7.1.tar.gz

Download URL superset_showtime-0.7.1.tar.gz
Size 89.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fae955c03bd042eba56ee940629f090214d57d696d5d247e098579fd3aca540b
BLAKE2b-256 checksum
How to use checksums
b738442b926be0879f13983e7f4be65f4cc9c8012d109d9dbe9567e711d978f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.15

Release files / superset_showtime-0.7.1-py3-none-any.whl

Download URL superset_showtime-0.7.1-py3-none-any.whl
Size 59.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
626d5c6c22d87773e3fd7502d07c056f9d52d104fb92fcd8c474ffc1b72f73a6
BLAKE2b-256 checksum
How to use checksums
75d151aeaf3d0b960cf83c6409fb904b75bbb14b548c30559493802ee08151bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.15

Release history Release notifications | RSS feed

This release

0.7.1 This release

2 release files

0.7.0

2 release files

0.6.11

2 release files

0.6.10

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.5.18

2 release files

0.5.12

2 release files

0.5.11

2 release files

0.5.10

2 release files

0.5.9

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.5

2 release files

0.4.2

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

1 release file

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page