diff --git a/huggingface-sagemaker/Dockerfile.codespace b/huggingface-sagemaker/Dockerfile.codespace new file mode 100644 index 00000000..540bb733 --- /dev/null +++ b/huggingface-sagemaker/Dockerfile.codespace @@ -0,0 +1,42 @@ +# Sandbox base image +FROM zenmldocker/zenml-sandbox:latest + +# Install uv from official distroless image +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ + +# Set uv environment variables for optimization +ENV UV_SYSTEM_PYTHON=1 +ENV UV_COMPILE_BYTECODE=1 + +# Project metadata +LABEL project_name="huggingface-sagemaker" +LABEL project_version="0.1.0" + +# Install dependencies with uv and cache optimization +RUN --mount=type=cache,target=/root/.cache/uv \ + uv pip install --system \ + "torch==2.1.1" \ + "torchvision==0.16.1" \ + "zenml[server]>=0.72.0" \ + "sagemaker==2.117.0" \ + "cuda-python==12.3.0" \ + "nvidia-cuda-cupti-cu12==12.1.105" \ + "nvidia-cuda-nvrtc-cu12==12.1.105" \ + "nvidia-cuda-runtime-cu12==12.1.105" \ + "datasets==2.14.7" \ + "transformers==4.31.0" \ + "accelerate==0.24.1" + +# Set workspace directory +WORKDIR /workspace + +# Clone only the project directory and reorganize +RUN git clone --depth 1 https://github.com/zenml-io/zenml-projects.git /tmp/zenml-projects && \ + cp -r /tmp/zenml-projects/huggingface-sagemaker/* /workspace/ && \ + rm -rf /tmp/zenml-projects + +# VSCode settings +RUN mkdir -p /workspace/.vscode && \ + printf '{\n "workbench.colorTheme": "Default Dark Modern"\n}' > /workspace/.vscode/settings.json + +