Skip to content

Commit

Permalink
updated INVALID config
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophSchranz committed Nov 26, 2024
1 parent dc6d68b commit 6acb083
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 39 deletions.
45 changes: 21 additions & 24 deletions .build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ USER root

# Install all OS dependencies for the Server that starts
# but lacks all features (e.g., download as all possible file formats)
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update --yes && \
# - `apt-get upgrade` is run to patch known vulnerabilities in system packages
# as the Ubuntu base image is rebuilt too seldom sometimes (less than once a month)
Expand All @@ -51,6 +51,10 @@ RUN apt-get update --yes && \
bzip2 \
ca-certificates \
locales \
# - `netbase` provides /etc/{protocols,rpc,services}, part of POSIX
# and required by various C functions like getservbyname and getprotobyname
# https://github.com/jupyter/docker-stacks/pull/2129
netbase \
sudo \
# - `tini` is installed as a helpful container entrypoint,
# that reaps zombie processes and such of the actual executable we want to start
Expand Down Expand Up @@ -85,7 +89,7 @@ RUN sed -i 's/^#force_color_prompt=yes/force_color_prompt=yes/' /etc/skel/.bashr
# and docs: https://docs.conda.io/projects/conda/en/latest/dev-guide/deep-dives/activation.html
echo 'eval "$(conda shell.bash hook)"' >> /etc/skel/.bashrc

# Create NB_USER with name jovyan user with UID=1000 and in the 'users' group
# Create "${NB_USER}" user (`jovyan` by default) with UID="${NB_UID}" (`1000` by default) and in the 'users' group
# and make sure these dirs are writable by the `users` group.
RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su && \
sed -i.bak -e 's/^%admin/#%admin/' /etc/sudoers && \
Expand Down Expand Up @@ -134,9 +138,9 @@ RUN set -x && \
--root-prefix="${CONDA_DIR}" \
--prefix="${CONDA_DIR}" \
--yes \
"${PYTHON_SPECIFIER}" \
'jupyter_core' \
'mamba' \
'jupyter_core' && \
"${PYTHON_SPECIFIER}" && \
rm -rf /tmp/bin/ && \
# Pin major.minor version of python
# https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#preventing-packages-from-updating-pinning
Expand Down Expand Up @@ -199,18 +203,18 @@ RUN apt-get update --yes && \

USER ${NB_UID}

# Install JupyterLab, Jupyter Notebook, JupyterHub and NBClassic
# Install JupyterHub, JupyterLab, NBClassic and Jupyter Notebook
# Generate a Jupyter Server config
# Cleanup temporary files
# Correct permissions
# Do all this in a single RUN command to avoid duplicating all of the
# files across image layers when the permissions change
WORKDIR /tmp
RUN mamba install --yes \
'jupyterlab' \
'notebook' \
'jupyterhub' \
'nbclassic' && \
'jupyterlab' \
'nbclassic' \
'notebook' && \
jupyter server --generate-config && \
mamba clean --all -f -y && \
npm cache clean --force && \
Expand Down Expand Up @@ -339,7 +343,7 @@ RUN mamba install --yes \
'dask' \
'dill' \
'h5py' \
'ipympl'\
'ipympl' \
'ipywidgets' \
'jupyterlab-git' \
'matplotlib-base' \
Expand All @@ -357,7 +361,7 @@ RUN mamba install --yes \
'sqlalchemy' \
'statsmodels' \
'sympy' \
'widgetsnbextension'\
'widgetsnbextension' \
'xlrd' && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
Expand Down Expand Up @@ -399,7 +403,7 @@ RUN mamba install --quiet --yes \
# using device_lib.list_local_devices() the cudNN version is shown, adapt version to tested compat
USER ${NB_UID}
RUN pip install --upgrade pip && \
pip install --no-cache-dir tensorflow==2.16.1 keras==3.1.1 && \
pip install --no-cache-dir tensorflow[and-cuda]==2.17.0 keras==3.6.0 && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"

Expand All @@ -410,11 +414,11 @@ RUN pip install --upgrade pip && \
# && torchviz==0.0.2 --extra-index-url https://download.pytorch.org/whl/cu121
RUN set -ex \
&& buildDeps=' \
torch==2.2.2 \
torchvision==0.17.2 \
torchaudio==2.2.2 \
torch==2.5.1 \
torchvision==0.20.1 \
torchaudio==2.5.1 \
' \
&& pip install --no-cache-dir $buildDeps --extra-index-url https://download.pytorch.org/whl/cu121 \
&& pip install --no-cache-dir $buildDeps --extra-index-url https://download.pytorch.org/whl/cu124 \
&& fix-permissions "${CONDA_DIR}" \
&& fix-permissions "/home/${NB_USER}"

Expand All @@ -426,14 +430,6 @@ RUN apt-get update && \
apt-get install -y --no-install-recommends cmake libncurses5-dev libncursesw5-dev git && \
apt-get clean && rm -rf /var/lib/apt/lists/*

USER $NB_UID
# These need to be two separate pip install commands, otherwise it will throw an error
# attempting to resolve the nvidia-cuda-nvcc package at the same time as nvidia-pyindex
RUN pip install --no-cache-dir nvidia-pyindex && \
pip install --no-cache-dir nvidia-cuda-nvcc && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"

# reinstall nvcc with cuda-nvcc to install ptax
USER $NB_UID
# These need to be two separate pip install commands, otherwise it will throw an error
Expand All @@ -443,7 +439,8 @@ RUN pip install --no-cache-dir nvidia-pyindex && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"

# Install cuda-nvcc with sepecific version, see here: https://anaconda.org/nvidia/cuda-nvcc/labels
# Install cuda-nvcc with sepecific version, see here:
# https://anaconda.org/nvidia/cuda-nvcc/labels
RUN mamba install -c nvidia cuda-nvcc=12.3.107 -y && \
mamba clean --all -f -y && \
fix-permissions $CONDA_DIR && \
Expand Down
2 changes: 1 addition & 1 deletion .build/docker-stacks
Submodule docker-stacks updated 36 files
+1 −1 .github/workflows/docker-build-test-upload.yml
+1 −1 .github/workflows/docker-merge-tags.yml
+1 −1 .github/workflows/docker-tag-push.yml
+1 −1 .github/workflows/docker-wiki-update.yml
+10 −10 .pre-commit-config.yaml
+1 −1 Makefile
+8 −7 README.md
+4 −2 binder/Dockerfile
+1 −0 docs/conf.py
+1 −1 docs/contributing/lint.md
+1 −1 docs/contributing/stacks.md
+1 −1 docs/maintaining/aarch64-runner.md
+2 −2 docs/using/common.md
+2 −2 docs/using/faq.md
+1 −1 docs/using/recipe_code/microsoft_odbc.dockerfile
+14 −13 docs/using/recipe_code/oracledb.dockerfile
+4 −4 docs/using/recipes.md
+8 −8 docs/using/running.md
+11 −7 docs/using/selecting.md
+3 −3 docs/using/troubleshooting.md
+1 −1 images/all-spark-notebook/Dockerfile
+4 −4 images/base-notebook/Dockerfile
+2 −2 images/base-notebook/docker_healthcheck.py
+8 −4 images/docker-stacks-foundation/Dockerfile
+9 −5 images/docker-stacks-foundation/start.sh
+2 −2 images/pytorch-notebook/Dockerfile
+9 −4 images/pytorch-notebook/cuda11/Dockerfile
+9 −4 images/pytorch-notebook/cuda12/Dockerfile
+2 −2 images/scipy-notebook/Dockerfile
+5 −1 images/tensorflow-notebook/Dockerfile
+10 −0 images/tensorflow-notebook/cuda/20tensorboard-proxy-env.sh
+10 −1 images/tensorflow-notebook/cuda/Dockerfile
+2 −2 images/tensorflow-notebook/cuda/nvidia-lib-dirs.sh
+39 −0 tests/docker-stacks-foundation/test_user_options.py
+1 −0 tests/scipy-notebook/data/matplotlib/matplotlib_1.py
+1 −0 tests/scipy-notebook/units/unit_pandas.py
4 changes: 2 additions & 2 deletions .build/docker_healthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import requests

# Several operations below deliberately don't check for possible errors
# As this is a healthcheck, it should succeed or raise an exception on error
# As this is a health check, it should succeed or raise an exception on error

# Docker runs healtchecks using an exec
# Docker runs health checks using an exec
# It uses the default user configured when running the image: root for the case of a custom NB_USER or jovyan for the case of the default image user.
# We manually change HOME to make `jupyter --runtime-dir` report a correct path
# More information: <https://github.com/jupyter/docker-stacks/pull/2074#issuecomment-1879778409>
Expand Down
14 changes: 9 additions & 5 deletions .build/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,14 @@ if [ "$(id -u)" == 0 ]; then
unset_explicit_env_vars

_log "Running as ${NB_USER}:" "${cmd[@]}"
exec sudo --preserve-env --set-home --user "${NB_USER}" \
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" \
PATH="${PATH}" \
PYTHONPATH="${PYTHONPATH:-}" \
"${cmd[@]}"
if [ "${NB_USER}" = "root" ] && [ "${NB_UID}" = "$(id -u "${NB_USER}")" ] && [ "${NB_GID}" = "$(id -g "${NB_USER}")" ]; then
HOME="/home/root" exec "${cmd[@]}"
else
exec sudo --preserve-env --set-home --user "${NB_USER}" \
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" \
PATH="${PATH}" \
PYTHONPATH="${PYTHONPATH:-}" \
"${cmd[@]}"
# Notes on how we ensure that the environment that this container is started
# with is preserved (except vars listed in JUPYTER_ENV_VARS_TO_UNSET) when
# we transition from running as root to running as NB_USER.
Expand Down Expand Up @@ -187,6 +190,7 @@ if [ "$(id -u)" == 0 ]; then
# above in /etc/sudoers.d/path. Thus PATH is irrelevant to how the above
# sudo command resolves the path of `${cmd[@]}`. The PATH will be relevant
# for resolving paths of any subprocesses spawned by `${cmd[@]}`.
fi

# The container didn't start as the root user, so we will have to act as the
# user we started as.
Expand Down
13 changes: 7 additions & 6 deletions custom/gpulibs.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN mamba install --quiet --yes \
# using device_lib.list_local_devices() the cudNN version is shown, adapt version to tested compat
USER ${NB_UID}
RUN pip install --upgrade pip && \
pip install --no-cache-dir tensorflow==2.16.1 keras==3.1.1 && \
pip install --no-cache-dir tensorflow[and-cuda]==2.17.0 keras==3.6.0 && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"

Expand All @@ -25,11 +25,11 @@ RUN pip install --upgrade pip && \
# && torchviz==0.0.2 --extra-index-url https://download.pytorch.org/whl/cu121
RUN set -ex \
&& buildDeps=' \
torch==2.2.2 \
torchvision==0.17.2 \
torchaudio==2.2.2 \
torch==2.5.1 \
torchvision==0.20.1 \
torchaudio==2.5.1 \
' \
&& pip install --no-cache-dir $buildDeps --extra-index-url https://download.pytorch.org/whl/cu121 \
&& pip install --no-cache-dir $buildDeps --extra-index-url https://download.pytorch.org/whl/cu124 \
&& fix-permissions "${CONDA_DIR}" \
&& fix-permissions "/home/${NB_USER}"

Expand All @@ -50,7 +50,8 @@ RUN pip install --no-cache-dir nvidia-pyindex && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"

# Install cuda-nvcc with sepecific version, see here: https://anaconda.org/nvidia/cuda-nvcc/labels
# Install cuda-nvcc with sepecific version, see here:
# https://anaconda.org/nvidia/cuda-nvcc/labels
RUN mamba install -c nvidia cuda-nvcc=12.3.107 -y && \
mamba clean --all -f -y && \
fix-permissions $CONDA_DIR && \
Expand Down
2 changes: 1 addition & 1 deletion generate-Dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cd $(cd -P -- "$(dirname -- "$0")" && pwd -P)
export DOCKERFILE=".build/Dockerfile"
export STACKS_DIR=".build/docker-stacks"
# please test the build of the commit in https://github.com/jupyter/docker-stacks/commits/main in advance
export HEAD_COMMIT="e838ff397a2d9c2ad0faae051ef0ec4f20732320"
export HEAD_COMMIT="00987883e58d139b5ed01f803f95e639c59bf340"

while [[ "$#" -gt 0 ]]; do case $1 in
-p|--pw|--password) PASSWORD="$2" && USE_PASSWORD=1; shift;;
Expand Down

0 comments on commit 6acb083

Please sign in to comment.