Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM nvidia/cuda:12.6.3-cudnn-devel-ubuntu24.04

RUN sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list.d/ubuntu.sources && \
sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/ubuntu.sources && \
apt-get update && \
apt-get install -yq software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get install -yq --no-install-recommends \
python3.12 python3.12-venv python3.12-dev git git-lfs unzip curl ffmpeg default-libmysqlclient-dev build-essential pkg-config && \
apt clean && rm -rf /var/lib/apt/lists/*

RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1 && \
curl -LsSf https://astral.sh/uv/install.sh | UV_INSTALL_DIR=/usr/local/bin sh

ENV UV_SYSTEM_PYTHON=1

WORKDIR /opt
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen

ENV PATH=$PATH:/opt/.venv/bin
24 changes: 24 additions & 0 deletions docs/en/kubeflow/how_to/assets/build-train-image/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[project]
name = "training-env"
version = "0.1.0"
requires-python = ">=3.11"
dependencies = [
"llamafactory[metrics,awq,modelscope]",
"torch==2.6.0",
"torchvision==0.21.0",
"torchaudio==2.6.0",
"transformers<=4.51.1",
"tokenizers>=0.21.1",
"sqlalchemy~=2.0.30",
"pymysql~=1.1.1",
"loguru~=0.7.2",
"mysqlclient~=2.2.7",
"deepspeed~=0.16.9",
"mlflow>=3.1",
]

[tool.uv]
index-url = "https://pypi.tuna.tsinghua.edu.cn/simple"

[tool.uv.sources]
llamafactory = { git = "https://github.com/hiyouga/LLaMA-Factory.git", tag = "v0.9.4" }
Loading