Skip to content

Commit cf60eda

Browse files
authored
Docker image with incremental updates (#1294)
* Add layer pruning and sync tf-io with tf * Upgrade to tf=2.13.0 Resolved bq_helper package which was broken as a side effect from the upgrade. * Removed tensorflow-gcs-config package and test. Package is being used minimally. See b/296908146#comment9 * Revert tf=2.12 Remove test for `tensorflow_gcs_config`
1 parent 9111864 commit cf60eda

File tree

3 files changed

+17
-43
lines changed

3 files changed

+17
-43
lines changed

Dockerfile.tmpl

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/lib
3737

3838
# Keep these variables in sync if base image is updated.
3939
ENV TENSORFLOW_VERSION=2.12.0
40+
# See https://github.com/tensorflow/io#tensorflow-version-compatibility
41+
ENV TENSORFLOW_IO_VERSION=0.32.0
4042

4143
# We need to redefine the ARG here to get the ARG value defined above the FROM instruction.
4244
# See: https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
@@ -181,15 +183,17 @@ RUN JAXVER=$(pip freeze | grep -e "^jax==") && \
181183
pandas \
182184
polars \
183185
flax \
184-
"${JAXVER}"
186+
"${JAXVER}" && \
187+
/tmp/clean-layer.sh
185188

186-
RUN apt-get install -y default-jre
189+
RUN apt-get install -y default-jre && \
190+
/tmp/clean-layer.sh
187191

188192
RUN pip install -f http://h2o-release.s3.amazonaws.com/h2o/latest_stable_Py.html h2o && /tmp/clean-layer.sh
189193

190194
RUN pip install \
191-
"tensorflow-gcs-config<=${TENSORFLOW_VERSION}" \
192195
"tensorflow==${TENSORFLOW_VERSION}" \
196+
"tensorflow-io==${TENSORFLOW_IO_VERSION}"\
193197
tensorflow-addons \
194198
tensorflow_decision_forests \
195199
tensorflow_text && \
@@ -536,6 +540,7 @@ RUN pip install flashtext \
536540
keras-cv \
537541
keras-nlp && \
538542
apt-get -y install libspatialindex-dev
543+
539544
RUN pip install pytorch-ignite \
540545
qgrid \
541546
bqplot \
@@ -616,7 +621,14 @@ RUN pip install --upgrade dask && \
616621
pip install --force-reinstall --no-deps jupyter_server>=2.* && \
617622
/tmp/clean-layer.sh
618623

619-
RUN pip install setuptools==59.8.0 && pip install -e git+https://github.com/SohierDane/BigQuery_Helper#egg=bq_helper
624+
# Fix to import bq_helper library without downgrading setuptools
625+
RUN mkdir -p ~/src && git clone https://github.com/SohierDane/BigQuery_Helper ~/src/BigQuery_Helper && \
626+
mkdir -p ~/src/BigQuery_Helper/bq_helper && \
627+
mv ~/src/BigQuery_Helper/bq_helper.py ~/src/BigQuery_Helper/bq_helper/__init__.py && \
628+
mv ~/src/BigQuery_Helper/test_helper.py ~/src/BigQuery_Helper/bq_helper/ && \
629+
sed -i 's/)/packages=["bq_helper"])/g' ~/src/BigQuery_Helper/setup.py && \
630+
pip install -e ~/src/BigQuery_Helper && \
631+
/tmp/clean-layer.sh
620632

621633
# Add BigQuery client proxy settings
622634
ENV PYTHONUSERBASE "/root/.local"
@@ -683,4 +695,4 @@ RUN echo "$GIT_COMMIT" > /etc/git_commit && echo "$BUILD_DATE" > /etc/build_date
683695
{{ if eq .Accelerator "gpu" }}
684696
# Remove the CUDA stubs.
685697
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH_NO_STUBS"
686-
{{ end }}
698+
{{ end }}

tests/test_imports.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ class TestImport(unittest.TestCase):
55
def test_basic(self):
66
import bq_helper
77
import cleverhans
8-
import tensorflow_gcs_config
98
import tensorflow_datasets
109
import segment_anything

tests/test_tensorflow_credentials.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)