diskimage-builder/elements/pip-cache
Monty Taylor 3acc866f6d Use DIB_IMAGE_CACHE everywhere
disk-image-create processes a DIB_IMAGE_CACHE variable and exports it,
but there are several elements that ignore the value and wrote out
the base location themselves. Use the variable everywhere so that it
will get overridden everywhere.

Change-Id: I00fff354d6c931ad67cf3052d055f0e4604dfdc8
2014-10-05 13:58:32 -07:00
..
environment.d Add a pip-cache element. 2013-08-26 15:17:41 -04:00
root.d Use DIB_IMAGE_CACHE everywhere 2014-10-05 13:58:32 -07:00
README.md Add a pip-cache element. 2013-08-26 15:17:41 -04:00

README.md

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