mirror of
https://github.com/apache/superset.git
synced 2026-05-29 20:29:34 +00:00
Replaces legacy ephemeral environment system with the new Superset Showtime tool (https://github.com/mistercrunch/superset-showtime), providing automated PR environment management using Docker containers deployed to AWS ECS. ## Key Changes ### New Showtime Workflows - `showtime-trigger.yml`: Handles all PR events (labeled, synchronize, closed) with intelligent build detection - `showtime-cleanup.yml`: Scheduled cleanup every 6 hours with manual trigger support ### Legacy Workflow Deprecation - Added deprecation notices to `ephemeral-env.yml` and `ephemeral-env-pr-close.yml` - Clear migration guidance from "testenv-up" to "🎪 trigger-start" labels - Both systems coexist during transition period ### Architecture Improvements - **Simplified Logic**: GitHub Actions just triggers, showtime CLI handles all decisions - **Smart Building**: Only builds Docker images when code changes, not label changes - **DuckDB Support**: Configured with `LOAD_EXAMPLES_DUCKDB=true` build arg - **Environment Variables**: Requires `SUPERSET__SQLALCHEMY_EXAMPLES_URI` in ECS (showtime CLI responsibility) ## Testing Simple 3-step test on PR 34831: 1. Set label: `gh pr edit 34831 --add-label "🎪 trigger-start"` 2. Run command: `gh workflow run showtime-trigger.yml --ref showtime_gha --field pr_number=34831` 3. Expected outcome: Environment accessible with DuckDB examples ## Benefits - **Reliability**: Dedicated Python package vs complex YAML logic - **Maintainability**: All environment logic centralized in showtime CLI - **Efficiency**: Conditional builds and smart resource management - **Testability**: Manual workflow_dispatch for development and debugging 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
82 lines
2.9 KiB
YAML
82 lines
2.9 KiB
YAML
name: Cleanup ephemeral envs (PR close) [DEPRECATED]
|
|
|
|
# ⚠️ DEPRECATION NOTICE ⚠️
|
|
# This workflow is deprecated and will be removed in a future version.
|
|
# The new Superset Showtime workflow handles cleanup automatically.
|
|
# See .github/workflows/showtime.yml and showtime-cleanup.yml for replacements.
|
|
# Migration guide: https://github.com/mistercrunch/superset-showtime
|
|
|
|
on:
|
|
pull_request_target:
|
|
types: [closed]
|
|
|
|
jobs:
|
|
config:
|
|
runs-on: ubuntu-24.04
|
|
outputs:
|
|
has-secrets: ${{ steps.check.outputs.has-secrets }}
|
|
steps:
|
|
- name: "Check for secrets"
|
|
id: check
|
|
shell: bash
|
|
run: |
|
|
if [ -n "${{ (secrets.AWS_ACCESS_KEY_ID != '' && secrets.AWS_SECRET_ACCESS_KEY != '') || '' }}" ]; then
|
|
echo "has-secrets=1" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
ephemeral-env-cleanup:
|
|
needs: config
|
|
if: needs.config.outputs.has-secrets
|
|
name: Cleanup ephemeral envs
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
pull-requests: write
|
|
steps:
|
|
- name: Configure AWS credentials
|
|
uses: aws-actions/configure-aws-credentials@v4
|
|
with:
|
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
aws-region: us-west-2
|
|
|
|
- name: Describe ECS service
|
|
id: describe-services
|
|
run: |
|
|
echo "active=$(aws ecs describe-services --cluster superset-ci --services pr-${{ github.event.number }}-service | jq '.services[] | select(.status == "ACTIVE") | any')" >> $GITHUB_OUTPUT
|
|
|
|
- name: Delete ECS service
|
|
if: steps.describe-services.outputs.active == 'true'
|
|
id: delete-service
|
|
run: |
|
|
aws ecs delete-service \
|
|
--cluster superset-ci \
|
|
--service pr-${{ github.event.number }}-service \
|
|
--force
|
|
|
|
- name: Login to Amazon ECR
|
|
if: steps.describe-services.outputs.active == 'true'
|
|
id: login-ecr
|
|
uses: aws-actions/amazon-ecr-login@v2
|
|
|
|
- name: Delete ECR image tag
|
|
if: steps.describe-services.outputs.active == 'true'
|
|
id: delete-image-tag
|
|
run: |
|
|
aws ecr batch-delete-image \
|
|
--registry-id $(echo "${{ steps.login-ecr.outputs.registry }}" | grep -Eo "^[0-9]+") \
|
|
--repository-name superset-ci \
|
|
--image-ids imageTag=pr-${{ github.event.number }}
|
|
|
|
- name: Comment (success)
|
|
if: steps.describe-services.outputs.active == 'true'
|
|
uses: actions/github-script@v7
|
|
with:
|
|
github-token: ${{github.token}}
|
|
script: |
|
|
github.rest.issues.createComment({
|
|
issue_number: ${{ github.event.number }},
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
body: '⚠️ **DEPRECATED WORKFLOW** - Ephemeral environment shutdown and build artifacts deleted. Please migrate to the new Superset Showtime system for future PRs.'
|
|
})
|