Commit Graph

29 Commits

Author SHA1 Message Date
Alex Kavanagh d4d415c859 Ensure that series upgrades ignore percona at focal
When doing a series upgrade from bionic to focal, the percona-cluster
charm needs to be avoided.  This filters the applications for percona if
the target is focal.  Note if percona is placed on the same unit as
something else that needs to be upgraded (bad idea) then it may still
get 'upgraded' and the operation will fail.
2021-11-30 18:50:14 +00:00
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
Alex Kavanagh fbaf48d541 More fixes for series-upgrade (#413) 2020-09-11 16:27:15 +02:00
Alex Kavanagh 66d95d65d7 Fix series-upgrade tests (#406)
A couple of changes here:

 * Ensure that the post-upgrade-hook runs BEFORE the config-changed to
   set the openstack-origin/source back to distro.  The former behaviour
   breaks keystone quite badly.
 * Ensure that the charm name is used, as discovered from the model, for
   rabbitmq-server and percona-cluster to cope with different names for
   the application in the model vs the charm name from the charm-store.
 * Check whether the machine needs to be rebooted after the dist-upgrade
   (before the do-release-upgrade), and reboot the machine first.
   Otherwise, do-release-upgrade will fail.
2020-09-04 13:33:42 +02:00
Alex Kavanagh 5ad5f85f99 Fix the charm-upgrade tests as used by CoT
The biggest change is that the upgrade_groups() is a list of tuples ...
[()] ... rathern than a collections.OrderedDict().  This tends to make
more sense as they are processed in order and don't actually need to be
indexed.

Also excludes easyrsa (as it's not an upgrade target) and adds a
"Database Services" which upgrades mysql or percona FIRST before moving
on to rabbitmq and other stateful services.  This is because some charms
really need to talk to mysql if one of the other stateful services does
a relation changed hook.  This makes it more likely that the system will
ugprade correctly.
2020-08-19 20:47:00 +01:00
Chris MacNaughton c492ecdcac Add functional test that covers Ubuntu Lite in Parallel 2020-04-15 15:54:44 +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
Chris MacNaughton 33fa6e02de Fix typo 2020-04-06 16:13:56 +02:00
Chris MacNaughton d3974c84a3 Fix iterating over applications 2020-04-06 16:12:00 +02:00
Chris MacNaughton 6bf6dcd8e8 fix lint 2020-03-25 15:36:22 +01:00
Chris MacNaughton 71b9d5a6fb lint fixes 2020-03-25 15:26:08 +01:00
Chris MacNaughton a1e5649d12 Refactor if-statement into upgrade config generator 2020-03-25 08:44:41 +01:00
Chris MacNaughton d4ee838d4b some refactoring and updates from review 2020-03-25 08:44:41 +01:00
Chris MacNaughton 0a94b97cf4 update for style bits 2020-03-25 08:44:41 +01:00
Chris MacNaughton 0b92a15da7 raise exceptions in the upgrade process 2020-03-25 08:44:41 +01:00
Chris MacNaughton 8450216f72 Create parallel (async) series upgrade 2020-03-25 08:44:41 +01:00
Chris MacNaughton 93fd631b1a Split up and re-organize upgrade helpers 2020-03-25 08:44:41 +01:00
Liam Young 19fb4c0782 Upgrade complete action for percona.
The Percona charm requires that an action is run once all the units
have performed their series upgrade. Longer term
test_200_run_series_upgrade needs refactoring but this is a
tactical fix in the meantime.
2020-02-10 10:24:10 +00:00
Liam Young 00af513cf4 Skip series upgrade of easyrsa (Bug #1850124) 2020-02-04 12:55:19 +00:00
Liam Young 5927878a03 Tidyup mojo cert unseal 2020-02-04 10:10:50 +00:00
Liam Young 83982a7aec Add unseal function for mojo use.
* Add an unseal function for mojo to use.
* Switch mojo to use new function after series upgrade reboot.
* Add fallback if vip client is unavailable (the case if all
  hacluster units are paused for series upgrade).
2020-02-03 13:39:17 +00:00
Liam Young b79900405b Easyrsa does not support series upgrade so skip it
Easyrsa does not currently support series upgrade so skip it in
the openstack tests until Bug #1850121 is resolved.
2020-02-02 18:38:08 +00:00
Liam Young 7995199136 Run complete-cluster-series-upgrade
After perfomring a series upgrade on rabbitmq run
complete-cluster-series-upgrade
2020-01-09 20:17:19 +00:00
Liam Young 6c15605222 Series upgrade tests run funcs after upgrade.
Execute a list of functions after series upgrade if one is
supplied. This change is driven by the upgrade testing of vault.
Vault needs to be unsealed after it is rebooted.
2019-10-14 10:39:11 +00:00
Liam Young 34a8cc14b8 No origin for designate-bind series upgrade 2019-10-13 09:50:21 +00:00
Liam Young f0d2853aec No origin for designate-bind series upgrade 2019-10-12 07:31:06 +00:00
Chris MacNaughton dd434e281e Add zaza namespacing, starting with openstack 2019-04-25 17:46:03 +02:00