daacf84e30
gates / gates (push) Successful in 25s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
22 lines
1.3 KiB
Python
22 lines
1.3 KiB
Python
#!/usr/bin/env python3
|
|
"""Part B on 9202: the controller's own Update button (POST /api/selfupdate/update) to the newest release, then the
|
|
decision-56 pass 3 minutes after the new controller starts. Images + GB before/after; the pass's own log lines."""
|
|
import time, sys
|
|
import walk as w
|
|
IMG = "docker image ls -a --format '{{.Repository}}:{{.Tag}} {{.ID}} {{.Size}}' | grep felhom-controller | sort -V; echo count=$(docker image ls -a --format '{{.Repository}}' | grep -c felhom-controller); docker system df | sed -n 1,2p; df -h /var/lib/docker | tail -1"
|
|
print("## before"); print(w.guest(IMG))
|
|
w.login()
|
|
print("check:", w.ctl("POST", "/api/selfupdate/check"))
|
|
print("trigger:", w.ctl("POST", "/api/selfupdate/update"))
|
|
for _ in range(60):
|
|
time.sleep(10)
|
|
img = w.guest("docker inspect felhom-controller --format '{{.Config.Image}} {{.State.StartedAt}}'").strip()
|
|
if sys.argv[1] in img:
|
|
break
|
|
print("running:", img)
|
|
print("update-state:", w.guest("docker exec felhom-controller cat /opt/docker/felhom-controller/data/update-state.json"))
|
|
time.sleep(200)
|
|
print("## the passes (positive observable: one line per pass)")
|
|
print(w.guest("docker logs --since 10m felhom-controller 2>&1 | grep -E 'image retention|Post-update startup' | cut -c1-260"))
|
|
print("## after"); print(w.guest(IMG))
|