-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmlf-sample-project.def
More file actions
34 lines (27 loc) · 1.31 KB
/
mlf-sample-project.def
File metadata and controls
34 lines (27 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# We are going to start with a base image from NVIDIA, which is a Ubuntu system with CUDA and cuDNN installed.
# You can also use a different base image. There are many available on Docker Hub (https://hub.docker.com).
# For instance, there are images for PyTorch, PyTorch Lightning, HuggingFace, MosaicML, etc.
# Most of the aforementioned images start with a NVIDIA base image like the below, so we will use that as our base for simplicity.
# To do so, change the FROM line below to the url of the image tag you want to use.
Bootstrap: docker
From: nvcr.io/nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
%files
# Copy the requirements.txt file into the container so it can be accessed during building.
requirements.txt
%post
# Update and install Ubuntu packages
apt-get update && apt-get install -y
apt-get install -y --no-install-recommends git curl
apt-get install -y python3 python3-pip python3-venv
# clean up the apt cache
apt-get clean
rm -rf /var/lib/apt/lists/*
python3 -m venv /venv
PATH=/venv/bin:$PATH
pip3 install wheel
# Install the required Python packages without caching the pip install files
pip3 install -r requirements.txt --no-cache-dir
# install code-server
curl -fsSL https://code-server.dev/install.sh | sh
%environment
PATH=/venv/bin:$PATH