Skip to content

Add provisioner support for ops-gitlab-net deployment pipeline environment

Current state

Provisioner creates deploy projects in https://gitlab.com/gitlab-com/gl-infra/platform/runway/deployments. Each deploy project can run a CI pipeline to deploy Runway services in a specified environment (staging/production).

This runs entirely in gitlab.com. In simple terms, the current deployment flow is: canonical service project pipeline --> canonical deployment project pipeline.

Proposed state

In order to accomplish #230 (closed), the Provisioner needs to support a ops.gitlab.net-only deployment flow of ops service project --> ops deployment project.

Note that ops service project pipeline --> ops deployment project pipeline is a minimal requirement for a deployment. The service owner is responsible for dictating how the ops service project's CI pipeline is triggered (canonical mirror or directly merging/pushing to the ops service project).

Getting there

Considerations

Deployment projects use gitlab-managed terraform states. When enabling deployment in ops for existing Runway workloads, we need to be careful to perform the migration steps

Note: This is not a problem for newly onboarded Runway services since the terraform state is empty.

We need to account for all state transitions:

  1. Workload exists. Canonical -> ops
  2. Workload exists. Ops -> canonical
  3. New workload. Canonical deployment.
  4. New workload. Ops deployment.

No issues: Transition 1 is the what topology service will encounter. Transition 3 and 4 are simple since users start off from a fresh state.

Transition 2 is tricky since that would mean the ops gitlab project should not be removed/archived until the terraform state as been migrated.

Closing summary

This is the high-level overview of the gitlab project setup to deploy from ops.

runway-ops-deployment-architecture

The planned changes to provisioner are completed:

  • Provisioner now creates the ops deployment project and other relevant resources (ops reconciler service account and sets roles).
  • CI jobs have been added to flag environment changes
  • existing scripts to check for workload removals have been updated to be compatible with ops.

The migration procedure is detailed in #325 (closed) and can be found in docs once #363 (closed) concludes.

Edited by Sylvester Chin