Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions docker_devbox/hub.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,23 @@ 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 \
&& 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 ; \
echo "Installing Traefik to server as proxy:" && source /opt/utils/script-setup-net.sh && setup_traefik ; \
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 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

Expand Down
9 changes: 5 additions & 4 deletions docker_devbox/work/install_list_JPY_extend.pip
Original file line number Diff line number Diff line change
@@ -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
24 changes: 17 additions & 7 deletions docker_devbox/work/script-devbox-jupyter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,23 @@ 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 ;

# 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 ;

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