Building Custom Images

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.
  • PVC mountable at /root
    • VESSL mounts a PVC at /root to keep state across Pod restarts.

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. Currently we offer 6 pre-built images. You can get these images from AWS ECR.
Python Version
CUDA Version
Image URL
3.6.14
CPU Only
public.ecr.aws/vessl/kernels:py36.full-cpu
3.6.14
10.2
public.ecr.aws/vessl/kernels:py36-cuda10.2.full-gpu
3.6.14
11.2
public.ecr.aws/vessl/kernels:py36-cuda11.2.full-gpu
3.7.11
CPU Only
public.ecr.aws/vessl/kernels:py37.full-cpu
3.7.11
10.2
public.ecr.aws/vessl/kernels:py37-cuda10.2.full-gpu
3.7.11
11.2
public.ecr.aws/vessl/kernels:py37-cuda11.2.full-gpu

Example

1
# Use Python 3.7.11, CUDA 11.2 image
2
FROM public.ecr.aws/vessl/kernels:py37-cuda11.2.full-gpu.jupyter
3
​
4
# Install Python dependencies
5
RUN pip install transformers
6
...
Copied!

Building from community maintained images

You can make your own images from any community maintained Docker images. But you have to be sure that your image meet our requirements.

Example

1
FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu18.04
2
ENV PYTHON_VERSION=3.7.11
3
​
4
RUN apt-get update
5
# Install sshd
6
RUN apt-get install -y -q openssh-server
7
​
8
# Install dependencies for installing Python
9
RUN apt-get install -y -q \
10
wget \
11
zlib1g-dev \
12
openssh-server \
13
curl \
14
libssl-dev \
15
libffi-dev
16
​
17
# Install dependencies for Jupyterlab
18
RUN apt-get install -y -q \
19
libsqlite3-dev
20
​
21
# Install Python
22
RUN wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz
23
RUN tar -xvf Python-$PYTHON_VERSION.tgz
24
RUN /bin/bash -c "cd Python-$PYTHON_VERSION/; ./configure; make install"
25
RUN rm -rf Python-$PYTHON_VERSION*
26
RUN update-alternatives --install /usr/bin/python python $(which python3) 1
27
​
28
# Install pip
29
RUN curl https://bootstrap.pypa.io/get-pip.py | python && pip install -U pip
30
​
31
# Install Jupyterlab
32
RUN pip install jupyterlab
Copied!

FAQ

  • If you use conda for installing Jupyterlab, generally Jupyterlab daemon is located in /opt/conda/bin/jupyter. In this case, you should make a symbolic link in /usr/local/bin/jupyter.
    1
    # In Dockerfile,
    2
    RUN ln -s /opt/conda/bin/jupyter /usr/local/bin/jupyter
    Copied!