Skip to main content

Releases and rollback

Every deploy of an application or model is recorded as a numbered version (v1, v2, …) with what it shipped: the image tag, chart version, Git revision or model. When a release misbehaves, roll back to an earlier version. You see the change first, and nothing is applied until you confirm.

An application: a failed update, a safe rollback

Before you start​

  • An application or model deployed at least twice. Rollback needs an earlier version that finished deploying.
  • Values in the specification that are secret references, not secret values. A version that may contain a secret is not recorded for rollback (see If it's refused).

In the console​

  1. Open the application from Workloads > Applications, or the model from Workloads > Models, and select its History tab. The Update tab's Roll back card opens the same list with Choose a version.

  2. Version history lists every version, newest first, with its source, when and by whom it shipped, and its state, such as Successful, Failed, Superseded or Replaced (a newer apply replaced it before it finished deploying). The running version is marked Current. Expand a version to see what it shipped.

    Open zoom view

    Version history for a model: v4 Current and Successful, v3 Failed with its reason, v2 and v1 Superseded with Roll back

    Version history for a model: v4 Current and Successful, v3 Failed with its reason, v2 and v1 Superseded with Roll backVersion history for a model: v4 Current and Successful, v3 Failed with its reason, v2 and v1 Superseded with Roll back

    A version that cannot be rolled back to has no Roll back button and shows the reason instead.

  3. Select Roll back on the version you want. Roll back application shows the change from the current version to the target and any warnings, with "Review the changes below. Nothing is applied until you confirm."

    Open zoom view

    Roll back application: v4 to v2, two warnings, and the name to type to confirm

    Roll back application: v4 to v2, two warnings, and the name to type to confirmRoll back application: v4 to v2, two warnings, and the name to type to confirm
  4. Type the application's name where it says "Type <name> to confirm", then select Confirm rollback.

Rollback: the failed update, the diff, a typed name, running again

You should see​

"Rollback started", then a new version at the top of Version history that deploys the target's specification. The application's page returns to Running once it is up. If it does not, its Events and Logs tabs say why: Troubleshoot.

Version history for an image application: the current version, superseded versions with Roll back, and a failed versionVersion history for an image application: the current version, superseded versions with Roll back, and a failed version

How versions work​

  • A rollback moves forward. Rolling back to v2 deploys v2's specification as a new version on top. History is never rewritten, so you can always move again.
  • A rollback keeps the endpoint's access policy. A model's endpoint keeps the access policy it has now, whatever the target version had.
  • A rollback reverts the deployed version only. It does not undo database migrations or other data changes.
  • A moving source is pinned. An application that tracks a branch or a moving tag is pinned to the target, and stops following its source until you resume it. Its history shows Pinned and a Resume tracking action.
  • Some versions cannot be restored. A version that never finished deploying, one replaced before its deploy finished, or one older than the versions AstroPulse keeps for rollback, cannot be rolled back to. Apply the specification you want instead.
  • A moving reference restores the specification, not the bytes. When a version recorded a tag that can move, the rollback restores its specification but may bring back a different image. Pin sources to exact tags or revisions.

Resume tracking​

After a rollback pins an application that follows a branch, select Resume tracking on its History tab. The dialog shows the change; confirm with the application's name and Confirm resume. The application follows its source again from the latest revision.

Other ways in​

  • Nova: ask it, for example "show the deploy history for hello-world" or "roll hello-world back to the last good version". Nova shows the plan first, and applies it only after you confirm the target version.
  • SDK and API: the same operations, in the API reference.

With astroctl​

Terminal
astroctl app history hello-world # every version (add -o json or -o yaml)
astroctl app rollback hello-world --dry-run # the plan, nothing applied
astroctl app rollback hello-world # back to the previous successful version, asks to confirm
astroctl app rollback hello-world --to v4 --yes # a chosen version, no prompt
astroctl app resume hello-world # follow the branch again

Add --reason "..." to record an audit reason. The plan's Current is the version History marks current. A newer apply that did not finish is on its own line, Applied: v5 (did not finish deploying), and in appliedVersion in the API. In history -o json, a script matches on each version's state and on rollbackState; the console shows each value's display name.

See astroctl app history, astroctl app rollback and astroctl app resume.

Settings​

Roll backtoVersion

The version to roll back to, such as v4. In the console, the version whose Roll back you select.

Accepts
a version in the application's history that can be rolled back to
Default
the previous successful version
reason

A free-form reason recorded with the rollback for audit.

Default
none

If it's refused​

"This version never finished deploying, so there is nothing to roll back to."
Cause
The version's deploy failed.
Fix
Pick an earlier Successful version.
"This version's deploy did not finish before a newer deploy replaced it, so it cannot be rolled back to."
Cause
The version reads Replaced: a newer deploy started before this one was running.
Fix
Pick another version, or apply this version's specification.
"This version is older than the deploys AstroPulse can still roll back to. Apply the version you want instead."
Cause
The version is outside the range AstroPulse keeps for rollback.
Fix
Apply that version's manifest with astroctl app apply.
"<app> is already at <version>"
Cause
The target is the version running now.
Fix
Nothing to do, or pick another version.
"Application <app> has no version <version>. List its versions with: astroctl app history <app>"
Cause
--to names a version that does not exist.
Fix
Run astroctl app history <app> and pick a listed version.
"This application already has an operation in progress."
Cause
A deploy, rollback or resume is still running.
Fix
Wait for it to finish, then roll back again.
"This version cannot be made rollbackable because a value may contain a secret; use secret references and redeploy."
Cause
The specification you applied contains what may be a secret value. Versions are stored without secrets.
Fix
Replace the value with a secret reference and apply again.
"<version> cannot be deployed again because a value in its specification may be a secret. Apply the specification you want, using secret references"
Cause
The target version's specification may contain a secret value.
Fix
Apply the specification you want with secret references instead of rolling back.
"<app> is not pinned by rollback; nothing to resume."
Cause
The application is not pinned, so it already follows its source.
Fix
Nothing to do.

Next​