Replace the V1 service with the tested V2 production configuration #258
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:cosmos
host:electra
host:fleet
host:lena
host:lyra
host:mass-storage
host:media1
host:nimmog-de
host:nova
host:pangolin
host:pangolin-vps
host:phone
host:router
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nix-idioms-hygiene
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:gitlab
service:hermes
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
service:tdarr
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!258
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/257-redview-v2-production"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replace the V1 application declaration with the root-layout V2 production module and retain the existing operational integrations. Use the same immutable dev.118 application package exercised by the operator; do not upgrade the application during this configuration merge.
Related: #257, milestone Lyra Redview v2 Migration. Keep the issue open for persistent deployment and the remaining operator acceptance.
Validation
Remaining operator steps
Keep the auto-update hold until persistent deployment succeeds. Test activation reverts on reboot. A personal login and new GPU/Reddit/VPN job were not performed by the agent's post-activation checks; production rollback was not exercised. Detailed operational metadata and commands remain in the privately staged guide. This PR does not publish a stable application release.
Automated code review
Reviewed commit:
fb39419204cae7a2382ca273e78ac3b3ecc61e3eVerdict: Requires further work
Resolve the blocking or important findings and investigate failed deterministic checks before merging.
Overall assessment
The PR introduces a V2 Redview service configuration on the Lyra host, replacing the V1 service. It includes a NixOS module update, a deterministic check script, and a shell helper for database migration with Python tests. The diff shows correct usage of
lib.rangewithin the flake context in the check script, and the migration script implements robust atomicity checks for snapshots and migrations.Blocking findings
None.
Important findings
The script explicitly stops services:
systemctl stop 'redview-v2-worker*.service' redview-v2.service redview.serviceand checks for specific units:for unit in redview.service redview-v2.service redview-v2-worker.service redview-v2-worker-{2,3,4}.service; do. This hardcodes the worker count (4) and naming scheme (redview-v2-worker,redview-v2-worker-2, etc.) which matches the NixOS module config but is brittle if the module configuration changes.Impact: If the NixOS module's worker naming or count changes, the migration script may fail to stop all relevant services or check for stale states incorrectly, potentially leading to data inconsistency during migration.
Suggested fix: Consider making the service names dynamic based on the expected configuration or documenting that this script must be updated alongside any changes to the NixOS module's worker configuration.
Suggestions
The script takes a Nix store path as an argument (
$1) and uses binaries from it ($package/bin/python3,$package/bin/redview-backup, etc.). While the README instructs users to pass a 'tested' package path, the script itself does not verify that these binaries are compatible with each other or with the target database schema beyond runtime execution.Impact: If a user passes a mismatched or partially built package, the migration might fail in subtle ways or produce an incompatible database.
Suggested fix: Add a version check or compatibility assertion within the script if possible, or ensure the operator guide explicitly states that all binaries must come from the same derivation build.
Tests and validation
Questions
redview-v2NixOS module automatically configureRequiresMountsForfor/var/lib/redview/mediain worker units, or is this handled by the explicitsystemd.servicesoverrides in the diff?redview-migratetool idempotent enough to resume from a partial migration state without corrupting the target database if interrupted again?Review limitations
redview-backup,redview-migrate, andredview-verify-migrationbinaries.redview-v2NixOS module from the flake input, only the host-specific configuration.Diff coverage
README.md: reviewed — included in a context-limited batchflake.lock: reviewed — included in a context-limited batchflake.nix: reviewed — included in a context-limited batchmodules/services/redview.nix: reviewed — included in a context-limited batchscripts/check-redview-v2-production.nix: reviewed — included in a context-limited batchscripts/redview-v2-production-prepare.sh: reviewed — included in a context-limited batchscripts/test-redview-v2-production-prepare.py: reviewed — included in a context-limited batchReview metadata
Reviewed the advisory findings against the implementation and test evidence:
fb39419: fetch through main while preserving the exact tested application commit and package. Package equality and full local flake checks pass. The old review at18de484predates this adjustment.The authoritative CI test job passed on the prior head and is running for the reference-only update. The operator has completed real migration/test activation; read-only post-activation checks passed. The issue remains open for persistent deployment and remaining operator acceptance.
Reviewed the updated
fb39419advisory: it reports no blocking findings. The remaining worker-naming concern is about hypothetical configuration drift. The stop command uses a wildcard for the whole worker pool, not just four named workers; systemctl stop is synchronous and any stop failure aborts the helper under set -e before migration. The subsequent explicit checks cover the exact four-worker target contract, which the flake check also asserts. An altered naming/count contract would require reviewing this target-specific initial-cutover helper. No observed stopping or migration defect was identified.The package argument supplies all tools from one immutable derivation; the prepared operator wrapper validates that exact package and configuration. Rehearsals cover interruption/retry and full-field verification, and the user completed the real cutover. Required mounts are checked in both evaluated configuration and the five live process namespaces.
Final-head authoritative CI and advisory jobs are successful. Local full flake checks and target system build pass; the main reference resolves to the identical deployed dev.118 package. Proceeding with the authorized configuration merge; persistent deployment remains with the operator.