-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.benchmark
More file actions
54 lines (41 loc) · 1.64 KB
/
Copy pathDockerfile.benchmark
File metadata and controls
54 lines (41 loc) · 1.64 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
50
51
52
53
54
# Admina — Benchmark Image
# Runs the Rust pipeline microbenchmark suite inside Docker.
#
# Usage:
# docker build -f Dockerfile.benchmark -t admina-bench .
# docker run --rm admina-bench
# Stage 1: Build Rust core
FROM python:3.14-slim AS rust-builder
RUN apt-get update && apt-get install -y --no-install-recommends \
curl build-essential rustc cargo && \
rm -rf /var/lib/apt/lists/*
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
RUN uv pip install --system --no-cache maturin
WORKDIR /build
COPY core-rust/ ./core-rust/
RUN cd core-rust && maturin build --release
# Stage 2: Benchmark runner
FROM python:3.14-slim
WORKDIR /app
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
# Install Python deps
COPY pyproject.toml uv.lock .python-version ./
RUN uv sync --frozen --no-dev --no-install-project --extra proxy --extra nlp --extra telemetry
ENV VIRTUAL_ENV="/app/.venv"
ENV PATH="/app/.venv/bin:$PATH"
# Install Rust core wheel
COPY --from=rust-builder /build/core-rust/target/wheels/ /tmp/wheels/
RUN uv pip install /tmp/wheels/*.whl && rm -rf /tmp/wheels
# Install test dependencies
RUN uv pip install pytest
# Copy source code needed by tests
COPY core/ ./core/
COPY domains/ ./domains/
COPY proxy/ ./proxy/
COPY plugins/ ./plugins/
COPY admina/ ./admina/
COPY sdk/ ./sdk/
COPY tests/test_benchmark_14us.py ./tests/
# Download spaCy model for PII benchmarks
RUN uv pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1-py3-none-any.whl
CMD ["pytest", "tests/test_benchmark_14us.py", "-v", "-s", "--tb=short", "--no-header", "-p", "no:cacheprovider", "--override-ini=addopts="]