mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-10 19:42:58 +00:00
Install tini as an ubuntu package
This commit is contained in:
@@ -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 \
|
||||
@@ -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 && \
|
||||
|
@@ -8,11 +8,7 @@ LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@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"""
|
||||
@@ -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}"
|
Reference in New Issue
Block a user