feat(stargate): add multi-cluster development deployment - #1519
Draft
barrygreengus wants to merge 43 commits into
Draft
feat(stargate): add multi-cluster development deployment#1519barrygreengus wants to merge 43 commits into
barrygreengus wants to merge 43 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
Contributor
🛡️ CodeQL Analysis🚨 Found 5 issue(s) Severity Breakdown:
📋 Top Issues🔗 View full details in Security tab 🕐 Last updated: 2026-09-03 17:42:41 UTC | Commit: d3ef5fd |
Deploy Grafana Alloy 1.12.1 to each dev cluster and provision Amazon Managed Prometheus and Grafana dashboards. Grafana Alloy is Apache-2.0 licensed; no vendored dependency or NOTICE update is required.
Deploy Grafana 13.2.0 with grafana-community chart 13.0.1 and the Amazon Managed Service for Prometheus datasource plugin 3.2.0. These are runtime deployment artifacts; no third-party source is vendored.
Organize live routing, traffic, latency, and backend health metrics into a sectioned 22-panel dashboard with top-level backend gauges. No dependencies are added.
barrygreengus
force-pushed
the
codex/stargate-dev-deployment-plan
branch
from
September 4, 2026 16:44
d3ef5fd to
f799ab8
Compare
Exercise the fixed affinity wait in the development comparison. Allow protected regional values to override the hold, including zero, and verify the rendered configuration. Relates to #1420
Abort the arm before recording results if the forwarding process exits, including when Spark has already exited successfully after connection errors. Relates to #1420
Check port availability with the same address reuse behavior as the forwarding listener so closed connections do not block the next clean-cache arm. Relates to #1420
Seed input throughput from the mock profile and disable periodic synthetic canaries during benchmark runs. Tiny canary requests otherwise dominate the cold-start estimate and prevent long requests from reaching the backends. Observed workload requests continue updating throughput. Relates to #1420
Run measured HTTP traffic in a dedicated Spark Pod to avoid shared port-forward failures. Verify uploaded workload hashes, pass credentials over stdin, download compressed reports, and stop remote workers on interruption. Bound finite workloads by worker count and request timeout instead of assuming the rate cap is achieved. Relates to #1420
Closed-loop workers can complete below the configured rate cap. Do not describe the rate-based lower bound as a campaign runtime guarantee.
Return 404 without subscribing when the stats stream is disabled. Disable it in the dev stack and use Pylon auto mode to exercise fallback observations. Keep startup calibration and periodic-canary settings unchanged. Relates to #1420
Use the Pylon max-engine-concurrency flag to retain the MockDynamo profile limit while its stats endpoint is disabled. Relates to #1420
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Stargate needs a repeatable, dev-only multi-cluster environment for validating routing behavior, backend discovery, authentication, telemetry, and load-balancer performance before production rollout. The previous ad hoc deployment and local benchmark scripts did not provide one source of truth for topology, image pins, credentials, observability, workloads, or result capture.
What changed
--disable-stats-streamto MockDynamo and disable the endpoint in the dev chart defaults. It returns HTTP 404 without opening a stats subscription. Pylon stays inautomode so it detects the unsupported endpoint and enables its OpenAI fallback aggregators and estimators.--spark-pod; retain WebSocket port forwarding for local clients and fail an arm when its forwarder exits.The affinity policy and concurrency-aware queue estimates are implemented in #1660. This deployment PR supplies the environment and canonical workload suite used to validate that change.
Customer Release Notes
Not customer visible.
Plan Summary
The stack deploys into existing Kubernetes clusters. One regional hub receives routing, auth, and observability services. Two regional MockDC clusters each receive two independent mocked inference backends. Published service images are supplied through a protected values file and pinned by digest.
Usage
Initialize credentials once, then apply each phase with protected regional values:
List and run the canonical load-test suites:
Repeat the same command with
--resumeto continue an interrupted campaign. WaitAndWiden requests includex-cache-affinity-key,x-input-tokens,x-request-slo-ms, andx-max-wait-msthrough Spark.Testing
python3 -m unittest discover -s deploy/stacks/stargate-dev/tests -v: 23 tests passed. The seven deployment invariant tests also passed after the calibration-cap wiring change.git diff --check: passed for the deployment changes.f9058ea9f, Pylon7ec0e9883, MockDynamo0cef9214c, and deployment configurationffb5c7ec8.f9058ea9fpassed 1,148 Cargo tests across Stargate, Pylon library, and protocol packages, plus Clippy with warnings denied. Both deployed images built successfully with Bazel.The full canonical WAW and PowerOf2 suite completed: 28 measured reports, 88,277 successful requests, zero failed requests, and two client retries.
Full canonical results with fallback statistics
The September 11 canonical campaign completed 28 measured reports and 88,277 logical requests. All 88,277 succeeded, with zero terminal failures. WAW had zero client retries. PowerOf2 had two client retries in the 48 RPS capacity arm; both requests ultimately succeeded. Four one-request mixed-session warm-ups are excluded from these totals.
Tested images: Stargate
f9058ea9f, Pylon7ec0e9883, and MockDynamo0cef9214c, deployed throughffb5c7ec8and pinned by digest. Both algorithms used the same images, resources, Spark commit3cb1478, and six byte-identical workload files.MockDynamo returned HTTP 404 for its disabled stats endpoint. Pylon stayed in auto mode and activated fallback aggregators and estimators.
--max-engine-concurrency=25retained the engine limit, startup calibration was capped at 25, and periodic canaries were disabled. KV-cache HTTP polling remained enabled.The suite covered smoke, five capacity levels, three normal-session repeats per algorithm, one high-context arm per algorithm, and two mixed-traffic repeats per algorithm. Each affinity arm reset caches, recalibrated Pylons, refreshed routing state, and waited for four active backends.
WAW used utilization comparison, two affinity candidates, input-token scale 0.1, a 200 ms affinity hold,
n=2,max_queued=1, and queue bounds of 100-5,000 ms. PowerOf2 used two samples and the TTFT comparator. Each scenario used identical request timing settings for both algorithms. The high-context arms used a 60-second request SLO and routing wait, with a 90-second client timeout.Capacity sweep
Each arm ran for 120 seconds. Target RPS is the generator rate cap; achieved throughput is reported separately. Every capacity arm completed with zero failed requests.
Session workloads
Counts below are sums across repeats. Throughput, cache-hit percentages, and latency percentiles are medians of per-run statistics, not pooled percentiles. Cache-hit percentages use successful requests with observed cache information.
The high-context workload used 32 persistent workers, each with eight ordered three-turn sessions: six high-context sessions at 80k/100k/120k input tokens, one medium session at 8k/16k/24k, and one low session at 1k/2k/4k. Both algorithms completed all 768 requests without retries. WAW finished in 258.558 seconds (4.31 minutes); PowerOf2 finished in 312.185 seconds (5.20 minutes).
Mixed arms ran concurrent hot- and short-session streams for ten minutes at rate caps of 8 and 4 RPS. All mixed requests succeeded without retries. Both smoke arms also passed all 32 requests without retries.
Latency and tradeoffs
WAW improved normal-session throughput and cache reuse and completed the high-context workload faster. PowerOf2 had lower TTFT tails for the hot mixed stream and at the highest capacity target. At that target, WAW achieved slightly higher throughput but its TTFT p99 was 721 ms versus 287 ms. This tradeoff matters when selecting an affinity hold for a strict latency target.
Validation and limits
Post-run regional checks passed. All four MockDynamo stats endpoints still returned 404, Pylon recorded fallback activation with no received engine-stream events, and deployment images, arguments, replica counts, and resource limits matched the captured environment. The temporary Spark Pod was removed and diagnostic collectors were stopped.
All successful routing snapshots showed four active backends: 972 observations across measured run windows, with one auxiliary read timeout. The fallback audit covered 941 observations with no unexpected stream activity and one auxiliary read timeout. These two monitoring timeouts were separate from the workload, which had zero failed requests.
This is a single-region mock benchmark. Unlike the earlier high-context-only comparison, both algorithms were rerun under the same fallback-stats setup. Historical stats-stream runs are separate evidence. Client latency includes retry time. Backend-share and routing-counter exports use their recorded Prometheus observation windows; mixed backend counters combine the hot and short streams.
Suggested production WAW configuration
For a scoped rollout of session-oriented text-generation models, use the following as a starting configuration. It preserves the WAW settings exercised by the latest benchmark and makes the tested TTFT bucket defaults explicit. Replace
MODEL_NAMEwith the routed model ID. Unlisted models continue using PowerOfN.{ "default": "power-of-n", "models": { "MODEL_NAME": { "algorithm": "wait-and-widen", "cache_affinity_backend_selection_count": 2, "cache_affinity_input_tokens_scale": 0.1, "cache_affinity_virtual_nodes": 150, "cache_affinity_wait_ms": 200, "comparator": "utilization", "max_queue_time_ceil_ms": 5000, "max_queue_time_floor_ms": 100, "max_queued": 1, "n": 2, "require_cache_affinity_key": true, "require_input_tokens": true, "ttft_bucket_size_ms": 20, "next_bucket_unlock_factor": 0.25 } } }Use Stargate builds containing the free-slot queue correction (tested at
f9058ea9f) and Pylon builds containing the explicit concurrency flag (tested at7ec0e9883), or releases containing the merged PR #1660 changes. Validate the configuration against the real inference engine and representative traffic before expanding the rollout; the current performance evidence comes from MockDynamo.Routing policy and tuning
n=2within unlocked TTFT buckets. Keep the same model configuration and affinity-hash settings across router replicas.cache_affinity_input_tokens_scale=0.1as the tested affinity scoring weight, not a measured 90% cache-hit rate. Tune it against observed prefill savings; use1.0when cache reuse is not established.max_queued=1as an initial bound: the capacity check allows the reported engine concurrency plus one pending request. This is separate from the queue-time allowance, which grows from 100 ms to 5,000 ms as the request SLO budget is consumed.Gateway and deadline settings
Use the per-model WAW policy by omitting an
x-routing-methodoverride for these requests. The example requires a stablex-cache-affinity-keyand anx-input-tokensestimate. The gateway should derive them from the session/prefix and request content. For a model that also accepts requests without an affinity key, setrequire_cache_affinity_key=false; those requests use non-affinity routing.Set
x-request-slo-msfrom the service latency target,x-max-wait-msfrom its routing-wait budget, andx-stargate-max-wait-mswhen an explicit proxy-retry budget is required. The SLO header controls queue-admission interpolation; it is not an end-to-end timeout. Budget routing waits, backend processing, response delivery, and retries within the client's deadline.The high-context test used a 60-second request SLO, a 60-second maximum routing wait, and a 90-second client timeout per attempt. These are workload-specific reference values, not universal production defaults.
Pylon and engine prerequisites
Require a valid measured throughput estimate and an accurately reported engine concurrency limit. For an engine owned by one Pylon per logical cluster, the matching startup settings are:
Replace
ENGINE_CONCURRENCYwith the engine's actual limit; it was 25 in this environment.--max-engine-concurrencysupplies capacity when the engine does not report it; an engine-reported limit takes precedence. Omit--initial-input-tpswhen startup calibration is enabled. Multiple Pylons sharing one engine require coordinated calibration or a separately measured bootstrap rate. Check the completed calibration ramp: the configured cap alone does not prove that calibration reached it.During rollout, track request failures and deadlines, TTFT and decode latency, active requests versus engine capacity, cache reuse, backend traffic distribution, and Pylon queue-mismatch rejections. Exercise both ordinary traffic and sustained saturation; overload should produce bounded waits and failures within the configured budgets. Use production authentication and routing infrastructure for this configuration; the dev stack's static-token auth service is scoped to development.
Notes
Fallback mode is deployed with Pylon
7ec0e9883and MockDynamo0cef9214c; Stargate remains onf9058ea9f. Deployment commitffb5c7ec8supplies--max-engine-concurrency=25. All four MockDynamo stats endpoints returned HTTP 404, Pylon recorded automatic fallback activation with no received stream events, and calibration advertised the 25-slot limit. Startup calibration is enabled and periodic canaries are disabled. The full canonical comparison completed with 88,277 successful requests and no failed requests.Repository defaults remain non-deployable placeholders so credentials and private registry coordinates are not committed. Live images are supplied by digest through a protected values file. The current dev deployment uses Stargate
f9058ea9f, Pylon7ec0e9883, and MockDynamo0cef9214c, withmax_queued=1, configured engine concurrency 25, startup calibration capped at 25, and periodic canaries disabled.Issues
Relates to #1420
References
Related Pull Requests
Dependencies
No new third-party dependencies. No license review or NOTICE change is required.