-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (33 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
42 lines (33 loc) · 1.09 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
ARG PYTHON_VERSION
ARG GIT_NAME
ARG GIT_EMAIL
ARG PROJECT_NAME
ARG VARIANT
FROM ghcr.io/${GIT_NAME}/ml-base:py${PYTHON_VERSION}-${VARIANT}
# Redefine ARGs to make them available after FROM
ARG PYTHON_VERSION
ARG GIT_NAME
ARG GIT_EMAIL
ARG PROJECT_NAME
ARG VARIANT
ARG SSH_KEY_NAME
WORKDIR /workspace/${PROJECT_NAME}
# Use system Python environment instead of virtual environment
ENV UV_SYSTEM_PYTHON=1
# Let uv automatically select PyTorch backend based on platform
ENV UV_TORCH_BACKEND=auto
# Setup Git configuration
RUN git config --global user.email "${GIT_EMAIL}" && \
git config --global user.name "${GIT_NAME}"
# Copy only the scripts we need
COPY scripts/ray-init.sh /usr/local/bin/ray-init.sh
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/ray-init.sh /usr/local/bin/entrypoint.sh
# Copy only dependency files
COPY pyproject.toml uv.lock* ./
# Install everything to system Python
RUN --mount=type=cache,target=/root/.cache/uv \
uv pip install --system -e '.[dev]' && \
uv pip install --system ipdb
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["zsh"]