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
13 changes: 13 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,22 @@
--build-arg "BASE_IMG=node" \
--build-arg "ARG_PROFILE_JUPYTER=hub"
push_image dev-hub

job-dev-hub-traefik:
name: "dev-hub-traefik"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- run: |
source ./tool.sh
build_image dev-hub-traefik latest docker_devbox/hub.Dockerfile \
--build-arg "BASE_IMG=base" \
--build-arg "ARG_PROFILE_JUPYTER=hub" \
--build-arg "ARG_KEEP_NODEJS=false"
push_image dev-hub-traefik

## OpenResty as gateway
job-openresty:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
name: "openresty"
runs-on: ubuntu-latest
steps:
Expand Down
14 changes: 10 additions & 4 deletions docker_devbox/hub.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,21 @@ RUN set -eux \
&& 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 ; \
# Using Traefik to server as proxy, which is a modern HTTP reverse proxy and load balancer that makes deploying microservices easy.
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}" ; \
# Using NodeJS to install configurable-http-proxy, which is a dependency of JupyterHub, and also used as the default proxy for JupyterHub.
echo "Keep NodeJS as ARG_KEEP_NODEJS defiend as: ${ARG_KEEP_NODEJS}" ; \
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 ; \
which npm && ( npm install -g npm configurable-http-proxy ) || ( echo "NPM not found!" && return 255 ) ; \
# 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 ; \
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...
Expand Down
7 changes: 0 additions & 7 deletions docker_devbox/work/script-devbox-jupyter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ 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 ) ;

pip install -Uq --pre jupyterhub jupyter_client \
dockerspawner jupyterhub-kubespawner jupyterhub-systemdspawner wrapspawner \
jupyterhub-ldapauthenticator jupyterhub-kerberosauthenticator \
Expand All @@ -115,10 +113,5 @@ setup_jupyter_hub() {
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 ;
}