fix: validate complete candidate service health
This commit is contained in:
@@ -402,6 +402,11 @@ services:
|
||||
continuity-runtime: { condition: service_started }
|
||||
commit-runtime: { condition: service_started }
|
||||
cognitive-worker-candidate: { condition: service_healthy }
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -qO- http://localhost:8084/healthz >/dev/null"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
|
||||
volumes:
|
||||
assistant_pg:
|
||||
|
||||
@@ -53,9 +53,9 @@ JSON
|
||||
)
|
||||
|
||||
stable_json="$(curl -fsS --max-time 10 "$SUPERVISOR_CONTROL_URL/v1/state")"
|
||||
stable_set="$(printf '%s' "$stable_json" | python3 -c 'import json,sys; s=json.load(sys.stdin).get("stable_release_set"); print(json.dumps(s,separators=(",",":")) if s else "")')"
|
||||
stable_set="$(printf '%s' "$stable_json" | python3 -c "import json,sys; s=json.load(sys.stdin).get('stable_release_set'); print(json.dumps(s,separators=(',',':')) if s else '')")"
|
||||
if [[ -z "$stable_set" ]]; then
|
||||
stable_revision="$(printf '%s' "$stable_json" | python3 -c 'import json,sys; print(json.load(sys.stdin).get("current",{}).get("version", "unknown"))')"
|
||||
stable_revision="$(printf '%s' "$stable_json" | python3 -c "import json,sys; print(json.load(sys.stdin).get('current',{}).get('version','unknown'))")"
|
||||
stable_set="$(cat <<JSON
|
||||
{"id":"stable-$stable_revision","revision":"$stable_revision","components":{
|
||||
"creator-web":{"name":"creator-web","revision":"$stable_revision","upstream":"http://creator-web:8084","health_url":"http://creator-web:8084/healthz","ready_url":"http://creator-web:8084/readyz"},
|
||||
@@ -68,7 +68,7 @@ JSON
|
||||
fi
|
||||
|
||||
curl -fsS --max-time 10 -X POST "$SUPERVISOR_CONTROL_URL/v1/releases/start-set" -H 'Content-Type: application/json' --data "$release_json" >/dev/null || fail_rollback
|
||||
observation="$(printf '%s' "$release_json" | python3 -c 'import json,sys,time; s=json.load(sys.stdin); print(json.dumps({"release_id":s["id"],"ready":True,"reason":"all ReleaseSet healthchecks and image revisions passed","observed_at_unix_millis":int(time.time()*1000),"components":{k:{"revision":v["revision"],"health":True,"ready":True} for k,v in s["components"].items()}},separators=(",",":")))')"
|
||||
observation="$(printf '%s' "$release_json" | python3 -c "import json,sys,time; s=json.load(sys.stdin); print(json.dumps({'release_id':s['id'],'ready':True,'reason':'all ReleaseSet healthchecks and image revisions passed','observed_at_unix_millis':int(time.time()*1000),'components':{k:{'revision':v['revision'],'health':True,'ready':True} for k,v in s['components'].items()}},separators=(',',':')))" )"
|
||||
curl -fsS --max-time 10 -X POST "$SUPERVISOR_CONTROL_URL/v1/releases/observe-set" -H 'Content-Type: application/json' --data "$observation" >/dev/null || fail_rollback
|
||||
control /v1/traffic/canary || fail_rollback
|
||||
|
||||
|
||||
Reference in New Issue
Block a user