Skip to content

Akvo Flow deployments

Dan Lebrero edited this page May 25, 2020 · 3 revisions

Overview

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

  1. Any master build is a candidate build.
  2. We test master in UAT2.
  3. We promote UAT2 to UAT1 and dark production.
  4. Final test in UAT1.
  5. Flip production traffic to UAT1 version.

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

Promote binaries to UAT1 and production

When we are happy with the code running in UAT2, we will promote the build to UAT1 and dark instances of production. Note that we just deploy whatever is running in UAT2.

For this:

  1. Make sure that your local git is up to date with latest master version.
  2. Run the ./ci/promote-test-to-prod.sh and follow the instructions.

The CI pipeline will be:

  • Skip
    • Build and test
    • Deployment to Clojars
  • Deploy the UAT2 version to UAT1 live (accessible via: https://uat1.akvoflow.org)
  • Deploy the UAT2 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, and testing in dark production instances if required.

Make new version live to all users

Once we are happy with UAT1, we will make the new version available to all partners.

For this:

  1. Make sure that your local git is up to date with latest master version.
  2. Run the ./ci/flip-production-traffic.sh and follow the instructions.

You will be asked what version to flip the traffic to, defaulting to the version running in UAT1.

The CI pipeline will be:

  • Skip
    • Build and test
    • Deployment to Clojars
    • Deployment to UAT instances
  • Migrate the traffic of all production instances to the UAT1 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 ./ci/flip-production-traffic.sh script and pick up the version that you want to revert to.

Clone this wiki locally