diff --git a/docker/terra_image/Dockerfile b/docker/terra_image/Dockerfile index 390684be4..c1d74bc4f 100644 --- a/docker/terra_image/Dockerfile +++ b/docker/terra_image/Dockerfile @@ -1,14 +1,22 @@ -FROM us.gcr.io/broad-dsp-gcr-public/terra-jupyter-gatk:2.0.1 +FROM us.gcr.io/broad-dsp-gcr-public/terra-jupyter-gatk:2.0.2 # https://github.com/DataBiosphere/terra-docker/blob/master/terra-jupyter-gatk/CHANGELOG.md USER root ENV PIP_USER=false -RUN pip3 install -U git+https://github.com/broadinstitute/ml4h.git +WORKDIR / + +# Now that the Terra image is built from a TensorFlow base image, if TF is included in the +# ML4h requirements.txt, this causes problems with the Terra 'cloud environment' launch. +# In addition, other tensorflow-related libraries need to be unpinned so that they remain consistent +# with the TF version used by the Terra base image. +RUN wget --no-check-certificate https://raw.githubusercontent.com/broadinstitute/ml4h/master/docker/vm_boot_images/config/tensorflow-requirements.txt -O /tensorflow-requirements.txt +RUN grep -v 'tensorflow==' /tensorflow-requirements.txt \ + | sed -E 's/(tensorflow-addons)(==.*)$/\1/g' \ + | sed -E 's/(tensorflow_probability)(==.*)$/\1/g' > /terra-tensorflow-requirements.txt \ +&& pip3 install --upgrade --requirement /terra-tensorflow-requirements.txt \ +&& pip3 install --upgrade --no-deps git+https://github.com/broadinstitute/ml4h.git -# Remove the following two installs after https://github.com/DataBiosphere/terra-docker/issues/244 is addressed. -RUN pip3 install -U tensorflow==2.4.3 -RUN pip3 install tensorflow-probability==0.12.2 # Remove this after https://broadworkbench.atlassian.net/browse/CA-1240 # As of release [google-cloud-bigquery 1.26.0 (2020-07-20)](https://github.com/googleapis/python-bigquery/blob/master/CHANGELOG.md#1260-2020-07-20) @@ -20,10 +28,9 @@ RUN pip3 uninstall -y google-cloud-bigquery-storage ENV USER jupyter USER $USER +ENV PIP_USER=true RUN jupyter nbextension install --user --py vega \ && jupyter nbextension enable --user --py vega \ && jupyter nbextension install --user --py ipycanvas \ && jupyter nbextension enable --user --py ipycanvas - -ENV PIP_USER=true diff --git a/docker/vm_boot_images/config/tensorflow-requirements.txt b/docker/vm_boot_images/config/tensorflow-requirements.txt index a85386eaf..deb682ee1 100644 --- a/docker/vm_boot_images/config/tensorflow-requirements.txt +++ b/docker/vm_boot_images/config/tensorflow-requirements.txt @@ -29,7 +29,7 @@ facets-overview plotnine vega ipycanvas>=0.7.0 -ipyannotations>=0.2.1 +ipyannotations==0.2.1 torch opencv-python blosc