Repository navigation
Expand file tree
/
Copy pathDockerfile.ci
More file actions
39 lines (29 loc) · 1.47 KB
/
Copy pathDockerfile.ci
File metadata and controls
39 lines (29 loc) · 1.47 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
# CPU-only CI Dockerfile
# Uses the SBT base image (Java + sbt pre-installed) and adds Python 3.13 with CPU JAX.
# Only `core` is built in CI, so no plotwit / examples dependencies are needed here.
FROM sbtscala/scala-sbt:eclipse-temurin-jammy-17.0.9_9_1.9.7_3.3.1
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /workspace
RUN apt-get update && apt-get install -y curl git \
&& rm -rf /var/lib/apt/lists/*
# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:${PATH}"
# pyproject.toml pins python 3.13; uv fetches it, jammy does not ship it.
# pyproject.toml specifies the GPU jax, so CPU jax is installed explicitly here.
RUN uv python install 3.13 && \
uv venv .venv --python 3.13 && \
uv pip install --python .venv/bin/python "jax[cpu]>=0.8.2" "einops>=0.8.1"
# build.sbt reads DIMWIT_PYTHON_PATH to derive the ScalaPy JVM properties. Setting it here
# means sbt never shells out to `uv run` at load time.
ENV DIMWIT_PYTHON_PATH=/workspace/.venv/bin/python
# The venv above is managed here, so dimwit must not run `uv sync` at initialize() time.
ENV DIMWIT_SKIP_SYNC=true
# Copy build definition first so dependency resolution is cached independently of the sources
COPY build.sbt /workspace/
COPY project/ /workspace/project/
# Pre-download sbt dependencies. Scoped to core: the root project aggregates `examples`,
# which depends on the not-yet-published plotwit.
RUN sbt "core/update" || true
COPY . /workspace/
CMD ["sbt", "core/compile"]