Skip to content

Commit

Permalink
mitiaging Docker issues with conda, rise, and pip
Browse files Browse the repository at this point in the history
  • Loading branch information
turnmanh committed Feb 6, 2024
1 parent 1e92485 commit 5b055e7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
21 changes: 14 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,40 @@
FROM jupyter/minimal-notebook:python-3.9.7
FROM jupyter/minimal-notebook:python-3.10.11

# keep env var name in sync with config_local.yml
ARG PARTICIPANT_BUCKET_READ_SECRET
ENV PARTICIPANT_BUCKET_READ_SECRET=${PARTICIPANT_BUCKET_READ_SECRET}

RUN if [ -z "$PARTICIPANT_BUCKET_READ_SECRET" ]; \
then echo "The build arg PARTICIPANT_BUCKET_READ_SECRET must be set to non-zero, e.g. \
by passing the flag --build-arg PARTICIPANT_BUCKET_READ_SECRET=$PARTICIPANT_BUCKET_READ_SECRET. " &&\
by passing the flag --build-arg PARTICIPANT_BUCKET_READ_SECRET=$PARTICIPANT_BUCKET_READ_SECRET. " &&\
echo "If running in CI, this variable should have been included as GH secret in the repository settings." &&\
echo "If you are building locally and the env var is not set, \
you might find the corresponding value inside config.yml under the 'secret' key." &&\
you might find the corresponding value inside config.yml under the 'secret' key." &&\
exit 1; \
fi
fi

USER root
RUN apt-get update && apt-get upgrade -y

# pandoc needed for docs, see https://nbsphinx.readthedocs.io/en/0.7.1/installation.html?highlight=pandoc#pandoc
# gh-pages action uses rsync
RUN apt-get -y install pandoc git-lfs rsync
RUN apt-get -y install \
build-essential \
libblas-dev \
liblapack-dev \
gfortran \
pandoc \
git-lfs \
rsync

USER ${NB_UID}

WORKDIR /tmp
COPY build_scripts build_scripts
RUN bash build_scripts/install_presentation_requirements.sh

COPY requirements-test.txt .
RUN pip install -r requirements-test.txt
# COPY requirements-test.txt .
# RUN pip install -r requirements-test.txt


# NOTE: this breaks down when requirements contain pytorch (file system too large to fit in RAM, even with 16GB)
Expand Down
3 changes: 2 additions & 1 deletion build_scripts/install_presentation_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ BUILD_DIR=$(dirname "$0")

(
cd "${BUILD_DIR}/.." || (echo "Unknown error, could not find directory ${BUILD_DIR}" && exit 255)
conda install -y -c conda-forge notebook==6.5.6 jupyter rise==5.7.1 sphinx sphinx_rtd_theme jupyter-book jupyter_contrib_nbextensions jupyter_nbextensions_configurator
conda install -y -c conda-forge notebook==6.5.6 jupyter sphinx sphinx_rtd_theme jupyter-book jupyter_contrib_nbextensions jupyter_nbextensions_configurator
pip install rise==5.7.1
python build_scripts/configure_spellcheck_dict.py
jupyter contrib nbextension install --user
jupyter nbextensions_configurator enable --user
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ tensorboard-data-server==0.7.2
tensorflow==2.15.0
tensorflow-estimator==2.15.0
tensorflow-io-gcs-filesystem==0.34.0
tensorflow-macos==2.15.0
# tensorflow-macos==2.15.0
tensorflow-probability==0.23.0
termcolor==2.4.0
terminado==0.18.0
Expand Down

0 comments on commit 5b055e7

Please sign in to comment.