Commit Graph

35 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov e44c99e64a Fix linters and metadata
With update of ansible-lint to version >=6.0.0 a lot of new
linters were added, that enabled by default. In order to comply
with linter rules we're applying changes to the role.

With that we also update metdata to reflect current state.

Change-Id: Ib390f06177fbac77a4285e3be86e6461fd769597
2023-07-14 19:36:45 +02:00
Damian Dabrowski c65b91b490 Include proper commit in rally_upper_constraints_url
Currently, rally_upper_constraints_url always points to master branch.
It is not a valid behavior because u-c from master may not work for
stable branches.
This change fixes rally_upper_constraints_url.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-rabbitmq_server/+/887592

Change-Id: I016e457c0e4b7819d6d65af3bc35e06061f92d1c
2023-07-04 17:04:36 +00:00
Dmitriy Rabotyagov 136dfa02d0 Control rally-openstack installed version
At the moment we don't have control what version of rally-openstack
is being installed. So we are installing latest version available in
PyPi. However rally package version is defined in
rally-openstack constraints.

With this patch we add variables to be able to adjust source of
rally-openstack as well as pick version for installation.

We also temporary disable upgrade jobs to resolve circular dependency

Needed-By: https://review.opendev.org/c/openstack/openstack-ansible/+/847272
Change-Id: I8100dfd3544c0530815fb877b44b960d404f635b
2022-07-05 22:03:20 +00:00
Damian Dabrowski e1b13a1e44 Install PyMySQL as rally commands may not work without it
(rally-23.1.0.dev64) root@aio1-utility-container-13a6c4d0:/etc/rally# rally task list
[...]
Command failed, please check log for more info
2021-11-24 16:21:59.593 3777441 CRITICAL rally [-] Unhandled error: ModuleNotFoundError: No module named 'pymysql'

relevant rally commit: 3f4bc46535

Change-Id: I2a755326559ee95b74fabe6bc89ed26a820a70a1
2021-11-25 16:50:53 +01:00
Jonathan Rosser 99f087d2e3 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: Iafcd10d169b9515846293731ca1e5b8a7ffb5fe1
2021-03-16 08:15:55 +00:00
Jonathan Rosser e856ad62da Switch default virtualenv to python3
Change-Id: I2d33757ad418977894de205899baa219865fc124
2021-03-10 09:02:03 +00:00
Jonathan Rosser 03c7872536 Ensure that the rally venv build is self contained
Rally ships it's own version of upper-constraints [1].

As we move openstack-ansible to using the new pip resolver this
causes several issues. The rally specific version of u-c contains
constraints for pip/setuptools/wheel which will inevitably be in
conflict with those in global-requirement-pins. This results in
several problems.

* Rally is branchless and so applying branch-specific versions
  of openstack u-c is incorrect

* Rally should be installed using the rally u-c rather than
  openstack u-c

* Rally should not use the repo server to build wheels as the repo
  server wheel build venv will have different versions of pip/
  setuptools/wheel to those specificed in rally u-c.

* Rally venv build should not be subject to openstack-ansible
  global-requirement-pins as these are in conflict with rally u-c.

This patch introduces the changes necessary to build rally in a self
contained manner on the utility host with no use of the repo server.
It also includes a revert of I73887784cbc3ce6089a42c67871dbc6c3d54acf6.

[1] https://opendev.org/openstack/rally-openstack/raw/branch/master/upper-constraints.txt

Change-Id: Idbd71ade1ab82d2d218e560b2f10c38116ff47e3
2021-01-19 10:25:28 +00:00
Jonathan Rosser 56f11c554c Use the utility host for db setup tasks
Move it to the service setup host (defaults to utility[0]) instead
of the galera[0] host, and use galera_address (defaults to internal VIP)
as the endpoint instead of a local connection on the db host.

Change-Id: I3d7688ea29f1eb4d65dd50ae82d157f988e404af
2020-09-23 15:56:07 +00:00
Dmitriy Rabotyagov 69d744dc80 Cleanup after repo_build and pip_install retirement
Change-Id: I1f2dd31d326692ec410c56971e087ed5376f563b
2020-05-13 11:55:59 +01:00
Dmitriy Rabotyagov b00e91e9c3 Change upper constraints url
To be consistent with other projects, we are changing upper constraints

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: I73887784cbc3ce6089a42c67871dbc6c3d54acf6
2019-11-14 18:34:04 +02:00
Jonathan Rosser cae0d4f431 Allow venv python interpreter to be overridden
Change-Id: I5a25f8d8beebc63159e740250c7e6e43294e568b
2019-09-11 21:23:38 +01:00
Mohammed Naser 1cce892008 build: use upper-constraints.txt from rally-openstack
We had all of the upper-constraints hardwired inside the role
which was not ideal.  This patch grabs the latest upper-constraints
as we are installing the latest package in this case.

Change-Id: Icfac74a031d9059d50772d8423c5ba3f6aa00407
2019-07-18 16:43:34 -04:00
Jean-Philippe Evrard dbc71ac98c Bump rally versions
This comes out of a latest pip freeze, finding what's not
in upper constraints, after install rally-openstack.

Change-Id: Ib62520f0302efe51fe03e97722c5e8d452a3f7c8
2019-05-22 12:34:03 +00:00
Guilherme Steinmüller 3407eb3685 Update role for new source build process
The variables rally_developer_mode and rally_venv_download
no longer carry any meaning. This review changes rally to
do the equivalent of what developer_mode was all the time,
meaning that it always builds the venv and never requires
the repo server, but it will use a repo server when available.

As part of this, we move the source build out of its own file
because it's now a single task to include the venv build role.
This is just to make it easier to follow the code.

Rally doesn't uses upper-constraints. We rely on stable releases,
for that reason, we don't need vars like rally_git_contraints,
rally_git_repo and rally_git_install_branch.

Change-Id: Iad66086bde1680e4a101f75a17700ab83c459124
2019-03-28 05:41:19 +00:00
Jesse Pretorius 9fdc3ab178 Use a common python build/install role
In order to radically simplify how we prepare the service
venvs, we use a common role to do the wheel builds and the
venv preparation. This makes the process far simpler to
understand, because the role does its own building and
installing. It also reduces the code maintenance burden,
because instead of duplicating the build processes in the
repo_build role and the service role - we only have it all
done in a single place.

We also change the role venv tag var to use the integrated
build's common venv tag so that we can remove the role's
venv tag in group_vars in the integrated build. This reduces
memory consumption and also reduces the duplication.

This is by no means the final stop in the simplification
process, but it is a step forward. The will be work to follow
which:

1. Replaces 'developer mode' with an equivalent mechanism
   that uses the common role and is simpler to understand.
   We will also simplify the provisioning of pip install
   arguments when doing this.
2. Uses Rally's own in-repo upper constraints, instead of
   the OpenStack requirements repo constraints.

Depends-On: https://review.openstack.org/598957
Change-Id: I3f70f7879d399c36fb8d145e69ce4a609157ec30
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2018-09-03 11:07:29 +00:00
Jesse Pretorius 6e0e08a7d0 Remove rally_requires_pip_packages
Given that the openstack_hosts role installs pip and virtualenv,
we do not need this extra task/var.

Change-Id: Id3c2329f0f0b86d88fcd748c7e4504400c942ef2
2018-07-31 19:49:37 +01:00
Guilherme Steinmüller 3da7a036d9 Change rally pip package
This is motivated by the recent change of rally
project [1] which states that In-tree OpenStack
plugins will be removed from the Rally main package soon.

Also, we do not have constraint for it, we need to pin it
to keep consistent build.

[1] https://github.com/openstack/rally/blob/master/CHANGELOG.rst#100---2018-06-20

Change-Id: I9121867301fc69ba6623110fa6e54c2da0b5ae2c
Closes-Bug: 1782372
2018-07-24 17:50:59 -03:00
Jesse Pretorius c4e6c8ce30 Move database creation into role
There is no record for why we implement the database creation outside
of the role in the playbook, when we could do it inside the role.

Implementing it inside the role allows us to reduce the quantity of
group_vars duplicated from the role, and allows us to better document
the required variables in the role. The delegation can still be done
as it is done in the playbook too.

In this patch we implement a new variable called 'rally_db_setup_host'
which is used in the role to allow delegation of the database setup
task to any host, but defaults to the first member of the galera_all
host group. We also document the variable 'rally_galera_address' which
has been used for a long time, but never documented. A bunch of unused
variables have also been removed.

Change-Id: Ifb89e35e3acaef33ce4ce24b3f5affc6c4e8e494
2018-06-28 19:50:37 +00:00
Jesse Pretorius 321fb7e69a Implement pypi-based install and package pinning for non u-c packages
Rally does not adhere to the global requirements process, so its
requirements extend beyond those managed by upper-constraints, and
sometimes are incompatible with upper constraints.

We have no need to track their development from git commit to git
commit, and can rather rely on stable releases which we verify are
working with the upper constraints whenever we do a pinning bump.

This keeps things simpler for us, and also allows the repo build
process in the integrated build to do a constrained venv build
instead of doing it unconstrained and breaking stable branch builds
down the line.

Depends-On: https://review.openstack.org/570906
Change-Id: If3d0120cf6f6f78463cf7805bc046382c3b6d44e
2018-05-29 16:16:20 +00:00
Jesse Pretorius 5b96496399 Pin cmd2 to the last python2 version of the library
The cmd2-0.9.0 is python3-only and the rally venv is built
unconstrained, so it's trying to bring in the latest version
which is incompatible with python2. We pin the library to
ensure that the venv build completes correctly.

We also re-arrange the package list to be alphabetically
sorted.

Depends-On: https://review.openstack.org/570879
Change-Id: I1e259ce98fc8517c0cd00a04d6fe7b3f0703f5b4
2018-05-29 09:48:58 +00:00
Jean-Philippe Evrard 12a98067f1 Replace virtualenv-tools by a script
virtualenv-tools has a bug which gets triggered in gates: it can't
change the shebang of a virtualenv python bin/ files if they
were generated with a virtualenv script whose shebang ends with
python2 instead of python.

Because we can't modify virtualenv-tools, we use shell scripts
instead.

Change-Id: I438ae40b42bcf61a1be56a5f52581444a9b181a3
Partial-Bug: #1741634
2018-01-15 14:15:58 +00:00
Jean-Philippe Evrard 6fd0163fda Constraint ansible installation
Rally installs ansible, in an unconstrained way.

To pass linters, we skip the lint job on the test
shell command.

Change-Id: Ic830cf81b3cc691aafb7a97819e0ce68e48dd809
2017-11-22 20:21:15 +00:00
Logan V c295b18a79 Clean up developer mode logic
Fixes the ability to deploy a venv in cases where:
1) developer_mode is not enabled
2) A cached venv is not downloaded from the repo server

Additional cleanup to the developer_mode venv deployment
logic is implemented by adding a *_venv_download var
which is used to decouple developer_mode from the
cached venv extraction process so that a deployer
can force venv builds in-place (disable cached
venv usage) without enabling developer mode
constraints.

Change-Id: I6939e47455898c07003f1b480e6d65b5d06e4c68
2017-01-18 13:37:28 +00:00
Jesse Pretorius 9c432d6db7 Simplify pip options/constraints mechanism
The current constraints generation for the
installation involves multiple tasks and multiple
variables.

Using multiple tasks extends the installation time
unnecessarily and the additional variables are
unnecessary.

This patch aims to simplify the mechanism and
hopes to speed it up a little.

Change-Id: I4633c71c515ab03a4e72ef08e1bb682dedc8c079
2016-11-02 17:58:38 +00:00
Logan V c5d8e6a765 Fix linting issues for ansible-lint 3.4.1
Preparing this role for the ansible-lint version bump

Change-Id: Ie9c73717f1999d166e1e28d30f97a2821bb95895
2016-11-02 12:53:39 +00:00
Travis Truman c0698d207b Remove rally_host_group variable
It was duplicating the meaning/purpose of the role
variable `rally_role_project_group`

Also ensure that additional tasks are limited to only
a single host in the host group.

Change-Id: I3d5cc822cc0d3c2b0b3ba7b05a9fe1b6b9e3a839
2016-08-23 14:45:16 -04:00
Travis Truman 75bff29613 Make os_rally inventory group configurable
The default value of "rally_all" remains, but this
allows deployers to target the role to multiple
groups now.

Change-Id: Id1bbda227032f66270fe5656250be7794a1dd4af
2016-08-18 18:21:38 -04:00
Jesse Pretorius 087acfb6e8 Add project group to role
This patch adds a var used by the repo_build process to determine
which host group to check for members of before building the pip
packages required by this role. This provides the ability to
optimise the repo build process to only building the packages
that are required for an environment.

Depends-On: Idda16b4f382eee57c7469af898859d6d81d4eb30
Change-Id: Iedb4c0c91daa291f881a9fc00c5b8c40bb312ce3
2016-08-04 05:18:13 +01:00
Jesse Pretorius 61b08b72b1 Add ability to change apt/yum package state
The current method of installing the distribution packages required is
set in the tasks and cannot be changed by a deployer.

Currently the apt task always installs the latest package. This results
in unexpected binary changes when a deployer may simply be trying to
execute a configuration change.

This patch adds the ability for a deployer to change the desired state
so that the results are predictable.

Change-Id: I1708ca8285ffa2bbd1a989b187ef3c6d9dd005c2
2016-08-02 15:03:37 +01:00
Anton Khaldin 1e1c8b35b9 Only install to virtual environment
Remove all tasks and variables related to toggling between installation
of rally inside or outside of a Python virtual environment.
Installing within a venv is now the only supported deployment.

Additionally, a few changes have been made to make the creation of the
venv more resistant to interruptions during a run of the role.
* unarchiving a pre-built venv will now also occur when the venv
  directory is created, not only after being downloaded
* virtualenv-tools is run against both pre-built and non pre-built venvs
  to account for interruptions during or prior to unarchiving

Change-Id: I815dff623fce1440a5d60f64bf69f4f563371998
Implements: blueprint only-install-venvs
2016-07-08 04:55:14 -07:00
Travis Truman 6f9765682a Updating os_rally to use the Multi-Distro framework
Debian-specific vars and logic have been moved to tasks
that will execute only on those distributions.

Change-Id: I6a9d04382b1f1badebf12483ce7d1d02b43f8903
Implements: blueprint multi-platform-host
2016-05-27 10:04:51 -04:00
Travis Truman 77f03a8729 setup the db schema during install 2016-03-25 16:19:57 -04:00
Travis Truman 8f06cbb62b Drop the templated config 2016-03-25 14:36:10 -04:00
Travis Truman 329318acfa Adding testing 2016-03-25 11:28:16 -04:00
Travis Truman 1e6d9b3a46 Inital commit 2016-03-24 17:13:47 -04:00