Skip to content

Update icl-jupyterhub image to 0.0.23 for Prefect 3.x - #56

Merged
aregm merged 1 commit into
mainfrom
update-jupyterhub-image-prefect3
Jul 14, 2026
Merged

Update icl-jupyterhub image to 0.0.23 for Prefect 3.x#56
aregm merged 1 commit into
mainfrom
update-jupyterhub-image-prefect3

Conversation

@aregm

@aregm aregm commented Jul 14, 2026

Copy link
Copy Markdown
Owner

What

Bumps the JupyterHub single-user image to pbchekin/icl-jupyterhub:0.0.23 and fixes everything needed to actually build and roll it out:

  • Tag bump to 0.0.23 in terraform/icl/variables.tf (jupyterhub_singleuser_default_image), the docker-icl-jupyterhub workflow default, the Triton image base (FROM), and scripts/etc/kind/images.txt (which still listed 0.0.18).
  • Dockerfile build fix: official python:3.12 images no longer bundle setuptools/wheel, so the jupyter_codeserver_proxy step (setup.py bdist_wheel) failed with ModuleNotFoundError: No module named 'setuptools'. Now installed explicitly in the builder stage.
  • entrypoint.sh upgrade handling: user home directories are persistent volumes, so existing users kept the old python-3.9 conda env (with a Prefect 2.13-era infractl) forever — the entrypoint only extracted the conda template on first boot. Now, if the expected python-3.12 kernel env is missing, the old prefix is backed up to ~/.conda.bak.<timestamp> (not deleted), the new template is extracted, and .profile is repointed. The kernel display-name fix is also idempotent now instead of first-boot-only.
  • ICL_JUPYTERHUB_IMAGE override in kind.sh so a locally built image (e.g. loaded with kind load docker-image) can be deployed without pushing to Docker Hub.
  • readme.md: dropped PREFECT_VERSION/MODIN_VERSION/RAY_VERSION build args that the Dockerfile no longer accepts.

Why

The published 0.0.22 image dates from October 2024 and predates the Prefect 3.6 migration: its kernel ships infractl with Prefect 2.13, which cannot talk to the Prefect 3.6.17 server that terraform/icl now deploys. Users following the README example hit griffe/circular-import errors from the stale client, and even redeploying with a new image would not have fixed existing sessions because of the persistent-home issue above.

Notes for reviewers

  • 0.0.23 does not exist on Docker Hub yet — the image needs to be built and pushed (workflow docker-icl-jupyterhub.yaml) before/alongside merging, or deployed locally via the new ICL_JUPYTERHUB_IMAGE override.
  • The fixed build step was verified in a clean python:3.12-bookworm container; the infractl wheel baked into the image was verified to require prefect>=3.6,<4.
  • The GPU profile images (icl-jupyterhub-gpu:0.0.21, Intel/NVIDIA variants) are still on old tags and need the same treatment separately.

🤖 Generated with Claude Code

The deployed singleuser image (0.0.22, built Oct 2024) predates the
Prefect 3.6 migration: its kernel environment ships infractl with
Prefect 2.13, which cannot talk to the Prefect 3.6.17 server that
terraform/icl now installs.

- Bump icl-jupyterhub tag to 0.0.23 in terraform/icl variables, the
  build workflow default, the triton image base, and kind images.txt
  (which still listed 0.0.18).
- Fix the image build on python:3.12-bookworm: the official 3.12
  images no longer bundle setuptools/wheel, so the
  jupyter_codeserver_proxy step ("setup.py bdist_wheel") failed with
  ModuleNotFoundError.
- Refresh a stale conda prefix in entrypoint.sh: home directories are
  persistent volumes, so existing users kept the old python-3.9
  environment forever. If the expected kernel env is missing, back up
  ~/.conda and extract the new one, and point .profile at the new env.
  Also make the kernel display-name fix idempotent instead of
  first-boot-only.
- Allow overriding the singleuser image in kind.sh via
  ICL_JUPYTERHUB_IMAGE, so a locally built image can be deployed
  without pushing to Docker Hub.
- Update docker/icl-jupyterhub/readme.md: drop PREFECT_VERSION /
  MODIN_VERSION / RAY_VERSION build args the Dockerfile no longer
  accepts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@aregm
aregm requested a review from pbchekin as a code owner July 14, 2026 04:54
@aregm
aregm merged commit fb032c2 into main Jul 14, 2026
1 check passed
@aregm

aregm commented Jul 14, 2026

Copy link
Copy Markdown
Owner Author

Pushed a second commit: full migration of the prefect_runtime plugin to Prefect 3.x (75b0978).

After deploying the new image, running the README example surfaced that the plugin still used the Prefect 2 deployment model (deployments.Deployment.build_from_flow, infrastructure.KubernetesJob), all removed in Prefect 3 — importing the default runtime raised PrefectImportError. The earlier partial migration had skipped the affected test modules via collect_ignore_glob to keep CI green.

Key changes:

  • Deployments are created via PrefectClient.create_flow/create_deployment targeting the default-pool kubernetes work pool (matching the worker installed by terraform/modules/prefect).
  • Code and runtime files are delivered with native pull steps (pull_with_blockrun_shell_scriptset_working_directory) instead of overriding the job command.
  • Per-deployment Kubernetes manifest surgery (customizations, manifest_filter, gpus, prefect_shared_volume_mount) is not expressible in the Prefect 3 work pool model and now raises PrefectRuntimeError with guidance. Follow-up: extend the work pool base job template to restore GPU/shared-volume support and migrate the remote docker builder.
  • docker/icl-prefect now builds on the Prefect 3 / Python 3.12 base (Modin/Ray optional, obsolete cryptography pin dropped).

Verified: 44 unit tests pass on Prefect 3.6.17, and both README examples (plain Python program and Prefect flow) run to completion end-to-end on a kind cluster against Prefect server 3.6.17.

Note: pbchekin/icl-prefect:3.6.17-py3.12-icl0.0.4 (the default flow-run image in defaults.py) is not on Docker Hub — the newest published tag is 2.20.16-py3.9. It needs to be built and pushed (there is no CI workflow for this image); until then, build locally and kind load it.

🤖 Generated with Claude Code

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