- Install and run Docker. We'll use
docker compose. - Run dev server in a separate terminal using Temporal CLI:
temporal server start-dev \ --dynamic-config-value frontend.workerVersioningWorkflowAPIs=true \ --dynamic-config-value system.enableDeploymentVersions=true \ --dynamic-config-value 'matching.wv.VersionDrainageStatusVisibilityGracePeriod="30s"' \ --dynamic-config-value 'matching.wv.VersionDrainageStatusRefreshInterval="5s"'
- Run load-gen in a separate terminal:
cd app; go run load-gen/load-gen.go
- Switch to
baselinebranch. - Run
./build.shto build the code. - Run
./deploy.sh <build id>to deploy the code in place (no Rainbow deployments). - Go to UI and ensure workflows are running.
- Note the workflows: one short running (Charge), one long-lived (Shipment).
- Switch to
use-versioningbranch. - Note the changes to
deploy.shthat uses Rainbow deployment strategy now. - Note the new steps:
promote.shanddecommission.sh.
- Now that the deployment system is ready we can enable Versioning in the workers.
- Note that now we pass Deployment Version to the deployed worker via and env var in
docker-compose.yaml. - Note the changes made in
main.goto pass DeploymentOptions and Versioning Behaviors.
- Unversioned workers are running.
- Only worker config is changed to enable Versioning but no other code changes.
- Run
build.shfollowed bydeploy.sh. - Now both unversioned and versioned workers should be running. Can see using
docker-compose ls. - In the UI, we now see a Worker Deployment. And a Worker Deployment Version in
Inactivestate. - The Current Version is still
__unversioned__. - Run
promote.shto set the Current Version. - Now workflows should start getting values in their Versioning Behavior and Deployment Version columns.
- All workflow should continue smoothly.
- You can decommission the unversioned workers immediately. No need to wait for any "drainage".
- Switch to
spend-creditbranch. - Notice the new activity added in the Charge workflow without Patching.
- Run the full build, deploy, promote, decommission process.
- Notice that the promote step now has a ramp step that checks the following at a 10% ramp:
- At least one wf succeeded in the new build.
- No errors are logged by the workers.
- Once the new Version is promoted, notice the old Version going through
DrainingandDrainedstatus. - Once
Drained, the decommission script should kill the workers.
- Switch to
bad-buildbranch. - Run
cicd.shto do the f. - Notice the ramp verification fails for errors. And the ramp is cancelled.
- There are some pinned workflows on the new Version.
- We don't want to reset them because we don't want them to lose their state.
- How can we roll forward?
- Switch to
fixed-buildbranch. - Build and deploy, but not promote the patched version.
- Run
move-pinned.shto move the stuck workflows to the fixed Version. - Verify that the stuck workflow is completed now and the bad Version is Drained.
- Now that the patch is confirmed on the broken workflows, run
promote.shto use it everywhere. - Run
decommission.shto decommission both the bad and old Versions.
- Switch to
acceptance-testbranch. - Note the added "Step 0" in
promote.shthat runs theAcceptanceTestworkflow on the new Version before starting to ramp. - Build, deploy and promote and notice that now the acceptance tests are being executed.