Refactor update_tools.sh workflow and regenerate par files (#209)
This reorganizes and comments some package dependencies in the Dockerfile.
It also regenerates the par files, so that we're now using pars based on the
current version of Bazel.
Fixes #208.
diff --git a/tools/piptool.par b/tools/piptool.par
index 11ec453..53df7d8 100755
--- a/tools/piptool.par
+++ b/tools/piptool.par
Binary files differ
diff --git a/tools/update_tools/Dockerfile b/tools/update_tools/Dockerfile
index 0fbf77b..1323478 100644
--- a/tools/update_tools/Dockerfile
+++ b/tools/update_tools/Dockerfile
@@ -1,19 +1,35 @@
FROM gcr.io/gcp-runtimes/ubuntu_16_0_4:latest
-# Install Bazel (https://docs.bazel.build/versions/master/install-ubuntu.html)
-RUN apt-get update -y && apt-get install openjdk-8-jdk wget git unzip build-essential -y
-RUN wget https://github.com/bazelbuild/bazel/releases/download/0.24.0/bazel-0.24.0-installer-linux-x86_64.sh -O /tmp/bazel-installer.sh
+# Install Bazel (https://docs.bazel.build/versions/master/install-ubuntu.html#install-with-installer-ubuntu).
+RUN apt-get update -y && apt-get install -y \
+ # The JDK requirement is from the instructions for the bazel apt package,
+ # which we're not using here, but let's be safe.
+ openjdk-8-jdk \
+ # These requirements are from the link above.
+ pkg-config zip g++ zlib1g-dev unzip python3 \
+ # And why should python3 have all the fun?
+ python \
+ # We also need git for git_repository to work. Maybe these other ones too.
+ git unzip build-essential \
+ # And wget for the below command.
+ wget
+
+RUN wget https://github.com/bazelbuild/bazel/releases/download/0.28.0/bazel-0.28.0-installer-linux-x86_64.sh -O /tmp/bazel-installer.sh
RUN chmod +x /tmp/bazel-installer.sh && /tmp/bazel-installer.sh
+
+# Sanity check the install.
RUN bazel help info >/dev/null 2>&1
-# Install Python 2.7.12
-RUN apt-get install python -y
-
-# Build par files. We have a source and work directory to avoid
-# stomping on other files as root.
+# Build par files. We have a source and work directory to avoid stomping on
+# other files as root.
CMD cp -r /opt/rules_python_source /opt/rules_python && \
cd /opt/rules_python && \
bazel clean && \
- bazel build //rules_python:piptool.par //rules_python:whltool.par && \
+ bazel build //rules_python:piptool.par //rules_python:whltool.par \
+ # This works around a bug in git_repository to give us better debugging
+ # if there's an error.
+ # TODO(brandjon): Remove this once we're using Bazel 0.29, which
+ # contains the fix.
+ --incompatible_string_join_requires_strings=false && \
cp bazel-bin/rules_python/piptool.par bazel-bin/rules_python/whltool.par /opt/rules_python_source/tools/ && \
chown --reference=/opt/rules_python_source/update_tools.sh /opt/rules_python_source/tools/piptool.par /opt/rules_python_source/tools/whltool.par
diff --git a/tools/whltool.par b/tools/whltool.par
index 7cb59c0..25f85e7 100755
--- a/tools/whltool.par
+++ b/tools/whltool.par
Binary files differ