This commit is contained in:
@@ -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" | jq -c '.stable_release_set // empty')
|
||||
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" | jq -r '.current.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,10 @@ 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=$(cat <<JSON
|
||||
{"release_id":"candidate-$REVISION","ready":true,"reason":"all ReleaseSet healthchecks and image revisions passed","observed_at_unix_millis":$(date +%s%3N),"components":{"creator-web":{"revision":"$REVISION","health":true,"ready":true},"core-runtime":{"revision":"$REVISION","health":true,"ready":true},"cognitive-worker":{"revision":"$REVISION","health":true,"ready":true},"research-runtime":{"revision":"$REVISION","health":true,"ready":true}}}
|
||||
JSON
|
||||
)
|
||||
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