Managed PostgreSQL extensions: finish observed-version reporting and lifecycle E2E
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- docker, go, postgresql
- 领域
- database, devops, infrastructure
调研方向
从现有的托管 PostgreSQL 驱动程序、services: postgres 声明、e2e/apps/immich.yml 以及 issue #63 的 backup/restore 子系统开始。完成的标准是:受支持的 PostgreSQL 18 pgvector 能力已完成验证、固定到 digest、具备生命周期感知能力、可安全采用且可逆,并有备份和隔离恢复证据覆盖。
由索引模型根据 Issue 内容生成。
描述
Current scope (v2026.10.1-alpha)
The basic managed-extension capability has shipped (f0746ff and subsequent hardening): a Onebox-owned PostgreSQL 18 image, extension declarations, dependency/preload settings, availability checks, reconciliation before application migrations, refusal of incompatible installed/candidate versions, preload-removal protection, and extension checks during restore.
The image-publication decision is made and the backup subsystem is executable. Neither should remain framed as an unstarted dependency.
This issue remains open for the outstanding proof and reporting requirements in the original proposal:
- Report observed available/enabled extension versions through a suitable server-facing read surface. Current
ob statusreports service health, not these extension facts; local-onlyob doctormust not silently become a remote probe. - Add end-to-end proof for plain PostgreSQL 18 adoption, vector data/index persistence, backup and isolated restore, and rollback with the supported managed image.
- Document the implemented compatibility and deliberate upgrade/removal refusal boundary, and distinguish it from automatic extension upgrades.
No PostgreSQL-extension/vector scenario was found in the current server E2E fixtures. Keep this open for those remaining requirements rather than treating the original feature as wholly absent or wholly proven.
Original proposal and historical context
Objective
Let the managed PostgreSQL driver provide a closed, versioned set of compiled extensions, starting with pgvector, without weakening the managed-service boundary into arbitrary images or runtime package installation.
This should be a general Onebox capability with PostgreSQL as the first implementation, not a Monk-specific exception.
Why
Today services: {postgres: 18} fixes the service image to postgres:18. Driver settings become PostgreSQL -c parameters; there is no extension, variant, image, package, or initialization-hook contract. Extensions that need server binaries therefore force the database into a user-owned daemon workload.
The repository already documents this boundary in e2e/apps/immich.yml: its vector-enabled PostgreSQL image cannot use the managed driver. Monk has the same requirement for its proposed hybrid PostgreSQL full-text + pgvector research store, while its current custom PostgreSQL 18 image also carries WAL-G.
Onebox should be able to own a vector-capable PostgreSQL service completely: image provenance, compatibility, lifecycle, credentials, persistence, health, planning, and recovery evidence.
Contract direction
Add a driver-owned capability surface rather than overloading settings. The exact authored shape needs design, but it should express an allowlisted extension and a pinned version, for example:
services:
postgres:
version: 18
features:
extensions:
vector: PINNED_VERSION
The driver resolves that declaration to a known digest-pinned image. It must not accept an arbitrary repository, Dockerfile, package name, shell command, or unbounded extension identifier. If Onebox cannot own a combination, validation refuses it and directs the user to a daemon workload.
Application migrations remain responsible for enabling an available extension in the intended database:
CREATE EXTENSION IF NOT EXISTS vector;
Onebox provides and verifies the compiled extension; it does not silently mutate every database.
Requirements
Driver and image ownership
- Define a closed per-driver extension catalogue, starting with
postgres/vector. - Bind PostgreSQL major versions to explicitly supported extension versions.
- Resolve each supported combination to a signed or otherwise provenance-verifiable, digest-pinned image.
- Build or resolve images before production; never install packages with
ob exec, container startup scripts, or a production build. - Include the resolved extension identity and image digest in plan, canonical state, and drift comparison.
- Reject unknown extensions, unsupported combinations, downgrades, and removal when safe continuity cannot be proven.
Runtime semantics
- Preserve the existing managed-service ownership model: separate Compose project, durable volume, target-generated credential, health gate, and injected connection parts.
- Verify the declared extension is present in
pg_available_extensionsbefore the service is considered ready. - Report available and enabled extension versions through status/doctor without exposing credentials.
- Keep database-level
CREATE EXTENSIONand extension-schema migrations under application ownership.
Lifecycle and adoption
- Plan extension installation, upgrade, downgrade, and removal as explicit stateful changes.
- Preflight the existing cluster for enabled extension versions and incompatible objects.
- Support moving an existing same-major PostgreSQL service to an extension-capable managed image without replacing or silently renaming its data volume.
- Document dump/restore when in-place adoption is not safe.
- Exercise rollback before declaring an extension combination supported.
Protection dependency
Managed PostgreSQL currently has no executable backup or restore contract. #63 tracks that existing subsystem. This issue must integrate with it rather than invent a second backup path.
- Do not describe extension-capable PostgreSQL as production-managed until the selected service has current backup evidence and a passing isolated restore proof.
- Backup and restore must preserve extension metadata and use an image containing the same compatible binaries.
- A stateful extension change must participate in the migration-backup gate.
First implementation: pgvector
Use pgvector as the first extension because it exercises the whole contract:
- compiled server binaries tied to PostgreSQL major version;
- database-level enablement through
CREATE EXTENSION vector; - extension-version upgrades;
- vector column, exact search, and HNSW/IVFFlat index persistence;
- backup and restore into an extension-capable image;
- measurable image, WAL, storage, and upgrade effects.
The implementation should not assume vector-only retrieval or make pgvector an application framework. It only supplies a trustworthy PostgreSQL capability.
Non-goals
- Arbitrary custom images inside
services. - Runtime
apt, source compilation, or mutable package installation. - Automatically enabling extensions in every database.
- Treating a migration success as backup or restore proof.
- Adding a Monk-specific driver or hidden exception.
- Claiming general support for PostGIS, TimescaleDB, VectorChord, or other extensions before each has its own compatibility and lifecycle contract.
Delivery slices
- Contract: choose and document the driver-owned feature shape, compatibility model, plan representation, and refusal behavior.
- Artifact: publish and resolve the first PostgreSQL 18 + pinned pgvector image with provenance and digest binding.
- Lifecycle: add availability health, status/doctor facts, drift detection, and upgrade/removal preflights.
- Protection: connect the image and extension identity to #63 backup, restore, and migration gates.
- Adoption: prove a plain PostgreSQL 18 data volume can move to the vector-capable image, enable pgvector by migration, restart, back up, restore, and roll back safely.
- Product proof: migrate one real consumer only after those gates pass. Monk is a suitable first consumer because it already owns PostgreSQL 18, WAL-G, SQLx migrations, and a proposed pgvector workload.
Verification
- Schema and loader tests accept the supported declaration and reject unknown or incompatible extensions.
- Generated service runtime uses the expected digest-pinned image and preserves existing credential/volume semantics.
- A PostgreSQL 18 service reports the pinned pgvector version in
pg_available_extensions. - An application migration enables
vector, writes vectors, performs exact distance search, creates an index, and survives restart. - Plan and drift output change when the extension or its resolved image changes.
- Unsafe removal/downgrade is refused with an actionable code.
- Existing plain PostgreSQL managed services remain byte-for-byte unchanged when no extension is declared.
- Backup and isolated restore preserve extension version, schema, data, and indexes once #63 is executable.
- Documentation states the managed-service versus daemon boundary and never implies that arbitrary PostgreSQL add-ons are supported.
Done when
A project can declaratively request PostgreSQL 18 with a pinned pgvector capability; Onebox validates and plans a known image, runs it with normal managed-service semantics, proves extension availability, observes lifecycle drift, safely handles adoption and upgrades, and has current backup plus isolated restore evidence through #63 before production use.
- 主要语言
- Go
- 星标
- 4
- 派生
- 0
- 平均合并
- 2 小时 46 分钟
- 30 天内合并 PR
- 38
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
labstack/onebox 的其他 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 80/100
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 65/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
prime-radiant-inc/evener#4329 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
openwatersio/aiscast#277 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 3 天内回复