-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
34 lines (25 loc) · 1.1 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
# Dockerfile — linux/amd64 test image
FROM --platform=$BUILDPLATFORM python:3.11-slim
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /workspace
# System deps
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential git curl ca-certificates python3-dev gcc g++ \
&& rm -rf /var/lib/apt/lists/*
# Install uv (repository-standard package manager)
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:$PATH"
# Copy project
COPY . /workspace
# Create venv and install deps via uv
RUN uv venv /opt/venv
ENV VIRTUAL_ENV="/opt/venv"
ENV PATH="/opt/venv/bin:$PATH"
# Install project and test dependencies via uv
RUN uv pip install . || true
RUN uv pip install pytest pytest-cov pytest-asyncio pytest-json-report
RUN uv pip install jax jaxlib
# Verify XLA compile compatibility
RUN python -c "import jax, jax.numpy as jnp; jax.jit(lambda x: x * 2)(jnp.ones(10)).block_until_ready()"
# Default test command
CMD ["/bin/bash","-lc",". /opt/venv/bin/activate && python -m pytest -n0 --cov=src --cov-report=html:output/2_tests_output/singleproc_htmlcov --tb=short --maxfail=10 -q"]