From c2ac2a1b1fa176af8a2de98b5184746c2692e827 Mon Sep 17 00:00:00 2001 From: haobibo Date: Sun, 9 Nov 2025 05:29:15 +0800 Subject: [PATCH 1/5] update devbox --- docker_devbox/hub.Dockerfile | 2 ++ .../work/install_list_JPY_extend.pip | 9 +++++---- docker_devbox/work/script-devbox-jupyter.sh | 19 ++++++++++++------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/docker_devbox/hub.Dockerfile b/docker_devbox/hub.Dockerfile index 5f77bd0..9922922 100644 --- a/docker_devbox/hub.Dockerfile +++ b/docker_devbox/hub.Dockerfile @@ -26,6 +26,8 @@ RUN set -eux \ else \ echo "Keep NodeJS as ARG_KEEP_NODEJS defiend as: ${ARG_KEEP_NODEJS}" ; \ fi \ + # network-tools https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/main/images/network-tools/Dockerfile + && apt-get update && apt-get install -y --no-install-recommends iptables \ # Clean up and display components version information... && source /opt/utils/script-utils.sh && install__clean && list_installed_packages diff --git a/docker_devbox/work/install_list_JPY_extend.pip b/docker_devbox/work/install_list_JPY_extend.pip index 2823595..22fa11b 100644 --- a/docker_devbox/work/install_list_JPY_extend.pip +++ b/docker_devbox/work/install_list_JPY_extend.pip @@ -1,14 +1,15 @@ % This file contains python packages to be installed with pip line by line. % Use percent char as line comment separator. +nbgitpuller % https://github.com/jupyterhub/nbgitpuller ipyparallel % https://github.com/ipython/ipyparallel % jupyterlab_myst % https://github.com/executablebooks/jupyterlab-myst - BUG: https://github.com/jupyter-book/jupyterlab-myst/issues/243 jupytext % https://github.com/mwouts/jupytext -ipynb % https://github.com/ipython/ipynb jupyterlab_server[openapi] % https://github.com/jupyterlab/jupyterlab_server jupyter-resource-usage % https://github.com/jupyter-server/jupyter-resource-usage -jupyterlab_rise % https://github.com/jupyterlab-contrib/rise jupyterlab-git % https://github.com/jupyterlab/jupyterlab-git -jupyterlab-language-pack-zh-CN % language pack: https://github.com/jupyterlab/language-packs/tree/main/language-packs/jupyterlab-language-pack-zh-CN +jupyterlab-language-pack-zh-CN % lang pack: https://github.com/jupyterlab/language-packs/tree/main/language-packs/jupyterlab-language-pack-zh-CN +jupyterlab-latex % https://github.com/jupyterlab/jupyterlab-latex % jupyter-collaboration % https://github.com/jupyterlab/jupyter-collaboration -% jupyterlab-latex % bug on pypi version: https://github.com/jupyterlab/jupyterlab-latex +% jupyterlab_rise % https://github.com/jupyterlab-contrib/rise +% ipynb % https://github.com/ipython/ipynb diff --git a/docker_devbox/work/script-devbox-jupyter.sh b/docker_devbox/work/script-devbox-jupyter.sh index ea386ea..1dcf1d8 100644 --- a/docker_devbox/work/script-devbox-jupyter.sh +++ b/docker_devbox/work/script-devbox-jupyter.sh @@ -102,13 +102,18 @@ setup_jupyter_extensions() { setup_jupyter_hub() { # ref1: https://github.com/jupyterhub/jupyterhub # ref2: https://github.com/jupyterhub/jupyterhub/blob/main/Dockerfile - which npm && ( npm install -g npm configurable-http-proxy ) || ( echo "NPM not found!" && return 255 ) - - pip install -Uq --pre jupyterhub \ - && pip install -Uq oauthenticator jupyterhub-ldapauthenticator jupyterhub-kerberosauthenticator \ - && pip install -Uq dockerspawner jupyterhub-kubespawner jupyterhub-systemdspawner wrapspawner \ - && pip install -Uq psutil pycurl jupyter_client jupyterhub \ - && pip install -Uq jupyterhub-traefik-proxy configurable-http-proxy + # ref3: https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/main/images/hub/unfrozen/requirements.txt + which npm && ( npm install -g npm configurable-http-proxy ) || ( echo "NPM not found!" && return 255 ) + + pip install -Uq --pre jupyterhub jupyter_client \ + dockerspawner jupyterhub-kubespawner jupyterhub-systemdspawner wrapspawner \ + jupyterhub-ldapauthenticator jupyterhub-kerberosauthenticator \ + jupyterhub-firstuseauthenticator jupyterhub-hmacauthenticator jupyterhub-ltiauthenticator \ + jupyterhub-nativeauthenticator jupyterhub-tmpauthenticator \ + oauthenticator[googlegroups,mediawiki] jupyterhub-idle-culler \ + psycopg pymysql sqlalchemy-cockroachdb \ + psutil pycurl py-spy \ + jupyterhub-traefik-proxy configurable-http-proxy type jupyterhub && echo "@ JupyterHub version: $(jupyterhub --version)" || return -1 ; } From 83fd2c5bb0b17accc9b52f2af6ec6374444c4663 Mon Sep 17 00:00:00 2001 From: haobibo Date: Sun, 9 Nov 2025 06:00:04 +0800 Subject: [PATCH 2/5] debug install --- docker_devbox/hub.Dockerfile | 2 +- docker_devbox/work/script-devbox-jupyter.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker_devbox/hub.Dockerfile b/docker_devbox/hub.Dockerfile index 9922922..e1ed12f 100644 --- a/docker_devbox/hub.Dockerfile +++ b/docker_devbox/hub.Dockerfile @@ -14,7 +14,7 @@ ARG ARG_KEEP_NODEJS=true COPY work /opt/utils/ RUN set -eux \ - && chmod +x /opt/utils/*.sh \ + && chmod +x /opt/utils/*.sh && rm -rf /opt/utils/etc_jupyter \ # Setup JupyterHub && source /opt/utils/script-devbox-jupyter.sh \ && mv /opt/utils/start-*.sh /usr/local/bin/ && chmod +x /usr/local/bin/start-*.sh \ diff --git a/docker_devbox/work/script-devbox-jupyter.sh b/docker_devbox/work/script-devbox-jupyter.sh index 1dcf1d8..7de2d53 100644 --- a/docker_devbox/work/script-devbox-jupyter.sh +++ b/docker_devbox/work/script-devbox-jupyter.sh @@ -106,7 +106,7 @@ setup_jupyter_hub() { which npm && ( npm install -g npm configurable-http-proxy ) || ( echo "NPM not found!" && return 255 ) pip install -Uq --pre jupyterhub jupyter_client \ - dockerspawner jupyterhub-kubespawner jupyterhub-systemdspawner wrapspawner \ + dockerspawner jupyterhub-kubespawner jupyterhub-systemdspawner wrapspawner \ jupyterhub-ldapauthenticator jupyterhub-kerberosauthenticator \ jupyterhub-firstuseauthenticator jupyterhub-hmacauthenticator jupyterhub-ltiauthenticator \ jupyterhub-nativeauthenticator jupyterhub-tmpauthenticator \ From 8b879f4968570b7a4a46a21411574ea25a984dbf Mon Sep 17 00:00:00 2001 From: haobibo Date: Sun, 9 Nov 2025 06:28:21 +0800 Subject: [PATCH 3/5] debug chp --- docker_devbox/hub.Dockerfile | 5 +++-- docker_devbox/work/script-devbox-jupyter.sh | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docker_devbox/hub.Dockerfile b/docker_devbox/hub.Dockerfile index e1ed12f..a77157f 100644 --- a/docker_devbox/hub.Dockerfile +++ b/docker_devbox/hub.Dockerfile @@ -18,7 +18,7 @@ RUN set -eux \ # Setup JupyterHub && source /opt/utils/script-devbox-jupyter.sh \ && mv /opt/utils/start-*.sh /usr/local/bin/ && chmod +x /usr/local/bin/start-*.sh \ - && for profile in $(echo $ARG_PROFILE_JUPYTER | tr "," "\n") ; do ( setup_jupyter_${profile} || true ) ; done \ + && for profile in $(echo $ARG_PROFILE_JUPYTER | tr "," "\n") ; do ( setup_jupyter_${profile} ) ; done \ # If not keeping NodeJS, remove NoedJS to reduce image size, and install Traefik instead && if [ ${ARG_KEEP_NODEJS} = "false" ] ; then \ echo "Removing Node/NPM..." && rm -rf /usr/bin/node /usr/bin/npm /usr/bin/npx /opt/node ; \ @@ -27,7 +27,8 @@ RUN set -eux \ echo "Keep NodeJS as ARG_KEEP_NODEJS defiend as: ${ARG_KEEP_NODEJS}" ; \ fi \ # network-tools https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/main/images/network-tools/Dockerfile - && apt-get update && apt-get install -y --no-install-recommends iptables \ + && apt-get update && apt-get install -y --no-install-recommends \ + iptables dnsutils libcurl4 libpq5 sqlite3 \ # Clean up and display components version information... && source /opt/utils/script-utils.sh && install__clean && list_installed_packages diff --git a/docker_devbox/work/script-devbox-jupyter.sh b/docker_devbox/work/script-devbox-jupyter.sh index 7de2d53..9e8cc75 100644 --- a/docker_devbox/work/script-devbox-jupyter.sh +++ b/docker_devbox/work/script-devbox-jupyter.sh @@ -113,7 +113,11 @@ setup_jupyter_hub() { oauthenticator[googlegroups,mediawiki] jupyterhub-idle-culler \ psycopg pymysql sqlalchemy-cockroachdb \ psutil pycurl py-spy \ - jupyterhub-traefik-proxy configurable-http-proxy + jupyterhub-traefik-proxy configurable-http-proxy ; + + ln -sf $(which configurable-http-proxy) /usr/local/bin/configurable-http-proxy ; + + type configurable-http-proxy && echo "@ Configurable HTTP Proxy version: $(configurable-http-proxy --version)" || return -1 ; type jupyterhub && echo "@ JupyterHub version: $(jupyterhub --version)" || return -1 ; } From 650036fe99ed2cb7dd2d1747f7a8075b90323e51 Mon Sep 17 00:00:00 2001 From: haobibo Date: Sun, 9 Nov 2025 08:14:02 +0800 Subject: [PATCH 4/5] debug CHP --- docker_devbox/hub.Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker_devbox/hub.Dockerfile b/docker_devbox/hub.Dockerfile index a77157f..0319e9a 100644 --- a/docker_devbox/hub.Dockerfile +++ b/docker_devbox/hub.Dockerfile @@ -17,7 +17,6 @@ RUN set -eux \ && chmod +x /opt/utils/*.sh && rm -rf /opt/utils/etc_jupyter \ # Setup JupyterHub && source /opt/utils/script-devbox-jupyter.sh \ - && mv /opt/utils/start-*.sh /usr/local/bin/ && chmod +x /usr/local/bin/start-*.sh \ && for profile in $(echo $ARG_PROFILE_JUPYTER | tr "," "\n") ; do ( setup_jupyter_${profile} ) ; done \ # If not keeping NodeJS, remove NoedJS to reduce image size, and install Traefik instead && if [ ${ARG_KEEP_NODEJS} = "false" ] ; then \ @@ -29,6 +28,9 @@ RUN set -eux \ # network-tools https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/main/images/network-tools/Dockerfile && apt-get update && apt-get install -y --no-install-recommends \ iptables dnsutils libcurl4 libpq5 sqlite3 \ + && curl -fsSL -o /usr/local/bin/start-configurable-http-proxy.sh https://raw.githubusercontent.com/jupyterhub/configurable-http-proxy/refs/heads/main/chp-docker-entrypoint \ + && mv /opt/utils/start-*.sh /usr/local/bin/ \ + && chmod +x /usr/local/bin/start-*.sh \ # Clean up and display components version information... && source /opt/utils/script-utils.sh && install__clean && list_installed_packages From ceca541054af0a260577c44a572ebfee5009b6f2 Mon Sep 17 00:00:00 2001 From: haobibo Date: Sun, 9 Nov 2025 09:08:44 +0800 Subject: [PATCH 5/5] update CHP --- docker_devbox/work/script-devbox-jupyter.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker_devbox/work/script-devbox-jupyter.sh b/docker_devbox/work/script-devbox-jupyter.sh index 9e8cc75..acc9da5 100644 --- a/docker_devbox/work/script-devbox-jupyter.sh +++ b/docker_devbox/work/script-devbox-jupyter.sh @@ -103,7 +103,7 @@ setup_jupyter_hub() { # ref1: https://github.com/jupyterhub/jupyterhub # ref2: https://github.com/jupyterhub/jupyterhub/blob/main/Dockerfile # ref3: https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/main/images/hub/unfrozen/requirements.txt - which npm && ( npm install -g npm configurable-http-proxy ) || ( echo "NPM not found!" && return 255 ) + which npm && ( npm install -g npm configurable-http-proxy ) || ( echo "NPM not found!" && return 255 ) ; pip install -Uq --pre jupyterhub jupyter_client \ dockerspawner jupyterhub-kubespawner jupyterhub-systemdspawner wrapspawner \ @@ -113,8 +113,9 @@ setup_jupyter_hub() { oauthenticator[googlegroups,mediawiki] jupyterhub-idle-culler \ psycopg pymysql sqlalchemy-cockroachdb \ psutil pycurl py-spy \ - jupyterhub-traefik-proxy configurable-http-proxy ; + jupyterhub-traefik-proxy ; + # Notes: there is also an python version of configurable-http-proxy available but has limited compatibility. ln -sf $(which configurable-http-proxy) /usr/local/bin/configurable-http-proxy ; type configurable-http-proxy && echo "@ Configurable HTTP Proxy version: $(configurable-http-proxy --version)" || return -1 ;