Release a version gradually

Serve a new version to a share of conversations (a canary) or only to test traffic (blue/green), and end it or make it the stable version.

By default a new version replaces the old one at once. When you want to see a version work on real conversations first, a rollout can say how the version should reach the environment instead. Two ways are available, and both need a stable version already serving: the new version is served next to it, and the stable one keeps serving everything else.

Gradual releases are delivered, not yet used by the runtime. You can apply a canary or blue/green, watch it move through its steps, approve it in production, and end it; every change is recorded. Each fleet receives both versions and the current split, activates them, and reports the split it applied, so get rollout shows what is wanted and, per fleet, what is applied. A fleet that cannot serve the new version keeps serving the stable one and is reported Degraded. The runtime library that chooses between the two when a conversation starts and runs the pinned release exists and is tested, but the engine does not use it yet, so conversations still run on the stable version until it does.

Canary: a rising share

How a canary moves A canary serves a rising share of new conversations with the candidate version. A step with a pause moves on by itself, a step without one waits for you, and the last step makes the candidate the stable version. Applying the stable version again aborts. CANDIDATE SERVESStep 1 · 5%pause 10m,then moves on CANDIDATE SERVESStep 2 · 25%no pause: waits forrobotelos advance CANDIDATE SERVESStep 3 · 50%optional match:internal callers only Stableversion 2 serves all;the canary is over Abortapply version 1, no strategy A conversation keeps the version it started with. Version 1 serves everyone else throughout.
A canary serves a rising share of new conversations. The last step makes the candidate the stable version.
apiVersion: robotelos.io/v1
kind: AgentRollout
metadata:
  agent: support
  environment: dev
spec:
  version: 2              # the new version: the candidate
  strategy:
    type: canary
    steps:
      - percent: 5
        pause: 10m        # wait this long before the next step; leave out to wait until you release it
      - percent: 25
      - percent: 50
        match: "robotelos.io/caller-class=internal"   # optional: only these conversations
robotelos apply -f canary.yaml
robotelos get rollout support/dev
agentrollout/support/dev
generation: 2
version: 1
strategy: canary
candidate: version 2 serves 5% of conversations (step 1)

version: 1 is what serves by default (the stable version); version 2 is the candidate. A conversation gets one or the other when it starts and keeps it for its whole life. The share is chosen by a fixed rule from the conversation, with nothing counted, so the same conversation always lands the same way and a rising percentage only adds conversations. Over many conversations the share is close to the number; for a handful it can be far off.

Percentages rise strictly from 1 to 100, with at most 20 steps; a pause is up to a week.

How a canary moves

A step with a pause moves on by itself when the pause has run: the platform takes the next step and records it in the history (get revisions). A step without a pause waits for you:

robotelos advance rollout support/dev
agentrollout/support/dev generation 3: version 2 serves 25% of conversations (step 2)

After the last step has run its pause (or you advance it), version 2 becomes the stable version and the canary is over. get rollout shows next step: with the time a step is due. Pausing (paused: true) stops the clock; when you resume, the current step’s pause starts again from zero. Steps are taken only as declared: in production, the approval of the promotion covers the steps and the final switch, so no second approval is asked.

Blue/green: only test traffic

spec:
  version: 2
  strategy:
    type: blueGreen
    match: "team=qa"

Version 2 serves every conversation that matches, and nobody else. The match is required: a blue/green with no match would be a release.

What a match can look at

Only what the server knows, never what a client claims. A client cannot set any of it, and a command that tries is rejected.

AttributeValue
robotelos.io/channelthe transport the conversation was started over: ws (WebSocket), sse or grpc
robotelos.io/caller-classgateway when the user’s own token came in X-Auth-Identity next to the gateway’s credential, otherwise direct
the claims you configurethe string claims of that verified token, named in ROBOTELOS_GATEWAY_JWT_LABEL_CLAIMS (for example tier or team). Claims that are not valid label values are ignored

The token is verified before anything is read from it, and it must belong to the same account as the credential. The values are written once, when the conversation starts, so the choice does not change during it. The syntax is the one of label selectors (key=value, key in (a,b), !key, joined by commas).

Ending it

You wantApply
Stop the experiment, keep the stable versionthe stable version again (version: 1, no strategy). This is an abort.
Make the candidate the stable versionthe candidate with no strategy (version: 2). This is the flip.
Change the steps or the matchthe same version with the new strategy: a new generation.
Try another version insteadthe other version with a strategy: it replaces the candidate and starts again at step 1.
Hold where you arepaused: true in the spec, and paused: false to go on.

Applying the same file twice changes nothing.

In production

A canary or blue/green in a gated environment such as prod goes through the same approval as any other change: applying it records a promotion that carries the strategy, and nothing changes until someone approves it. The approver sees which strategy they approve. Production needs a stable version first, because there must be something to run next to. Ending a candidate (applying the stable version again) needs no approval: it only reduces what is exposed to a version that was already approved.

Making the candidate the stable version in production is a promotion like any other and needs an approval too.

Next steps