Skip to content

feat(nixos): Kaneo + PostgreSQL as pm-apps oci-containers (code#1752) - #7926

Closed
dezren39 wants to merge 1 commit into
mainfrom
nixos/1752-kaneo-oci-cutover
Closed

dezren39 wants to merge 1 commit into
mainfrom
nixos/1752-kaneo-oci-cutover

Conversation

@dezren39

@dezren39 dezren39 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Completes the #1752 unification for Kaneo + PostgreSQL under Drew's 2026-11-08 ruling (Option A): "nixos for now... unify for all nixos but understand we might move all to compose right after. ruling is unify first, not making a permanent ruling." Provisional — this unifies all four PM servers under NixOS; it does not settle compose-vs-NixOS permanently.

What changes

  • pm-apps declares pm-postgres + pm-kaneo as oci-containers, mirroring pm-grist/pm-pad: same images (tag + digest pins of the images the compose stack was verified running at cutover time), same loopback port 5173, same ~/pm-stack/.env, same named volume pm-stack_postgres_data mounted in place — no data moves.
  • Networking fix the 2026-10 attempt lacked: Kaneo resolves its database as host postgres (upstream default; no DATABASE_URL). Both containers attach to the pm-stack_default network, pm-postgres carries --network-alias=postgres, and a new pm-stack-network oneshot creates the network at boot (docker compose down deletes it; nothing else recreates it). In 2026-10 both containers sat on the default bridge with no alias and the oci Kaneo never connected (zero client connections on the oci postmaster).
  • pm-stack module: pm-kaneo.service + pm-kaneo.timer removed, so the compose manager/self-heal cannot resurrect the stack against the same volume (the 2026-11-01 two-postmaster incident, Two postmasters on the PM data volume + docker-pm-kaneo start-limit loop — dual Kaneo/PostgreSQL managers (pm-apps oci vs pm-stack compose) #3849). deploy.sh compose actions are documented as retired; deploy.sh render remains the .env/tunnel.env re-render path.

Cutover sequence (executed with this PR)

  1. Verified backup first: pg_dump of the kaneo DB, restore-verified into a scratch container (45 tables; task/project/workspace counts identical to live), plus a fresh dump + cold volume tar at the stop. Hashes recorded on nixos: bring Grist, Kaneo, Pad, ready-for-agent in as flake services — the last hand-run PM servers #1752.
  2. Compose units' stack stopped before the switch — no postmaster overlap at any moment.
  3. nixos-rebuild switch from the primary checkout.
  4. Verify: Grist :8484, Kaneo :5173, Pad :7777, ready-for-agent :6056 answer; exactly one postmaster; Kaneo serves live counts.

Refs #1752.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 9, 2026 02:25
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-09T02:26:02.805223Z
We couldn’t complete this review. Comment @codex review to try again.
dfebbbd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bdc02e1a-1088-421b-9725-9f9552baff3a
Commits

Reviewing files that changed from the base of the PR and between 4ca19ee and 8c057ea.

Files selected for processing: 2

  • nixos/services/pm-apps/default.nix
  • nixos/services/pm-stack/default.nix
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Drew ruled 2026-11-08 (Option A): "nixos for now... unify for all
nixos but understand we might move all to compose right after.
ruling is unify first, not making a permanent ruling." Provisional
unification, not a permanent compose-vs-NixOS settlement.

- pm-apps declares pm-postgres + pm-kaneo as oci-containers,
  mirroring pm-grist/pm-pad: same images (tag + digest pins of the
  images the compose stack was verified running), same port
  (127.0.0.1:5173), same .env file, same named volume
  pm-stack_postgres_data mounted in place.
- Networking fix the 2026-10 attempt lacked: Kaneo resolves its
  database as host "postgres"; both containers attach to the
  pm-stack_default network with pm-postgres aliased "postgres",
  and a pm-stack-network oneshot creates the network (compose
  down deletes it).
- pm-stack module: pm-kaneo.service + pm-kaneo.timer removed, so
  the compose manager cannot resurrect against the volume
  (the 2026-11-01 two-postmaster fight, code#3849).
- Cutover order: verified backup -> compose stack stopped ->
  switch -> verify all four servers + single postmaster.
@dezren39

dezren39 commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

Do not merge this ahead of the cutover sitting. Status (full record on #1752):

  • This change is complete and verified as far as a PR can be: it evaluates, its units build, and the Kaneo backup was taken and restore-verified before anything was touched.
  • The amd toplevel build is currently red on main for reasons unrelated to this PR (mcpx: TestCommittedRegionsAreCurrent + TestRetentionAcrossReopenRunsFromCompletion; the earlier id schedule-test failure was fixed upstream by bd43291 and this branch is rebased past it). The switch therefore has not run.
  • Merging early is a hazard, not a shortcut: any routine switch landing this change while the compose stack still runs would start the oci Postgres against the same volume the compose postmaster serves — the 2026-11-01 two-postmaster incident (code#3849). Merge only in the same sitting as: compose stop (pm-kaneo.timer/service + compose down) → fresh dump + cold volume snapshot → nixos-rebuild switch → four-server verification.

@dezren39 dezren39 added user/escalated Requires a Drew decision or access queue/blocked Queue or user escalation state status/blocked Queue or user escalation state labels Nov 14, 2026
@dezren39

Copy link
Copy Markdown
Member Author

agent-note:v1
state: blocked
task: 17267
lane: code-b
worker: repo-worker-code
note: Shepherd pass in task 17267: NOT merged and NOT closed. This PR is decision-gated by Drews own instruction on this PR (2026-11-09): Do not merge this ahead of the cutover sitting. Main has since recorded the standing position in nixos/services/pm-apps/default.nix: Kaneo and its PostgreSQL stay compose-managed by the pm-stack module, and completing the #1752 oci-container migration instead means disabling the pm-stack compose units first and planning the cutover — until that decision is made, compose is the single manager. Merging this PR from a queue lane would enact the cutover without the sitting. Blocking queue task 17267 for the specific decision: Drew to hold the #1752 Kaneo/PostgreSQL cutover sitting (disable compose units + planned cutover) or rule the oci-container migration abandoned, in which case this PR should be closed. Labels set: user/escalated, queue/blocked, status/blocked.

@dezren39

Copy link
Copy Markdown
Member Author

agent-note:v1
state: blocked
task: 17267
lane: code-a
worker: repo-worker-code
note: Shepherd revalidation in task 17267 (2026-11-16): NOT merged and NOT closed. Fresh evidence this shift: PR #7926 is still OPEN, head unchanged at 8c057ea, now CONFLICTING against current main, with basic checks failing on the stale branch. Drew's own instruction on this PR (2026-11-09) still stands: do not merge ahead of the cutover sitting — merge, compose stop, fresh dump + cold volume snapshot, nixos-rebuild switch, and four-server verification must happen in one sitting, because merging early lets a routine switch start the oci Postgres against the volume the compose postmaster serves (the 2026-11-01 two-postmaster incident, code#3849). The end-state decision itself is already answered in the pending-decisions ledger (item kaneo-postgres-endstate-1752: Drew ruled Option A, NixOS cutover, on 2026-11-08); what remains gated is the sitting itself, or a ruling that the migration is abandoned (in which case this PR closes). A queue lane cannot clear this alone: the merge is unsafe without the coordinated host switch sitting. Blocking task 17267 as escalated-to-user naming that gate; ledger item kaneo-postgres-endstate-1752 already carries the decision record. Labels: user/escalated, queue/blocked, status/blocked.

@dezren39

Copy link
Copy Markdown
Member Author

Program tending — stalled PR check-in (tracking: #1352)

  • No activity for 2 day(s); last update 2026-11-16T10:49:12Z.
  • Waiting on: blocked (status/blocked label).
  • Next step: clear the recorded blocker, or update the PR with the current blocker.

@dezren39 dezren39 removed their assignment Nov 20, 2026
@dezren39 dezren39 added status/superseded Work superseded by a newer change, PR or task and removed status/blocked Queue or user escalation state user/escalated Requires a Drew decision or access queue/blocked Queue or user escalation state labels Nov 22, 2026
@dezren39

Copy link
Copy Markdown
Member Author

Closed as superseded. Closed by queue task 17267 as superseded by the NixOS-managed compose service on current main; not merged. #1752 requires a NixOS/flake service following the pm-stack shape, which is already provided by pm-kaneo.service and its timer in nixos/services/pm-stack/default.nix. The OCI proposal in this PR conflicts with current main and would reintroduce the documented dual-manager/two-postmaster risk on pm-stack_postgres_data. PR #3847 removed the duplicate OCI declarations. If OCI migration is again required, it needs a new planned cutover from current main with verified backup/snapshot, compose shutdown, switch, and post-switch checks in one operation. Evidence/decision recorded on #1752.
Successor: #3847

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

Labels

status/superseded Work superseded by a newer change, PR or task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant