Requirements

To use custom images to run a workspace, your custom images have to satisfy below requirements.

  • Jupyterlab
    • VESSL runs Jupyterlab and expose port 8888. Jupyterlab should be pre-installed in the container image.
    • Jupyterlab daemon must be located in /usr/local/bin/jupyter.
  • sshd
    • VESSL runs sshd and expose port 22 as NodePort. sshd package should be pre-installed in the container image.
  • Persistent Volume Claim (PVC) mountable at /root
    • VESSL mounts a PVC at /root to keep state across Pod restarts.
  • curl
    • VESSL verifies workspace status. curl package should be pre-installed in the container image.

Building from VESSL’s pre-built images

VESSL offers pre-built images to run workspaces directly. You can use these images to build your own images. These images already have pre-installed Jupyterlab and sshd. The list of images is in the following table.

CPU pre-built images

PythonTensorflowPyTorchTorchvisionImage
3.82.12.01.13.10.14.1quay.io/vessl-ai/python:3.8
3.92.12.01.13.10.14.1quay.io/vessl-ai/python:3.9
3.102.12.01.13.10.14.1quay.io/vessl-ai/python:3.10
3.112.12.02.0.10.15.2quay.io/vessl-ai/python:3.11

GPU pre-built images

PythonCUDATensorFlowPyTorchImage
3.1012.1-2.3.1quay.io/vessl-ai/torch:2.3.1-cuda12.1
3.1011.8-2.2.2quay.io/vessl-ai/torch:2.2.2-cuda11.8
3.1012.2-2.1.0quay.io/vessl-ai/torch:2.1.0-cuda12.2
3.812.0-1.14.0quay.io/vessl-ai/torch:1.14.0-cuda12.0
3.1012.32.14.0-quay.io/vessl-ai/tensorflow:2.14.0-cuda12.3
3.1012.4--quay.io/vessl-ai/cuda:12.4
3.1012.1--quay.io/vessl-ai/cuda:12.1
3.1011.8--quay.io/vessl-ai/cuda:11.8

Example

# Use CUDA 12.1, PyTorch 2.3.1 base image
FROM quay.io/vessl-ai/torch:2.3.1-cuda12.1

# Install custom Python dependencies
RUN pip install transformers
...

Building from community-maintained images

You can make your own images from any community-maintained Docker images. Make sure that your image meet our requirements.

Example

FROM nvidia/cuda:11.2.2-devel-ubuntu20.04

RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive \
    apt-get install -y \
    software-properties-common curl openssh-server

# Install Python 3.9
# Note that base image has python3.8 (3.8.10) installed
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get install -y python3.9 python3.9-distutils
# Add symbolic links
RUN update-alternatives --install /usr/bin/python3 python3 $(which python3.9) 1
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1

# Install pip
RUN curl https://bootstrap.pypa.io/get-pip.py | python
RUN pip install -U pip

# Install Jupyterlab
RUN pip install jupyterlab

FAQ

If you use conda to install JupyterLab, the JupyterLab executable is generally located at /opt/conda/bin/jupyter. In this case, you should create a symbolic link at usr/local/bin/jupyter.

# In Dockerfile,
RUN ln -s /opt/conda/bin/jupyter /usr/local/bin/jupyter