-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.ci
More file actions
46 lines (35 loc) · 1.28 KB
/
Dockerfile.ci
File metadata and controls
46 lines (35 loc) · 1.28 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
# CPU-only CI/CD Dockerfile
# Uses SBT base image with Java pre-installed, adds Python and JAX CPU
# ~2-3 GB total size vs ~8 GB for GPU image
FROM sbtscala/scala-sbt:eclipse-temurin-jammy-17.0.9_9_1.9.7_3.3.1
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /workspace
# Install Python and curl
RUN apt-get update && apt-get install -y \
python3.11 \
python3.11-dev \
libpython3.11 \
python3-pip \
curl \
&& rm -rf /var/lib/apt/lists/* && \
ln -sf /usr/bin/python3.11 /usr/bin/python
# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:${PATH}"
# Copy only build files first for dependency caching
COPY build.sbt /workspace/
COPY project/ /workspace/project/
# Set up Python venv with CPU JAX (pyproject.toml specifies cuda12; override here)
RUN uv venv .venv --python python3.11 && \
uv pip install --python .venv/bin/python "jax[cpu]>=0.4" "einops>=0.8"
# Skip uv sync at runtime and point directly at the venv Python
# This also prevents uv from being called at sbt load time
ENV DIMWIT_SKIP_SYNC=true
ENV DIMWIT_PYTHON_PATH=/workspace/.venv/bin/python
# Pre-download SBT dependencies
RUN sbt update || true
# Copy project files
COPY . /workspace/
# Set Python path
ENV PYTHONPATH=/workspace/src/python
CMD ["sbt", "compile"]