Commit Graph

18 Commits

Author SHA1 Message Date
Alex Kavanagh 7ced54b382 Concurrent series upgrade updates (#466)
* Updates to concurrent series upgrade

Updates to make it run more in parallel and spend less time waiting on
the whole model when updating machines.

* Make the concurrent series upgrade tests work

This is a number of changes to get the concurrent (here called
'parallel' historically) series upgrade tests to work.  A number of
changes were required which included limiting the number of concurrent
async co-routines (futures) that could be run as with large models it
hits the limits of the Py3 runtime.

* Fix the tests and change pause order in maybe_pause_things

Due to an additional model helper call, an additional model AsyncMock is
required.  Also the pause order had changed, and this is restored to
ensure the original design is retained (for pause order).

Clean up some commented out code and sort out a few PEP8 errors.

* Update comment to reflect code (3 -> 4)

* Fix tests that fail on bionic but pass on focal

Essentially, asyncio.gather has different behaviour on bionic that
focal.  Although this doesn't affect testing, it does affect the unit
tests.  These changes are simply to normalise the behaviour of unit
tests on focal and bionic.
2020-12-02 11:22:00 +01:00
Chris MacNaughton a8a25b2134 Handle leader prepare step before non-leaders 2020-05-11 10:03:36 +02:00
Chris MacNaughton 9cec2efabe Actually pass to and from series into upgrade 2020-04-20 11:47:12 +02:00
Chris MacNaughton 28e1ce2d3f Add check to include subordinates for idleness
Depends-On: https://github.com/openstack-charmers/zaza/pull/346
2020-04-17 16:50:57 +02:00
Chris MacNaughton f49259e426 Set some apt config to accept package defaults
Because the OpenStack charms re-render their config
whenever things are incorrect, we can accept any new
package defaults as a part of the upgrade and
resolve incorrect config after the upgrade
2020-04-17 13:45:47 +02:00
Chris MacNaughton de028d7eb2 fix copy-pasta error 2020-04-16 11:58:54 +02:00
Chris MacNaughton 2bc2234cad Update to migrate bits out to Zaza 2020-04-16 11:53:35 +02:00
Chris MacNaughton fa4587f366 Ensure that origin is set only after the first machine is rebooting 2020-04-15 16:38:42 +02:00
Chris MacNaughton 592622935c tidy up and add more debugability 2020-04-15 10:06:41 +02:00
Chris MacNaughton 6c70ee5171 The units in an application need to be idle before we try to series-upgrade them 2020-04-14 12:42:18 +02:00
Chris MacNaughton 27e5f7d8bc We must have async functions for the before/after callables 2020-04-10 16:51:41 +02:00
Chris MacNaughton a7df42a9df According to the series upgrade doc, source should update early 2020-04-10 16:27:03 +02:00
Chris MacNaughton 74652f2523 Add unit test coverage for series upgrades
This also includes some tidying
2020-04-10 10:50:43 +02:00
Chris MacNaughton 9cd4b32aa3 Remove leftover development comments, useless function 2020-04-10 10:50:43 +02:00
Chris MacNaughton 392470e946 Cleanup based on feedback
This change removes some redundant checking at setup
time and splits the long parameter lists into one
argument per line lists
2020-04-10 10:50:43 +02:00
Chris MacNaughton 2a98274d67 Add a few more function hooks to the series upgrade process
By including pre and pos-application functions, charm
series upgrades can be handled in a more generic way,
even when they require running additional actions
before a unit is upgraded, or after the whole application
is upgraded.
2020-04-10 10:50:43 +02:00
Chris MacNaughton 186708e883 Change upgrade process to handle each machine fully
Updating each machine in a fully self-contained way makes
it easy to add per-machine and (possibly) per-application
post-upgrade function calls. This still performs the actual
series upgrades fully in parallel but will, for example,
start the do-release-upgrade on one unit while another is
still performing the initial dist-upgrade
2020-04-10 10:50:43 +02:00
Chris MacNaughton cf1ea4c71b First pass at batched parallel series upgrade 2020-04-10 10:50:43 +02:00