Skip to content

Akvo Flow deployments

Juan A. Ruz 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 the one 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 it was 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 reaction to changes pushed to our git repository:

Commits to feature branches

Any commit made to a feature branch is built 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 is merged into master branch our CI pipeline will be:

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

This instance can be used for the developer to integration testing with all the rest of the 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 will be:

  • 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 allows 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 will be:

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

FAQ

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

In order to 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