-
Notifications
You must be signed in to change notification settings - Fork 268
/
Copy pathDockerfile.uv
37 lines (31 loc) · 1.22 KB
/
Dockerfile.uv
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
FROM ghcr.io/allenai/oi-cuda-no-conda:12.1-cudnn8-dev-ubuntu20.04
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
ENV HF_HUB_ENABLE_HF_TRANSFER=1
ENV UV_COMPILE_BYTECODE=1
# setup files
WORKDIR /stage/
# Install the project's dependencies using the lockfile and settings
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-project
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-project --extra compile
COPY open_instruct open_instruct
COPY eval eval
COPY configs configs
COPY scripts scripts
# hack: only copy oe-eval-internal if it exists
COPY mason.py oe-eval-internal* /stage/
COPY .git/ ./.git/
COPY pyproject.toml uv.lock .
RUN chmod +x scripts/*
# install dependencies
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --extra compile
# for interactive session
RUN chmod -R 777 /stage/
# uv dockerfile magic: place executables in the environment at the front of the path
ENV PATH=/stage/.venv/bin:$PATH