Deployment Strategies
Runway implements multiple Deployment Strategies, which control how quickly and in which order canary revisions are deployed.
Services have different requirements for deployments. For example, a service serving live user traffic may require a slow, region-by-region deployment, while a service in the early stages of development values the short turn-around times of an expedited deployment process. During incident response, an incident responder may need to roll back a service to the last known good configuration quickly.
Available deployment strategies
- regional_rollout: This deployment strategy deploys canary revisions region-by-region sequentially, assigning 5%, 25%, 50%, 75% and finally 100% to the canary revision.
- legacy: This deployment strategy deploys canary revisions globally, i.e. to all regions simultaneously, assigning 25%, 50%, 75%, and finally 100% of traffic to the canary revision. It is the current default strategy.
- expedited: This deployment strategy deploys to 100% of traffic globally in one “big bang” deployment. It is intended for interactive use (e.g. during development) and incident response.
- dryrun: The “dryrun” strategy does not make any changes to the system and is run in a merge request pipeline to preview changes.
Setting a deployment strategy
You can set a deployment strategy in 2 ways:
-
Using the
RUNWAY_DEPLOYMENT_STRATEGY
CI variable. You can either set the variable in the project’s CI settings, or using thevariables
global keyword. -
Configuring
spec.deployment.strategy
inrunway.yml
.This allows you to set different strategies between staging and production environment. For example, you could set
expedited
on staging andregional_rollout
on production.
Setting traffic rollout percentages
Instead of rolling out traffic using the default deployment steps as described in the deployment strategies. You can also configure the rollout percentages in the deployment.traffic_rollout_percentages
in runway.yml
. For example:
Auto rollback
From v3.26.0, Runway automatically rolls back to the stable revision when the new canary revision is experiencing an elevated 5xx error ratio in one of the regions.
The rollback process is described as the following:
- Right after the 25% deployment, Runway sleeps for 5 minutes (configurable by
LEGACY_DEPLOY_MONITOR_DELAY_DURATION_S
variable in your deployment project) to monitor and compare the canary vs stable revision error ratio for each region. - When a region’s new canary revision error ratio is elevated by
50%
continuously for 5 minutes, all regions are rolled back to 100% traffic to the stable revision, - The deployment job fails eventually.
Change Lock
Runway deployments adhere to production change lock process. To learn more, refer to production change lock page.