Skip to main content

🐳 Docker Registry

We distinguish 3 types of Docker images:

  1. The external public OSS images for various services
  2. The private Datalayer images for e.g. IAM, IAM, Operator... services.
  3. The base Kernel jupyter-python image that you can extend to fit your needs.

Access the Docker Registry

You need read access to a Container Registry where the Docker Images reside.

# Ensure you can login to the Docker Registry.
export DATALAYER_DOCKER_REGISTRY_HOST=docker.io
export DATALAYER_DOCKER_REGISTRY=${DATALAYER_DOCKER_REGISTRY_HOST}/datalayer
docker login https://${DATALAYER_DOCKER_REGISTRY}

Create the Registry Secret

Your Kubernetes cluster need to pull those Docker Images, therefor you need to create a Registry Secret in each of the Namespace.

plane reg-creds-create

Pre-pull the Docker Images

Check you have access to a Docker Registry with the Docker Images available and pull them.

docker login https://${DATALAYER_DOCKER_REGISTRY}
for DOCKER_IMAGE in iam jupyter operator jupyter-companion jupyter-python
do
echo -----------------------------------------------
echo -e "Pulling Docker Image [datalayer-$DOCKER_IMAGE]"
echo
docker pull $DATALAYER_DOCKER_REGISTRY/datalayer/$DOCKER_IMAGE
echo
done

The base jupyter-python Kernel Docker Image has been pulled in the previous step. You can extend the base ones to create custom ones that fit your requirements.

Pre-pull the Jupyter Kernel Docker Images on the Kubernetes cluster nodes for optimal behavior.

Prepull for the CPU nodes.

plane k8s-prepull-cpu
kubectl get daemonset images-prepuller-cpu -n datalayer-jupyter
kubectl delete daemonset images-prepuller-cpu -n datalayer-jupyter

Prepull for the GPU CUDA nodes.

plane k8s-prepull-gpu-cuda
kubectl get daemonset images-prepuller-gpu-cuda -n datalayer-jupyter
kubectl delete daemonset images-prepuller-gpu-cuda -n datalayer-jupyter

Build the Docker Images

If needed, you can build your own images. Therefor, you need docker with buildx on your machine.

# Setup for Ubuntu.
sudo apt update
sudo apt install docker.io docker-buildx
# Logoff / Login to be able to access the Docker process from your user.
sudo usermod -aG docker $USER

If you have access to the Datalayer Plane respository, you can push the Docker Images to your Container OCI Registry where you have write access to.

Some Docker registries enforce you to create the repositories in advance. If this is the case, ensure you have the following repositories pre-created.

  • datalayer/iam
  • datalayer/ingress-nginx-controller
  • datalayer/jupyter-python
  • datalayer/jupyter
  • datalayer/jupyter-companion
  • datalayer/operator

You are now ready to build and push all the Docker Images with the following commands.

# Build all the Docker Images.
plane docker-build
# Push all the Docker Images.
plane docker-push