Skip to content

[draft] "sampler" build runner to sample between multiple build runners - #567

Draft
mnoah1 wants to merge 2 commits into
mainfrom
mnoah1/buildrunner-sampler
Draft

[draft] "sampler" build runner to sample between multiple build runners#567
mnoah1 wants to merge 2 commits into
mainfrom
mnoah1/buildrunner-sampler

Conversation

@mnoah1

@mnoah1 mnoah1 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Why?

What?

Test Plan

Issue

mnoah1 added 2 commits August 10, 2026 23:52
…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.
@behinddwalls

Copy link
Copy Markdown
Collaborator

we can probably close it in favor of shadow/simulation framework

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