diff --git a/gocd/templates/bash/deploy-py.sh b/gocd/templates/bash/deploy-py.sh index 0cab90eeac..081aeda6a3 100644 --- a/gocd/templates/bash/deploy-py.sh +++ b/gocd/templates/bash/deploy-py.sh @@ -9,7 +9,6 @@ IMAGE_TAG="${GO_REVISION_SNUBA_REPO}" --label-selector="${LABEL_SELECTOR}" \ --image="us-docker.pkg.dev/sentryio/snuba-mr/image:${IMAGE_TAG}" \ --container-name="snuba" \ - --container-name="api" \ --container-name="dlq-consumer" \ --container-name="eap-items-subscriptions-executor" \ --container-name="eap-items-subscriptions-scheduler" \ @@ -46,4 +45,9 @@ IMAGE_TAG="${GO_REVISION_SNUBA_REPO}" --image="us-docker.pkg.dev/sentryio/snuba-mr/image:${IMAGE_TAG}" \ --type="cronjob" \ --container-name="optimize" \ - --container-name="cleanup" + --container-name="cleanup" \ +&& k8s-deploy \ + --label-selector="${LABEL_SELECTOR}" \ + --image="us-docker.pkg.dev/sentryio/snuba-mr/image:${IMAGE_TAG}" \ + --type="${SNUBA_API_DEPLOY_TYPE:-deployment}" \ + --container-name="api" diff --git a/gocd/templates/pipelines/snuba.libsonnet b/gocd/templates/pipelines/snuba.libsonnet index 57d3a1d3ae..cd8a9bca54 100644 --- a/gocd/templates/pipelines/snuba.libsonnet +++ b/gocd/templates/pipelines/snuba.libsonnet @@ -40,6 +40,12 @@ local migrate_stage(stage_name, region) = [ }, ]; +// Regions where snuba-api is an Argo Rollout and k8s-deploy should track the +// Rollout instead of the (scaled to zero) Deployment it references. +local api_rollout_regions = ['s4s2']; + +local is_api_rollout(region) = std.member(api_rollout_regions, region); + local saas_datadog_monitor_ids = { us: '311884335 311884334', de: '311884404 311884405', @@ -215,10 +221,13 @@ function(region) { ], }, 'deploy-primary': { - timeout: 1200, + // Argo Rollout canary steps and analyses take longer than a + // plain rolling update. + timeout: if is_api_rollout(region) then 2400 else 1200, elastic_profile_id: 'snuba', environment_variables: { LABEL_SELECTOR: 'service=snuba', + [if is_api_rollout(region) then 'SNUBA_API_DEPLOY_TYPE' else null]: 'rollout', }, tasks: [ gocdtasks.script(importstr '../bash/deploy-py.sh'),