-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
82 lines (67 loc) · 2.22 KB
/
Dockerfile
File metadata and controls
82 lines (67 loc) · 2.22 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# SimpleTuner needs CU141
FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04
ARG PYTHON_VERSION=3.11
# Prevent commands from blocking for input during build
ENV DEBIAN_FRONTEND=noninteractive
# /workspace is the default volume for Runpod & other hosts
WORKDIR /workspace
# Base system dependencies (including Python ${PYTHON_VERSION} toolchain)
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
ffmpeg \
git \
git-lfs \
htop \
inotify-tools \
iputils-ping \
less \
libgl1-mesa-glx \
libsm6 \
libxext6 \
libopenmpi-dev \
net-tools \
nvtop \
openmpi-bin \
openssh-client \
openssh-server \
p7zip-full \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python${PYTHON_VERSION}-venv \
rsync \
tmux \
tldr \
unzip \
vim \
wget \
zip && \
rm -rf /var/lib/apt/lists/*
# Configure git to support LFS and credential storage
RUN git config --global credential.helper store && \
git lfs install
# Create a dedicated virtual environment with the requested Python version
RUN python${PYTHON_VERSION} -m venv /opt/venv && \
/opt/venv/bin/pip install --upgrade pip setuptools wheel
# Use the virtual environment for all subsequent Python work
ENV VIRTUAL_ENV=/opt/venv
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
# Ensure SSH access. Not needed for Runpod but is required on Vast and other Docker hosts
EXPOSE 22/tcp
# HuggingFace cache location and platform hint for setup.py
ENV HF_HOME=/workspace/huggingface
ENV SIMPLETUNER_PLATFORM=cuda
# Install supporting CLIs ahead of the project install
RUN pip install --no-cache-dir "huggingface_hub[cli]" wandb
# Install MPI bindings needed for CUDA multi-node support
RUN pip install --no-cache-dir mpi4py
# Install SimpleTuner from PyPI to match published releases
RUN pip install --no-cache-dir simpletuner
# Copy start script with exec permissions
COPY --chmod=755 docker-start.sh /start.sh
# Ensure we remain in the default workspace location
WORKDIR /workspace
# Dummy entrypoint
ENTRYPOINT [ "/start.sh" ]