diskimage-builder/elements/pip-cache
Ben Nemec 16be6d7ce0 set -u and -o pipefail everywhere
As with the previous similar changes, this is intended to catch
problems as they happen instead of ignoring them and continuing on
to potentially fail later.  Setting this on all existing scripts
will allow us to enforce use via Jenkins.

Change-Id: Iad2d490c86dceab148ea9ab08f457c49a5d5352e
2014-05-06 15:51:07 -05:00
..
environment.d Add a pip-cache element. 2013-08-26 15:17:41 -04:00
root.d set -u and -o pipefail everywhere 2014-05-06 15:51:07 -05:00
README.md Add a pip-cache element. 2013-08-26 15:17:41 -04:00

Use a cache for pip

Using a download cache speeds up image builds.

Including this element in an image build causes $HOME/.cache/image-create/pip to be bind mounted as /tmp/pip inside the image build chroot. The $PIP_DOWNLOAD_CACHE environment variable is then defined as /tmp/pip, which causes pip to cache all downloads to the defined location.

Note that pip and its use of $PIP_DOWNLOAD_CACHE is not concurrency safe. Running multiple instances of diskimage-builder concurrently can cause issues. Therefore, it is advised to only have one instance of diskimage-builder that includes the pip-cache element running at a time.

The pip concurrency issue is being tracked upstream at https://github.com/pypa/pip/issues/1141