Skip to content

Commit

Permalink
Revert "Switch to heredocs (#611)"
Browse files Browse the repository at this point in the history
This reverts commit 3fc15ee.
  • Loading branch information
raydouglass committed Dec 7, 2023
1 parent 3fc15ee commit 8db640c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 53 deletions.
36 changes: 14 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ ARG DASK_SQL_VER

ARG RAPIDS_BRANCH="branch-${RAPIDS_VER}"

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

RUN pip install --upgrade conda-merge rapids-dependency-file-generator

COPY condarc /condarc
Expand All @@ -43,15 +41,13 @@ WORKDIR /home/rapids

COPY condarc /opt/conda/.condarc

RUN <<EOF
mamba install -y -n base \
"rapids=${RAPIDS_VER}.*" \
"dask-sql=${DASK_SQL_VER%.*}.*" \
"python=${PYTHON_VER}.*" \
"cuda-version=${CUDA_VER%.*}.*" \
ipython
conda clean -afy
EOF
RUN mamba install -y -n base \
"rapids=${RAPIDS_VER}.*" \
"dask-sql=${DASK_SQL_VER%.*}.*" \
"python=${PYTHON_VER}.*" \
"cuda-version=${CUDA_VER%.*}.*" \
ipython \
&& conda clean -afy

COPY entrypoint.sh /home/rapids/entrypoint.sh

Expand All @@ -71,19 +67,15 @@ COPY --from=dependencies --chown=rapids /test_notebooks_dependencies.yaml test_n

COPY --from=dependencies --chown=rapids /notebooks /home/rapids/notebooks

RUN <<EOF
mamba env update -n base -f test_notebooks_dependencies.yaml
conda clean -afy
EOF
RUN mamba env update -n base -f test_notebooks_dependencies.yaml \
&& conda clean -afy

RUN <<EOF
mamba install -y -n base \
RUN mamba install -y -n base \
"jupyterlab=3" \
dask-labextension
pip install jupyterlab-nvdashboard
conda clean -afy
pip cache purge
EOF
dask-labextension \
&& pip install jupyterlab-nvdashboard \
&& conda clean -afy \
&& pip cache purge

ENV DASK_LABEXTENSION__FACTORY__MODULE="dask_cuda"
ENV DASK_LABEXTENSION__FACTORY__CLASS="LocalCUDACluster"
Expand Down
26 changes: 10 additions & 16 deletions raft-ann-bench/cpu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,26 @@ ARG PYTHON_VER

COPY condarc /opt/conda/.condarc

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

# Create a data folder accessible by any user so mounted volumes under it can be accessible
# when the user passes their uid to docker run with -u $(id -u)
# Also add the conda_prefix config to the global bashrc file so that all users have it correctly configured.
RUN <<EOF
mkdir /data
chmod 777 /data
echo ". /opt/conda/etc/profile.d/conda.sh; conda activate base" >> /etc/bash.bashrc
EOF
RUN mkdir /data && chmod 777 /data \
&& ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh; \
echo ". /opt/conda/etc/profile.d/conda.sh; conda activate base" >> /etc/bash.bashrc

# we need perl temporarily for the remaining benchmark perl scripts
RUN apt-get install perl -y

# Install python before updating environment, otherwise Python 3.9 image
# runs into a solver conflict with truststore 0.8.0. This avoids the environment installing
# packages incompatible with python version needed before python itself is pinned to the correct version.
RUN <<EOF
mamba install -y -n base "python=${PYTHON_VER}"
mamba update --all -y -n base
mamba install -y -n base \
"raft-ann-bench-cpu=${RAPIDS_VER}.*" \
"python=${PYTHON_VER}"
conda clean -afy
chmod -R 777 /opt/conda
EOF
RUN mamba install -y -n base "python=${PYTHON_VER}" \
&& mamba update --all -y -n base \
&& mamba install -y -n base \
"raft-ann-bench-cpu=${RAPIDS_VER}.*" \
"python=${PYTHON_VER}" \
&& conda clean -afy \
&& chmod -R 777 /opt/conda

RUN useradd -rm -d /home/rapids -s /bin/bash -u 1001 rapids
USER rapids
Expand Down
24 changes: 9 additions & 15 deletions raft-ann-bench/gpu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,24 @@ ARG RAPIDS_VER

COPY condarc /opt/conda/.condarc

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

# Create a data folder accessible by any user so mounted volumes under it can be accessible
# when the user passes their uid to docker run with -u $(id -u)
# Also add the conda_prefix config to the global bashrc file so that all users have it correctly configured.
RUN <<EOF
mkdir /data
chmod 777 /data
echo ". /opt/conda/etc/profile.d/conda.sh; conda activate base" >> /etc/bash.bashrc
EOF
RUN mkdir /data && chmod 777 /data \
&& ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh; \
echo ". /opt/conda/etc/profile.d/conda.sh; conda activate base" >> /etc/bash.bashrc

# we need perl temporarily for the remaining benchmark perl scripts
RUN apt-get install perl -y

# temporarily downgrade conda from 23.9.0 due to https://github.com/mamba-org/mamba/issues/2882
# after the mamba update step
RUN <<EOF
mamba update --all -y -n base
mamba install -y -n base \
"raft-ann-bench=${RAPIDS_VER}.*" \
"cuda-version=${CUDA_VER%.*}.*"
conda clean -afy
chmod -R 777 /opt/conda
EOF
RUN mamba update --all -y -n base \
&& mamba install -y -n base \
"raft-ann-bench=${RAPIDS_VER}.*" \
"cuda-version=${CUDA_VER%.*}.*" \
&& conda clean -afy \
&& chmod -R 777 /opt/conda

# We add rapids is the default user in case the user runs without -u,
# but users are encouraged to use the -u docker run flag to write/read to mounted volumes.
Expand Down

0 comments on commit 8db640c

Please sign in to comment.