Skip to main content

Create instances with your own container image

The platform is container-native, offering flexibility and performance of containers for AI/ML without infrastructure overhead.

You can launch instance with your own custom container. This allows you to adjust the environment to your specific needs. You can extend provided containers with additional packages and libraries.

If you install packages in a running instance, note that only /data and /home/jovyan persist on restart. Using a custom image ensures your environment is reproducible.

Steps

Build a container image

We recommend extending provided images as they are already configured for compatibility.

Requirements:

  • Build image for linux/amd64.
    • Add in Dockerfile:
      FROM --platform=linux/amd64 <image>
    • Or build with flag:
      docker build --platform=linux/amd64
  • Image must be pushed to a registry
  • Container should expose port 8888 running Jupyter Lab.

Patching with Dockerfile

Use images as base and extend them:

FROM aimle2e/ubuntu-cuda-jupyter:22.04-12.2.2
# Add packages/libraries, e.g.
# RUN pip install -r requirements.txt
docker build --platform linux/amd64 -t my-repo/tir-cuda:12.2.2-ubuntu22.04-01 .

Patching a container instance

  1. Run a base image:
    docker run --platform=linux/amd64 -d <image>
  2. Enter the container:
    docker exec -it <container_id> /bin/bash
    Install required packages, then exit.
  3. Commit changes:
    docker commit <container_id> <image_repository[:tag]>
  4. Push this image to the registry.

Using Image Builder Utility

If you already have a custom image, use the instance Image Builder to make it Instance-compatible.

git clone https://github.com/tire2e/notebook-image-builder.git
cd notebook-image-builder/
./generate_image.sh -b my-trainer:latest -i tir-my-trainer -t v1

Add -P to auto-push to E2E Container Registry (use -u <username> if not logged in).

Note

If auto-pushed via image builder, no need to push again manually.

Push the container image

Setup Registry Integration

  1. Go to AI platform, select your project.
  2. Navigate to Integrations > E2E Container Registry.
  3. Click Create E2E Registry, provide Namespace and Username Prefix.
  4. Registry should be created.

Login locally

docker login registry.e2enetworks.net

Push the image

Tag and push your image:

docker tag my_custom_img:v1 registry.e2enetworks.net/my-cr/my_custom_img:v1
docker push registry.e2enetworks.net/my-cr/my_custom_img:v1

Your namespace-specific commands are also available in the dashboard under Commands.

Create Instances

  • Create Intance, and choose Custom Images > select your registry Namespace
  • Fill other details and launch
  • Open Jupyter Lab or SSH to confirm installed packages