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
- Add in Dockerfile:
- Image must be pushed to a registry
- Container should expose port
8888running Jupyter Lab.
Patching with Dockerfile
Use images as base and extend them:
- Ubuntu (GPU)
- Pytorch (GPU)
- Tensorflow (GPU)
- Transformers (GPU)
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 .
FROM aimle2e/nvidia-pytorch:23.06-2.1.0
docker build --platform linux/amd64 -t my-repo/tir-pytorch:23.06-py3-04 .
FROM aimle2e/nvidia-tensorflow:23.06-2.12.0
docker build --platform linux/amd64 -t my-repo/tir-tensorflow:23.06-tf2-py3-02 .
FROM aimle2e/nvidia-pytorch-transformers:23.06-2.1.0-4.31.0
docker build --platform linux/amd64 -t my-repo/tir-transformers:23.06-py3 .
Patching a container instance
- Run a base image:
docker run --platform=linux/amd64 -d <image> - Enter the container:
Install required packages, then exit.
docker exec -it <container_id> /bin/bash - Commit changes:
docker commit <container_id> <image_repository[:tag]> - 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).
If auto-pushed via image builder, no need to push again manually.
Push the container image
Setup Registry Integration
- Go to AI platform, select your project.
- Navigate to Integrations > E2E Container Registry.
- Click Create E2E Registry, provide Namespace and Username Prefix.
- 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