Skip to content

Akvo Flow deployments

Iván Perdomo edited this page Apr 3, 2020 · 3 revisions

Overview

We're using trunk based development with short-lived feature branches.

Live vs Dark

A deployed version can be live or dark.

A live version is a version that is serving our users when they visit https://<org>.akvoflow.org

A dark version is a deployed version that does not get traffic, unless its accessed via a different URL. A dark URL follows this pattern https://VERSION_ID-dot-SERVICE_ID-dot-PROJECT_ID.REGION_ID.r.appspot.com. Akvo Flow uses only 1 service (default).

More info at: Google App Engine Overview

Git operations

Our CI pipeline follows the following logic in reaction to changes pushed our git repository:

Commits to feature branches

Any commit made to a feature branch gets build and tested. We deploy Akvo Flow core classes to Clojars in order to have them available for testing Flow services.

Merge to master

When a feature branch gets merged to master our CI pipeline:

  • Build and tests
  • Deploy core classes to Clojars
  • Deploy the built version to UAT2 live, accessible via: https://uat2.akvoflow.org

This instance can be used for developer testing integrated with all the rest of changes

Tag a version in master

A tagged version is a candidate version. Similar to other services we're using the tag name scheme YYYYMMDD-HHmmSS (e.g. 20200403-073034).

The CI pipeline do:

  • Build and test
  • Deploy core classes to Clojars
  • Deploy the built version to UAT1 live (accessible via: https://uat1.akvoflow.org)
  • Deploy the built version to all production instances in dark
    • If we want to test a particular bug-fix/feature in a production instance we must use the dark URL pattern

This allow us to do a regression testing in UAT1.

Tag a version in master with name promote-*

When we tag a version with the prefix promote- the CI pipeline:

  • Expects that a versions is already deployed, e.g. promote-20200403-073034 expects that the version 20200403-073034 is already deployed in all instances.
  • Skips
    • Build and test
    • Deploy to Clojars
    • Deploy to UAT instances
  • Migrate the traffic of all production instances to the promoted version

FAQ

What do I need to do if we want to switch back to the previous deployed version?

In order rollback to the previous version, you need to execute the deploy script promoting the previous version, e.g.

[akvo-flow]$ ./scripts/deploy/run.sh promote-<previous-version> all

You can get the list of available versions:

gcloud app versions list --project=akvoflow-uat1

You'll get something output like this:

$ gcloud app versions list --project=akvoflow-uat1
SERVICE  VERSION.ID       TRAFFIC_SPLIT  LAST_DEPLOYED              SERVING_STATUS
default  1                0.00           2020-03-20T14:01:05+01:00  SERVING
default  20200325-143651  0.00           2020-03-25T18:02:23+01:00  SERVING
default  20200402-183144  0.00           2020-04-02T18:37:38+02:00  SERVING
default  20200402-184619  0.00           2020-04-02T18:52:08+02:00  SERVING
default  20200402-191702  0.00           2020-04-02T19:23:05+02:00  SERVING
default  20200403-062203  1.00           2020-04-03T06:27:30+02:00  SERVING
Clone this wiki locally