launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #29965
[Merge] ~cjwatson/launchpad:build-tarball-assets into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:build-tarball-assets into launchpad:master.
Commit message:
Include built assets in deployment tarballs
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/441734
We currently serve API documentation, CSS, and JavaScript from our frontends; at the moment that involves running `make build` on the frontends to build them. In order to translate this to Juju deployments, one fundamental step is to build those assets into the tarballs we use as payloads for Juju charms.
This adds about 8.7 MiB (9%) to the size of these tarballs, and the added parts will only be used on one or two Juju applications. Still, I think that's an excellent trade-off for the extra flexibility it gives us, and once everything is converted to Juju it should result in faster deployments since `make build` is quite slow.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:build-tarball-assets into launchpad:master.
diff --git a/Makefile b/Makefile
index ebacd51..a6b86ab 100644
--- a/Makefile
+++ b/Makefile
@@ -278,7 +278,7 @@ requirements/combined.txt: \
# dependencies without also building a useless wheel of Launchpad itself;
# fortunately that doesn't take too long, and we just remove it afterwards.
.PHONY: build_wheels_only
-build_wheels_only: $(PIP_BIN) requirements/combined.txt
+build_wheels_only: build
$(RM) -r wheelhouse wheels
$(SHHH) $(PIP) wheel -w wheels -r requirements/setup.txt
$(SHHH) $(PIP) wheel \
diff --git a/ols-vms.conf b/ols-vms.conf
index bad8b0b..0ff80f3 100644
--- a/ols-vms.conf
+++ b/ols-vms.conf
@@ -3,7 +3,7 @@ vm.architecture = amd64
vm.release = focal
apt.sources = ppa:launchpad/ppa
-vm.packages = launchpad-dependencies
+vm.packages = launchpad-frontend-dependencies
[launchpad]
vm.class = lxd
diff --git a/utilities/build-tarball b/utilities/build-tarball
index 22cba4a..0d4cb88 100755
--- a/utilities/build-tarball
+++ b/utilities/build-tarball
@@ -33,6 +33,14 @@ mkdir -p "$output_dir"
echo ./version-info.py
echo ./version-info.txt
find ./wheels/ -name \*.whl -print
+ # We include assets (API documentation, CSS, and JavaScript); only some
+ # deployments need these, but including them in the tarball anyway is
+ # relatively cheap, and they'd otherwise take some time to build during
+ # rollouts.
+ find ./lib/canonical/launchpad/apidoc/ -not -type d -print
+ find ./yarn/node_modules/yui/ -not -type d -print
+ find ./lib/canonical/launchpad/icing/ -not -type d -print
+ find ./build/js/ -not -type d -print
) | sort >"$output_dir/.files"
# Create the tarball.