Skip to content

feat(ops): queue autoscaler, staged ramp, stalled analysis remediation, CNI restart recovery#83

Open
anchapin wants to merge 1 commit into
179d_spot_instancefrom
feat/ops-operational-scripts
Open

feat(ops): queue autoscaler, staged ramp, stalled analysis remediation, CNI restart recovery#83
anchapin wants to merge 1 commit into
179d_spot_instancefrom
feat/ops-operational-scripts

Conversation

@anchapin

Copy link
Copy Markdown
Collaborator

Summary

Adds four new operational scripts for managing large-scale batch simulation runs, plus significant improvements to the existing health remediation loop.

New Scripts

scripts/queue-autoscale-loop.sh

Continuously adjusts worker HPA minReplicas and web-background replicas based on live queue depths:

  • Ratio-based simulation queue floor (e.g. 30 queued jobs per running worker)
  • Bounded scale step limits to prevent runaway scaling
  • Optional direct web-background replica management (vs deferring to HPA)
  • Configurable via env vars; meant to run alongside the health loop

scripts/worker-staged-ramp.sh

Ramps worker HPA maxReplicas through stages (default: 2k → 5k → 10k → 15k):

  • Validates readiness ratio, non-running pod count, sandbox failure rate,
    CreateContainerError counts, and Terminating pod count before advancing
  • Auto-rolls back to last stable stage on guardrail breach
  • Hold period at each stage before advancing

scripts/remediate-stalled-analyses.sh

Detects analyses stuck in na/queued state with no queue activity:

  • Dry-run by default; requires --execute flag to act
  • Supports --analysis-id for targeted remediation

scripts/clean-data.sh

Safely deletes projects, analyses, Redis queues, and optionally PVs for a fresh deployment start. Supports dry-run, force mode, and PV deletion.

Updated: scripts/health-remediation-loop.sh

  • Add CNI sandbox timeout detection: identifies pods stuck with
    FailedCreatePodSandBox + DeadlineExceeded, restarts aws-node on the
    affected node with a configurable cooldown (CNI_RESTART_COOLDOWN_SECONDS)
  • Cap CNI restarts per cycle (MAX_CNI_RESTARTS_PER_CYCLE)
  • Update default HPA scaling parameters to match 15k scaling targets
  • Add ENFORCE_WORKER_HPA_MAX_REPLICAS flag (0 = disabled, N = enforce max)

…ed analysis remediation, CNI restart recovery

Add new operational scripts for large-scale batch run management:

scripts/queue-autoscale-loop.sh:
  - Continuously adjusts worker HPA minReplicas and web-background replicas
    based on queue depths and running worker count
  - Supports ratio-based simulation queue floor (simulations per worker)
  - Optional MANAGE_WEB_BACKGROUND for direct scale control or deference to HPA

scripts/worker-staged-ramp.sh:
  - Ramps HPA maxReplicas through configurable stages (2k, 5k, 10k, 15k)
  - Validates readiness ratio, non-running pod counts, sandbox failure rate,
    and CreateContainerError counts before advancing each stage
  - Auto-rolls back to last stable stage on guardrail breach

scripts/remediate-stalled-analyses.sh:
  - Detects analyses stuck in na/queued state with no queue progress
  - Optionally re-triggers start for stalled analyses via REST API

scripts/clean-data.sh:
  - Safely delete projects, analyses, and associated data for a fresh start
  - Supports dry-run mode, PV deletion, and namespace targeting

scripts/health-remediation-loop.sh updates:
  - Add CNI sandbox timeout remediation: detect FailedCreatePodSandBox +
    DeadlineExceeded, restart aws-node on affected node with cooldown
  - Update default HPA parameters to match 15k scaling targets
  - Add ENFORCE_WORKER_HPA_MAX_REPLICAS flag (0 = disabled)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants