Skip to content

Commit 01a36d3

Browse files
committed
revert to single stage image
Signed-off-by: Peter St. John <[email protected]>
1 parent 0c76e68 commit 01a36d3

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed
Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
# An example, minimal Dockerfile to install dependencies in a fresh python environment with CUDA support.
22

3-
FROM nvcr.io/nvidia/cuda:13.0.2-cudnn-devel-ubuntu24.04 AS build
4-
COPY --from=ghcr.io/astral-sh/uv:0.6.13 /uv /usr/local/bin/uv
3+
FROM nvcr.io/nvidia/cuda:13.0.2-cudnn-devel-ubuntu24.04
54

6-
ENV UV_PYTHON_INSTALL_DIR=/python
7-
ENV UV_PYTHON_PREFERENCE=only-managed
85
ENV UV_LINK_MODE=copy
96
SHELL ["/bin/bash", "-c"]
107

11-
RUN uv python install 3.12
12-
8+
RUN mkdir -p /workspace && chown -R ubuntu:ubuntu /workspace
9+
USER ubuntu
1310
RUN --mount=type=cache,target=/root/.cache/uv \
1411
--mount=type=cache,target=/root/.cache/pip \
1512
--mount=type=bind,source=requirements.txt,target=/requirements.txt \
13+
--mount=from=ghcr.io/astral-sh/uv,source=/uv,target=/bin/uv \
1614
<<EOF
1715
uv venv --python 3.12 --seed /workspace/.venv
1816
source /workspace/.venv/bin/activate
@@ -22,10 +20,5 @@ pip install --no-build-isolation transformer-engine[pytorch]==2.9.0
2220
uv pip install -r /requirements.txt
2321
EOF
2422

25-
# We still need the devel image to be able to use torch.compile; otherwise, we can use the runtime image.
26-
FROM nvcr.io/nvidia/cuda:13.0.2-cudnn-devel-ubuntu24.04
27-
COPY --from=build --chown=ubuntu:ubuntu /python /python
28-
COPY --from=build --chown=ubuntu:ubuntu --chmod=777 /workspace/.venv /workspace/.venv
2923
ENV PATH="/workspace/.venv/bin:$PATH"
30-
USER ubuntu
3124
WORKDIR /workspace/bionemo

0 commit comments

Comments
 (0)