Image
class. The options specified in the Image
class will influence how the image is built.
Image
class. This class provides a variety of methods for customizing the container image used to run your application.
It exposes options for:
ubuntu:22.04
as its base and installs Python
3.10.add_python_packages
method on the Image
object with a list of package names.
requirements.txt
requirements.txt
file, you can also use that directly using the Image
constructor’s python_packages
parameter:
add_commands
method on the Image
object with a list of commands.
For instance, you might need to install libjpeg-dev
when using the Pillow
library. In the example below, we’ll install libjpeg-dev
and then install Pillow
.
nvcr.io/nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04
). These images come with additional libraries, debugging tools, and nvcc
installed.
The image below will use a custom CUDA image as the base.
Component | Location | Role |
---|---|---|
NVIDIA Kernel Driver | Host Machine | Low-level GPU management, talks directly to hardware. |
CUDA Runtime & Libraries | Container | Provides high-level APIs and libraries for applications. |
GPU | Driver Version | CUDA Version |
---|---|---|
T4 | 550.127.05 | 12.4 |
A10G | 550.90.12 | 12.4 |
RTX4090 | 550.127.05 | 12.4 |
L40s | 550.127.05 | 12.4 |
A100-40 | 550.127.05 | 12.4 |
H100 | 550.127.05 | 12.4 |
python_version
parameter:
python_version
is specified and the CUDA image has no Python version installed.
python_version
is specified.
python_version
in your Image
constructor. This function will use the PyTorch image as the base and will use the Python version that already exists in the PyTorch image.
build_with_gpu()
command to run your build on the GPU of your choice.
with_envs
command:
with_secrets
command:
beam secret create HF_TOKEN <your_token>
.from_dockerfile()
command accepts a path to a valid Dockerfile as well as an optional path to a context directory:
COPY
and ADD
, meaning all relative paths are relative to this directory.
The image built from your Dockerfile will be used as the base image for a Beam application.
micromamba
method to your Image
definition and then specify packages and channels via the add_micromamba_packages
method.
pip
to install additional packages in the conda
environment and you can run shell commands too.
micromamba run -n beta9
as shown above.