Merge ~cjwatson/launchpad:the-wheels-on-the-bus into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: b06134c9d269070fbb556b423fed4ee9e85a5963
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:the-wheels-on-the-bus
Merge into: launchpad:master
Prerequisite: ~cjwatson/launchpad:unittest2-1.1.0+lp1
Diff against target: 64 lines (+18/-6)
2 files modified
.gitignore (+1/-0)
Makefile (+17/-6)
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+379684@code.launchpad.net

Commit message

Build a wheelhouse with relocation-safe paths

Description of the change

The paths to the wheels in pip's download cache (download-cache/wheels/) depend on the hashes of the paths to the sdists from which they're built. As a result, a build on one machine that's pushed out to a different file system path on another machine won't use the cached wheels and will build them all again from scratch, which is very slow.

Instead, extend "make build_wheels" to use "pip wheel" to build a wheelhouse of all our dependencies that forms part of the deployment artifact and survives this kind of relocation. This allows us to have more reasonable deployment times again without having to commit lots of wheels to lp-source-dependencies that might be architecture- or series-dependent.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2index 25bc29d..b61b548 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -73,3 +73,4 @@ callgrind.out.*
6 !logs/README.txt
7 /logs
8 yarn/node_modules
9+/wheelhouse
10diff --git a/Makefile b/Makefile
11index b416d3d..14a6f31 100644
12--- a/Makefile
13+++ b/Makefile
14@@ -20,7 +20,7 @@ PIP_ENV += PIP_NO_INDEX=$(PIP_NO_INDEX)
15 # system-installed Python packages. If we ever manage to remove the need
16 # for virtualenv --system-site-packages, then we can remove this too.
17 PIP_ENV += PIP_IGNORE_INSTALLED=1
18-PIP_ENV += PIP_FIND_LINKS=file://$(WD)/download-cache/dist/
19+PIP_ENV += PIP_FIND_LINKS="file://$(WD)/wheelhouse/ file://$(WD)/download-cache/dist/"
20
21 VIRTUALENV := $(PIP_ENV) virtualenv
22 PIP := PYTHONPATH= $(PIP_ENV) env/bin/pip --cache-dir=$(WD)/download-cache/
23@@ -221,10 +221,20 @@ jsbuild: $(LP_JS_BUILD) $(YUI_SYMLINK)
24
25 # This target is used by LOSAs to prepare a build to be pushed out to
26 # destination machines. We only want wheels: they are the expensive bits,
27-# and the other bits might run into problems like bug 575037. This
28-# target runs pip, and then removes everything created except for the
29-# wheels.
30-build_wheels: $(PIP_BIN) clean_pip
31+# and the other bits might run into problems like bug 575037. This target
32+# runs pip, builds a wheelhouse with predictable paths that can be used even
33+# if the build is pushed to a different path on the destination machines,
34+# and then removes everything created except for the wheels.
35+#
36+# It doesn't seem to be straightforward to build a wheelhouse of all our
37+# dependencies without also building a useless wheel of Launchpad itself;
38+# fortunately that doesn't take too long, and we just remove it afterwards.
39+build_wheels: $(PIP_BIN)
40+ $(RM) -r wheelhouse
41+ $(SHHH) $(PIP) wheel \
42+ -c setup-requirements.txt -c constraints.txt -w wheelhouse .
43+ $(RM) wheelhouse/lp-[0-9]*.whl
44+ $(MAKE) clean_pip
45
46 # Compatibility.
47 build_eggs: build_wheels
48@@ -242,6 +252,7 @@ $(PY): download-cache constraints.txt setup.py
49 $(VIRTUALENV) \
50 --python=$(PYTHON) --system-site-packages --never-download \
51 --extra-search-dir=$(WD)/download-cache/dist/ \
52+ --extra-search-dir=$(WD)/wheelhouse/ \
53 env
54 ln -sfn env/bin bin
55 $(SHHH) $(PIP) install -r setup-requirements.txt
56@@ -388,7 +399,7 @@ lxc-clean: clean_js clean_pip clean_logs
57 if test -f sourcecode/pygettextpo/Makefile; then \
58 $(MAKE) -C sourcecode/pygettextpo clean; \
59 fi
60- $(RM) -r env
61+ $(RM) -r env wheelhouse
62 $(RM) -r $(LP_BUILT_JS_ROOT)/*
63 $(RM) -r $(CODEHOSTING_ROOT)/*
64 $(RM) -r $(APIDOC_DIR)

Subscribers

People subscribed via source and target branches

to status/vote changes: