From a09c84321d73fe667fc6da6cba030c1f58c75659 Mon Sep 17 00:00:00 2001
From: Moritz Maxeiner <mm@ucw.sh>
Date: Tue, 21 Jul 2020 16:57:51 +0200
Subject: [PATCH] [tensorflow] use python3.8, switch to using robofish fork of
 tensorflow

---
 tensorflow/Dockerfile                          | 15 +++++----------
 .../disable-enforced-bazel-build-mirror.patch  | 18 ------------------
 2 files changed, 5 insertions(+), 28 deletions(-)
 delete mode 100644 tensorflow/disable-enforced-bazel-build-mirror.patch

diff --git a/tensorflow/Dockerfile b/tensorflow/Dockerfile
index 78d750e..fea8cb1 100644
--- a/tensorflow/Dockerfile
+++ b/tensorflow/Dockerfile
@@ -30,16 +30,11 @@ RUN mkdir -p /opt/bazel && \
     rm -f /opt/bazel/installer.sh
 
 ARG TF_VERSION=1.15.3
-RUN git clone --recursive --branch v${TF_VERSION} https://github.com/tensorflow/tensorflow.git /opt/tensorflow/src
-
-COPY disable-enforced-bazel-build-mirror.patch /opt/tensorflow/patches/disable-enforced-bazel-build-mirror.patch
-RUN sed -i '/https:\/\/mirror.bazel.build\/github.com\/pybind\/pybind11\/archive\/v2.3.0.tar.gz/d' /opt/tensorflow/src/tensorflow/workspace.bzl && \
-    cd /opt/tensorflow/src && \
-    patch -p1 -i /opt/tensorflow/patches/disable-enforced-bazel-build-mirror.patch
+RUN git clone --recursive --branch ${TF_VERSION} https://git.imp.fu-berlin.de/bioroboticslab/robofish/vendor/tensorflow.git /opt/tensorflow/src
 
 RUN mkdir -p /opt/tensorflow/.venv && \
-    python3.7 -m venv /opt/tensorflow/.venv/python3.7 && \
-    . /opt/tensorflow/.venv/python3.7/bin/activate && \
+    python3.8 -m venv /opt/tensorflow/.venv/python3.8 && \
+    . /opt/tensorflow/.venv/python3.8/bin/activate && \
     pip --no-cache-dir install --upgrade pip && \
     pip --no-cache-dir install wheel && \
     pip --no-cache-dir install \
@@ -63,9 +58,9 @@ ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION}
 
 COPY tf_configure.bazelrc /opt/tensorflow/src/.tf_configure.bazelrc
 RUN cd /opt/tensorflow/src && \
-    . /opt/tensorflow/.venv/python3.7/bin/activate && \
+    . /opt/tensorflow/.venv/python3.8/bin/activate && \
     bazel build \
-        --action_env PYTHONPATH="/opt/tensorflow/.venv/python3.7/lib/python3.7/site-packages" \
+        --action_env PYTHONPATH="/opt/tensorflow/.venv/python3.8/lib/python3.8/site-packages" \
         --config=cuda --config=opt --config=mkl \
         //tensorflow/tools/pip_package:build_pip_package && \
     ./bazel-bin/tensorflow/tools/pip_package/build_pip_package /opt/tensorflow/build
diff --git a/tensorflow/disable-enforced-bazel-build-mirror.patch b/tensorflow/disable-enforced-bazel-build-mirror.patch
deleted file mode 100644
index e399696..0000000
--- a/tensorflow/disable-enforced-bazel-build-mirror.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- a/third_party/repo.bzl        2020-06-29 16:54:49.000000000 +0200
-+++ b/third_party/repo.bzl        2020-06-29 17:20:42.594725313 +0200
-@@ -80,15 +80,6 @@
-     _execute_and_check_ret_code(ctx, cmd)
- 
- def _tf_http_archive(ctx):
--    if ("mirror.tensorflow.org" not in ctx.attr.urls[0] and
--        (len(ctx.attr.urls) < 2 and
--         ctx.attr.name not in _SINGLE_URL_WHITELIST.to_list())):
--        fail("tf_http_archive(urls) must have redundant URLs. The " +
--             "mirror.tensorflow.org URL must be present and it must come first. " +
--             "Even if you don't have permission to mirror the file, please " +
--             "put the correctly formatted mirror URL there anyway, because " +
--             "someone will come along shortly thereafter and mirror the file.")
--
-     use_syslib = _use_system_lib(ctx, ctx.attr.name)
-     if not use_syslib:
-         ctx.download_and_extract(
-- 
GitLab