-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (36 loc) · 1.16 KB
/
Copy pathDockerfile
File metadata and controls
49 lines (36 loc) · 1.16 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
43
44
45
46
47
48
49
# Multi-stage Dockerfile for Deep Learning Model Scaling Analysis
# Builder stage
FROM python:3.11-slim as builder
WORKDIR /build
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy project files
COPY pyproject.toml setup.py README.md LICENSE ./
COPY src/ ./src/
# Build wheel
RUN pip install --no-cache-dir build && \
python -m build --wheel
# Runtime stage
FROM python:3.11-slim
LABEL maintainer="Deep Learning Model Scaling Analysis Contributors"
LABEL description="Causal inference analysis of neural network scaling laws"
WORKDIR /app
# Install runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
# Copy wheel from builder and install
COPY --from=builder /build/dist/*.whl /tmp/
RUN pip install --no-cache-dir /tmp/*.whl && \
rm -rf /tmp/*.whl
# Create data directory
RUN mkdir -p /app/data /app/outputs
# Set environment variables
ENV DML_DATA_DIR=/app/data
ENV DML_OUTPUT_DIR=/app/outputs
ENV PYTHONUNBUFFERED=1
# Default command
ENTRYPOINT ["dml-scale"]
CMD ["--help"]