Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(deploy): make the HCC rollout wait a budget that can actually elapse
Jose Ramirez48435f9c0e66
diff --git a/deploy/base/control-plane/host-context-controller.yaml b/deploy/base/control-plane/host-context-controller.yamlindex 0d32a622f..396cd5e2f 100644--- a/deploy/base/control-plane/host-context-controller.yaml+++ b/deploy/base/control-plane/host-context-controller.yaml@@ -13,6 +13,22 @@ metadata:app: host-context-controllerspec:replicas: 1+ # HCC's /ready stays 503 until its initial fleet reconciliation finishes, so time-to-Ready+ # scales with the McpServer/Context fleet rather than with process start. clerum-dev took+ # 651s on 2026-08-05 at 108 McpServers / 22 Contexts.+ #+ # Unset, this defaults to 600s, and that default is what actually governed the deploy:+ # `kubectl rollout status` aborts the instant the controller sets ProgressDeadlineExceeded,+ # so provision-gfs-runtime.sh's --timeout could never exceed the deadline remaining. The+ # clock also starts several steps earlier, at apply-inter-service-tokens.sh's `rollout+ # restart` of HCC, so the wait inherits only what is left. On 2026-08-05 that was 600-160+ # = 440s against a 480s timeout: the timeout raised in #202 never bound, and the deploy+ # failed 50s before HCC came Ready.+ #+ # 1200s covers the 900s wait plus a 300s head-start allowance. This is a mitigation, not+ # the fix — evenfire-ai/evenfire#205 decouples readiness from fleet convergence, after+ # which both numbers should come back down.+ progressDeadlineSeconds: 1200selector:matchLabels:app: host-context-controllerdiff --git a/deploy/scripts/provision-gfs-runtime.sh b/deploy/scripts/provision-gfs-runtime.shindex 910651637..1853b8873 100755--- a/deploy/scripts/provision-gfs-runtime.sh+++ b/deploy/scripts/provision-gfs-runtime.sh@@ -173,7 +173,19 @@ finalize_credentials_after_overlay() {filog "Waiting for the post-overlay HCC rollout"- kctl -n control-plane rollout status deployment/host-context-controller --timeout=480s+ # HCC serves 503 on /ready until its initial fleet reconciliation completes, so+ # time-to-Ready scales with the McpServer/Context fleet. clerum-dev (108 McpServers,+ # 22 Contexts) took 651s on 2026-08-05; clerum-prod (7/6) is far quicker.+ #+ # This number is only half the budget. `kubectl rollout status` aborts as soon as the+ # Deployment controller sets Progressing=False/ProgressDeadlineExceeded, so it can never+ # outlast progressDeadlineSeconds on the Deployment — and that clock starts earlier, when+ # apply-inter-service-tokens.sh `rollout restart`s HCC several steps before this one.+ # Keep this UNDER (progressDeadlineSeconds - that head start) or it silently does nothing:+ # at 480s against the unset-hence-600s default it never once bound. The manifest now sets+ # progressDeadlineSeconds: 1200; scripts/tests/test-provision-gfs-runtime.sh pins the+ # relationship so the two cannot drift apart again.+ kctl -n control-plane rollout status deployment/host-context-controller --timeout=900swait_for_gfsc_secret_referenceslog "Finalizing staged GFS credentials after the overlay"diff --git a/scripts/tests/test-provision-gfs-runtime.sh b/scripts/tests/test-provision-gfs-runtime.shindex c61c66bb5..0201a8abe 100755--- a/scripts/tests/test-provision-gfs-runtime.sh+++ b/scripts/tests/test-provision-gfs-runtime.sh@@ -2,6 +2,14 @@set -euo pipefailROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"++# The HCC post-overlay wait, and the two facts that decide whether it can actually elapse.+# Kept here so the script, the Deployment manifest and this test cannot drift apart.+HCC_ROLLOUT_TIMEOUT_S=900+# Observed head start from apply-inter-service-tokens.sh's `rollout restart` of HCC to this+# script's wait: 160s on clerum-dev 2026-08-05. Rounded up for slower deploys.+HCC_RESTART_HEAD_START_S=300+TMP="$(mktemp -d)"trap 'rm -rf "$TMP"' EXITmkdir -p "$TMP/bin" "$TMP/overlay/instances"@@ -48,8 +56,35 @@ reconcile="$ROOT/deploy/scripts/reconcile-gfs-deploy-credentials.sh"echo 'FAIL: post-overlay credential reconciliation did not run once per deploy' >&2exit 1}-[ "$(grep -Fc 'rollout status deployment/host-context-controller --timeout=480s' "$CALL_LOG")" -eq 3 ] || {- echo 'FAIL: HCC post-overlay rollout did not use its dedicated 480s timeout' >&2+[ "$(grep -Fc "rollout status deployment/host-context-controller --timeout=${HCC_ROLLOUT_TIMEOUT_S}s" "$CALL_LOG")" -eq 3 ] || {+ echo "FAIL: HCC post-overlay rollout did not use its dedicated ${HCC_ROLLOUT_TIMEOUT_S}s timeout" >&2+ exit 1+}++# The timeout above is only ever the REAL budget if the Deployment's own+# progressDeadlineSeconds outlasts it. `kubectl rollout status` aborts the moment the+# Deployment controller sets Progressing=False/ProgressDeadlineExceeded, so a --timeout+# larger than the remaining progress deadline is dead code.+#+# Two things make the margin bigger than it looks. The deadline clock starts when the new+# ReplicaSet is created — that is apply-inter-service-tokens.sh's `rollout restart` of HCC,+# several deploy steps EARLIER — not when this script starts waiting. And the deadline is+# absolute, so the head start is subtracted from the budget this script thinks it has.+#+# On clerum-dev 2026-08-05 the head start was 160s: RS created 10:34:02, this wait began+# 10:36:42, and with progressDeadlineSeconds unset (k8s default 600) the controller+# aborted at 10:44:03 — 39s before the then-480s timeout would have fired. #202 raised+# that timeout and nothing changed, because it could never bind.+hcc_manifest="$ROOT/deploy/base/control-plane/host-context-controller.yaml"+deadline="$(awk '/^ progressDeadlineSeconds:/ { print $2; exit }' "$hcc_manifest")"+[ -n "$deadline" ] || {+ echo "FAIL: $hcc_manifest does not declare progressDeadlineSeconds, so it defaults to 600s" >&2+ echo ' and silently caps the rollout-status timeout above.' >&2+ exit 1+}+[ "$deadline" -ge "$(( HCC_ROLLOUT_TIMEOUT_S + HCC_RESTART_HEAD_START_S ))" ] || {+ echo "FAIL: progressDeadlineSeconds=${deadline}s cannot cover a ${HCC_ROLLOUT_TIMEOUT_S}s wait that" >&2+ echo " starts ${HCC_RESTART_HEAD_START_S}s after the restart — the deadline would abort first." >&2exit 1}for deployment in gfsc-writer gfsc-reader; do