Cut PostgreSQL CI time: parallel builds and split qualification
Foundation / checks (ecs) (push) Successful in 5m55s
Foundation / checks (deploy) (push) Successful in 6m56s
Foundation / checks (tsan) (push) Successful in 9m35s
Foundation / checks (client) (push) Successful in 20m0s
Foundation / checks (network) (push) Successful in 22m38s
Foundation / checks (checks) (push) Successful in 44m57s
Foundation / checks (postgres) (push) Successful in 48m59s
Foundation / server-image (push) Successful in 40s
Foundation / image (push) Successful in 3m11s
Foundation / postgres-tools (push) Successful in 4m26s

Compile the PostgreSQL stages with PG_BUILD_JOBS=6 (was 2), including
PostgreSQL itself. postgres-check.sh gains --full (release),
--sanitizer (ASan: C++ suite plus backup/DR/upgrade process checks that
run the instrumented binaries) and --suite-only (clang-tidy build), so
SQL-only checks run once. Each run prints per-phase timings, and the
postgres job logs runner CPU, memory and disk headroom.

Also refresh the dev REGION_SESSION_WINDOW.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-13 08:38:26 -04:00
co-authored by Claude Opus 5.5
parent 08b4e843c1
commit a33755c60d
6 changed files with 83 additions and 15 deletions
+16 -8
View File
@@ -111,12 +111,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# The toolchain installs versioned compilers only; there is no bare cc/gcc.
COPY tools/prepare-postgres.sh tools/prepare-postgres.sh
RUN CC=gcc-14 bash tools/prepare-postgres.sh
# Compile parallelism for the PostgreSQL stages. Each clang ASan/analysis job can take
# 1-2 GiB, so raising this needs matching runner memory (see .gitea/workflows/build.yaml).
ARG PG_BUILD_JOBS=6
RUN CC=gcc-14 PG_BUILD_JOBS=${PG_BUILD_JOBS} bash tools/prepare-postgres.sh
# PostgreSQL itself is prepared once. Source/test changes invalidate only the
# layers below, while postgres-tools can reuse this image without compiling the
# full C++ test matrix.
FROM postgres-toolchain AS postgres-build
ARG PG_BUILD_JOBS=6
COPY CMakeLists.txt CMakePresets.json .clang-format .clang-tidy ./
COPY cmake/ cmake/
COPY include/ include/
@@ -135,25 +139,29 @@ RUN cmake --preset release -B build/postgres -DCMAKE_CXX_COMPILER=g++-14 \
-DCMAKE_C_COMPILER=gcc-14 -DEVO_BUILD_NETWORK=ON \
-DEVO_BUILD_QUIC=ON -DEVO_BUILD_POSTGRES=ON \
-DPostgreSQL_ROOT=/source/.cache/postgres/install \
&& cmake --build build/postgres --target evo-server evo-session-probe evo-world-clone --parallel 2
&& cmake --build build/postgres --target evo-server evo-session-probe evo-world-clone --parallel "${PG_BUILD_JOBS}"
FROM postgres-build AS postgres-test-build
RUN cmake --build build/postgres --target evo-postgres-tests --parallel 2
ARG PG_BUILD_JOBS=6
RUN cmake --build build/postgres --target evo-postgres-tests --parallel "${PG_BUILD_JOBS}"
RUN cmake --preset analysis -B build/postgres-analysis -DCMAKE_CXX_COMPILER=clang++-19 \
-DCMAKE_C_COMPILER=clang-19 -DEVO_BUILD_NETWORK=ON \
-DEVO_BUILD_POSTGRES=ON -DPostgreSQL_ROOT=/source/.cache/postgres/install \
&& cmake --build build/postgres-analysis --target evo-postgres-tests --parallel 2
&& cmake --build build/postgres-analysis --target evo-postgres-tests --parallel "${PG_BUILD_JOBS}"
RUN cmake --preset asan -B build/postgres-asan -DCMAKE_CXX_COMPILER=clang++-19 \
-DCMAKE_C_COMPILER=clang-19 -DEVO_BUILD_NETWORK=ON \
-DEVO_BUILD_POSTGRES=ON -DPostgreSQL_ROOT=/source/.cache/postgres/install \
&& cmake --build build/postgres-asan --target evo-postgres-tests --parallel 2
&& cmake --build build/postgres-asan --target evo-postgres-tests --parallel "${PG_BUILD_JOBS}"
FROM postgres-test-build AS ci-postgres
RUN useradd --uid 10001 --no-create-home evo
USER 10001:10001
RUN bash tools/ci/postgres-check.sh /source/build/postgres/evo-postgres-tests \
&& bash tools/ci/postgres-check.sh /source/build/postgres-analysis/evo-postgres-tests \
&& bash tools/ci/postgres-check.sh /source/build/postgres-asan/evo-postgres-tests
# Full qualification once on the release build. ASan/UBSan reruns everything that
# executes its instrumented binaries; the uninstrumented clang-tidy build reruns only
# the C++ suite. SQL-only checks do not change with compiler flags.
RUN bash tools/ci/postgres-check.sh --full /source/build/postgres/evo-postgres-tests \
&& bash tools/ci/postgres-check.sh --suite-only /source/build/postgres-analysis/evo-postgres-tests \
&& bash tools/ci/postgres-check.sh --sanitizer /source/build/postgres-asan/evo-postgres-tests
FROM postgres-toolchain AS postgres-tools
RUN apt-get update && apt-get install -y --no-install-recommends libssl3t64 zlib1g ca-certificates \