48 Commits

Author SHA1 Message Date
Antony Messerli
aa26271ee5 Allow for Swift Leap Upgrade to be skipped
An operator might want to ensure Swift is available during
an upgrade and manually upgrade Swift on completion of the
maintenance.

The operator would need to set these vars before operation:

   export SKIP_SWIFT_UPGRADE=yes
   export CONTAINERS_TO_DESTROY=add_!swift_all_exclusion

This would prevent the swift containers from being torn
down during the upgrade and would skip all Swift upgrade
operations.

Change-Id: Ibf40499750751dd9f41e447b7b90bb77f592cc14
2018-08-15 10:58:48 -05:00
Antony Messerli
e5d39f460e Use setuptools==33.1.1 in leap upgrade-requirements.txt
Avoids using setuptools 34.x as using it can hit this bug
when packages are being upgraded:

https://github.com/pypa/setuptools/issues/951

Pinning to setuptools==33.1.1 also aligns to the
global-requirement-pins.txt in newton-eol

Change-Id: Ib33b828751c5a36d61448d148c5941beb6827c73
2018-07-06 09:25:05 -05:00
zhulingjie
4f734efd16 Remove the duplicated word
Change-Id: Ib213eb887df7d914271d3a60c6a9d8a37a830302
2018-06-12 12:24:10 -04:00
Zuul
9b3a190581 Merge "Update Newton release to newton-eol in leap-upgrades" 2018-06-20 15:12:02 +00:00
Antony Messerli
027ee66b28 Update Newton release to newton-eol in leap-upgrades
Bumps NEWTON_RELEASE to newton-eol tag

Change-Id: I38639f678ec54627f908abb88e0297ad53560ecd
2018-06-19 19:10:59 -05:00
Antony Messerli
851d22e4d5 Adds support for leaping from Mitaka
Adds a few tweaks to get Mitaka to function as a
leapfrog source.

- Adds Mitaka as option
- Adjusts detection to include eol branches
- Creates file if user_variables.yml doesn't exist
- Checks if osa_secrets_file_name exists

Change-Id: Id0bce1441456bc545deca67710004b750901e81b
2018-06-14 14:05:48 -05:00
Zuul
052bdbf672 Merge "On failure return output of all tasks to be reran" 2018-01-24 05:34:26 +00:00
Antony Messerli
f5e74f065f Remove BOOTSTRAP_ANSIBLE_FOLDER variable
Removes the BOOTSTRAP_ANSIBLE_FOLDER variable because
the assumption was made that Ansible would always be
bootstrapped from /opt/openstack-ansible and setting
this would cause a noop when Ansible was bootstrapped.

Change-Id: I284ad62b6f14cc334ae949946e839a1e8ec6a1d8
2018-01-22 17:42:15 -06:00
Antony Messerli
c8107e781b On failure return output of all tasks to be reran
Appears that the last task in the list was being
stripped off of the output.

Change-Id: Ifade924961855ac22452e80149916027af068b06
2018-01-22 13:39:39 -06:00
Antony Messerli
e67f805f35 Link the current deployed release on a leapfrog
Existing code assumes starting point of KILO_RELEASE.
This change allows other releases to be the starting
point before the migrations occur.

Change-Id: Idb7d2981b37e653c9e92a9e41e4bf54b17aef1f5
2017-12-14 14:36:32 -06:00
Marc Gariepy
c753f86d17 Ignore comments in openstack_user_config
Ignore comments in the config file to get the right host.

Change-Id: I68b444a4fe1f180c9146b6b1df743de072615861
2017-12-01 09:23:23 -05:00
Marc Gariepy
2ccc760da8 Validate the target directory exists before linking.
If you run the script manually and export the target release to another tag, it
might generate a broken link, this ensure the target exists.

Change-Id: Ia18bd7796f5f48c42ad9c23e917ddb37aa8103b3
2017-11-29 14:06:22 +00:00
Zuul
b4f3e676f7 Merge "Specify containers to destroy" 2017-11-14 20:25:37 +00:00
Antony Messerli
4538a7e083 Specify containers to destroy
Allows the operator to specify the containers to destroy
or exclude.

Change-Id: If1b72fd8bdf790184579130aa4b44221b339a41f
2017-11-13 19:04:42 -06:00
Antony Messerli
71fd2f6b7f Prevent deploying old code once leaped
Previously the operator could choose to leap from old
code once the code to leap to had been deployed. This
would cause things to break as it would attempt to
run the older version code on top of the newly deployed
leaped code.

This identifies those conditions, alerts the operator
and calls the resume_incompete_leap instead of asking
the operator to input the release to upgrade from
again.

Change-Id: I928bf7e6db88d46617af800692e9b76a6bcc1ba8
2017-11-03 11:42:47 -05:00
Kevin Carter
e7ea3b56c6 Add option to set FROM code and fix logic bug
The leap tooling was attempting to run `set_upgrade_vars` at point where
specific upgrade variables were already needed. Within this change that
function call is moved up a few lines so that it has the chance to set
the required values. Additionally the option to pre-define the variable
CODE_UPGRADE_FROM has been added giving the deployer the option to set
this variable before a leap upgrade is run.

Change-Id: I2c780eb46dd57e680fc8681824de2fe913824fd9
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-10-11 14:15:56 +00:00
Antony Messerli
e2592e4d06 Allow for Leapfrogs from other Releases
Leapfrogs currently only work with Juno/Kilo
releases as certain parts are hard coded.

This patch adds support for handling
multiple releases and attempts to remove some
duplicate code with loops.

Also adds a UPGRADES_TO_TODOLIST variable check on
migration.sh and upgrade.sh to ensure the list of
releases to be ugpraded to are set if the commands
are ran individually.

Change-Id: Ia56f073863533d4b6fa58b78b59b5086c7f9a331
2017-09-27 14:11:42 -05:00
Jenkins
8a9d9ed96a Merge "Echo warning to export TODOLIST var." 2017-09-22 10:19:59 +00:00
Antony Messerli
16e5db982c Adjust logic to allow for redeploy retry on failure
Previously if a redeploy failed during the process, if
you attempted to start it over, it would reprompt for the
version you were attempting to upgrade.  At this point in
process, you are already on the latest version of the code,
so putting the original code version would actually break
the leap.  This attempts to detect if a redeploy started
but didn't complete and asks the user if they would like
to reattempt the redeploy.

Change-Id: I7c2f734edc4ec3186be3d24a60ee41b43269d07b
2017-09-15 10:13:34 -05:00
Marc Gariepy
100b38128a Echo warning to export TODOLIST var.
In case the scripts are run independently and not via run-stages.sh
some vars are not set for script execution and the deployer need to
export a new env var.

Change-Id: I4f24478d92563f5c00fefce269120f1b908aedcd
2017-09-14 13:39:44 -04:00
Jean-Philippe Evrard
b77287b87f redeploy should be done in the proper folder
run_ansible wrapper should work in the latest checkout of OA,
which should be in a REDEPLOY folder instead of just
a static "/opt/openstack-ansible"

Change-Id: I4d20fd7480f2f38e55d3f081c0c0f11726458583
2017-08-30 13:59:30 +00:00
Jenkins
f6aee32287 Merge "Allow overrides of bootstrap ansible script" 2017-08-30 13:40:51 +00:00
Jean-Philippe Evrard
a476a4037f Allow overrides of bootstrap ansible script
Some providers may have a different bootstrapping script,
and probably want to use their own instead of always
bootstrapping the OSA one for the leap.

We should be able to give a script as env var, and use
that script for installing an ansible that works for leapfrog.

Change-Id: I034d3dace52ae092e04d4573c6299b464153084d
2017-08-30 11:28:11 +00:00
Matthew Thode
6388d8f3ef
Fix venv build in when mariadb is installed
Previous change forgot to remove the NOT, this fixes that.  We should
install libmariadbclient-dev if libmariadbclient is detected, not
libmysqlclient-dev.

Change-Id: Id261a2b0d3574ed8995c969320000a742e60f4da
2017-08-29 18:45:39 -05:00
Matthew Thode
fb887e3c79 allow libmariadbclient-dev to be installed
if mariadb is detected, install libmariadbclient-dev
otherwise, install libmysqlclient-dev

Change-Id: I9876e759deb0a235a5c98cc134caeae7593b6835
2017-08-29 13:54:22 +00:00
Jean-Philippe Evrard
202e603864 Don't reinstall all pins
Bootstrap ansible should already do the needful, and we
shouldn't help him bootstrap, because we already did
pre-flight checks that are technically sufficient for it to
run.

Change-Id: I910eb4f0bd4d3eeef52885fcf30aa865634fb105
2017-08-23 11:04:51 +00:00
Matthew Thode
1fd0f80b1b
Fix venv building for new tags
more headers were needed, also, revert the kilo release change.
eol-kilo has swift in upper-constraints, which causes problems for venv
building, it was removed from future releases for this exactly this
reason.

Change-Id: I1f8c8ea4681ab63dd67851235f405d1cbd478eae
2017-08-21 20:06:46 -05:00
Jenkins
3eafd56664 Merge "Add missing dependencies for pyldap" 2017-08-21 21:11:06 +00:00
Jenkins
3f1102a007 Merge "Allow mariadb to be used in place of mysql" 2017-08-21 21:11:00 +00:00
Matthew Thode
8ef0c3c993
Add missing dependencies for pyldap
The venv fails to build without the sasl and ldap headers

Change-Id: I9243417ac1c53f24acbad65ff08dd42941341c74
2017-08-21 13:11:04 -05:00
Matthew Thode
40dcac33ec
Allow mariadb to be used in place of mysql
Some installs have libmariadbclient-dev already installed, so use that
if it's available.

Change-Id: I630f2f32c3b7b71eb6f348ae6b6838ae8cd6730d
2017-08-21 11:46:12 -05:00
Matthew Thode
aa04643ded
update tags the leap-upgrade use
The comment on the bug in setuptools was fixed a while ago upstream and
evrardjp also mentioned that comment could be removed.  Branches other
than newton have an EOL release, so change to use those.

Change-Id: I80cf1fc929e86c3498760ad4b342964c7f82ea5f
2017-08-18 09:36:26 -05:00
Jean-Philippe Evrard
22e6295c84 Implement logging for leapfrog
Default logging could be used in leapfrog, into the leapfrog
folder, to help debugging.

Change-Id: Ief9c4d2b9e46e515850720e07a62d59d561a3aa1
2017-08-08 15:15:31 +00:00
Jean-Philippe Evrard
81713f8e60 Be more lenient on input version.
RPC is using r11 and 11 for kilo, same for upper branches.
We should be more lenient to the version allowed, whether it's
starting with a r or not, as long as the major version is the
same number.

Change-Id: I42053681fdc5e0b2c16060d8a51b4a620569f38c
2017-08-03 13:57:40 +00:00
Jenkins
1116df7528 Merge "Improve openstack-release file discovery" 2017-07-13 14:18:52 +00:00
Miguel Alex Cantu
ebb827ea46 Improve openstack-release file discovery
In cases where the deployment node is seperated from the infrastructure
node, the openstack-release file discovery logic might calculate the
wrong release since the /etc/openstack-release file does not get generated
on the deployment node.
This commit adds logic to pull down the /etc/openstack-release file from
the infrastucture node to the deployment node. This way, the release discovery
logic will properly assess the openstack release even in situations where the
deployment node is isolated from the infra node.
If the openstack-release file is not found, an attempt to retrieve the
rpc-release file is made.

A conditional is added to check if the rpc-release file exist in the
environment. If it does, and there is no openstack-release file, then
the deployment version is set to Juno.

Co-Authored-By: git-harry <git-harry@live.co.uk>

Change-Id: I6136609ef11be7b98ddcfc7589dd17cf1e98c362
2017-07-13 14:58:06 +01:00
Jean-Philippe Evrard
9c6cb57cf7 Change mirror used to fetch venvs by default
Move to use rpc-repo (the origin) instead of its mirror,
mirror.rackspace.com

Change-Id: I5991026faed73d7712bdc6385d5cf350fb435ad8
2017-07-13 10:24:15 +00:00
git-harry
6d26cf0c6d Ensure mysql-python dependency met
`libmysqlclient-dev` is missing, when performing a Kilo to Newton upgrade
on a multi-node AIO, causing `mysql-python` to fail to install. This
change ensures it is present.

Change-Id: Id418929b1713357bea183c50b64219f175aee9bc
2017-07-13 10:55:36 +01:00
git-harry
9ff145e3b2 Ensure PIP requirements are always met
This change is necessary to ensure that all the required PIP packages
are installed. Without this change the code assumes that if the version
of `pip` in okay then all the required packages are already installed.

Change-Id: I16a4eaf24e346411a7f0890d69939f666ecc6be3
2017-07-13 09:38:13 +01:00
Jean-Philippe Evrard
da7cc439f7 Ensure liberasurecode-dev is installable
Make sure the liberasurecode-dev is installable when needed, in order
to build the venvs for swift.
No distinction is done anymore for backports/anything else like UCA.

Change-Id: I552b77eeb05469b815592da1dd7fab45124ffe89
2017-07-03 15:01:24 +01:00
Jean-Philippe Evrard
6178be497b Improve suspend/resume of leapfrog
While we could do better by using other mechanisms than shell
scripts, this commit sticks to the current method of doing (having
marker files), to mark steps that were missing a marker.

On top of it, you couldn't resume from a leapfrog that's started
from a shell script, because the readlink failed.

Change-Id: I73f09bb8214741772545c73fac5e5fdb5698c52e
2017-05-31 17:38:39 +00:00
Jean-Philippe Evrard
9d282388ac Improve Gating of leapfrog
Instead of relying on "echo YES| " in gating, we should re-use
an environment variable that bypasses the user validation.

This commit also adds logging of the extra step that was added
previously.

Change-Id: If5e986daa6404470d9d260032a24eb8cc17aa161
2017-05-31 15:14:04 +01:00
Jean-Philippe Evrard
ee93901d05 Make possible to start leap from K
This change:
- discovers the current running version to know what
  to leap from, because we can't assume Juno only.
  At the same time it introduces a human verification
  of the source branch.
- removes the useless "-v" of the runs that produced
  an undesirable output, making the interface less
  "user friendly".

Change-Id: I04e4780bf5f58638addbd992eab7152f288532ae
Co-Authored-By: Jean-Philippe Evrard <jean-philippe@evrard.me>
2017-05-19 09:15:47 +00:00
Jimmy McCrory
c4526c0a61 Apply upper-constraints when building venvs
When building a venv for leap upgrades, checkout the applicable
requirements repo SHA and apply its upper-constraints file. If
packages within the venv are installed unconstrained, a project's
database migration scripts may fail.

Also remove tempest from being built within the venv.

Change-Id: Ic7e9aaa2d445bfe22c0f707a00a867cc8e84a38d
2017-04-07 23:50:49 -07:00
Jimmy McCrory
ed717932c0 Fix downloading of pre-created leap release venvs
Precreated bundled venvs for OpenStack-Ansible have been created,
update the default VENV_URL with the path to them. Also fix the wget
command used to download them so that it returns a 0 on success and
deletes a failed download allowing the local build function to continue
on.

Change-Id: Ic4ae115384015dd7159da4e5850452bb5db181be
2017-02-23 15:24:56 -08:00
Jimmy McCrory
5b7f261735 Fix checkout of cloned leap upgrade repos
Perform a git branch checkout on cloned OSA repo directories when the
ignore-changes.marker file does not exist.

Change-Id: Ib062198f54e399d644e13c7aea7582e0ad6e1976
2017-02-22 12:13:42 -08:00
Jimmy McCrory
164570a626 Fixes to leap upgrade preflight function
- Check for existence of the configuration directory
  (rpc_deploy/openstack_deploy) since only one should exist, dependent
  on the current stage of the upgrade
- Correct the path to upgrade-requirements.txt
- Use pip to install requirements found in upgrade-requirements.txt
  to avoid a 'double requirement given' error when installing pip

Change-Id: If39826c26eb948b91f14e7e27d0a5d0740c8349c
2017-02-22 10:49:30 -08:00
Kevin Carter
2438ad03ab Added leap upgrade tooling
This change adds upgrade tooling that will take a Juno based
OpenStack-Ansible cloud and upgrade it to Newton. The tooling
will run a deployment through all of the needed steps upgrading
the environment and skipping all of the OpenStack releases in
between.

**This tooling should be considered experimental at this time**

Change-Id: I1880794717b9e47786ae255ea1afa57d805cde8e
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-02-01 14:27:07 +00:00