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
2 changes: 1 addition & 1 deletion .github/workflows/docker-icl-jupyterhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
type: string
description: Image tag
required: true
default: 0.0.22
default: 0.0.23
push:
description: Push image to DockerHub
required: true
Expand Down
2 changes: 1 addition & 1 deletion docker/icl-jupyterhub-triton/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG BASE_TAG

FROM pbchekin/icl-jupyterhub:0.0.22
FROM pbchekin/icl-jupyterhub:0.0.23

USER root

Expand Down
2 changes: 2 additions & 0 deletions docker/icl-jupyterhub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ RUN set -ex; \
python -m build

RUN set -ex; \
# python:3.12 images do not include setuptools and wheel, required for "setup.py bdist_wheel"
pip install setuptools wheel; \
git clone https://github.com/dirkcgrunwald/jupyter_codeserver_proxy-.git; \
cd jupyter_codeserver_proxy-; \
make build-package
Expand Down
20 changes: 17 additions & 3 deletions docker/icl-jupyterhub/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ cd ~
if [[ ! -d $conda_prefix ]]; then
echo "$conda_prefix does not exists, copying from /template"
tar x -Ipixz -f /template/conda.tar.xz
elif [[ ! -d $conda_prefix/envs/$kernel_env ]]; then
# The existing conda prefix was created by an older image and does not have
# the expected kernel environment: back it up and copy a new one from /template.
conda_backup=$HOME/.conda.bak.$(date +%Y%m%d%H%M%S)
echo "$conda_prefix does not have environment $kernel_env, moving it to $conda_backup and copying from /template"
mv $conda_prefix $conda_backup
tar x -Ipixz -f /template/conda.tar.xz
# .profile may activate an environment that only exists in the old prefix
if [[ -f ~/.profile ]]; then
sed -i "s/^conda activate python-3\..*/conda activate $kernel_env/" ~/.profile
fi
unset conda_backup
fi

if [[ ! -f ~/.profile ]]; then
Expand All @@ -39,13 +51,15 @@ if [[ ! -f ~/.jupyter/jupyter_config.json ]]; then
}
}
EOF
fi

# Use environment name for display_name
kernel_json=$conda_prefix/envs/$kernel_env/share/jupyter/kernels/python3/kernel.json
# Use environment name for display_name
kernel_json=$conda_prefix/envs/$kernel_env/share/jupyter/kernels/python3/kernel.json
if [[ -f $kernel_json ]]; then
jq ".display_name = \"$kernel_env\"" $kernel_json > /tmp/kernel.json
mv /tmp/kernel.json $kernel_json
unset kernel_json
fi
unset kernel_json

source $conda_prefix/etc/profile.d/conda.sh
conda activate $jupyterlab_env
Expand Down
12 changes: 3 additions & 9 deletions docker/icl-jupyterhub/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,15 @@ Overview
conda-based
passwordless sudo, potentially can be disabled later
additional packages installed (gh cli, ssh, vim, rsync, s3cmd)
Modin, Prefect, Ray, ICL
ICL (infractl) with Prefect 3.x in the python-3.12 kernel environment, built from the repository sources
Build and push the image
TARGET_TAG=pbchekin/icl-jupyterhub:latest
MODIN_VERSION="0.26.1"
PREFECT_VERSION="2.13.0"
RAY_VERSION="2.9.2"
TARGET_TAG=pbchekin/icl-jupyterhub:0.0.23
Needs to be run from the root of the repository:

docker build . \
--file docker/icl-jupyterhub/Dockerfile \
--progress=plain \
--tag $TARGET_TAG \
--build-arg PREFECT_VERSION="$PREFECT_VERSION" \
--build-arg MODIN_VERSION="$MODIN_VERSION" \
--build-arg RAY_VERSION="$RAY_VERSION"
--tag $TARGET_TAG
docker push $TARGET_TAG
Create custom JupyterLab kernel
In Terminal, create a new conda environment and install ipykernel.
Expand Down
6 changes: 6 additions & 0 deletions scripts/deploy/kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,12 @@ if [[ " $@ " =~ " --with-cert-manager " ]]; then
terraform_extra_args+=( -var cert_manager_enabled=true )
fi

# Use a custom JupyterHub single-user image, for example a locally built one
# loaded into the kind cluster with "kind load docker-image <image> --name x1".
if [[ -n "${ICL_JUPYTERHUB_IMAGE:-}" ]]; then
terraform_extra_args+=( -var jupyterhub_singleuser_default_image="$ICL_JUPYTERHUB_IMAGE" )
fi

with_corefile
control_node "terraform -chdir=terraform/icl init -upgrade -input=false && terraform -chdir=terraform/icl apply -input=false -auto-approve ${terraform_extra_args[*]}"

Expand Down
2 changes: 1 addition & 1 deletion scripts/etc/kind/images.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ kuberay/operator:v0.4.0
kubernetesui/dashboard:v2.6.0
minio/console:v0.20.3
minio/operator:v4.5.1
pbchekin/icl-jupyterhub:0.0.18
pbchekin/icl-jupyterhub:0.0.23
pbchekin/icl-prefect:3.6.17-py3.12-icl0.0.4
pbchekin/icl-ray:2.9.2-py312
prefecthq/prefect:3.6.17-python3.12
Expand Down
2 changes: 1 addition & 1 deletion terraform/icl/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ variable "jupyterhub_singleuser_volume_size" {
variable "jupyterhub_singleuser_default_image" {
description = "Default Docker image for JupyterHub default profile"
# original image: jupyterhub/k8s-singleuser-sample:2.0.1-0.dev.git.6035.h643c0f0c
default = "pbchekin/icl-jupyterhub:0.0.22"
default = "pbchekin/icl-jupyterhub:0.0.23"
type = string
}

Expand Down
Loading