81 lines
6.2 KiB
YAML
81 lines
6.2 KiB
YAML
# nh3-svos -> SVOS v0.0.15 (57d90d6): kernel 0.0.15 (the short spoken summons: no card ids, no reference; WAV cap 12 MiB)
|
|
# and app-voice 0.0.2 (utterance_seconds up to 120). No migration (schema 14), no manifest change, no card. Config:
|
|
# voice.toml utterance_seconds 30 -> 60 (needs voice 0.0.2), and [notifications.matrix] request_timeout_seconds 60
|
|
# (this morning's stopgap) -> 30. svos-dev's ask on Prime's wording ruling (thread 01M5558E19Q3ZK4RRZXQG6A2Y9, 1059).
|
|
steps:
|
|
- name: Private staging dir
|
|
shell: install -d -m 0700 /tmp/svos-stage-57d90d6
|
|
- {name: stage release, upload: {src: /tmp/claude-1000/-home-lkraven-development-eshpfi-management/a0a50e2d-b274-4f8c-b8e6-0606c48d35b5/scratchpad/svos-57d90d6/svos-release-57d90d6.tar.gz, dest: /tmp/svos-stage-57d90d6/release.tar.gz, mode: "0644"}}
|
|
- {name: stage uv, upload: {src: /home/lkraven/bin/uv, dest: /tmp/svos-stage-57d90d6/uv, mode: "0755"}}
|
|
- {name: stage installer, upload: {src: /tmp/claude-1000/-home-lkraven-development-eshpfi-management/a0a50e2d-b274-4f8c-b8e6-0606c48d35b5/scratchpad/svos-57d90d6/install-release.py, dest: /tmp/svos-stage-57d90d6/install-release.py, mode: "0644"}}
|
|
- name: Verify staged hashes
|
|
shell: cd /tmp/svos-stage-57d90d6 && printf '%s %s\n' ffee056d65ec4df4c916611c678b9268b0c8bbf3339e865cfd8a3ca2075448c3 release.tar.gz 83aa128da93e168283ed32cf75cd819fe17b135b3fc1f7ccb3c912eec198d9fb uv | sha256sum -c -
|
|
changed_when: "false"
|
|
- name: Install release 57d90d6 beside the live one (current NOT switched)
|
|
sudo: true
|
|
shell: python3 /tmp/svos-stage-57d90d6/install-release.py
|
|
creates: /opt/svos/releases/57d90d6/apps-env/pyvenv.cfg
|
|
- name: New kernel accepts the live configuration as it is
|
|
sudo: true
|
|
shell: runuser -u svc-svos -- /opt/svos/releases/57d90d6/kernel-env/bin/svos-kernel check-config --data-root /var/lib/svos
|
|
- name: Stop the local apps then the kernel
|
|
sudo: true
|
|
shell: systemctl stop svos-voice svos-knowledge svos-interface svos-kernel; systemctl is-active svos-kernel svos-interface svos-knowledge svos-voice | tr '\n' ' '; echo
|
|
- name: Offline backup to /var/lib/svos/backup/pre-57d90d6 (database + both configs)
|
|
sudo: true
|
|
shell: |
|
|
set -e
|
|
d=/var/lib/svos/backup/pre-57d90d6
|
|
runuser -u svc-svos -- install -d -m 0700 $d
|
|
runuser -u svc-svos -- python3 -c "
|
|
import sqlite3
|
|
s = sqlite3.connect('/var/lib/svos/state/svos.db'); t = sqlite3.connect('$d/svos.db'); s.backup(t); t.close(); s.close()
|
|
c = sqlite3.connect('file:$d/svos.db?mode=ro', uri=True); print('integrity', c.execute('pragma integrity_check').fetchone()[0], 'user_version', c.execute('pragma user_version').fetchone()[0])"
|
|
runuser -u svc-svos -- cp -p /var/lib/svos/config/instance.toml /var/lib/svos/config/instance.toml.pre-57d90d6
|
|
runuser -u svc-svos -- cp -p /var/lib/svos/config/apps/voice.toml /var/lib/svos/config/apps/voice.toml.pre-57d90d6
|
|
- name: Switch current to 57d90d6
|
|
sudo: true
|
|
shell: ln -sfn /opt/svos/releases/57d90d6 /opt/svos/current.new && chgrp -h svc-svos /opt/svos/current.new && mv -T /opt/svos/current.new /opt/svos/current && readlink /opt/svos/current
|
|
- name: Config - voice utterance_seconds 60, Matrix request_timeout_seconds 30; the new kernel must accept it (else restore all + old release)
|
|
sudo: true
|
|
shell: |
|
|
runuser -u svc-svos -- python3 - <<'PY'
|
|
import os
|
|
def write(p, s):
|
|
t = p + ".tmp"; fd = os.open(t, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600)
|
|
with os.fdopen(fd, "w") as f: f.write(s)
|
|
os.replace(t, p)
|
|
p = "/var/lib/svos/config/apps/voice.toml"; s = open(p).read()
|
|
assert s.count("utterance_seconds = 30\n") == 1
|
|
write(p, s.replace("utterance_seconds = 30\n", "utterance_seconds = 60 # 2026-10-17 v0.0.15 (voice 0.0.2 admits 0.1..120); 6 MiB output holds 65 s at 48 kHz\n"))
|
|
p = "/var/lib/svos/config/instance.toml"; s = open(p).read()
|
|
old = "request_timeout_seconds = 60 # 2026-10-17 stopgap (svos-dev): summons synthesis needs > 15 s; range 15..60\n"
|
|
assert s.count(old) == 1
|
|
write(p, s.replace(old, "request_timeout_seconds = 30 # 2026-10-17 v0.0.15: the short spoken summons is 5-9 s of audio; headroom for a slow gateway\n"))
|
|
print("edited")
|
|
PY
|
|
if runuser -u svc-svos -- /opt/svos/releases/57d90d6/kernel-env/bin/svos-kernel check-config --data-root /var/lib/svos; then exit 0; fi
|
|
runuser -u svc-svos -- cp -p /var/lib/svos/config/instance.toml.pre-57d90d6 /var/lib/svos/config/instance.toml
|
|
runuser -u svc-svos -- cp -p /var/lib/svos/config/apps/voice.toml.pre-57d90d6 /var/lib/svos/config/apps/voice.toml
|
|
ln -sfn /opt/svos/releases/3726d73 /opt/svos/current.new && chgrp -h svc-svos /opt/svos/current.new && mv -T /opt/svos/current.new /opt/svos/current
|
|
systemctl start svos-kernel.service svos-interface svos-knowledge svos-voice; echo "RESTORED configs + 3726d73"; exit 1
|
|
- name: Start the kernel (READY-gated, no migration) then the local apps
|
|
sudo: true
|
|
shell: |
|
|
t0=$(date +%s.%N); systemctl start svos-kernel.service; rc=$?; t1=$(date +%s.%N)
|
|
echo "kernel start rc=$rc after $(python3 -c "print(round($t1-$t0,2))") s"
|
|
systemctl start svos-interface svos-knowledge svos-voice
|
|
for i in $(seq 1 60); do h=$(curl -s http://127.0.0.1:8400/health); case "$h" in *'"down":0'*) case "$h" in *'"unknown":0'*) break;; esac;; esac; sleep 1; done
|
|
echo "$h"; systemctl is-active svos-kernel svos-interface svos-knowledge svos-voice | tr '\n' ' '; echo
|
|
- name: Regenerate the front door inventory
|
|
sudo: true
|
|
shell: /usr/local/sbin/svos-front-inventory 2>&1 | grep -E 'GENERATED|updated|root \*|path /assets' | head -6
|
|
verify:
|
|
- name: Health is schema 14, status ok, nothing down
|
|
shell: h=$(curl -s http://127.0.0.1:8400/health); echo "$h"; echo "$h" | grep -q '"schema_version":14' && echo "$h" | grep -q '"status":"ok"' && echo "$h" | grep -q '"down":0'
|
|
changed_when: "false"
|
|
- name: Front door inventory current (regenerated after the switch; the header names the release dir even when the web build is byte-identical)
|
|
sudo: true
|
|
shell: /usr/local/sbin/svos-front-inventory --check
|
|
changed_when: "false"
|