akvo / akvo-flow

A data collection and monitoring tool that works anywhere.
http://akvo.org/products/akvoflow/
GNU Affero General Public License v3.0
65 stars 31 forks source link

Speed up deployments (part 2) #3479

Closed muloem closed 4 years ago

muloem commented 4 years ago

Context

We have previously done some work to speed up deployments (https://github.com/akvo/akvo-flow/issues/2562) by using the GAE admin API. However, we had to revert it due the inability to set the correct scaling model for background instances. We have since phased out background instances therefore would like to reconsider the approach to fast deployments.

Problem or idea

We have to deploy to 100s of instances and this takes a long time and is scalable. We currently do push based deployments, i.e. code is deployed from a machine out to the instances. In the past we implemented pull based to speed up deployments and would like to look at this approach again.

Solution or next step

How could we solve it?

iperdomo commented 4 years ago

After some test and more thinking I think we're going back to deploy via gcloud app deploy and a new strategy for deploying when tagging.

Problems with GAE Admin API

While is really appealing to issue a POST request with a JSON payload for a new version, is not clear that with that request we can deploy changes to: Tasks, Indexes and Cron definitions. The current documentation of the GAE Admin API doesn't describe how to deploy changes to those other objects.

Inspecting gcloud's HTTP calls

gcloud has a flag to log all the HTTP requests issued during a process. After checking the result of this there are requests to other services like an internal Datastore API for configuring indexes, CloudTasks, etc.

After checking this it's clear that our interface to deployment must be gcloud app deploy and stop trying to fiddle with the internal details.

New strategy

Deploy in parallel