ops(svos): repo-dread (dreadnaught; handle dread-dev) and repo-svtc in [[seats.repos]] (gen d7502572)
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
# nh3-svos: add repo-dread (path .../dreadnaught) and repo-svtc to [[seats.repos]] (Prime 0118 2026-10-19 via svos-dev,
|
||||
# thread 01M59JT6AF3H6AH8E59KV7D9P2: "register dreadnaught and svtc"). Config only: check-config, then reload; no restart.
|
||||
# ⚠ The name after `repo-` must match the session's ALTHING_HANDLE (`<component>-<role>`, kernel/seats.py _matching), and
|
||||
# dreadnaught's session is `dread-dev`, so the repo is `repo-dread` (precedent: repo-infra, repo-highseat, repo-design).
|
||||
steps:
|
||||
- name: Back up instance.toml, then insert both repos in alphabetical place
|
||||
sudo: true
|
||||
shell: |
|
||||
set -e
|
||||
p=/var/lib/svos/config/instance.toml
|
||||
runuser -u svc-svos -- cp -p $p $p.pre-repo-dread-svtc
|
||||
runuser -u svc-svos -- python3 - <<'PY'
|
||||
import os
|
||||
p = "/var/lib/svos/config/instance.toml"; s = open(p, encoding="utf-8").read()
|
||||
assert 'name = "repo-dread"' not in s and 'name = "repo-svtc"' not in s
|
||||
a1 = '[[seats.repos]]\nname = "repo-dvalin-smithy"\n'
|
||||
a2 = '[[seats.repos]]\nname = "repo-tts"\n'
|
||||
assert s.count(a1) == 1 and s.count(a2) == 1
|
||||
s = s.replace(a1, '[[seats.repos]] # 2026-10-19 (Prime): the session is dread-dev, so the name is repo-dread\nname = "repo-dread"\npath = "/home/lkraven/development/dreadnaught"\n' + a1)
|
||||
s = s.replace(a2, '[[seats.repos]] # 2026-10-19 (Prime)\nname = "repo-svtc"\npath = "/home/lkraven/development/svtc"\n' + a2)
|
||||
t = p + ".tmp"; fd = os.open(t, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600)
|
||||
with os.fdopen(fd, "w", encoding="utf-8") as f: f.write(s)
|
||||
os.replace(t, p); print("edited")
|
||||
PY
|
||||
- name: check-config (restore on refusal), then reload
|
||||
sudo: true
|
||||
shell: |
|
||||
if ! runuser -u svc-svos -- /opt/svos/current/kernel-env/bin/svos-kernel check-config --data-root /var/lib/svos; then
|
||||
runuser -u svc-svos -- cp -p /var/lib/svos/config/instance.toml.pre-repo-dread-svtc /var/lib/svos/config/instance.toml; echo RESTORED; exit 1; fi
|
||||
systemctl reload svos-kernel; sleep 4; curl -s http://127.0.0.1:8400/health; echo
|
||||
verify:
|
||||
- name: Health ok on the new generation; dev-dread and dev-svtc adopted
|
||||
sudo: true
|
||||
shell: |
|
||||
sleep 8
|
||||
python3 -c "
|
||||
import sqlite3
|
||||
c = sqlite3.connect('file:/var/lib/svos/state/svos.db?mode=ro', uri=True)
|
||||
rows = c.execute(\"select name, repo, role, runtime, state, origin from seats where repo in ('repo-dread','repo-svtc')\").fetchall(); print(rows)
|
||||
for r in c.execute(\"select id, at, action, object, summary from events where object in ('seat:dev-dread','seat:dev-svtc') or action='config_accepted' order by id desc limit 6\"): print(r)
|
||||
assert len(rows) == 2, 'expected two seats'"
|
||||
changed_when: "false"
|
||||
Reference in New Issue
Block a user