Add infrastructure for pre-compiling Python wheels
This patch makes it so `rules_python` uses our FRC971 mirror for
downloading wheels instead of reaching out to pypi.org. This also
means that `rules_python` will not build a wheel from scratch.
Instead, we now have a new script that will build wheels in as
reproducible a way as possible and then upload them to our internal
mirror.
Run with:
$ bazel run //tools/python:mirror_pip_packages --config=k8_upstream_python -- --ssh_host software
This patch does not move the entire repo to use this new setup yet. I
still need to take inventory of all the pip packages we need.
Buildkite will enforce that wheels are uploaded and available on our
mirror for all pip dependencies.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I12a1a29026a13211ea279b5567ed70529f0c66b5
diff --git a/WORKSPACE b/WORKSPACE
index 062fe25..13a8726 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -309,6 +309,8 @@
ci_configure(name = "ci_configure")
+load("@ci_configure//:ci.bzl", "RUNNING_IN_CI")
+
http_archive(
name = "platforms",
sha256 = "2c8d8347427e6bb0ba7cf9f933c08fe2be2b62ff2454546ad852f7bf267aad87",
@@ -403,6 +405,10 @@
http_archive(
name = "rules_python",
+ patch_args = ["-p1"],
+ patches = [
+ "//third_party:rules_python/0001-Support-overriding-individual-packages.patch",
+ ],
sha256 = "b593d13bb43c94ce94b483c2858e53a9b811f6f10e1e0eedc61073bd90e58d9c",
strip_prefix = "rules_python-0.12.0",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.12.0.tar.gz",
@@ -421,7 +427,9 @@
pip_parse(
name = "pip_deps",
+ overrides = "//tools/python:whl_overrides.json",
python_interpreter_target = python_interpreter,
+ require_overrides = RUNNING_IN_CI,
requirements_lock = "//tools/python:requirements.lock.txt",
)