Persist Lyra’s Redview encoder and remote-worker authentication #268

Closed
opened 2026-10-06 12:34:04 +01:00 by nimmo · 6 comments
Owner

Lyra is running Redview 2.4.0-rc.3 through temporary runtime overrides with a validated CUDA encoder and a dedicated protected worker key. Those overrides disappear on reboot and can shadow a declarative upgrade. MR #269 persists the encoder/key setup; accepted stable Redview 2.4.0 is now selected by main's automated lock update 4d8adab and incorporated into the MR.

Scope:

  • Persist the validated encoder runtime/cache and protected worker-key file alongside existing SOPS settings.
  • Gate API/worker startup on the operator-validated model contract. README documents generation of the identity from the selected package and the model/runtime update acceptance procedure; a flake refresh does not silently approve a model change.
  • Retire only the recognised RC3 runtime definitions once during operator cutover, outside permanent configuration. No additional scripts are shipped in nixos-config.
  • Keep Nova's permanent worker setup deferred until stable Lyra rollout is confirmed.

Validation:

  • Missing encoder/readiness contracts reproduced before implementation.
  • Final integrated stable-lock flake checks and full Lyra system build pass; MR action #1060 attempt 2 passes its test job. CI build/cache jobs were skipped; local full build supplies closure evidence.
  • Private cleanup tests pass: known-unit removal/repeatability, mismatched/symlinked definitions rejected before stopping, stop failure retains runtime definitions.
  • Operator cutover removes trial overrides and activates the reviewed declarative configuration.
  • Live health, exact model identity, four workers and remote authentication verified after persistent activation.
  • Persistent switch and no-op follow-up complete before the user releases Lyra's hold.

One-off cutover plan (operator sudo only; NOT executed during review):

  1. Keep Lyra's existing update hold. After MR acceptance/merge, update the normal ~/nixos-config checkout and build the exact Lyra system. Confirm its Redview package VERSION is 2.4.0, its encoder definition uses the validated runtime/cache, and the protected worker environment file is present. Retain the previous system closure and existing database backup. Do not run the original V1 migration helper.
  2. Run the privately staged helper on Lyra: sudo python3 /home/nimmo/redview2-test/amd-validation/retire-rc3-runtime.py --systemctl /run/current-system/sw/bin/systemctl. It first checks regular-file shape and known ExecStart definitions for only the five /run/systemd/system/<API-or-worker>.service.d/90-redview-rc3.conf files and /run/systemd/system/redview-v2-encoder-rc3.service; it rejects mismatched/symlinked entries before stopping anything. It saves the recognised definitions privately under /var/lib/redview-v2/rc-backups/rc3-runtime-units-*, stops four workers/API/trial encoder, then removes those six definitions. It does not touch databases, media, credentials, other overrides or job intents. Record its JSON backup path. Repeated cleanup is a no-op once those files are gone.
  3. Reload systemd after removal, then use the repository's documented just test from the updated checkout. This is a short planned service interruption. Verify the declarative redview-v2-encoder, API and all four worker services; check /health, /api/spec version 2.4.0, /metadata identity/dimensions and remote authentication read-only. Retain the pinned runtime's GC roots. Gracefully interrupted jobs may be paused; inspect before explicitly resuming. Preserve purge job 92's pending intents and verify reconciliation when it runs.
  4. After accepting the test activation, persist the same reviewed generation with the normal sudo nixos-rebuild switch --flake .#lyra. Verify health and a no-op follow-up before the operator releases the hold. Nova remains stopped until stable Lyra is confirmed live.

Recovery if activation fails: keep the hold and inspect readiness/service logs first. Do not migrate, overwrite or automatically restore the database. If reverting to the trial is necessary, stop the declarative encoder/API/workers, restore the six saved unit definitions to their original /run paths, reload systemd, and start the RC3 encoder followed by API/four workers. Match each saved <name>.service.d.conf to <name>.service.d/90-redview-rc3.conf; restore the saved encoder unit to its original name. The saved definitions and previous system generation are retained for operator recovery. Do not run both encoders on port 3212.

Do not close this issue before live activation and follow-up evidence.

Lyra is running Redview 2.4.0-rc.3 through temporary runtime overrides with a validated CUDA encoder and a dedicated protected worker key. Those overrides disappear on reboot and can shadow a declarative upgrade. MR #269 persists the encoder/key setup; accepted stable Redview 2.4.0 is now selected by main's automated lock update 4d8adab and incorporated into the MR. Scope: - Persist the validated encoder runtime/cache and protected worker-key file alongside existing SOPS settings. - Gate API/worker startup on the operator-validated model contract. README documents generation of the identity from the selected package and the model/runtime update acceptance procedure; a flake refresh does not silently approve a model change. - Retire only the recognised RC3 runtime definitions once during operator cutover, outside permanent configuration. No additional scripts are shipped in nixos-config. - Keep Nova's permanent worker setup deferred until stable Lyra rollout is confirmed. Validation: - [x] Missing encoder/readiness contracts reproduced before implementation. - [x] Final integrated stable-lock flake checks and full Lyra system build pass; MR action #1060 attempt 2 passes its test job. CI build/cache jobs were skipped; local full build supplies closure evidence. - [x] Private cleanup tests pass: known-unit removal/repeatability, mismatched/symlinked definitions rejected before stopping, stop failure retains runtime definitions. - [ ] Operator cutover removes trial overrides and activates the reviewed declarative configuration. - [ ] Live health, exact model identity, four workers and remote authentication verified after persistent activation. - [ ] Persistent switch and no-op follow-up complete before the user releases Lyra's hold. One-off cutover plan (operator sudo only; NOT executed during review): 1. Keep Lyra's existing update hold. After MR acceptance/merge, update the normal ~/nixos-config checkout and build the exact Lyra system. Confirm its Redview package VERSION is 2.4.0, its encoder definition uses the validated runtime/cache, and the protected worker environment file is present. Retain the previous system closure and existing database backup. Do not run the original V1 migration helper. 2. Run the privately staged helper on Lyra: `sudo python3 /home/nimmo/redview2-test/amd-validation/retire-rc3-runtime.py --systemctl /run/current-system/sw/bin/systemctl`. It first checks regular-file shape and known ExecStart definitions for only the five `/run/systemd/system/<API-or-worker>.service.d/90-redview-rc3.conf` files and `/run/systemd/system/redview-v2-encoder-rc3.service`; it rejects mismatched/symlinked entries before stopping anything. It saves the recognised definitions privately under `/var/lib/redview-v2/rc-backups/rc3-runtime-units-*`, stops four workers/API/trial encoder, then removes those six definitions. It does not touch databases, media, credentials, other overrides or job intents. Record its JSON backup path. Repeated cleanup is a no-op once those files are gone. 3. Reload systemd after removal, then use the repository's documented `just test` from the updated checkout. This is a short planned service interruption. Verify the declarative `redview-v2-encoder`, API and all four worker services; check /health, /api/spec version 2.4.0, /metadata identity/dimensions and remote authentication read-only. Retain the pinned runtime's GC roots. Gracefully interrupted jobs may be paused; inspect before explicitly resuming. Preserve purge job 92's pending intents and verify reconciliation when it runs. 4. After accepting the test activation, persist the same reviewed generation with the normal `sudo nixos-rebuild switch --flake .#lyra`. Verify health and a no-op follow-up before the operator releases the hold. Nova remains stopped until stable Lyra is confirmed live. Recovery if activation fails: keep the hold and inspect readiness/service logs first. Do not migrate, overwrite or automatically restore the database. If reverting to the trial is necessary, stop the declarative encoder/API/workers, restore the six saved unit definitions to their original /run paths, reload systemd, and start the RC3 encoder followed by API/four workers. Match each saved `<name>.service.d.conf` to `<name>.service.d/90-redview-rc3.conf`; restore the saved encoder unit to its original name. The saved definitions and previous system generation are retained for operator recovery. Do not run both encoders on port 3212. Do not close this issue before live activation and follow-up evidence.
Author
Owner

Prepared locally on fix/lyra-redview-persistent-encoder, commit 6afd952 (not pushed).

Implemented persistent encoder/cache configuration and required worker-key loading, a bounded metadata readiness gate before API/worker startup, encoder failure monitoring, and guarded one-time RC3 runtime cleanup. Cleanup preserves unit definitions and leaves databases, media, credentials and unrelated overrides untouched.

Validation:

  • Focused configuration check first failed at service.encoder.enable; corrected service assertions pass.
  • Readiness check first failed because the startup timeout/gate was absent; it now passes.
  • Six focused Python tests pass: cleanup repeatability/changed or symlinked units/stop failure, and readiness retry/model mismatch/timeout.
  • Actual readiness command passed against Lyra’s existing encoder without restarting production.
  • Full nix flake check passes with a Git-tracked release/2.4.0 RC3 input override and no lockfile writes. Existing upstream platform-deprecation warnings remain; the introduced encoder network-ordering warning was fixed.
  • Current stable-only lock still selects Redview 2.3.0. The new configuration correctly rejects that input before deployment. Stable 2.4.0 publication and input refresh remain prerequisites.
  • Full Lyra closure build is running; some unrelated existing CUDA/speech-service dependencies require building/downloading.

No host activation, stable promotion, branch publication or Nova permanent deployment has occurred. Live transition/no-op follow-up remain acceptance work; keep this issue open.

Prepared locally on `fix/lyra-redview-persistent-encoder`, commit `6afd952` (not pushed). Implemented persistent encoder/cache configuration and required worker-key loading, a bounded metadata readiness gate before API/worker startup, encoder failure monitoring, and guarded one-time RC3 runtime cleanup. Cleanup preserves unit definitions and leaves databases, media, credentials and unrelated overrides untouched. Validation: - Focused configuration check first failed at `service.encoder.enable`; corrected service assertions pass. - Readiness check first failed because the startup timeout/gate was absent; it now passes. - Six focused Python tests pass: cleanup repeatability/changed or symlinked units/stop failure, and readiness retry/model mismatch/timeout. - Actual readiness command passed against Lyra’s existing encoder without restarting production. - Full `nix flake check` passes with a Git-tracked `release/2.4.0` RC3 input override and no lockfile writes. Existing upstream platform-deprecation warnings remain; the introduced encoder network-ordering warning was fixed. - Current stable-only lock still selects Redview 2.3.0. The new configuration correctly rejects that input before deployment. Stable 2.4.0 publication and input refresh remain prerequisites. - Full Lyra closure build is running; some unrelated existing CUDA/speech-service dependencies require building/downloading. No host activation, stable promotion, branch publication or Nova permanent deployment has occurred. Live transition/no-op follow-up remain acceptance work; keep this issue open.
Author
Owner

Published minimal configuration commit 40eaa77 in draft PR #269. The final patch changes three existing files only: service configuration, its existing evaluation check and README. No new test or operational scripts remain in the config repository. Inline encoder readiness and six private checks pass, as do the final frozen-RC3 override flake checks. Full Lyra closure build is still running. The stable Redview release is in PR nimmo/redview#17; refresh only its lock entry after the accepted main merge, then run stable-lock gates before this PR leaves draft.

RC3 override retirement is a one-off operator cutover step outside permanent configuration, not an activation helper shipped in the repository. Nova's worker, encoder and tunnel are stopped until stable Lyra deployment. Keep this issue open for the final deployment and follow-up evidence.

Published minimal configuration commit 40eaa77 in draft PR #269. The final patch changes three existing files only: service configuration, its existing evaluation check and README. No new test or operational scripts remain in the config repository. Inline encoder readiness and six private checks pass, as do the final frozen-RC3 override flake checks. Full Lyra closure build is still running. The stable Redview release is in PR nimmo/redview#17; refresh only its lock entry after the accepted main merge, then run stable-lock gates before this PR leaves draft. RC3 override retirement is a one-off operator cutover step outside permanent configuration, not an activation helper shipped in the repository. Nova's worker, encoder and tunnel are stopped until stable Lyra deployment. Keep this issue open for the final deployment and follow-up evidence.
Author
Owner

MR #269 is accepted and merged through the normal protected workflow after the operator authorised proceeding on reviewed false positives. The model-identity option, documented update process and private RC3 cleanup plan are included. All pre-merge local/CI gates pass; the main cache action #1066 is running.

This issue remains open for the documented operator cutover, persistent activation and no-op follow-up. Lyra's hold has not been released; no trial cleanup/host activation was executed. Nova's worker services remain stopped. Do not let the main update replace the cutover plan: retire the recognised RC3 runtime definitions and their encoder before the declarative encoder starts on port 3212.

MR #269 is accepted and merged through the normal protected workflow after the operator authorised proceeding on reviewed false positives. The model-identity option, documented update process and private RC3 cleanup plan are included. All pre-merge local/CI gates pass; the main cache action #1066 is running. This issue remains open for the documented operator cutover, persistent activation and no-op follow-up. Lyra's hold has not been released; no trial cleanup/host activation was executed. Nova's worker services remain stopped. Do not let the main update replace the cutover plan: retire the recognised RC3 runtime definitions and their encoder before the declarative encoder starts on port 3212.
Author
Owner

Operator test activation is now confirmed live. Read-only Lyra checks show the declarative encoder, API and all four worker services active/running with zero restarts and successful exit status. API /health is healthy and /api/spec reports stable2.4.0. Encoder metadata matches the validated identity b29707036e0d2824eb0381df897c3940c65f24b1f00b4e30ee5ad6f832a078c0 and2048 dimensions. Main cache action1066 completed successfully.

At the check, /run/current-system still differs from the persistent system profile, so this is test activation only. Operator persistent switch, health/no-op follow-up and hold release remain outstanding. Nova workers remain stopped; this issue stays open.

Operator test activation is now confirmed live. Read-only Lyra checks show the declarative encoder, API and all four worker services active/running with zero restarts and successful exit status. API /health is healthy and /api/spec reports stable2.4.0. Encoder metadata matches the validated identity b29707036e0d2824eb0381df897c3940c65f24b1f00b4e30ee5ad6f832a078c0 and2048 dimensions. Main cache action1066 completed successfully. At the check, /run/current-system still differs from the persistent system profile, so this is test activation only. Operator persistent switch, health/no-op follow-up and hold release remain outstanding. Nova workers remain stopped; this issue stays open.
Author
Owner

Persistent operator activation is confirmed: the running system and persistent system profile now resolve to the same Lyra closure. A fresh non-activating build from Lyra's normal checkout also resolves to that exact running system, confirming an unchanged follow-up build. API health/version and encoder identity/dimensions are correct; all six declarative services remain active with zero restarts and successful exit status. The hold can now be released by the operator. Nova's workers remain stopped pending their separate setup; live remote-worker authentication acceptance remains a follow-up. This supersedes the earlier test-only activation observation.

Persistent operator activation is confirmed: the running system and persistent system profile now resolve to the same Lyra closure. A fresh non-activating build from Lyra's normal checkout also resolves to that exact running system, confirming an unchanged follow-up build. API health/version and encoder identity/dimensions are correct; all six declarative services remain active with zero restarts and successful exit status. The hold can now be released by the operator. Nova's workers remain stopped pending their separate setup; live remote-worker authentication acceptance remains a follow-up. This supersedes the earlier test-only activation observation.
Author
Owner

Redview v2 encoder and remote-worker authentication persistence completed and validated in production on Lyra. Closing as complete.

Redview v2 encoder and remote-worker authentication persistence completed and validated in production on Lyra. Closing as complete.
nimmo closed this issue 2026-10-07 06:44:27 +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#268
No description provided.