Skip to main content
An upgrade applies the files of a newer build, by the method you installed with, and keeps what is yours: your values.yaml or your .env, and your Secrets. Every build has new files, since they name its images by digest: there is no upgrade of the images alone, and the engine, Command Center, the executor images the engine starts and the permissions they need always move together. The commands use your namespace in $NS on Kubernetes, and your stack name in $STACK on Docker Swarm (ai-2501, or the CLI’s for an installation moved from it). Each Release says until when its version is supported, 3 months after its release. Fixes go into the newest version only: upgrade before that date.

Before you start

  1. Read the Upgrade actions. The release notes of each release list, under Upgrade actions, what changed in what you apply, such as a permission, a new required secret or value, or a change that interrupts running tasks. Read them for every release you cross, not only the last one.
  2. Back up the database, schema and data. Restoring this backup is what makes going back possible. The commands take the role and database from $U and $DB: 2501 and 2501, the CLI’s, which the chart keeps on Kubernetes; on Docker Swarm, your database.user and database.name (2501 by default, postgres and 2501 for an installation moved from the CLI).
    Keep automated backups for disaster recovery too, not only one dump before an upgrade.
  3. Download and verify the new build’s files from its Release on github.com/2501-ai/install, as for the install: see Verify the installation files. On Kubernetes and OpenShift, https://github.com/2501-ai/install/releases/latest/download/2501.tgz is always the newest build’s chart; helm show chart 2501.tgz prints its build, and the commands below take it in place of 2501-<build>.tgz. If you copy the images into your registry, copy the new ones first.

Agent engines that inherit

In this release, the migration moves each agent engine that equals its default model to Default. The migration runs before the new engine and Command Center start. Until they replace the old ones, a task that starts can fail at setup with an engine error.
  • Upgrade in a maintenance window. Pause the job schedules and the gateways, keep them paused until the upgrade ends, and start no task by hand.
  • After the upgrade, run again each task that failed at setup during the upgrade. No data is lost.
  • To go back, follow Go back: the backup holds the engines as they were. To go back without that restore, first send each inheriting engine as its model with pin_engines: true, through POST /api/v1/agents/{id}.
No agent changes the models it runs with. The migration also sets the default models that agents follow, when none exist yet:
  • A tenant without default models gets the main and secondary engines that its active agents use most, among the enabled text models of providers that every organization can use. With no such pair, it gets its oldest such model for both engines. A tenant that already has default models keeps them.
  • A managed service provider tenant, where every provider belongs to an organization, gets no default models. Each of its organizations without defaults gets the pair its own active agents use most, else its oldest usable model. An organization with no usable model gets none, and its pages ask an Admin to set them.
  • Archived agents keep their models.

Review the change

Look at everything the new build changes before you apply it, permissions included:

Apply

With the new build’s files, run the same commands as for the install:
  • kubectl or oc: render the new 2501-<build>.tgz with the same values.yaml, then the same kubectl apply --prune of the result, as in Apply. If the Upgrade actions name a new value, add it to your values.yaml first: the render refuses one without it. Your Secrets stay as they are, and the diff shows only what the build changes.
  • Helm: helm upgrade --install with the new 2501-<build>.tgz and the same values.yaml, as in With Helm or ArgoCD.
  • ArgoCD: replace the unpacked chart in your Git repository with the new one (rm -rf <path>/2501 && tar -xzf 2501-<build>.tgz -C <path>), commit, and sync.
  • Docker Swarm: add any new variable to your .env and create any new secret, then the same docker stack deploy --with-registry-auth --prune with the new compose.yaml.
The engine stops before the new one starts, so tasks in flight get up to 110 seconds to finish and new tasks wait until it is back. Command Center keeps serving until its new version is ready. Then check the installation as after an install: Kubernetes or Docker Swarm.
On Kubernetes, the chart marks the engine pod so the cluster autoscaler never evicts it: the node that runs it is not scaled down. A manual node drain still evicts it and interrupts the tasks in flight, so drain that node only when no task is running.

Go back

If the new build misbehaves, go back to the last one that worked, with the data that went with it:
  1. Stop the engine, Command Center and the bootstrap of the new build (with ArgoCD, turn off automated sync first, or it starts them again), which retries its migrations, and wait until their pods or containers are gone, so nothing writes to the database while it is restored. scale returns at once, and the engine gives running tasks up to 110 seconds. The wait fails after five minutes; do not go on until it succeeds.
    On Docker Swarm, the next deploy creates the bootstrap again. Run gone on every node:
  2. Restore the backup into an empty database. The names are quoted: 2501 is not a valid name without quotes. template0 keeps the new database from inheriting template1’s collation version, which a newer PostgreSQL image refuses to copy. For the PostgreSQL 2501 provides on Kubernetes:
    On Docker Swarm, on the node labelled 2501-data:
    For your own database, recreate it empty and run pg_restore -d "$DIRECT_URL" --exit-on-error 2501-preupgrade.dump.
  3. Apply the previous build by the method you use: its chart, from its Release, with the values.yaml you ran it with (from your Git history), or its Swarm files. A Release never changes, so they are still there. With ArgoCD, revert the commit that brought in the new chart.
  4. If the two builds run different PostgreSQL images, PostgreSQL warns of a “collation version mismatch”: rebuild the indexes, as in step 4 of Move from the CLI.
  5. Check the installation before handing it back to users, and tell 2501 what went wrong, with the details you still have.
A restore rewinds the data to the moment of the backup. Always restore it when you go back: an upgrade can change the database in a way the previous build cannot read, and the previous engine then fails every task. On Docker Swarm, an engine that fails to start after an update is rolled back to the previous image on its own, which puts the previous engine on the upgraded database: restore the backup then too.