Skip to content

Fix JupyterHub kernel connectivity, multi-arch Docker image, and JupyterHub 5.x compat#54

Merged
aregm merged 3 commits intomainfrom
fix/jupyter-websocket-timeout
Feb 17, 2026
Merged

Fix JupyterHub kernel connectivity, multi-arch Docker image, and JupyterHub 5.x compat#54
aregm merged 3 commits intomainfrom
fix/jupyter-websocket-timeout

Conversation

@aregm
Copy link
Owner

@aregm aregm commented Feb 17, 2026

Summary

Ingress fixes

  • Add proxy-read-timeout: 3600, proxy-send-timeout: 3600, and proxy-buffering: off nginx annotations to the JupyterHub ingress to keep WebSocket kernel connections alive.
  • Add PREFECT_API_REQUEST_TIMEOUT: 5 env var to prevent Prefect SDK from blocking kernel startup when the Prefect server is unavailable.

Singleuser image fixes (multi-arch + JupyterHub 5.x)

  • Dockerfile: Detect architecture dynamically for Miniforge (uname -m) and GitHub CLI (dpkg --print-architecture) instead of hardcoding x86_64/amd64 — enables Apple Silicon (arm64) builds.
  • Dockerfile: Add setuptools/wheel install for Python 3.12 compatibility (removed from stdlib).
  • Dockerfile: Replace pixz -9 with xz -3 -T0 for Docker Desktop memory compatibility.
  • entrypoint.sh: Replace pixz decompression with standard tar xf.
  • requirements.txt: Pin jupyterlab==4.5.3.

Terraform fixes

  • Remove JUPYTERHUB_SINGLEUSER_APP env var override that conflicts with z2jh 4.x internal server configuration and breaks kernel communication.
  • Update default singleuser image to locally-built icl-jupyterhub:local.

Test plan

  • Build Docker image: docker build . --file docker/icl-jupyterhub/Dockerfile --tag icl-jupyterhub:local
  • Load into Kind: kind --name x1 load docker-image icl-jupyterhub:local
  • Deploy JupyterHub and verify kernels start and execute code
  • Verify kernel stays connected after 60+ seconds idle
  • Build on Apple Silicon (arm64) — should download correct Miniforge and GitHub CLI

Areg Melik-Adamyan and others added 2 commits February 17, 2026 00:58
- deploy-kind.yaml: Remove push/PR triggers, keep only manual
  workflow_dispatch. The job requires a self-hosted runner with Docker
  which is not currently registered, causing jobs to queue forever.
- publish-pages.yaml: Bump configure-pages v3->v5,
  upload-pages-artifact v2->v3, deploy-pages v2->v4. The old v2
  actions depend on deprecated upload-artifact v3 which GitHub now
  blocks.

Co-authored-by: Cursor <cursoragent@cursor.com>
Jupyter kernels use long-lived WebSocket connections that were being
dropped by nginx after the default 60s timeout. Add proxy-read-timeout
and proxy-send-timeout (1 hour) and disable proxy-buffering to keep
kernel connections alive and stream frames in real time.

Co-authored-by: Cursor <cursoragent@cursor.com>
@aregm aregm requested a review from pbchekin as a code owner February 17, 2026 07:08
The Prefect 3.x SDK eagerly initializes its client when PREFECT_API_URL
is set. If the Prefect server is unreachable or slow to start, the
connection attempt blocks indefinitely, hanging the Jupyter kernel.

Set PREFECT_API_REQUEST_TIMEOUT=5 so the client fails fast (5 seconds)
instead of blocking forever, allowing the kernel to remain responsive
even when the Prefect server is temporarily unavailable.

Co-authored-by: Cursor <cursoragent@cursor.com>
@aregm aregm merged commit 286eb4b into main Feb 17, 2026
1 check passed
@aregm aregm changed the title Fix Jupyter kernel websocket timeouts via nginx annotations Fix JupyterHub kernel connectivity, multi-arch Docker image, and JupyterHub 5.x compat Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant