feat(demo): provoke the triage tick instead of waiting a minute for it
Some checks failed
Tests / Declarative: Post Actions failed: 2, passed: 142
Some checks failed
Tests / Declarative: Post Actions failed: 2, passed: 142
Both demos went quiet for up to a minute between the build turning red and the monitor reacting, because Ariadne's tick is on cron. The scripts now run that tick immediately over the pod's own loopback - nothing exposed outside the cluster - and print what it saw, so the pause becomes a visible step rather than dead air. Falls back to silence rather than failure: if the request does not land the scheduler still picks the build up within the minute, which is exactly the old behaviour. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
8899b76d07
commit
bd6c0678d8
@ -175,6 +175,10 @@ PY
|
||||
note "HTTP $(jenkins_post "/job/$CODE_JOB/build")"
|
||||
note "result: $(wait_for_build "$CODE_JOB" "$next_num")"
|
||||
|
||||
say "Asking Ariadne to look now rather than on its next minute"
|
||||
note "\$ POST /api/internal/hermes/autotriage/run"
|
||||
note "$(poke_ariadne)"
|
||||
|
||||
say "Ariadne collects evidence and asks Hermes for a minimal patch"
|
||||
note "Hermes returns an anchored patch as data; Ariadne validates path, size,"
|
||||
note "changed lines, and that the anchor is unique, then pushes hermes-repair/$next_num"
|
||||
|
||||
@ -92,6 +92,24 @@ wait_for_build() { # job number [max_seconds] -> prints result
|
||||
printf 'TIMEOUT'
|
||||
}
|
||||
|
||||
# Ariadne's triage tick is on cron, which cannot fire more often than once a
|
||||
# minute. That minute is the largest gap between a build going red and the
|
||||
# system visibly reacting, and it is pure dead air on stage. This runs the same
|
||||
# tick immediately over the pod's own loopback, so nothing is exposed outside
|
||||
# the cluster. The tick is idempotent - incidents dedupe on job and build
|
||||
# number - so provoking it can only ever be a no-op, never a second incident.
|
||||
poke_ariadne() {
|
||||
kubectl -n maintenance exec deploy/ariadne -c ariadne -- python3 -c "
|
||||
import json, urllib.request
|
||||
req = urllib.request.Request(
|
||||
'http://127.0.0.1:8080/api/internal/hermes/autotriage/run', method='POST')
|
||||
body = json.load(urllib.request.urlopen(req, timeout=120))
|
||||
jobs = body.get('jobs') or {}
|
||||
print(body.get('status', 'ok'), '|', ', '.join(
|
||||
f\"{name}={info.get('status')}\" for name, info in jobs.items()) or 'no jobs')
|
||||
" 2>/dev/null || echo "tick request failed; the scheduler will pick it up within a minute"
|
||||
}
|
||||
|
||||
ariadne_ticks() { # tail the autotriage decisions in human-readable form
|
||||
kubectl -n maintenance logs deploy/ariadne -c ariadne --tail="${1:-400}" 2>/dev/null |
|
||||
grep 'hermes autotriage tick' |
|
||||
|
||||
@ -68,6 +68,10 @@ cmd_run() {
|
||||
say "Waiting for the seeded build to fail"
|
||||
note "result: $(wait_for_build "$FIXTURE_JOB" "$next_num")"
|
||||
|
||||
say "Asking Ariadne to look now rather than on its next minute"
|
||||
note "\$ POST /api/internal/hermes/autotriage/run"
|
||||
note "$(poke_ariadne)"
|
||||
|
||||
say "Ariadne detects, gathers evidence, asks Hermes, authorizes, repairs"
|
||||
note "the repair is a single in-process ConfigMap patch, so watch the fixture"
|
||||
for _ in $(seq 1 40); do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user