- 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
baseline
branch. - Run
./build.sh
to 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-versioning
branch. - Note the changes to
deploy.sh
that uses Rainbow deployment strategy now. - Note the new steps:
promote.sh
anddecommission.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.go
to pass DeploymentOptions and Versioning Behaviors.
- Unversioned workers are running.
- Only worker config is changed to enable Versioning but no other code changes.
- Run
build.sh
followed 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
Inactive
state. - The Current Version is still
__unversioned__
. - Run
promote.sh
to 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-credit
branch. - 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
Draining
andDrained
status. - Once
Drained
, the decommission script should kill the workers.
- Switch to
bad-build
branch. - Run
cicd.sh
to 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-build
branch. - Build and deploy, but not promote the patched version.
- Run
move-pinned.sh
to 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.sh
to use it everywhere. - Run
decommission.sh
to decommission both the bad and old Versions.
- Switch to
acceptance-test
branch. - Note the added "Step 0" in
promote.sh
that runs theAcceptanceTest
workflow on the new Version before starting to ramp. - Build, deploy and promote and notice that now the acceptance tests are being executed.