Files
gps-denied-onboard/tests/e2e/Dockerfile
T
Oleksandr Bezdieniezhnykh c2934b8686 [AZ-603] [AZ-604] e2e-runner: install SUT, fix entrypoint (Track 1)
Multi-stage Ubuntu 22.04 e2e-runner image installs gps-denied-onboard
(editable) into /opt/venv so the AZ-404 replay tests can subprocess
gps-denied-replay against the Derkachi fixture. Image layout mirrors
the host repo (/opt/pyproject.toml + /opt/src + /opt/tests bind mount)
so Path(__file__).parents[3] resolves to /opt and AC-4's AST scan
finds the components dir.

Entrypoint now runs `pytest /opt/tests/e2e/` instead of the empty
`scenarios/` dir. The bootstrap harness collects 24 tests vs. 0 before.

Compose: e2e-runner env mirrors the companion service (FullSystemConfig
requirements) plus RUN_REPLAY_E2E=1, BUILD_REPLAY_SINK_JSONL=ON;
bind-mounts the Derkachi fixture dir; adds writable fdr-data /
tile-data volumes the SUT requires.

Reality Gate signal is now real: 17 pass / 5 fail / 1 skip / 1 xfail.
The 5 heavy-AC failures share root cause AZ-614 (tlog synth time-base
mismatch, surfaced by the now-functional harness).

Also archives the replayed leftover entries (csv_reporter -> AZ-601,
harness rehab -> AZ-602 epic + 11 child stories).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 01:28:36 +03:00

72 lines
2.9 KiB
Docker

# Tier-1 e2e-runner image — multi-stage.
#
# Installs the gps-denied-onboard SUT so `gps-denied-replay` is on PATH for
# the tests in `tests/e2e/replay/`. Mirrors the install layout of
# `docker/companion-tier1.Dockerfile` minus the C++ build stage — the test
# runner only needs the Python entry points.
#
# Image layout intentionally mirrors the repo (so tests that compute
# `Path(__file__).resolve().parents[3] / "src" / "gps_denied_onboard" ...`
# resolve correctly):
#
# /opt/pyproject.toml
# /opt/src/gps_denied_onboard/... (SUT package, editable install)
# /opt/tests/... (bind-mounted from host)
# /opt/_docs/00_problem/input_data/... (bind-mounted from host)
#
# Build context is the repo root (see `docker-compose.test.yml` →
# `services.e2e-runner.build.context`).
# Stage 1: system deps -------------------------------------------------------
FROM ubuntu:22.04 AS system-deps
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
build-essential \
libpq-dev \
libspatialindex-dev \
python3.10 \
python3.10-venv \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Stage 2: python deps + SUT editable install -------------------------------
FROM system-deps AS python-deps
WORKDIR /opt
COPY pyproject.toml README.md ./
COPY src ./src
RUN python3 -m venv /opt/venv \
&& /opt/venv/bin/pip install --upgrade pip \
&& /opt/venv/bin/pip install --no-cache-dir -e ".[dev]"
# Stage 3: runtime ----------------------------------------------------------
FROM ubuntu:22.04 AS runtime
ARG DEBIAN_FRONTEND=noninteractive
# Notes on runtime deps beyond python:
# * `python3` — provides the /usr/bin/python3 symlink the venv's
# shebang resolves to; without it every
# console-script fails with "not found".
# * `libgl1` + `libglib2.0-0` — opencv-python requires both at runtime.
# * `libspatialindex-c6` — rtree wrapper's native lib.
# * `libpq5` — psycopg's libpq client.
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
python3 \
python3.10 \
libpq5 \
libspatialindex-c6 \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=python-deps /opt/venv /opt/venv
COPY --from=python-deps /opt/src /opt/src
COPY --from=python-deps /opt/pyproject.toml /opt/pyproject.toml
ENV PATH="/opt/venv/bin:${PATH}"
ENV PYTHONPATH="/opt/src"
WORKDIR /opt
# `pytest /opt/tests/e2e/` exercises both `tests/e2e/replay/` (heavy
# replay tests gated by RUN_REPLAY_E2E) and any future `tests/e2e/scenarios/`
# additions. Rootdir resolves to /opt via the COPY'd pyproject.toml so
# `from tests.e2e.replay._helpers import ...` works inside the test files.
ENTRYPOINT ["pytest", "-q", "/opt/tests/e2e/"]