Commit Graph

15 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov d9df50f4e3 Retire pip_install role
As repo_build role has been succesfully replaced with
python_venv_build role, we have no need in it's futher maintaining and
releasing.

Depends-On: https://review.opendev.org/717715
Change-Id: Ibf9ce1d602c5cfa9ed7431ca37de02df3335b36a
2020-04-06 14:27:00 +00:00
Georgina Shippey 79d2ab3f0b Replace usage of netloc filters to urlsplit
Removed references to netloc_no_port as it will be taken out from
openstack-ansible-plugins. Now using ansible 2.4's urlsplit filter
as a replacement.

Change-Id: If28c8bf2856ebb9a1cab4759b3ddc5b6c4685abf
Related-Bug: #1820830
2019-03-22 16:40:11 +00:00
Zuul 737c9ee415 Merge "Ensure that pip.conf templates variables properly" 2018-04-23 10:44:47 +00:00
Zuul 670f97b4a0 Merge "Disable the pip version check" 2018-04-22 13:29:20 +00:00
Jesse Pretorius b9d90b5e81 Ensure that pip.conf templates variables properly
When a user provides values other than the defaults for
upgrade/pre, they may not format it in a way that pip
interprets properly. To ensure that we template the
conf file correctly, we ensure that it's interpreted
as a boolean, then make it lower case as is expected by
pip.

Change-Id: I91590665cd2d878b6b5ef92d1118610bb4a3fd84
2018-04-21 10:36:29 +01:00
Jesse Pretorius 70b8cd5737 Disable the pip version check
In our logs it is frequent that the warning to upgrade the
pip version is present, but this warning is unnecessary as
we are always using a well tested version of pip.

To reduce noise, we set disable the version check. This has
the added benefit of not adding more internet access to every
pip task than is necessary.

In the template we ensure that the var is interpreted as a
boolean (in case of user error), then force it to lower case
as that's what pip prefers in pip.conf.

We also now remove the test for the self check file, as it
will no longer be present with this option implemented.

Change-Id: Ie0427d3435270836302441b92eaff7e7980d7047
2018-04-20 14:31:55 +01:00
Markos Chandras 2c724509d1 pip: Use 'upgrade-strategy' option to make PIP upgrades less aggressive
The default upgrade-strategy could change from one version of PIP to
another and the results may be unpredictable. We can control the PIP
behavior during upgrades using the 'upgrade-strategy' option and default
that to 'only-if-required' so PIP only upgrades what's really necessary.
This also ensure that getting the latest pip passes the idempotence test
now that we only upgrade only what's really necessary.

Depends-On: I998182eca9851d2cc745930fc73ca37bfefd0951
Link: https://pip.pypa.io/en/stable/user_guide/#only-if-needed-recursive-upgrade
Co-Authored-By: Jean-Philippe Evrard <jean-philippe@evrard.me>
Change-Id: I2ba89e25c0010c9a5b515a3d0c9c731b30876e74
2018-04-18 16:15:26 +01:00
Jesse Pretorius 1085f00f16 Remove the implementation of constraints in pip.conf
In https://review.openstack.org/526889 constraints were
added to pip.conf. While this may be something we want
later in the python build simplification process, it is
currently causing problems in several tests due to the
assumption that constraints are only set on the CLI.

At this stage I think it's better to leave constraints
setting to be done on the CLI as that is ubiquitous
across all pip install tasks right now.

If we switch to setting constraints in pip.conf then it
will take more co-ordination.

Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
Change-Id: Idf726729e725d94b70b53dc40da1ec7e7b0a00bf
2018-02-24 15:43:21 +00:00
Kevin Carter 0f18e40fb6
Set pip to use the pypi-server when locked down
The repo server now hosts a native pypi-server. This new server allows
us to use a native pip install instead of our existing "find-links"
approach. Moving to the native pypi server is not only faster, it is also
more scalable. This change agments our existing wheel lockdown by
setting the index to our new pypi-server and defining an online
constraint file in the pip.conf.

Additional checks have been set within the configuration task file so
that we're confirming pip can be locked down prior to setting the
pip.conf file which can, and will break a deployment if configured
incorrectly. These tasks will only fire when the option
`pip_lock_to_internal_repo` has been set to "true" making them a no-op
by default.

Change-Id: I2f9aaa1aecf7d03a833f60d483de364d6a6d64fa
Depends-On: Icc2ee264fc213b258642b5393dd78b1b26ef0542
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-02-10 11:13:35 -06:00
Jesse Pretorius 43603dfcff Add find-links, even when not being locked down
Using find-links when doing installs can be done
regardless of whether we're locking down the index.

In order to help transition to using the pypi cache
alongside the older repo build mechanism, we need
to be able to use a set index with find-links
pointing at the old links location.

Change-Id: I1e9782eb0fd72690a9644c7a01e8c83a4486872b
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2017-12-04 17:09:18 +00:00
Jesse Pretorius 06bf2a9e07 Add find-links back to pip.conf
In https://review.openstack.org/522761 the find-links
configuration was mistakenly removed from pip.conf
which results in a broken integrated build. This
returns the configuration back.

Implements: blueprint python-build-install-simplification
Change-Id: I578b5eff4f07f0016d000dfb7cc90aa6ed78ed4d
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2017-11-29 09:15:14 +00:00
Jesse Pretorius 4606182b00 Add ability to set the default index
In this patch we allow the default index to be
changed so that we can set it to the repo server
when the pypi reverse proxy is available to be
used.

The repeated implementation of the find-links
in the install section is removed as it is
unnecessary - the global find-links option
applies there too.

Implements: blueprint python-build-install-simplification
Change-Id: I56f22f46ff849a7049ac7ae873af7a4bc526fa63
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2017-11-24 09:51:36 +00:00
Andy McCrae 5041d0e9ba Use netloc_no_port for trusted-host in pip.conf
The move to templating pip.conf has caused an issue with trusted-hosts,
The value requires no port, and will fail if a port is specified. This
patch resolves that by using the "netloc_no_port" filter instead of the
"netloc" filter.

Change-Id: I9cca5138934eee438906ac25d165d128c2411e31
2017-02-15 13:13:27 +00:00
Jimmy McCrory 0c40d7a7bf Template pip.conf directly
With the pip_install and pip_lock_down roles merged, the tasks can be
simplified and pip.conf can be templated directly instead of requiring
a script.

Change-Id: Ia1ff5b10e0c9eccbacb130c89c784bcc77356505
2017-02-14 19:04:12 +00:00
Travis Truman c7d3889bd8 Combine pip_install and pip_lockdown roles
Since lockdown is really just a form of specific pip
configuration and since the pip_install role already does
some pip configuration, it seems logical and desirable for
these functions to take place in the same role.

This change should pave the way for a simplification of
role dependencies and the removal of explicit pip_lockdown
role usage with various playbooks that will already have a
dependency on pip_install.

Change-Id: Ia0fc276c2b501f16d4acf73bbbcad6f80804628e
2016-05-03 11:12:18 -04:00