[refactor] Introduce multi-mode startup and registry-based images

- Replace monolithic build flow with three operating modes: pull (default), local-build, publish
- Add version.txt for image tagging and multi-platform builds via buildx (--publish)
- Switch builder to tarball-based Quarto install for better cross-platform reliability
- Update docker-compose.yml and jupyterhub_config.py to use environment variables for image names, defaulting to registry images
- Refactor start-jupyterhub.sh: modular functions for image management, clearer flag handling and error messages
- Simplify Readme.md with structured tables instead of dense paragraphs, clarify data persistence and R package workflow
This commit is contained in:
Eric Coissac
2026-04-30 19:34:49 +02:00
parent 9484857d9a
commit 15faada234
6 changed files with 499 additions and 316 deletions
+7 -4
View File
@@ -55,12 +55,15 @@ RUN ARCH=$(dpkg --print-architecture) \
| tar -xz -C /usr/local/bin hugo \
&& chmod +x /usr/local/bin/hugo
# Install Quarto using the official .deb package (handles all dependencies properly)
# Install Quarto from the official tarball.
# Using tar.gz instead of .deb avoids dpkg and is more reliable in cross-arch
# (QEMU) builds where GitHub downloads are slower and more prone to transient errors.
ARG QUARTO_VERSION=1.6.42
RUN ARCH=$(dpkg --print-architecture) \
&& curl -fsSL -o /tmp/quarto.deb "https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-${ARCH}.deb" \
&& dpkg -i /tmp/quarto.deb \
&& rm /tmp/quarto.deb
&& curl -fsSL --retry 5 --retry-delay 10 \
"https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-${ARCH}.tar.gz" \
| tar -xz -C /opt \
&& ln -s "/opt/quarto-${QUARTO_VERSION}/bin/quarto" /usr/local/bin/quarto
# Create working directory
WORKDIR /workspace
+3 -4
View File
@@ -1,11 +1,8 @@
services:
jupyterhub:
build:
context: .
dockerfile: Dockerfile.hub
container_name: jupyterhub
hostname: jupyterhub
image: jupyterhub-hub:latest
image: ${HUB_IMAGE:-registry.metabarcoding.org/metabarschool/obijupyterhub-hub:latest}
expose:
- "8000"
volumes:
@@ -21,6 +18,8 @@ services:
- jupyterhub-network
restart: unless-stopped
environment:
# Docker image used for student containers (read by jupyterhub_config.py)
STUDENT_IMAGE: ${STUDENT_IMAGE:-registry.metabarcoding.org/metabarschool/obijupyterhub-student:latest}
# Shared password for all students
JUPYTERHUB_PASSWORD: metabar2025
# Admin password (for installing R packages)
+4 -1
View File
@@ -14,7 +14,10 @@ VOLUMES_BASE_PATH = '/volumes/users' # Path as seen from JupyterHub container (
HOST_VOLUMES_PATH = os.environ.get('HOST_VOLUMES_PATH', '/volumes') # Real path on host machine (parent dir)
# Docker image to use for student containers
c.DockerSpawner.image = 'jupyterhub-student:latest'
c.DockerSpawner.image = os.environ.get(
'STUDENT_IMAGE',
'registry.metabarcoding.org/metabarschool/obijupyterhub-student:latest'
)
# Docker network (create with: docker network create jupyterhub-network)
c.DockerSpawner.network_name = 'jupyterhub-network'