Skip to content

Commit

Permalink
Merge pull request #1308 from romainx/iss-1306
Browse files Browse the repository at this point in the history
Install tini from the ubuntu package
  • Loading branch information
mathbunnyru authored May 19, 2021
2 parents 3fe198a + 0aabfa4 commit 855a3b9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
5 changes: 2 additions & 3 deletions base-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ ARG miniforge_checksum="d4065b376f81b83cfef0c7316f97bb83337e4ae27eb988828363a578
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -q update && \
apt-get install -yq --no-install-recommends \
tini \
wget \
ca-certificates \
sudo \
Expand Down Expand Up @@ -115,10 +116,8 @@ RUN wget --quiet "https://github.com/conda-forge/miniforge/releases/download/${m
conda list python | grep '^python ' | tr -s ' ' | cut -d '.' -f 1,2 | sed 's/$/.*/' >> $CONDA_DIR/conda-meta/pinned && \
conda install --quiet --yes \
"conda=${CONDA_VERSION}" \
'pip' \
'tini=0.18.0' && \
'pip' && \
conda update --all --quiet --yes && \
conda list tini | grep tini | tr -s ' ' | cut -d ' ' -f 1,2 >> $CONDA_DIR/conda-meta/pinned && \
conda clean --all -f -y && \
rm -rf /home/$NB_USER/.cache/yarn && \
fix-permissions $CONDA_DIR && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@


@pytest.mark.parametrize(
"env,expected_server",
[
(["JUPYTER_ENABLE_LAB=yes"], "lab"),
(None, "notebook"),
],
"env,expected_server", [(["JUPYTER_ENABLE_LAB=yes"], "lab"), (None, "notebook"), ],
)
def test_start_notebook(container, http_client, env, expected_server):
"""Test the notebook start-notebook script"""
Expand All @@ -31,3 +27,17 @@ def test_start_notebook(container, http_client, env, expected_server):
if not env:
msg = "WARN: Jupyter Notebook deprecation notice"
assert msg in logs, f"Expected warning message {msg} not printed"


def test_tini_entrypoint(container, pid=1, command="tini"):
"""Check that tini is launched as PID 1
Credits to the following answer for the ps options used in the test:
https://superuser.com/questions/632979/if-i-know-the-pid-number-of-a-process-how-can-i-get-its-name
"""
LOGGER.info(f"Test that {command} is launched as PID {pid} ...")
c = container.run(tty=True, command=["start.sh"])
# Select the PID 1 and get the corresponding command
cmd = c.exec_run(f"ps -p {pid} -o comm=")
output = cmd.output.decode("utf-8").strip("\n")
assert output == command, f"{command} shall be launched as pid {pid}, got {output}"
2 changes: 1 addition & 1 deletion docs/using/selecting.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ core images and link them below.
**nvidia/cuda** base image, the well-maintained **docker-stacks** that is integrated as submodule
and GPU-able libraries like **Tensorflow**, **Keras** and **PyTorch** on top of it.

- [PRP GPU Jupyter repo](https://gitlab.nautilus.optiputer.net/prp/jupyter-stack/-/tree/prp) and [Registry](https://gitlab.nautilus.optiputer.net/prp/jupyter-stack/container_registry): PRP (Pacific Research Platform) maintained registry for jupyter stack based on NVIDIA CUDA-enabled image. Added the PRP image with Pytorch and some other python packages, and GUI Desktop notebook based on https://github.com/jupyterhub/jupyter-remote-desktop-proxy.
- [PRP GPU Jupyter repo](https://gitlab.nautilus.optiputer.net/prp/jupyter-stack/-/tree/prp) and [Registry](https://gitlab.nautilus.optiputer.net/prp/jupyter-stack/container_registry): PRP (Pacific Research Platform) maintained registry for jupyter stack based on NVIDIA CUDA-enabled image. Added the PRP image with Pytorch and some other python packages, and GUI Desktop notebook based on <https://github.com/jupyterhub/jupyter-remote-desktop-proxy>.

- [cgspatial-notebook](https://github.com/SCiO-systems/cgspatial-notebook) is a community Jupyter
Docker Stack image. The image includes major geospatial Python & R libraries on top of the
Expand Down

0 comments on commit 855a3b9

Please sign in to comment.