superset-showtime 0.5.1__py3-none-any.whl → 0.5.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of superset-showtime might be problematic. Click here for more details.
- showtime/__init__.py +1 -1
- showtime/core/pull_request.py +62 -0
- showtime/core/show.py +5 -5
- {superset_showtime-0.5.1.dist-info → superset_showtime-0.5.3.dist-info}/METADATA +1 -1
- {superset_showtime-0.5.1.dist-info → superset_showtime-0.5.3.dist-info}/RECORD +7 -7
- {superset_showtime-0.5.1.dist-info → superset_showtime-0.5.3.dist-info}/WHEEL +0 -0
- {superset_showtime-0.5.1.dist-info → superset_showtime-0.5.3.dist-info}/entry_points.txt +0 -0
showtime/__init__.py
CHANGED
showtime/core/pull_request.py
CHANGED
|
@@ -246,6 +246,9 @@ class PullRequest:
|
|
|
246
246
|
print(f"✅ Deployment completed - environment running at {show.ip}:8080")
|
|
247
247
|
self._update_show_labels(show, dry_run_github)
|
|
248
248
|
|
|
249
|
+
# Blue-green cleanup: stop all other environments for this PR
|
|
250
|
+
cleaned_count = self.stop_previous_environments(show.sha, dry_run_github, dry_run_aws)
|
|
251
|
+
|
|
249
252
|
# Show AWS console URLs for monitoring
|
|
250
253
|
self._show_service_urls(show)
|
|
251
254
|
|
|
@@ -278,6 +281,9 @@ class PullRequest:
|
|
|
278
281
|
print(f"✅ Rolling update completed - new environment at {new_show.ip}:8080")
|
|
279
282
|
self._update_show_labels(new_show, dry_run_github)
|
|
280
283
|
|
|
284
|
+
# Blue-green cleanup: stop all other environments for this PR
|
|
285
|
+
cleaned_count = self.stop_previous_environments(new_show.sha, dry_run_github, dry_run_aws)
|
|
286
|
+
|
|
281
287
|
# Show AWS console URLs for monitoring
|
|
282
288
|
self._show_service_urls(new_show)
|
|
283
289
|
|
|
@@ -580,6 +586,17 @@ class PullRequest:
|
|
|
580
586
|
for old_status_label in sha_status_labels:
|
|
581
587
|
get_github().remove_label(self.pr_number, old_status_label)
|
|
582
588
|
|
|
589
|
+
# For running environments, ensure only ONE active pointer exists
|
|
590
|
+
if show.status == "running":
|
|
591
|
+
# Remove ALL existing active pointers (there should only be one)
|
|
592
|
+
existing_active_pointers = [
|
|
593
|
+
label for label in self.labels
|
|
594
|
+
if label.startswith("🎪 🎯 ")
|
|
595
|
+
]
|
|
596
|
+
for old_pointer in existing_active_pointers:
|
|
597
|
+
print(f"🎯 Removing old active pointer: {old_pointer}")
|
|
598
|
+
get_github().remove_label(self.pr_number, old_pointer)
|
|
599
|
+
|
|
583
600
|
# Now do normal differential updates - only for this SHA
|
|
584
601
|
current_sha_labels = {
|
|
585
602
|
label for label in self.labels
|
|
@@ -616,3 +633,48 @@ class PullRequest:
|
|
|
616
633
|
print(f"📝 Logs: {urls['logs']}")
|
|
617
634
|
print(f"📊 Service: {urls['service']}")
|
|
618
635
|
print("")
|
|
636
|
+
|
|
637
|
+
def stop_previous_environments(self, keep_sha: str, dry_run_github: bool = False, dry_run_aws: bool = False) -> int:
|
|
638
|
+
"""Stop all environments except the specified SHA (blue-green cleanup)
|
|
639
|
+
|
|
640
|
+
Args:
|
|
641
|
+
keep_sha: SHA of environment to keep running
|
|
642
|
+
dry_run_github: Skip GitHub label operations
|
|
643
|
+
dry_run_aws: Skip AWS operations
|
|
644
|
+
|
|
645
|
+
Returns:
|
|
646
|
+
Number of environments stopped
|
|
647
|
+
"""
|
|
648
|
+
stopped_count = 0
|
|
649
|
+
|
|
650
|
+
for show in self.shows:
|
|
651
|
+
if show.sha != keep_sha:
|
|
652
|
+
print(f"🧹 Cleaning up old environment: {show.sha} ({show.status})")
|
|
653
|
+
try:
|
|
654
|
+
show.stop(dry_run_github=dry_run_github, dry_run_aws=dry_run_aws)
|
|
655
|
+
|
|
656
|
+
# Remove labels for this old environment
|
|
657
|
+
if not dry_run_github:
|
|
658
|
+
old_labels = show.to_circus_labels()
|
|
659
|
+
print(f"🏷️ Removing labels for {show.sha}: {len(old_labels)} labels")
|
|
660
|
+
for label in old_labels:
|
|
661
|
+
try:
|
|
662
|
+
get_github().remove_label(self.pr_number, label)
|
|
663
|
+
except Exception as e:
|
|
664
|
+
print(f"⚠️ Failed to remove label {label}: {e}")
|
|
665
|
+
|
|
666
|
+
stopped_count += 1
|
|
667
|
+
print(f"✅ Stopped environment {show.sha}")
|
|
668
|
+
|
|
669
|
+
except Exception as e:
|
|
670
|
+
print(f"❌ Failed to stop environment {show.sha}: {e}")
|
|
671
|
+
|
|
672
|
+
if stopped_count > 0:
|
|
673
|
+
print(f"🧹 Blue-green cleanup: stopped {stopped_count} old environments")
|
|
674
|
+
# Refresh labels after cleanup
|
|
675
|
+
if not dry_run_github:
|
|
676
|
+
self.refresh_labels()
|
|
677
|
+
else:
|
|
678
|
+
print("ℹ️ No old environments to clean up")
|
|
679
|
+
|
|
680
|
+
return stopped_count
|
showtime/core/show.py
CHANGED
|
@@ -165,17 +165,17 @@ class Show:
|
|
|
165
165
|
|
|
166
166
|
# Detect if running in CI environment
|
|
167
167
|
is_ci = bool(os.getenv("GITHUB_ACTIONS") or os.getenv("CI"))
|
|
168
|
-
|
|
168
|
+
|
|
169
169
|
# Build command without final path
|
|
170
170
|
cmd = [
|
|
171
171
|
"docker",
|
|
172
|
-
"buildx",
|
|
172
|
+
"buildx",
|
|
173
173
|
"build",
|
|
174
174
|
"--push",
|
|
175
175
|
"--platform",
|
|
176
176
|
"linux/amd64",
|
|
177
177
|
"--target",
|
|
178
|
-
"
|
|
178
|
+
"showtime",
|
|
179
179
|
"--build-arg",
|
|
180
180
|
"INCLUDE_CHROMIUM=false",
|
|
181
181
|
"--build-arg",
|
|
@@ -190,7 +190,7 @@ class Show:
|
|
|
190
190
|
cmd.extend([
|
|
191
191
|
"--cache-from",
|
|
192
192
|
"type=registry,ref=apache/superset-cache:showtime",
|
|
193
|
-
"--cache-to",
|
|
193
|
+
"--cache-to",
|
|
194
194
|
"type=registry,mode=max,ref=apache/superset-cache:showtime",
|
|
195
195
|
])
|
|
196
196
|
print("🐳 CI environment: Using full registry caching")
|
|
@@ -204,7 +204,7 @@ class Show:
|
|
|
204
204
|
|
|
205
205
|
# Add --load only when explicitly requested for local testing
|
|
206
206
|
force_load = os.getenv("DOCKER_LOAD", "false").lower() == "true"
|
|
207
|
-
|
|
207
|
+
|
|
208
208
|
if force_load:
|
|
209
209
|
cmd.append("--load")
|
|
210
210
|
print("🐳 Will load image to local Docker daemon (DOCKER_LOAD=true)")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: superset-showtime
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.3
|
|
4
4
|
Summary: 🎪 Apache Superset ephemeral environment management with circus tent emoji state tracking
|
|
5
5
|
Project-URL: Homepage, https://github.com/apache/superset-showtime
|
|
6
6
|
Project-URL: Documentation, https://superset-showtime.readthedocs.io/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
showtime/__init__.py,sha256=
|
|
1
|
+
showtime/__init__.py,sha256=HKR0Quvgeabq-6nUgJV_sgWCHcm5jzwuQR_uOoXJ9VQ,448
|
|
2
2
|
showtime/__main__.py,sha256=EVaDaTX69yIhCzChg99vqvFSCN4ELstEt7Mpb9FMZX8,109
|
|
3
3
|
showtime/cli.py,sha256=cQB5kH-XWFX3MhsxRaChVdjVe_I_7kBVyFY4fQrHPWA,30542
|
|
4
4
|
showtime/core/__init__.py,sha256=54hbdFNGrzuNMBdraezfjT8Zi6g221pKlJ9mREnKwCw,34
|
|
@@ -7,10 +7,10 @@ showtime/core/emojis.py,sha256=MHEDuPIdfNiop4zbNLuviz3eY05QiftYSHHCVbkfKhw,2129
|
|
|
7
7
|
showtime/core/github.py,sha256=uETvKDO2Yhpqg3fxLtrKaCuZR3b-1LVmgnf5aLcqrAQ,9988
|
|
8
8
|
showtime/core/github_messages.py,sha256=MfgwCukrEsWWesMsuL8saciDgP4nS-gijzu8DXr-Alg,7450
|
|
9
9
|
showtime/core/label_colors.py,sha256=efhbFnz_3nqEnEqmgyF6_hZbxtCu_fmb68BIIUpSsnk,3895
|
|
10
|
-
showtime/core/pull_request.py,sha256=
|
|
11
|
-
showtime/core/show.py,sha256=
|
|
10
|
+
showtime/core/pull_request.py,sha256=X0LU717-Bzs5TSmD36DMaNQ9KfpwXMJ74OWr2aBj7X0,27000
|
|
11
|
+
showtime/core/show.py,sha256=FpxDm52LASCJvf8UF998AtNiVzfdYIwNEsPAsOAAwL0,9701
|
|
12
12
|
showtime/data/ecs-task-definition.json,sha256=2acmqoF-3CxaBJP_VDkMMpG_U2RI4VPk1JvFOprMFyc,2098
|
|
13
|
-
superset_showtime-0.5.
|
|
14
|
-
superset_showtime-0.5.
|
|
15
|
-
superset_showtime-0.5.
|
|
16
|
-
superset_showtime-0.5.
|
|
13
|
+
superset_showtime-0.5.3.dist-info/METADATA,sha256=nP5JM98Vi0uUgEYBn2lVxsXRVvb4_CuK9U-WgbiBlZE,12052
|
|
14
|
+
superset_showtime-0.5.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
15
|
+
superset_showtime-0.5.3.dist-info/entry_points.txt,sha256=rDW7oZ57mqyBUS4N_3_R7bZNGVHB-104jwmY-hHC_ck,85
|
|
16
|
+
superset_showtime-0.5.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|