[draft] "sampler" build runner to sample between multiple build runners - #567
Draft
mnoah1 wants to merge 2 commits into
Draft
[draft] "sampler" build runner to sample between multiple build runners#567mnoah1 wants to merge 2 commits into
mnoah1 wants to merge 2 commits into
Conversation
…nfigurable The fake previously succeeded immediately for every build unless a request carried a marker, so a local stack could not be made to look like a real one. Params now set a failure rate and a build duration for every build, and New validates them so a misconfigured stack fails at wiring time. Duration is configured as a typical value plus DurationJitterPercent, a symmetric spread around it: 60s at 25% draws uniformly from 45s to 75s. A percentage of the duration rather than a min/max pair keeps the bounds stateable in one line, cannot be inverted, and — capped at 100 — cannot go negative. Zero jitter reproduces the previous fixed-duration behavior. Markers still win for the build that carries them, so a stack running a failure rate can still ask for a specific outcome per request. The knobs are wired through BUILD_RUNNER_* environment variables and Compose. Also records the leading-underscore convention for unexported globals in AGENTS.md, which this code follows.
…tage The sampler wraps two BuildRunners and routes a configured share of builds to the candidate, so a backend rollout or comparison can be exercised on live traffic without a real CI system. The sample is drawn per Trigger, so the percentage is a rate over many builds rather than a guarantee. Status and Cancel have to reach whichever runner minted a build's opaque id, so the sampler tags each id with the slot behind it and strips the tag before delegating; untagged ids route to the baseline. Tagging rather than bookkeeping keeps it stateless across redeliveries and replicas, and lets samplers nest. BUILD_RUNNER=sampler selects it in the wiring layer, which grows a second set of BUILD_RUNNER_CANDIDATE_* knobs so the two runners can be given different profiles.
Collaborator
|
we can probably close it in favor of shadow/simulation framework |
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?
What?
Test Plan
Issue