diff --git a/tools/docker/cpu_tests.Dockerfile b/tools/docker/cpu_tests.Dockerfile index 76ba882222..d88656c6eb 100644 --- a/tools/docker/cpu_tests.Dockerfile +++ b/tools/docker/cpu_tests.Dockerfile @@ -10,6 +10,9 @@ RUN bash bazel.sh COPY requirements.txt ./ RUN pip install -r requirements.txt +COPY tools/docker/finish_bazel_install.sh ./ +RUN bash finish_bazel_install.sh + COPY ./ /addons WORKDIR addons RUN bash tools/ci_testing/addons_cpu.sh --no-deps diff --git a/tools/docker/finish_bazel_install.sh b/tools/docker/finish_bazel_install.sh new file mode 100644 index 0000000000..1ed4bd22fa --- /dev/null +++ b/tools/docker/finish_bazel_install.sh @@ -0,0 +1,12 @@ +set -e +# hack to have the dependecies in the docker cache +# and have much faster local build with docker +# can be removed once docker buildx/buildkit is stable +# and we'll use "RUN --mount=cache ..." instead +cd /tmp +git clone https://github.com/tensorflow/addons.git +cd addons +python ./configure.py --no-deps +bazel build --nobuild -- //tensorflow_addons/... +cd .. +rm -rf ./addons diff --git a/tools/docker/gpu_tests.Dockerfile b/tools/docker/gpu_tests.Dockerfile index 440591b0d1..0b151485d9 100644 --- a/tools/docker/gpu_tests.Dockerfile +++ b/tools/docker/gpu_tests.Dockerfile @@ -7,6 +7,10 @@ RUN python3 -m pip install -r build-requirements.txt COPY requirements.txt ./ RUN python3 -m pip install -r requirements.txt +COPY tools/docker/finish_bazel_install.sh ./ +RUN bash finish_bazel_install.sh + + COPY ./ /addons WORKDIR addons CMD ["bash", "tools/ci_testing/addons_gpu.sh"] diff --git a/tools/docker/sanity_check.Dockerfile b/tools/docker/sanity_check.Dockerfile index c91fdab0d1..053f3664d5 100644 --- a/tools/docker/sanity_check.Dockerfile +++ b/tools/docker/sanity_check.Dockerfile @@ -45,6 +45,9 @@ RUN apt-get update && apt-get install sudo COPY tools/ci_build/install/bazel.sh ./ RUN bash bazel.sh +COPY tools/docker/finish_bazel_install.sh ./ +RUN bash finish_bazel_install.sh + COPY ./ /addons WORKDIR /addons RUN python ./configure.py --no-deps