Skip to content

Commit e148948

Browse files
authored
Merge pull request #214 from zenml-io/auto-dockerfile-huggingface-sagemaker
Auto-generate Dockerfile.codespace for huggingface-sagemaker
2 parents 99fa89f + f2d2d54 commit e148948

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Sandbox base image
2+
FROM zenmldocker/zenml-sandbox:latest
3+
4+
# Install uv from official distroless image
5+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
6+
7+
# Set uv environment variables for optimization
8+
ENV UV_SYSTEM_PYTHON=1
9+
ENV UV_COMPILE_BYTECODE=1
10+
11+
# Project metadata
12+
LABEL project_name="huggingface-sagemaker"
13+
LABEL project_version="0.1.0"
14+
15+
# Install dependencies with uv and cache optimization
16+
RUN --mount=type=cache,target=/root/.cache/uv \
17+
uv pip install --system \
18+
"torch==2.1.1" \
19+
"torchvision==0.16.1" \
20+
"zenml[server]>=0.72.0" \
21+
"sagemaker==2.117.0" \
22+
"cuda-python==12.3.0" \
23+
"nvidia-cuda-cupti-cu12==12.1.105" \
24+
"nvidia-cuda-nvrtc-cu12==12.1.105" \
25+
"nvidia-cuda-runtime-cu12==12.1.105" \
26+
"datasets==2.14.7" \
27+
"transformers==4.31.0" \
28+
"accelerate==0.24.1"
29+
30+
# Set workspace directory
31+
WORKDIR /workspace
32+
33+
# Clone only the project directory and reorganize
34+
RUN git clone --depth 1 https://github.com/zenml-io/zenml-projects.git /tmp/zenml-projects && \
35+
cp -r /tmp/zenml-projects/huggingface-sagemaker/* /workspace/ && \
36+
rm -rf /tmp/zenml-projects
37+
38+
# VSCode settings
39+
RUN mkdir -p /workspace/.vscode && \
40+
printf '{\n "workbench.colorTheme": "Default Dark Modern"\n}' > /workspace/.vscode/settings.json
41+
42+

0 commit comments

Comments
 (0)