-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DO NOT MERGE] create a new 'rapids' conda environment instead of installing packages in the 'base' environment #713
Changes from 14 commits
4501d4f
5e0e3d7
894c6f1
9b0c398
a6ad9fa
4a9eae6
3879447
41e77b9
e149215
b36ee3e
15351b6
6a30e19
c836a9d
7c316ce
ac5b95e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,14 +57,52 @@ conda config --show-sources | |
conda list --show-channel-urls | ||
|
||
# Install RAPIDS | ||
mamba install -y -n base \ | ||
mamba create -y -n rapids \ | ||
"rapids=${RAPIDS_VER}.*" \ | ||
"python=${PYTHON_VER}.*" \ | ||
"cuda-version=${CUDA_VER%.*}.*" \ | ||
ipython | ||
|
||
conda clean -afy | ||
EOF | ||
|
||
# remove the 'conda activate base' in .bashrc that comes from miniforge-cuda, | ||
# to avoid that happening in the entrypoint script | ||
RUN sed -i.bak '/conda activate base/d' ~/.bashrc \ | ||
&& rm -f ./*.bak | ||
|
||
# manually activate the 'rapids' environment, to cause any filesystem changes made by activation scripts | ||
RUN . /opt/conda/etc/profile.d/conda.sh; conda activate rapids | ||
|
||
# Set more environment variables, to mimic what would happen with 'conda activate rapids' | ||
# | ||
# This is a workaround to allow RAPIDS libraries to be accessible to processes that bypass the entrypoint, | ||
# even though they aren't (and can't be) installed in the 'base' environment. | ||
# See the discussion in https://github.com/rapidsai/docker/issues/712. | ||
# | ||
# This list was generated by building this image without this ENV layer and running: | ||
# | ||
# env > ./old.txt | ||
# . /opt/conda/etc/profile.d/conda.sh; conda activate rapids | ||
# env > ./new.txt | ||
# diff -u ./old.txt ./new.txt | ||
# | ||
ENV \ | ||
CONDA_DEFAULT_ENV=rapids \ | ||
CONDA_PREFIX=/opt/conda/envs/rapids \ | ||
CONDA_PREFIX_1=/opt/conda/envs/rapids \ | ||
CONDA_PREFIX_2=/opt/conda \ | ||
CONDA_PROMPT_MODIFIER="(rapids)" \ | ||
CPL_ZIP_ENCODING=UTF-8 \ | ||
GDAL_DATA=/opt/conda/envs/rapids/share/gdal \ | ||
GDAL_DRIVER_PATH=/opt/conda/envs/rapids/lib/gdalplugins \ | ||
GSETTINGS_SCHEMA_DIR=/opt/conda/envs/rapids/share/glib-2.0/schemas \ | ||
GSETTINGS_SCHEMA_DIR_CONDA_BACKUP= \ | ||
PATH=/opt/conda/envs/rapids/bin:/opt/conda/condabin:/opt/conda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ | ||
PROJ_DATA=/opt/conda/envs/rapids/share/proj \ | ||
PROJ_NETWORK=ON \ | ||
XML_CATALOG_FILES="file:///opt/conda/envs/rapids/etc/xml/catalog file:///etc/xml/catalog" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of this is to make it feel like It's a hack and could hopefully be reverted completely in RAPIDS 24.12 through some combination of the following:
If reviewers agree with this approach, I'll write up a separate issue to track that work of reverting all of this. NOTE: I'm intentionally not doing this in the |
||
|
||
COPY entrypoint.sh /home/rapids/entrypoint.sh | ||
|
||
ENTRYPOINT ["/home/rapids/entrypoint.sh"] | ||
|
@@ -90,20 +128,20 @@ 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 | ||
mamba env update -n rapids -f test_notebooks_dependencies.yaml | ||
conda clean -afy | ||
EOF | ||
|
||
RUN <<EOF | ||
mamba install -y -n base \ | ||
mamba install -y -n rapids \ | ||
"jupyterlab=4" \ | ||
dask-labextension \ | ||
jupyterlab-nvdashboard | ||
conda clean -afy | ||
EOF | ||
|
||
# Disable the JupyterLab announcements | ||
RUN /opt/conda/bin/jupyter labextension disable "@jupyterlab/apputils-extension:announcements" | ||
RUN /opt/conda/envs/rapids/bin/jupyter labextension disable "@jupyterlab/apputils-extension:announcements" | ||
|
||
ENV DASK_LABEXTENSION__FACTORY__MODULE="dask_cuda" | ||
ENV DASK_LABEXTENSION__FACTORY__CLASS="LocalCUDACluster" | ||
|
@@ -140,7 +178,7 @@ LABEL com.nvidia.workbench.package-manager.apt.binary="/usr/bin/apt" | |
LABEL com.nvidia.workbench.package-manager.apt.installed-packages="" | ||
LABEL com.nvidia.workbench.package-manager.conda3.binary="/opt/conda/bin/conda" | ||
LABEL com.nvidia.workbench.package-manager.conda3.installed-packages="rapids cudf cuml cugraph rmm pylibraft cuspatial cuxfilter cucim xgboost jupyterlab" | ||
LABEL com.nvidia.workbench.package-manager.pip.binary="/opt/conda/bin/pip" | ||
LABEL com.nvidia.workbench.package-manager.pip.binary="/opt/conda/envs/rapids/bin/pip" | ||
LABEL com.nvidia.workbench.package-manager.pip.installed-packages="jupyterlab-nvdashboard" | ||
LABEL com.nvidia.workbench.programming-languages="python3" | ||
LABEL com.nvidia.workbench.schema-version="v2" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the environment hacking is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah you're right, it shouldn't be! I'll try reverting it.