If the SSH or login session is not restarted, it is possible that
recently written contents of /etc/environment are not accounted for
when installing the built wheels when TLS is enabled on the internal
VIP.
REQUESTS_CA_BUNDLE must be set to allow pip to trust the certificate
presented on the internal VIP.
Change-Id: I7ed37d76c4c3854dc4939c884062bd03a76ece37
See https://github.com/ansible/ansible/issues/82598
Setting the 'use' parameter to something other than 'auto'
should cause a different code path to be use in the package
action plugin which could avoid the templating unsafe text
inside the plugin.
Change-Id: I0c14510eb625d74a654a6398387ab74c4355a4e8
Add file to the reno documentation build to show release notes for
stable/2023.2.
Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2023.2.
Sem-Ver: feature
Change-Id: I79b16ce2f6b0045f8c9239ed86d37389af14c1db
That is a follow-up patch for Rocky, that as EL derivative also follows
naming convention, where distribution_version contains also minor
version, while we need to build only against major versions of distros.
With that the only distro we need to use distro version for is Ubuntu.
Change-Id: I62f69bc31ed04ab65a167d07de44067fcaa74a66
We add become overrides on the task level which neglect provided by
user options in favor of quite narrow usecase. As a result, role can not
be run as a non-root user in cases where venv_build_host is not localhost
Removing become override potenially unblocks running OSA with non-root
user on hosts.
Change-Id: I663bdb1bcc60fec0d9efc55cbb1b2a0c566ab2ab
Debian does include minor versioning into distribution_version facts
causing versions to look like "12.2" or "11.4", which is causing issues
once debian is minorly updated since there might be no repo container
to satisfy such specific request across the board (ie having repo 11.3
while compute reports 11.4). Thus we're taking into account only major
versions for these distros. Same approach has been taken for building
wheels in project-config [1]
[1] https://review.opendev.org/c/openstack/project-config/+/897545
Change-Id: Iaf6ed4dd5e01b25b5935b959c73ab657cfefef47
This is renamed to be more specific to the wheel build process
and not to collied with similarly named variables in other ansible
roles.
Change-Id: I470507ed904bca1845fdccc9494cc62bc10229b7
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: I6b4b83ec472d4a3de9139eb4e7c7b2dc8a9fc260
Since ansible-core 2.14 you can't use warn as module argument.
Instead, a tag is used to instruct ansible-lint to
supress alerts.
Change-Id: I4ceeee4bf6c1020851824450ec7b30f6d14573f3
In case venv_build_group is not present in inventory or does not contain
a single host, it does not make sense to attept building wheels.
With that we're changing default behaviour to avoid building wheels
if there're no potential targets exists.
Change-Id: Ifd0e80dd1d1f002a1b80f57b53b81ca9110e719c
In order to be flexible and get rid of hardcoded repo_all group, new
variable named `venv_build_group` was added. It's set to repo_all by
default, so it is not changing current behaviour remains
Change-Id: I30c2c26abeb103de63aff0946ec7783f902886b8
At the moment if no appropriate build target is present role fails with
quite unclear message. This patch aims to provide human-readable
failure message when it's not possible to select build target, but
wheels build is enabled.
Change-Id: Ice35e3e4a14ee74b6ff40bd2385550f2da162878
At the moment we have 2 slightly different variations of merging
distro_arch - one through `-` and another through `_`. This patch
aligns usage and re-use _venv_build_dist_arch.
Change-Id: If478ab0f0c0a5acc8974a69a11453377c98c28be
Change venv_build_targets data structure to a single-level dict
with keys of the form <distro_ver>_<arch> instead of nested dicts.
When adding new architectures to the old structure, previous
entries for other architectures were overwritten, leaving only
the last seen architecture for each distro version. This could
result in a "Dict object has no attribute ..." error when trying
to build a venv for any other architure.
Closes-Bug: #2018012
Change-Id: I8ddabf996559b5300b52cad1649d8657889337cd
Setuptools v54.1.0 introduces a warning that the use of dash-separated
options in 'setup.cfg' will not be supported in a future version [1].
Get ahead of the issue by replacing the dashes with underscores. Without
this, we see 'UserWarning' messages like the following on new enough
versions of setuptools:
UserWarning: Usage of dash-separated 'description-file' will not be
supported in future versions. Please use the underscore name
'description_file' instead
[1] https://github.com/pypa/setuptools/commit/a2e9ae4cb
Change-Id: I3699a7b8ae858463cdd84b11072557049e798309
With this patch we're trying to optimize role runtime by replacing
separate tasks with loops. Hoepfully, this will slighlty improve
permorfance as we need less connections now.
We also create a venv with pip module rather then command.
Change-Id: I219c0336079ca89bde586c8076bd964fada747c6
We should filter out empty elements from lists that are provided as
input to the role, to ensure idempotence of build constraints and
requirements file as a result.
Additionally to that we should ensure to control jinja whitespaces
not to add extra new lines to the end of files.
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/872896
Change-Id: Ide47712f775c91d90b749bc8e4d8f87c5bd658f2
Closes-Bug: #2004546
Due to some corner cases that are possible with currnet logic,
it was decided to simply it and always build wheel regardless of host
count. While runtime might take a bit longer, it's always better for
scaling up to already have wheels prepared.
Closes-Bug: #2004252
Change-Id: I5f53db8476eb394516fb35d593932d2552b95a57
It's not always enough to provide extra arguments for pip installation.
For usescases, like isolated installations, and some specific packages
that still utilize deprecated setuptools.installer instead of
PEP 517 installer,
you might find impossible to provide some easyisntall options without
having a configuration file that should be created by deployer as
pre-step. However, these options might be covered with ENV variables.
Change-Id: I9a060cbcdf9f5c54efd423a4b4fe32b418377f86
With tox release of 4.0, some parameters were deprecated and are ignored now
which causes tox failures. One of the most spread issues we have is using
`whitelist_externals` isntead of `allowlist_externals`
Change-Id: Ic77fb02afbf08e071d7ba0f0eb3a273f03a3a960
Add file to the reno documentation build to show release notes for
stable/zed.
Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/zed.
Sem-Ver: feature
Change-Id: I720d64d26b796db633fe9cae25c0b0497637ad00
With fixing multi-distro support logic, venv_wheel_build_enable logic
stopped working for metal deployments, that have more then 1 host.
Currently, we were checking, that we are not building wheels if build_host
is the same as inventory_hostname. Which is now true for all metal
deployments. However, other hosts do expect wheels to present, which
results in installation failure.
According to the original idea we need to build wheels only when we have
more then 1 host with same arch/distro combination otherwise it does
not make sense to build wheels and faster to install tarball.
To achieve that we build mapping of all distro/arch combinations and
enable wheels building only when there distro-arch combination
is not unique for the host we're playing against.
Despite it might be overkill, as scenario of having only single host
with uniqe distro-arch combination, and overhead of building wheels for
it would be quite small, alternative would be to hardcode `True` for
venv_wheel_build_enable.
Closes-Bug: #1989506
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_placement/+/858258
Change-Id: I762e36acf76729fd61f28ca1b03bc9f562b5db0a
This line was introduced by I3c2164ca8f610fbef88744d9acfca4e926059c81
but should already be covered by the distribution_major_version line
above.
Change-Id: I33a9a85649ff955adfdc8164f42610400381f5bb
In [1] the build host facts gathering was moved from a place in the
code which was covered by run_once to one that is not. The task is
now missing a run_once so it iterates over the repo_all group for
each host in the play which could be a very large number of tasks.
[1] I79a10a3f774246ab9c57313f19f3804f9422e08c
Change-Id: Ic86c19ca48fb55ad2c464c22f31ac41c5cc4c2e5
There may be multiple architecures and OS versions in
ansible_play_hosts. However, with run_once we build wheels only
for one selected distro and do not repsect multi-arch/multi-distro
setups.
Instead of run_once we need to select single (and first in play)
host of each architecture and distro and delegate wheels building
from it. That is needed, because venv_build_host is selected based
on the facts gathered for current inventory_hostname and will
depend on it's arch/distro.
Change-Id: I492d17169538ad2768e28f7c48314bdec407ab36
Closes-Bug: #1964535
With sphinx release of 5.0.0, they changed default for language variable
to 'en' from None. With that current None valuable is not valid and should
not be used.
Change-Id: I693a7be59720ab2e00088e8f0dfbfd646316afb7
This patch aims to split functionality of ``venv_rebuild`` into 2
separate parts - rebuilding venv and rebuilding wheels. That will give
more control over what needs to be done.
Change-Id: Ie14f12c6756cd1f866b660acc8fd6aa5695f6c33
Related-Bug: #1914301
The previous code assumed that the major version ('python3') could be
obtained by removing the last two characters from 'python3.X. This
does not work for pyhton releases 3.10 and onward, so this patch
changes the code to split the string on '.' and take the first portion.
Change-Id: I771cac2fc9badb61c22cfde65775aee97c31f89c
This reverts commit 7166e396d1.
Reason for revert: unbreak tripleo-quickstart
Change-Id: I91a21138a20331e2123f878ac8fb51a6552e2cef
Disable setuptools auto discovery
Jobs are broken due to a release of setuptools 61.0 introducing
non-backwards compatible breaking changes [1]
Setting py_modules to an empty string here will disable autodiscovery
and should permit jobs to run as before.
[1] https://github.com/pypa/setuptools/issues/3197
Signed-off-by: Neil Hanlon <neil@shrug.pw>
Change-Id: Ie0215582fe630f1897a85c1e88fd578d100bc3cf
Currently playbook slurps constraints.txt valid for a first host in a
batch and then uses it for each other host.
It saves time but batch may consists of hosts with different operating
systems or even OSA versions and current mechanism doesn't take this
into account.
In my opinion we should slurp constraints.txt separately for each host.
Change-Id: I9ba1d342af13e9c923151f735940bda29bf1b262
The conditionals for packge installation are getting more complex
than can be handled with the ternary operator, so create per distro
vars files to describe these differences.
Change-Id: I3c2164ca8f610fbef88744d9acfca4e926059c81
Previously the build base package list was ignored, and the
condition included the install package list which was not relevant.
Change-Id: Iadedc5b35f1919058c9971b3ef03d403d153ed62
Currently alert is raised when wheels are built while it should be triggered only
when they are not.
Change-Id: I3c3547c3fa6df2bef6834e0cec4d43ef03b82f5f
Closes-Bug: #1956026
We create virtualenv with a separate command since we need to create
constraints before running pip. In the meanwhile when using pyenv
it becomes more messy to use virtualenv, as it would require
setting virtualenv_command and you can't define virtualenv_python then.
Using exacutable requires setuptools to be present
for ansible_python_interpreter
Change-Id: I5bf617ad0eca3dd5e58e25af7b44d536dc4579d3