Deploy Attic on lyra against shared PostgreSQL and NAS storage #7

Closed
opened 2026-07-01 16:14:38 +01:00 by nimmo · 4 comments
Owner

Goal

Add atticd to lyra only after vega is stable on PostgreSQL-backed metadata.

Scope

This issue covers the work from projects/attic-postgres-lyra-rollout.md Phase 3.

Acceptance Checklist

  • Mount the same NAS-backed Attic storage on lyra.
  • Enable Attic for lyra through the repo/module path.
  • Point lyra at the same PostgreSQL database as vega.
  • Give lyra the same token/secret material needed to serve the same cache.
  • Start atticd successfully on lyra.
  • Confirm lyra can serve known-good cache metadata locally.

Implementation Outline

  1. Ensure the shared storage mount exists on lyra.
  2. Enable Attic on lyra.
  3. Use the same PostgreSQL metadata DB.
  4. Provide the same cache-serving secret material.
  5. Start the service and validate local responses.

Verification

ssh vega systemctl status atticd
ssh lyra systemctl status atticd
ssh lyra curl -I http://127.0.0.1:8081/nixos/nix-cache-info
ssh lyra curl http://127.0.0.1:8081/nixos/<known-good-hash>.narinfo

Success means both nodes can start and serve the same cache metadata while reading the same shared storage.

Notes

  • Do not update the public reverse proxy yet; keep this step direct/local until both nodes are healthy.
## Goal Add `atticd` to `lyra` only after `vega` is stable on PostgreSQL-backed metadata. ## Scope This issue covers the work from `projects/attic-postgres-lyra-rollout.md` Phase 3. ## Acceptance Checklist - Mount the same NAS-backed Attic storage on `lyra`. - Enable Attic for `lyra` through the repo/module path. - Point `lyra` at the same PostgreSQL database as `vega`. - Give `lyra` the same token/secret material needed to serve the same cache. - Start `atticd` successfully on `lyra`. - Confirm `lyra` can serve known-good cache metadata locally. ## Implementation Outline 1. Ensure the shared storage mount exists on `lyra`. 2. Enable Attic on `lyra`. 3. Use the same PostgreSQL metadata DB. 4. Provide the same cache-serving secret material. 5. Start the service and validate local responses. ## Verification ```bash ssh vega systemctl status atticd ssh lyra systemctl status atticd ssh lyra curl -I http://127.0.0.1:8081/nixos/nix-cache-info ssh lyra curl http://127.0.0.1:8081/nixos/<known-good-hash>.narinfo ``` Success means both nodes can start and serve the same cache metadata while reading the same shared storage. ## Notes - Do not update the public reverse proxy yet; keep this step direct/local until both nodes are healthy.
Author
Owner

Starting implementation.

Current repo state before changes:

  • lyra does not currently import the shared Attic module.
  • The shared Attic module now correctly relies on the secret-backed PostgreSQL URL instead of nixpkgs' default SQLite config, and vega is already running successfully on the reset PostgreSQL-backed cache.

Planned repo change for this phase:

  • enable the shared modules/services/atticd.nix module on lyra,
  • keep using the same NAS-backed storage and PostgreSQL metadata DB,
  • validate the configuration locally before any host deployment.
Starting implementation. Current repo state before changes: - `lyra` does not currently import the shared Attic module. - The shared Attic module now correctly relies on the secret-backed PostgreSQL URL instead of nixpkgs' default SQLite config, and `vega` is already running successfully on the reset PostgreSQL-backed cache. Planned repo change for this phase: - enable the shared `modules/services/atticd.nix` module on `lyra`, - keep using the same NAS-backed storage and PostgreSQL metadata DB, - validate the configuration locally before any host deployment.
Author
Owner

Repo-side enablement for lyra is done.

Implemented:

  • hosts/lyra/default.nix now imports the shared modules/services/atticd.nix module.
  • lyra host tags now include attic so inventory reflects the new role.
  • nix flake check passes with the change.

This means the remaining work for #7 is deployment/validation on the host itself:

  • test-deploy lyra,
  • confirm atticd starts there against the shared PostgreSQL DB and NAS storage,
  • verify local 127.0.0.1:8081/nixos/nix-cache-info from lyra.
Repo-side enablement for `lyra` is done. Implemented: - `hosts/lyra/default.nix` now imports the shared `modules/services/atticd.nix` module. - `lyra` host tags now include `attic` so inventory reflects the new role. - `nix flake check` passes with the change. This means the remaining work for #7 is deployment/validation on the host itself: - test-deploy `lyra`, - confirm `atticd` starts there against the shared PostgreSQL DB and NAS storage, - verify local `127.0.0.1:8081/nixos/nix-cache-info` from `lyra`.
Author
Owner

Host-side validation on lyra is largely successful.

Observed after test deployment:

  • atticd.service starts successfully on lyra.
  • The shared NAS mount is present at /srv/attic/storage.
  • atticd starts against the same checked config shape as vega, runs migrations, and listens on 0.0.0.0:8081.
  • Local curl -i http://127.0.0.1:8081/nixos/nix-cache-info on lyra returns 200 OK with public cache visibility.

This confirms lyra is serving the shared PostgreSQL-backed Attic cache locally. The only remaining nice-to-have before closing this issue is a local .narinfo behavior check on lyra (either a known present object once the cache is repopulated, or the expected clean miss for an old historical path while the cache is still empty).

Host-side validation on `lyra` is largely successful. Observed after test deployment: - `atticd.service` starts successfully on `lyra`. - The shared NAS mount is present at `/srv/attic/storage`. - `atticd` starts against the same checked config shape as `vega`, runs migrations, and listens on `0.0.0.0:8081`. - Local `curl -i http://127.0.0.1:8081/nixos/nix-cache-info` on `lyra` returns `200 OK` with public cache visibility. This confirms `lyra` is serving the shared PostgreSQL-backed Attic cache locally. The only remaining nice-to-have before closing this issue is a local `.narinfo` behavior check on `lyra` (either a known present object once the cache is repopulated, or the expected clean miss for an old historical path while the cache is still empty).
Author
Owner

Final local data-path verification on lyra passed.

  • curl http://127.0.0.1:8081/nixos/4da5p6rwzj366cfsq0xslgqi1q7j5nbr.narinfo on lyra returned a valid .narinfo payload, not just nix-cache-info.
  • That confirms lyra can resolve real cache metadata against the shared PostgreSQL DB and shared NAS-backed Attic storage.

Issue outcome:

  • lyra is now successfully running Attic against the shared backend stack and can serve the same cache locally.
  • The next milestone step is the public dual-backend proxy change in issue #8.
Final local data-path verification on `lyra` passed. - `curl http://127.0.0.1:8081/nixos/4da5p6rwzj366cfsq0xslgqi1q7j5nbr.narinfo` on `lyra` returned a valid `.narinfo` payload, not just `nix-cache-info`. - That confirms `lyra` can resolve real cache metadata against the shared PostgreSQL DB and shared NAS-backed Attic storage. Issue outcome: - `lyra` is now successfully running Attic against the shared backend stack and can serve the same cache locally. - The next milestone step is the public dual-backend proxy change in issue #8.
nimmo closed this issue 2026-07-06 16:25:17 +01:00
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/nixos-config#7
No description provided.