9 Commits

Author SHA1 Message Date
Ian Wienand
9f6f1dd295 python-builder: don't force siblings install
It seems I added this --force with the original commit
(I4943ae723b06b0ad808e7c7f20788109e21aa8bf) but I'm not really sure
why.  If we have built any siblings their wheels should have higher
version numbers (e.g. like pbr versioning with a "dev" on it).

Thus we shouldn't need to force the wheels to be installed.  The
--force here causes a lot of uninstalls that take up quite a bit of
time, especialy under emulation.

Change-Id: I88b824058dc1cee90bfe4c8c4fd43a86472bc478
2021-05-20 11:59:44 +10:00
Clark Boylan
45da85124f Use pip install -r not -f to install extras
The pip install -f flag is for find-links which is a list of locations
to look for python packages. What we hvae at this path for extras
installation is a list of packages themselves not locations to find
them. We need to use the -r flag for requirements lists to specify this
instead.

This change should update our zuul and nodepool images to include useful
debugging extras.

Change-Id: I647bb835d0c85c3772e1593866a54cfc5ea1db2f
2020-08-03 10:26:30 -07:00
Monty Taylor
f2e9f556e8 Make bindep installs non-interactive
python-builder is for building docker images. As such, we almost
certainly don't want to be prompted for debconf questions.

Set DEBIAN_FRONTEND=noninteractive so that things like krb5-user
can be installed.

Change-Id: Ieff0555a57e7dbc1b7c4a059b1d0351d016a0c86
2020-06-25 18:18:32 -05:00
Monty Taylor
cee7903827 Add constraints support to python-builder
If someone drops an upper-constraints.txt into the source dir,
add it to the pip interactions.

Change-Id: I6b3c2a178d6fd9ee19918657c809ebf100a7724b
2020-05-04 15:21:33 -05:00
Monty Taylor
f3304c38d5 Allow passing an arbitrary package list to assemble
This lets you build an image to install a package or set of packages
without having to build a fake pbr install.

Change-Id: I6c171881283b89a14a532f31aedb33e223a0ea1f
2020-04-22 19:15:51 -05:00
Monty Taylor
ba3a0eb775 Allow requesting a list of extras to install
We produce lists of extras requirements to install, but installing
them takes an extra step. Allow it to be done all at once by accepting
names of extras on the install-from-bindep command line.

Change-Id: Ie75b9a668569c759f78b70617e311ed6f025039a
2020-04-22 14:39:55 -05:00
Ian Wienand
bd66a7cb1b python-builder: install sibling packages
In the dependent change, the docker roles will add sibling packages to
the .zuul-siblings directory of the checked-out source.

Refactor the "assemble" script to handle this.  Essentially we build
the wheel for "." and then iterate over ZUUL_SIBLINGS subdirectories
(set in a --build-arg by the role in dependent change) to also build
the sibling packages.  Note we concatenate the bindep.txt files, so
that we end up with the complete package list required by the main
code and its dependencies.

"install-from-bindep" now installs all the wheels, using --force to
make sure we re-install the speculatively built packages.

This means that a single Dockerfile works under Zuul when
ZUUL_SIBLINGS is set, pointing to Zuul's checkouts; but it also works
stand-alone -- in this case ZUUL_SIBLINGS is empty and we just install
from upstream as usual.

Depends-On: https://review.opendev.org/696987
Change-Id: I4943ae723b06b0ad808e7c7f20788109e21aa8bf
2019-12-03 20:51:32 +11:00
Monty Taylor
d3c6bbc7af
Install python requirements directly
There are cases when an issue has been fixed upstream in a
dependency but not yet released and it is desirable to install
that version in a built image. pbr does not support such urls
in requirements files because releasing software that depends
on unreleased software is quite dangerous.

Update assemble and install-from-bindep to install -r requirements.txt
before installing the actual software so that image builds with
such requirements lines will work.

Change-Id: Ie17a66bdc4ea0609ce4e66051f659cbd829fdd5d
2019-01-21 20:50:43 +00:00
Monty Taylor
0e1cd6ee85
Add python-builder docker image
This is a builder image intended to make it easy to build
images for projects that use pbr and bindep.

Also, build a python-base image for use with python-builder

pbrx installed dumb-init in a base image and used it as an
entrypoint for the image. This is a good pattern that we should
continue. Make a python-base image that can be used in the FROM
line of consuming final images.

Change-Id: I8da39e680e9c5ca0d8f603a2645e83fc3be87a8b
2019-01-21 20:06:42 +00:00