Skip to content

Commit f196e0f

Browse files
authored
update devbox and devhub (#42)
* update devbox * debug install * debug chp * debug CHP
1 parent c1d12e1 commit f196e0f

File tree

3 files changed

+30
-14
lines changed

3 files changed

+30
-14
lines changed

docker_devbox/hub.Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,23 @@ ARG ARG_KEEP_NODEJS=true
1414
COPY work /opt/utils/
1515

1616
RUN set -eux \
17-
&& chmod +x /opt/utils/*.sh \
17+
&& chmod +x /opt/utils/*.sh && rm -rf /opt/utils/etc_jupyter \
1818
# Setup JupyterHub
1919
&& source /opt/utils/script-devbox-jupyter.sh \
20-
&& mv /opt/utils/start-*.sh /usr/local/bin/ && chmod +x /usr/local/bin/start-*.sh \
21-
&& for profile in $(echo $ARG_PROFILE_JUPYTER | tr "," "\n") ; do ( setup_jupyter_${profile} || true ) ; done \
20+
&& for profile in $(echo $ARG_PROFILE_JUPYTER | tr "," "\n") ; do ( setup_jupyter_${profile} ) ; done \
2221
# If not keeping NodeJS, remove NoedJS to reduce image size, and install Traefik instead
2322
&& if [ ${ARG_KEEP_NODEJS} = "false" ] ; then \
2423
echo "Removing Node/NPM..." && rm -rf /usr/bin/node /usr/bin/npm /usr/bin/npx /opt/node ; \
2524
echo "Installing Traefik to server as proxy:" && source /opt/utils/script-setup-net.sh && setup_traefik ; \
2625
else \
2726
echo "Keep NodeJS as ARG_KEEP_NODEJS defiend as: ${ARG_KEEP_NODEJS}" ; \
2827
fi \
28+
# network-tools https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/main/images/network-tools/Dockerfile
29+
&& apt-get update && apt-get install -y --no-install-recommends \
30+
iptables dnsutils libcurl4 libpq5 sqlite3 \
31+
&& 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 \
32+
&& mv /opt/utils/start-*.sh /usr/local/bin/ \
33+
&& chmod +x /usr/local/bin/start-*.sh \
2934
# Clean up and display components version information...
3035
&& source /opt/utils/script-utils.sh && install__clean && list_installed_packages
3136

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
% This file contains python packages to be installed with pip line by line.
22
% Use percent char as line comment separator.
33

4+
nbgitpuller % https://github.com/jupyterhub/nbgitpuller
45
ipyparallel % https://github.com/ipython/ipyparallel
56
% jupyterlab_myst % https://github.com/executablebooks/jupyterlab-myst - BUG: https://github.com/jupyter-book/jupyterlab-myst/issues/243
67
jupytext % https://github.com/mwouts/jupytext
7-
ipynb % https://github.com/ipython/ipynb
88
jupyterlab_server[openapi] % https://github.com/jupyterlab/jupyterlab_server
99
jupyter-resource-usage % https://github.com/jupyter-server/jupyter-resource-usage
10-
jupyterlab_rise % https://github.com/jupyterlab-contrib/rise
1110
jupyterlab-git % https://github.com/jupyterlab/jupyterlab-git
12-
jupyterlab-language-pack-zh-CN % language pack: https://github.com/jupyterlab/language-packs/tree/main/language-packs/jupyterlab-language-pack-zh-CN
11+
jupyterlab-language-pack-zh-CN % lang pack: https://github.com/jupyterlab/language-packs/tree/main/language-packs/jupyterlab-language-pack-zh-CN
12+
jupyterlab-latex % https://github.com/jupyterlab/jupyterlab-latex
1313
% jupyter-collaboration % https://github.com/jupyterlab/jupyter-collaboration
14-
% jupyterlab-latex % bug on pypi version: https://github.com/jupyterlab/jupyterlab-latex
14+
% jupyterlab_rise % https://github.com/jupyterlab-contrib/rise
15+
% ipynb % https://github.com/ipython/ipynb

docker_devbox/work/script-devbox-jupyter.sh

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,23 @@ setup_jupyter_extensions() {
102102
setup_jupyter_hub() {
103103
# ref1: https://github.com/jupyterhub/jupyterhub
104104
# ref2: https://github.com/jupyterhub/jupyterhub/blob/main/Dockerfile
105-
which npm && ( npm install -g npm configurable-http-proxy ) || ( echo "NPM not found!" && return 255 )
106-
107-
pip install -Uq --pre jupyterhub \
108-
&& pip install -Uq oauthenticator jupyterhub-ldapauthenticator jupyterhub-kerberosauthenticator \
109-
&& pip install -Uq dockerspawner jupyterhub-kubespawner jupyterhub-systemdspawner wrapspawner \
110-
&& pip install -Uq psutil pycurl jupyter_client jupyterhub \
111-
&& pip install -Uq jupyterhub-traefik-proxy configurable-http-proxy
105+
# ref3: https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/main/images/hub/unfrozen/requirements.txt
106+
which npm && ( npm install -g npm configurable-http-proxy ) || ( echo "NPM not found!" && return 255 ) ;
107+
108+
pip install -Uq --pre jupyterhub jupyter_client \
109+
dockerspawner jupyterhub-kubespawner jupyterhub-systemdspawner wrapspawner \
110+
jupyterhub-ldapauthenticator jupyterhub-kerberosauthenticator \
111+
jupyterhub-firstuseauthenticator jupyterhub-hmacauthenticator jupyterhub-ltiauthenticator \
112+
jupyterhub-nativeauthenticator jupyterhub-tmpauthenticator \
113+
oauthenticator[googlegroups,mediawiki] jupyterhub-idle-culler \
114+
psycopg pymysql sqlalchemy-cockroachdb \
115+
psutil pycurl py-spy \
116+
jupyterhub-traefik-proxy ;
117+
118+
# Notes: there is also an python version of configurable-http-proxy available but has limited compatibility.
119+
ln -sf $(which configurable-http-proxy) /usr/local/bin/configurable-http-proxy ;
120+
121+
type configurable-http-proxy && echo "@ Configurable HTTP Proxy version: $(configurable-http-proxy --version)" || return -1 ;
112122

113123
type jupyterhub && echo "@ JupyterHub version: $(jupyterhub --version)" || return -1 ;
114124
}

0 commit comments

Comments
 (0)