Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ci/start-postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set -euo pipefail

container_name="rememberstack-postgres-ci"

# POSTGRES_IMAGE runs a published image instead of building Dockerfile.postgres
# (a released engine needs the PostgreSQL it was released with).
# PostgreSQL 18 is the sole server baseline (D157). POSTGRES_IMAGE may select
# a released PG18 foundation instead of building this checkout's Dockerfile.
if [ -n "${POSTGRES_IMAGE:-}" ]; then
image_name="${POSTGRES_IMAGE}"
docker pull "${image_name}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
python-version: ["3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Start PostgreSQL 19 with required extensions
- name: Start PostgreSQL 18 with required extensions
run: .github/ci/start-postgres.sh
- uses: astral-sh/setup-uv@v5
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
REMEMBERSTACK_DATABASE_URL: postgresql+psycopg://rememberstack:rememberstack_test@localhost:5432/rememberstack_test
steps:
- uses: actions/checkout@v4
- name: Start PostgreSQL 19 with required extensions
- name: Start PostgreSQL 18 with required extensions
run: .github/ci/start-postgres.sh
- uses: astral-sh/setup-uv@v5
with:
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
REMEMBERSTACK_DATABASE_URL: postgresql+psycopg://rememberstack:rememberstack_test@localhost:5432/rememberstack_test
steps:
- uses: actions/checkout@v4
- name: Start PostgreSQL 19 with required extensions
- name: Start PostgreSQL 18 with required extensions
run: .github/ci/start-postgres.sh
- uses: astral-sh/setup-uv@v5
with:
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
REMEMBERSTACK_DATABASE_URL: postgresql+psycopg://rememberstack:rememberstack_test@localhost:5432/rememberstack_test
steps:
- uses: actions/checkout@v4
- name: Start PostgreSQL 19 with required extensions
- name: Start PostgreSQL 18 with required extensions
run: .github/ci/start-postgres.sh
- uses: astral-sh/setup-uv@v5
with:
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
REMEMBERSTACK_DATABASE_URL: postgresql+psycopg://rememberstack:rememberstack_test@localhost:5432/rememberstack_test
steps:
- uses: actions/checkout@v4
- name: Start PostgreSQL 19 with required extensions
- name: Start PostgreSQL 18 with required extensions
run: .github/ci/start-postgres.sh
- name: Start real MinIO for D155 object contracts
run: .github/ci/start-minio.sh
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/compatibility-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ jobs:
uv run pytest src/tests/surfaces/test_remember_facade.py -v
uv run pytest src/tests/surfaces/test_client_connection.py -v

- name: Start PostgreSQL 19 with required extensions
# Releases up to 0.17.2 create SQL/PGQ property graphs, which only
# PostgreSQL 19 Beta 3 supports, so each runs its own released image.
- name: Start PostgreSQL 18 with required extensions
# Only engines released on the D157 PostgreSQL 18 baseline belong here.
env:
POSTGRES_IMAGE: ${{ matrix.engine-version != 'candidate' && format('ghcr.io/writeitai/remember-stack-postgres:19beta3-{0}', matrix.engine-version) || '' }}
POSTGRES_IMAGE: ${{ matrix.engine-version != 'candidate' && format('ghcr.io/writeitai/remember-stack-postgres:18-{0}', matrix.engine-version) || '' }}
run: .github/ci/start-postgres.sh

- name: Start SeaweedFS object store
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
fi
echo "${{ needs.prepare.outputs.source_sha }} is on main"

- name: Start PostgreSQL 19 with required extensions
- name: Start PostgreSQL 18 with required extensions
run: .github/ci/start-postgres.sh

- name: Install uv
Expand Down Expand Up @@ -323,8 +323,8 @@ jobs:


# Each architecture builds on its own native runner. The build runs the
# pg_textsearch regression suite, whose parallel_build test fails under QEMU
# emulation (the parallel workers do not launch in time), so arm64 is never
# pg_textsearch regression suite. Its parallel_build test has failed under
# QEMU (parallel workers did not launch in time), so arm64 is never
# emulated. Each leg pushes its image by digest; publish-postgres-ghcr then
# joins both into the one immutable two-architecture tag.
build-postgres:
Expand Down Expand Up @@ -362,12 +362,12 @@ jobs:
with:
images: ghcr.io/writeitai/remember-stack-postgres
flavor: latest=false
tags: type=raw,value=19rc1-${{ needs.prepare.outputs.version }}
tags: type=raw,value=18-${{ needs.prepare.outputs.version }}

- name: Skip a build whose immutable tag already exists (recovery)
id: existing
env:
IMAGE: ghcr.io/writeitai/remember-stack-postgres:19rc1-${{ needs.prepare.outputs.version }}
IMAGE: ghcr.io/writeitai/remember-stack-postgres:18-${{ needs.prepare.outputs.version }}
run: |
if docker manifest inspect "$IMAGE" >/dev/null 2>&1; then
echo 'present=true' >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -434,12 +434,12 @@ jobs:
with:
images: ghcr.io/writeitai/remember-stack-postgres
flavor: latest=false
tags: type=raw,value=19rc1-${{ needs.prepare.outputs.version }}
tags: type=raw,value=18-${{ needs.prepare.outputs.version }}

- name: Preserve an existing immutable foundation tag on recovery
id: existing
env:
IMAGE: ghcr.io/writeitai/remember-stack-postgres:19rc1-${{ needs.prepare.outputs.version }}
IMAGE: ghcr.io/writeitai/remember-stack-postgres:18-${{ needs.prepare.outputs.version }}
run: |
if docker manifest inspect "$IMAGE" >/dev/null 2>&1; then
docker pull --platform linux/amd64 "$IMAGE" >/dev/null
Expand Down
47 changes: 20 additions & 27 deletions Dockerfile.postgres
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM postgres:19rc1-trixie@sha256:f6bab6213c486e940e310a88490935cbc71b88f6c19fee3cd2ab14b3b02ff65b AS pg_textsearch_builder
FROM postgres:18.6-trixie@sha256:979bccfde35445db618c65107d27d08c6c21339d8dc3ad4c830c6633947be0e4 AS pg_textsearch_builder

ARG PG_TEXTSEARCH_REVISION=fa142d049d08eac45a263f5abc250c8877ae076e
ARG PG_TEXTSEARCH_SOURCE_SHA256=445a546810cbc17e15d05ff8a391f1b693eab382a2ef6efbf72e1c37fa0c48d0
ARG PG_TEXTSEARCH_LICENSE_SHA256=d33de21a123ce25b41722a5d10750984cb9c844c4d9b01add9e1b31f3ff452e5
ARG PG_TEXTSEARCH_NOTICE_SHA256=ff70cf4336c579957368a71c6b6b66ee8954011deef2b3d2c7a11f931080851d

# The prerelease base can carry an older CA bundle than the PGDG archive's
# The pinned base can carry an older CA bundle than the PGDG archive's
# current CloudFront chain. Debian remains usable when that source warns, so
# refresh trust first and then require a clean archive update.
RUN set -eux; \
Expand All @@ -27,11 +27,10 @@ RUN set -eux; \
update-ca-certificates; \
apt-get update; \
# The headers must be the base image's exact server build: the archive
# also serves newer prereleases, and an extension compiled against their
# headers fails at run time (an index access method struct changes).
# also serves newer server builds. Keep compile and runtime inputs equal.
apt-get install -y --no-install-recommends \
build-essential curl patch \
"postgresql-server-dev-19=${PG_VERSION}" "libpq-dev=${PG_VERSION}"; \
build-essential curl \
"postgresql-server-dev-18=${PG_VERSION}" "libpq-dev=${PG_VERSION}"; \
curl --fail --location --show-error \
--output /tmp/pg_textsearch.tar.gz \
"https://github.com/timescale/pg_textsearch/archive/${PG_TEXTSEARCH_REVISION}.tar.gz"; \
Expand All @@ -45,47 +44,41 @@ RUN set -eux; \
echo "${PG_TEXTSEARCH_NOTICE_SHA256} /src/pg_textsearch/NOTICE" | sha256sum --check --strict; \
rm -rf /var/lib/apt/lists/*

# PostgreSQL 19 RC 1 headers no longer pull in <limits.h>, and v1.5.1's
# src/planner/hooks.c uses INT_MAX without including it (upstream issue
# timescale/pg_textsearch#586). Force-include the standard header on top of
# the server's own preprocessor flags, which reach both the shared object and
# the JIT bitcode compiles; the pinned source stays unmodified.
RUN set -eux; \
cd /src/pg_textsearch; \
make -j"$(nproc)" CPPFLAGS="$(pg_config --cppflags) -include limits.h"; \
make -j"$(nproc)"; \
make install; \
{ \
sha256sum /usr/lib/postgresql/19/lib/pg_textsearch.so; \
find /usr/share/postgresql/19/extension -maxdepth 1 \
sha256sum /usr/lib/postgresql/18/lib/pg_textsearch.so; \
find /usr/share/postgresql/18/extension -maxdepth 1 \
-type f -name 'pg_textsearch*' -print0 | sort -z | xargs -0 sha256sum; \
} > /tmp/pg_textsearch-artifacts.sha256

# Local PostgreSQL 19 gate (D142, design §6): upstream supports PG19 on a
# best-effort basis, so every image build runs the extension's own regression
# suite against a throwaway cluster of this exact server build.
# Extension gate (D142/D157): every image build runs the upstream regression
# suite against a throwaway cluster of this exact PostgreSQL 18 server build.
RUN set -eux; \
chown -R postgres /src/pg_textsearch; \
su postgres -c "/usr/lib/postgresql/19/bin/initdb -D /tmp/pg_regress_data >/dev/null"; \
su postgres -c "/usr/lib/postgresql/18/bin/initdb -D /tmp/pg_regress_data >/dev/null"; \
echo "shared_preload_libraries = 'pg_textsearch'" >> /tmp/pg_regress_data/postgresql.conf; \
su postgres -c "/usr/lib/postgresql/19/bin/pg_ctl -D /tmp/pg_regress_data -l /tmp/pg_regress.log -w start"; \
su postgres -c "/usr/lib/postgresql/18/bin/pg_ctl -D /tmp/pg_regress_data -l /tmp/pg_regress.log -w start"; \
if ! su postgres -c "cd /src/pg_textsearch && make installcheck"; then \
cat /src/pg_textsearch/regression.diffs 2>/dev/null || true; \
exit 1; \
fi; \
su postgres -c "/usr/lib/postgresql/19/bin/pg_ctl -D /tmp/pg_regress_data -w stop"; \
su postgres -c "/usr/lib/postgresql/18/bin/pg_ctl -D /tmp/pg_regress_data -w stop"; \
rm -rf /tmp/pg_regress_data /tmp/pg_regress.log

FROM postgres:19rc1-trixie@sha256:f6bab6213c486e940e310a88490935cbc71b88f6c19fee3cd2ab14b3b02ff65b
FROM postgres:18.6-trixie@sha256:979bccfde35445db618c65107d27d08c6c21339d8dc3ad4c830c6633947be0e4

# pg_textsearch uses the PostgreSQL License at the source revision pinned above
# (v1.5.1, which supports PostgreSQL 19 upstream; no local patch, D142).
COPY --from=pg_textsearch_builder /usr/lib/postgresql/19/lib/pg_textsearch.so /usr/lib/postgresql/19/lib/pg_textsearch.so
COPY --from=pg_textsearch_builder /usr/share/postgresql/19/extension/pg_textsearch* /usr/share/postgresql/19/extension/
# (v1.5.1; no local patch or compiler workaround, D142/D157).
COPY --from=pg_textsearch_builder /usr/lib/postgresql/18/lib/pg_textsearch.so /usr/lib/postgresql/18/lib/pg_textsearch.so
COPY --from=pg_textsearch_builder /usr/share/postgresql/18/extension/pg_textsearch* /usr/share/postgresql/18/extension/
COPY --from=pg_textsearch_builder /src/pg_textsearch/LICENSE /usr/share/doc/pg_textsearch/LICENSE
COPY --from=pg_textsearch_builder /src/pg_textsearch/NOTICE /usr/share/doc/pg_textsearch/NOTICE
COPY --from=pg_textsearch_builder /tmp/pg_textsearch-artifacts.sha256 /usr/share/doc/pg_textsearch/artifacts.sha256

# Refresh the prerelease base's trust bundle before the archive update; package
# Refresh the pinned base's trust bundle before the archive update; package
# signatures still provide apt's normal authenticity boundary.
RUN set -eux; \
for pgdg_source_file in \
Expand All @@ -106,6 +99,6 @@ RUN set -eux; \
update-ca-certificates; \
apt-get update; \
apt-get install -y --no-install-recommends \
postgresql-19-partman=5.5.0-1.pgdg13+1 \
postgresql-19-pgvector=0.8.6-1.pgdg13+2; \
postgresql-18-partman=5.5.0-1.pgdg13+1 \
postgresql-18-pgvector=0.8.6-1.pgdg13+2; \
rm -rf /var/lib/apt/lists/*
11 changes: 6 additions & 5 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,16 @@ uv run python scripts/check_release_contract.py --tag v0.17.0
```

That release pull request also refreshes the PostgreSQL foundation pins in
`Dockerfile.postgres`: use the reviewed PostgreSQL 19 prerelease/GA base digest,
`Dockerfile.postgres`: use the reviewed official PostgreSQL 18.x base digest (minor and image at
least two weeks old),
pin the intended PGDG pgvector and pg_partman package versions, and pin the
pg_textsearch source revision plus source, compatibility-patch, license, and
pg_textsearch source revision plus source, license, and
notice checksums. Build the Dockerfile for both architectures, record each
embedded artifact manifest and immutable image digest, and run the extension
and graph release matrix before tagging. The tag workflow then rebuilds and
publishes `ghcr.io/writeitai/remember-stack-postgres:19rc1-VERSION` for both
architectures, each built on a native runner (the build's pg_textsearch
regression suite fails under QEMU emulation), and attaches `postgres-image-digests.json` to the GitHub release;
publishes `ghcr.io/writeitai/remember-stack-postgres:18-VERSION` for both
architectures, each built on a native runner (the pg_textsearch worker-count
regression has failed under QEMU emulation), and attaches `postgres-image-digests.json` to the GitHub release;
UMC consumes the recorded manifest digest, never that human-readable tag.
Updating the foundation pins remains a manual, reviewable patch cadence;
publishing and digest capture are mechanical and mutable database-image tags
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/locomo/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"""Concise adjudication projector/response-adapter generation (D121/D123)."""

EXPECTED_SURFACE_MANIFEST_HASH: Final = (
"f238bb518de2aed12db7278d274878006382aa7186baae40c3cdb7ec6b7c48c6"
"280cac8902f50aff8e6a02fe0fa39abdae6a64520e6a0b792bb8eef9c63e23e2"
)
EXPECTED_PIPELINE_STAGES: Final = (
"convert",
Expand Down
2 changes: 1 addition & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ services:
build:
context: .
dockerfile: Dockerfile.postgres
image: ghcr.io/writeitai/remember-stack-postgres:19rc1-0.20.0
image: ghcr.io/writeitai/remember-stack-postgres:18-0.20.0
command:
- postgres
- -c
Expand Down
Loading
Loading