Skip to content

Build native releases and images through a single Nix flake - #299

Merged
jgoux merged 17 commits into
mainfrom
nix-native-release-pipeline
Sep 7, 2026
Merged

jgoux merged 17 commits into
mainfrom
nix-native-release-pipeline

Conversation

@jgoux

@jgoux jgoux commented Sep 5, 2026 •

Copy link
Copy Markdown
Collaborator

This migrates native service builds and image assembly to a single root Nix flake. Release jobs previously selected between host installers, copied upstream overlays, and several Nix invocation paths. They now resolve the requested source and dependency hashes into an explicit release input, build a portable runtime, and package the audited bytes with pinned archive tools and dockerTools.

The hourly poller, release floors, exact-version selection, and automatic native-package/image publication remain intact. New upstream releases do not require edits to the repository lock. Postgres and Edge Runtime retain their selected upstream release's own dependency graph; verified upstream archives and mirrored images retain their existing provenance paths.

The migration removes host Go/npm installers, duplicated Nix pins, copied overlays, Docker build runners, and slim Dockerfiles. Studio uses the standard nixpkgs pnpm fetcher and configuration hook. Runtime identity, working directories, entrypoints, volume permissions, and platform floors remain part of the validation contract.

Service artifacts also own Realtime, Analytics, Storage, and Pooler preparation, Pooler tenant provisioning, and PostgreSQL first boot. Native services and derived images use the same launchers. PostgreSQL bootstraps through a private socket and a directly owned temporary server, preserves existing volumes, and rejects incomplete initialization. Ports, credentials, and project configuration remain in the CLI stack rewrite.

Validation: repository checks, host fixture suites, shell syntax/ShellCheck, and pure flake evaluation pass. All 15 selected release validations pass across Linux amd64, Linux arm64, and macOS arm64, covering 13 services, PostgreSQL 15 and 17, and two Studio versions. Validation-only runs build, audit, archive, and smoke without replacing published assets or images. A fresh poller dry run found no unpublished backlog among 155 eligible versions.

Same-version Linux ARM64 comparisons: compressed images decreased by 4.4 MiB for PostgreSQL 17, 3.2 MiB each for Storage and PgMeta, and 8.7 MiB for Studio. Native archives for the first three increased by 1.1–3.0 MiB with bundled glibc; Studio's archive decreased by 0.5 MiB. Parallel-stack memory capacity remains unmeasured.

Successful release-validation runs
Release CI
studio 2026.08.03-sha-022b374 Passed
studio 2026.09.04-sha-5a67366 Published and verified
postgres 17.6.1.159 Passed
postgres 15.14.1.159 Passed
pgmeta v0.96.6 Passed
storage v1.68.1 Passed
analytics v1.49.2 Passed
pooler v2.9.10 Passed
realtime v2.123.5 Passed
postgrest v14.16 Passed
auth v2.195.0 Passed
vector 0.53.0 Passed
mailpit v1.30.2 Passed
imgproxy v3.8.0 Passed
edge-runtime v1.74.3 Passed

Repository checks

Service preparation validation

The eight selected releases were replaced from this branch after passing all three native targets and both Linux images. Each release has verified archive checksums, manifests, and SBOMs; CLI PR #6440 pins the published multi-architecture image digests. PostgreSQL coverage includes existing volumes, backup restoration, restart behavior, and failed initialization; host fixtures verify cancellation and process cleanup.

Release CI
realtime v2.134.5 Published and verified
pooler v2.9.12 Published and verified
analytics v1.50.9 Published and verified
storage v1.73.0 Published and verified
studio 2026.09.04-sha-5a67366 Published and verified
pgmeta v0.99.0 Published and verified
postgres 17.6.1.168 Published and verified
postgres 15.14.1.168 Published and verified

Supersedes #298

@jgoux
jgoux marked this pull request as ready for review September 5, 2026 03:17
@jgoux
jgoux requested a review from avallete September 5, 2026 07:30
@jgoux
jgoux merged commit c9e242d into main Sep 7, 2026
55 of 56 checks passed
@jgoux
jgoux deleted the nix-native-release-pipeline branch September 7, 2026 08:37
pull Bot pushed a commit to oogalieboogalie/cli that referenced this pull request Sep 7, 2026
## Summary

Rewrites `@supabase/stack` around one managed-only runtime shared by
strict native and container execution modes. The package owns durable
configuration and secrets, sticky ports, artifact preparation, lifecycle
arbitration, per-service eager or lazy activation, service migrations,
ingress, retained and live logs, and exact resource cleanup.

A stopped stack has no resident supervisor or runtime resources: status
and retained logs come from durable state, while a later start creates a
fresh owner and performs clean recovery. PostgreSQL 17 is the only eager
service by default; other enabled services activate through stack
ingress, and callers can configure eager activation. Dependency-ready
workloads start concurrently. Docker-compatible engines, including
Podman, share the same container path.

Enabled lazy services prepare their artifacts in the background after
startup by default. `preparation: "on-demand"` retains full lazy
downloading, while explicit `prepare()` remains available in either
mode. Foreground activation prepares its dependency closure concurrently
and shares in-flight downloads with background preparation. All selected
workload downloads can run concurrently. Native archives are streamed to
disk while hashing, verified before extraction, and decompressed without
retaining whole archives in memory. Runtime cleanup cancels unfinished
transfers and retains completed cache entries. Status exposes artifact
preparation separately from service readiness, and explicit preparation
reports progress through `onProgress`.

Edge Functions are served through the stack-owned Edge Runtime for
package consumers. The package runs independently of the CLI and accepts
normalized `StackConfig` values without reading `config.toml`. All CLI
integration, including `supabase functions serve` and lifecycle commands
under `experimental start`, belongs to M5 in separate PRs. Existing CLI
Functions behavior is preserved. The deleted `next` CLI was a disposable
proving ground and is not part of this PR.

Service preparation now lives in the published runtime artifacts:
PostgreSQL owns first boot and bundled migrations, service helpers own
migration and Pooler tenant provisioning, and Node services expose
public launchers shared with their images. The stack supplies instance
settings and sequences those commands. Default images use the configured
slim-services tags or digests, including the artifacts from
[slim-services #299](supabase/slim-services#299)
and the BEAM versions republished after [slim-services
#302](supabase/slim-services#302). Native
downloads are checked against the checksum published with the same
release. BEAM launchers own the shared runtime defaults in native and
container modes; Vector configuration and Edge Functions bootstrap
remain stack-owned.

Unix control sockets bind inside owner-private directories. Container
mount paths preserve CSV special characters, and default state paths use
the user home directory when `HOME` is absent.

Obsolete process-compose integration and superseded runtime helpers are
removed.

Supersedes supabase#6385
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants