ON-PREM CHOREO CLOUD BOTH

What you will learn

  • Say when a hotfix is the right tool and when a promotion is
  • Say in which repository an Agent Manager code fix is made, and which commit it starts from
  • Follow a hotfix from the first commit to the backport and say who acts at each step
  • Name the ways a hotfix goes wrong and how you would notice

Before you start

On this page

Sometimes a bug is hurting customers and its fix should reach them without moving anything else. A moves one fix onto exactly what an environment already runs.

Hotfix or promotion

A promotion moves the whole state of an environment to a tested commit. A hotfix adds one fix to the commit an environment runs today. Two rules frame every hotfix.

  • Stage before production. A hotfix must be deployed and verified on stage before production. Applying it directly to production is forbidden unless the Senior Leadership Team approves it in an emergency.
  • The fix must reach main too. After the hotfix is verified, the developer must put the change on main. Otherwise the next full release can overwrite it.

In which repository is the fix made?

The team’s rule is simple. The fix is made in the repository where the broken code lives.

  • For an Agent Manager code fix, that is the agent platform repository. The base commit is the source commit that the environment runs, which you read from the image tag. You cherry-pick the fix there and cut the tag there, and the tag builds the image.
  • For a change to the deployment files, it is the deployment repository. The base is the pin in base.yaml. A tag there builds no image. The SRE team applies the tag and its commit.

This is how the team works. The deployment repository’s own README describes the second case: read the pinned commit, create a branch at it, change the files, tag, push the tag, ask the SRE team to apply it and put the change on main.

The steps

  1. Find the commit the environment runs

    Stage and production environments follow one commit of the deployment repository, written on line 19 of the control plane base.yaml on the environment’s own branch. Dev has no commit to read, because it follows main. Stage-v2, prod-v2 and prod-v2-eu name only a commit. Stage and prod also name the hotfix-manifests branch that holds it.

  2. Read which agent platform commit that is

    At that commit, the Agent Manager service’s workload file names an image tag. A normal tag, main-<commit>, ends in a commit of the agent platform repository. If the environment already runs a hotfix, the tag is a vhotfix tag instead, and you resolve it in the agent platform repository. No file says in words that this is how you find the source commit. It joins two files.

  3. Branch from that commit and cherry-pick the fix

    Start a local branch at the source commit in the repository you are fixing. only the commit or commits that make up the fix. Your branch is then the environment’s state plus the fix, and nothing else from main.

  4. Cut the tag and push it

    The tag is vhotfix-<YYYYMMDD>-<n>: the word vhotfix, today’s date as eight digits, a dash and a number. Use 1 for the first tag of the day, and the next free number if the date already has one. Check the tags that exist first, because the count is kept in each repository separately. Pushing the tag to the agent platform repository starts the build.

  5. The build system builds and scans the images

    A webhook reaches the CI/CD system, and a sensor that only looks at the tag name starts a run of autobuild-hotfix-image. It clones the source at the tag, runs change detection, builds each component that detection selects, scans it and pushes it as system/<name>:<tag>. Last, a chat card lists the images and says a platform engineer can now trigger the manual deployment. What detection selects is decided by a script that is not readable in the files, so do not assume that all six images are built.

  6. Create a CR and hand it to the SRE team

    Nothing on stage or production is changed directly. You create a (change request) and hand it to the SRE team. Put the full image references from the chat card in it, the environments you want, the implementation plan, the test plan and the monitoring checks answer.

  7. The SRE team runs the hotfix workflow on stage first

    They trigger manual-deploy-hotfix with the target environment and the image references. The README describes what it does: it starts from the commit that environment runs today, writes the new image tags into the component files, regenerates the releases, updates the release bindings, pushes a hotfix-manifests-<tag> branch and opens a pull request against the environment branch that moves the pin.

  8. QA and a Platform Engineer approve, and the pin moves

    The README says a QA representative and a Platform Engineer must both approve the pull request. After the merge, Flux in each cluster pulls the new pin.

  9. The SRE team checks the release status

    The release status dashboard shows the applied revision of every part, for cloud-cp, cloud-dp-oc-cp, cloud-dp-oc-ci and cloud-dp-oc-ob. All parts must be green and show the intended revision. The dashboard does not show the OpenChoreo release bindings, and no file describes reading the image of a running pod. The dashboard and the workload file at the new pin are the written checks.

  10. Production, then the backport

    After stage is verified, the README’s rule lets the same images go to production through a CR for the production environments. The runbook lists prod, prod-v2 and prod-v2-eu as targets, and the CR form allows several environments, while the workflow takes one target for each run. No file says whether stage-v2 plays the part of stage for prod-v2 and prod-v2-eu, so ask the SRE team which environment must be verified first. Last, the developer puts the fix on main.

Where it goes wrong

  • Branching from the tip of main. Everything merged since the environment’s commit comes along, including changes nobody tested on stage.
  • A tag that already exists. The README says image tags are immutable and the build fails. Take the next number. Do not move the old tag.
  • A tag pushed to the wrong repository. On the deployment repository the run starts but skips every build step, so no image and no chat card appear.
  • A bot comment taken for a rollout. It says the pin moved. The sensor that writes it lists stage, prod and stage-v2 only. The dashboard is the check.
  • A database change. On Choreo Cloud the Agent Manager service does not migrate its database at startup, because its workload starts without the migrate flag. The SRE team has a runbook for running the image once with the migrate option, written for new or rebuilt databases. The files do not describe it for a hotfix, so ask the SRE team how they want a migration run.
  • The release binding. What runs is the image in the release that the binding’s releaseName names, not what the workload file says.
  • Two runs at once. Promotions and hotfix deploys share one lock, so the second run waits for the first.

Your turn

Open Try it, the Release Pipeline Player for this hotfix. Press Play and watch the fix move from the author to the build system, the SRE team, the pin and the clusters. Open the checkpoints and notice which steps rest on the team’s own process and which are readable in the files. Then do the next lesson, where you decide each step yourself.

Recap

  • A hotfix adds one fix to exactly what an environment runs. A promotion moves the whole state.
  • The fix is made in the repository where the broken code lives. For an Agent Manager code fix that is the agent platform repository, with the source commit from the image tag as the base.
  • A pushed vhotfix-<date>-<n> tag builds the image, and a CR hands the image to the SRE team, who apply it on stage first.
  • QA and a Platform Engineer approve the pull request that moves the pin. The dashboard shows whether Flux applied it.
  • After stage, production follows through a CR. Then the fix goes on main.

Try it

Follow a change to production

What to do: press Play, or use Step, to move the change along the lanes. Watch the checkpoints and the pin.

Loading the release pipeline...

Wrap up

Recap

Tick each one when you could explain it to a colleague.

Finished?

Quick check

Loading the quick check...

Spotted something wrong or unclear in this lesson? Report an inaccuracy (opens GitHub in a new tab)