Learning paths / Deploy on ComputeSphere / The deployment lifecycle

Deploy history and rollback

Reading · 6 min · Module 7, lesson 4 of 636 min left in this module

Module 7 · The deployment lifecycleLesson 4 of 6

Goal: Find an earlier version of a service and roll back to it from the console or the CLI, knowing what a rollback restores and what it leaves alone.

Key idea

Every deploy records a version of your service. Rolling back puts an earlier version back in front of your users, so you can fix a bad release without doing it under pressure.

Versions

A version (v1, v2, v3…) is a snapshot of one release: the image plus the service's settings at that moment. It also records how the rollout went: Running if it went live, Failed if it didn't.

A new version is recorded every time a change rolls out: when the service is created, a deploy with csph deploy (even the same image again) or a build, Save & redeploy of variables or settings, or a scaling change that redeploys.

Restart, stop, start and Save only don't record one. A change you save without rolling it out is captured in the next version.

One version is marked current: the one most recently put in place. After a failed deploy, the failed version is current, even though the version before it is still serving (lesson 5.7.2). That's the moment to roll back.

What a rollback does

Rolling back redeploys the service from an earlier version's snapshot and marks that version current. It doesn't record a new version.

Rollback restores, from that versionRollback keeps, as it is now
The image, build and start commandsVariables and secrets
Port and health checkThe spherelet count and autoscaling settings
The URL and custom domains

Variables and secrets stay as they are now. A secret you rotated after that version stays rotated.

A rollback is refused while the service is mid-action (Deploying, Redeploying, Restarting, Stopping or Starting). Wait for it to finish or fail.

Check yourself

You scaled to 4 spherelets, then shipped v5, which failed. You roll back to v4. How many spherelets run?

Roll back

Open the service, choose ⋯ in its header, then Roll back. The dialog lists your versions, newest first:

Roll back hello-web
Select a version to restore:
  v3   27/09/2026, 14:02    current   (dimmed)
● v2   27/09/2026, 13:40
○ v1   27/09/2026, 13:15

The current version is dimmed. Below it are the last five versions you can restore, with the most recent selected, and Show older versions lists more. Failed versions aren't offered.

Pick one and choose Roll back to v2 (the button names your pick).

The service redeploys from that version and returns to Running when it's healthy.

Roll back first, investigate second

  1. Roll back to the last version that was Running.
  2. Confirm the service is Running and answering.
  3. Investigate the failed version's deploy log and runtime log, with no users waiting.
  4. Ship the fix as a new deploy, which records a new version.
API routes, and rollback with automatic deploys

Through the API, GET /deployments/{id}/versions lists a service's versions with their status, GET /deployments/{id}/versions/current returns the current one, and POST /deployments/{id}/rollback with {"deployment_id": "<version-id>"} rolls back.

A rollback pauses automatic deploys: the Deploy card in the service's Settings shows the pause. When your fix is ready, choose Resume auto-deploy, then push again or choose Redeploy → Build & deploy.

In the docs