-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (26 loc) · 1.34 KB
/
Copy pathDockerfile
File metadata and controls
38 lines (26 loc) · 1.34 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
FROM nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu22.04
LABEL org.opencontainers.image.source="https://github.com/ortizeg/object-detection-training"
LABEL org.opencontainers.image.license="Apache-2.0"
WORKDIR /app
# Install curl and other basics needed for pixi install
# libgl1 and libglib2.0-0 are often needed for OpenCV and other ML libraries
RUN apt-get update && apt-get install -y curl libgl1 libglib2.0-0 && rm -rf /var/lib/apt/lists/*
# Install pixi
RUN curl -fsSL https://pixi.sh/install.sh | bash
# Add pixi to PATH
ENV PATH="/root/.pixi/bin:$PATH"
# Override CUDA version for pixi to allow installation of cuda-dependent packages
# even if the build environment doesn't have a GPU attached.
ENV CONDA_OVERRIDE_CUDA=12.1
COPY pixi.toml pixi.lock* pyproject.toml ./
# Create a dummy project structure to allow pixi (and flit) to install dependencies
# without invalidating the cache when source code changes.
RUN mkdir -p src/object_detection_training && touch src/object_detection_training/__init__.py
# Install dependencies (only production environment)
RUN pixi install --environment prod
# Copy source code
COPY . .
# Runtime secrets (WANDB_API_KEY, etc.) should be injected via
# environment variables at container run time, NOT baked into the image.
# Set entrypoint to run the training task defined in pixi.toml
ENTRYPOINT ["pixi", "run", "train"]