mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-18 07:22:57 +00:00
Pin jupyter_server>=2.0.0 (#1853)
* Pin jupyter_server==2.0.0 * Update scipy-notebook/Dockerfile Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com> * Fix test * Fix test * Test healthcheck properly * Fix typing Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
This commit is contained in:
@@ -68,7 +68,7 @@ RUN sed -re "s/c.ServerApp/c.NotebookApp/g" \
|
|||||||
# HEALTHCHECK documentation: https://docs.docker.com/engine/reference/builder/#healthcheck
|
# HEALTHCHECK documentation: https://docs.docker.com/engine/reference/builder/#healthcheck
|
||||||
# This healtcheck works well for `lab`, `notebook`, `nbclassic`, `server` and `retro` jupyter commands
|
# This healtcheck works well for `lab`, `notebook`, `nbclassic`, `server` and `retro` jupyter commands
|
||||||
# https://github.com/jupyter/docker-stacks/issues/915#issuecomment-1068528799
|
# https://github.com/jupyter/docker-stacks/issues/915#issuecomment-1068528799
|
||||||
HEALTHCHECK --interval=15s --timeout=3s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=5s --timeout=3s --start-period=5s --retries=3 \
|
||||||
CMD wget -O- --no-verbose --tries=1 --no-check-certificate \
|
CMD wget -O- --no-verbose --tries=1 --no-check-certificate \
|
||||||
http${GEN_CERT:+s}://localhost:8888${JUPYTERHUB_SERVICE_PREFIX:-/}api || exit 1
|
http${GEN_CERT:+s}://localhost:8888${JUPYTERHUB_SERVICE_PREFIX:-/}api || exit 1
|
||||||
|
|
||||||
|
@@ -39,6 +39,8 @@ RUN mamba install --quiet --yes \
|
|||||||
'h5py' \
|
'h5py' \
|
||||||
'ipympl'\
|
'ipympl'\
|
||||||
'ipywidgets' \
|
'ipywidgets' \
|
||||||
|
# Temporary fix for: https://github.com/jupyter/docker-stacks/issues/1851
|
||||||
|
'jupyter_server>=2.0.0' \
|
||||||
'matplotlib-base' \
|
'matplotlib-base' \
|
||||||
'numba' \
|
'numba' \
|
||||||
'numexpr' \
|
'numexpr' \
|
||||||
|
18
tests/base-notebook/test_healthcheck.py
Normal file
18
tests/base-notebook/test_healthcheck.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Copyright (c) Jupyter Development Team.
|
||||||
|
# Distributed under the terms of the Modified BSD License.
|
||||||
|
|
||||||
|
import logging
|
||||||
|
import time
|
||||||
|
|
||||||
|
from tests.conftest import TrackedContainer, get_health
|
||||||
|
|
||||||
|
LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def test_health(container: TrackedContainer) -> None:
|
||||||
|
running_container = container.run_detached(
|
||||||
|
tty=True,
|
||||||
|
)
|
||||||
|
# sleeping some time to let the server start
|
||||||
|
time.sleep(10)
|
||||||
|
assert get_health(running_container) == "healthy"
|
@@ -69,6 +69,7 @@ EXCLUDED_PACKAGES = [
|
|||||||
"ca-certificates",
|
"ca-certificates",
|
||||||
"conda-forge::blas[build=openblas]",
|
"conda-forge::blas[build=openblas]",
|
||||||
"hdf5",
|
"hdf5",
|
||||||
|
"jupyter_server[version='>", # Temporary fix for: https://github.com/jupyter/docker-stacks/issues/1851
|
||||||
"openssl",
|
"openssl",
|
||||||
"protobuf",
|
"protobuf",
|
||||||
"python",
|
"python",
|
||||||
|
@@ -24,6 +24,12 @@ def find_free_port() -> str:
|
|||||||
return s.getsockname()[1] # type: ignore
|
return s.getsockname()[1] # type: ignore
|
||||||
|
|
||||||
|
|
||||||
|
def get_health(container: Container) -> str:
|
||||||
|
api_client = docker.APIClient()
|
||||||
|
inspect_results = api_client.inspect_container(container.name)
|
||||||
|
return inspect_results["State"]["Health"]["Status"] # type: ignore
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def http_client() -> requests.Session:
|
def http_client() -> requests.Session:
|
||||||
"""Requests session with retries and backoff."""
|
"""Requests session with retries and backoff."""
|
||||||
|
Reference in New Issue
Block a user