openvibers/openvibe.host Commits
Data role: Valkey takes no end-of-line comments (its first start on the host refused 'maxmemory-policy volatile-lru # …'), so the comment has its own line, and the test checks every Valkey line. The role also sets vm.overcommit_memory = 1 (sysctl.d), as Valkey's startup warning recommends for background saves, and resets a failed Valkey unit before restarting it, since systemd refuses a unit that hit its start limit.
Changes
nnew file mode 100644@@@ -0,0 +1,3 @@++# OpenVibe data role (ADR-035): Valkey forks for background saves; without overcommit a fork can fail++# under memory pressure (Valkey's own startup warning recommends this).++vm.overcommit_memory = 1@@@ -1,10 +1,11 @@# OpenVibe data role (ADR-035): Valkey is shared and never authoritative (ADR-007 2026-09-24 rule 4).--# Included from /etc/valkey/valkey.conf by roles/data/provision.sh.++# Included from /etc/valkey/valkey.conf by roles/data/provision.sh. Valkey takes no end-of-line comments.bind 127.0.0.1 -::1port 6379protected-mode yesmaxmemory 768mb--maxmemory-policy volatile-lru # only keys with a TTL (caches) are evicted; queues and counters are not++# Only keys with a TTL (caches) are evicted; queues and counters are not.++maxmemory-policy volatile-lruappendonly yesappendfsync everysecaclfile /etc/valkey/users.acl@@@ -94,6 +94,7 @@ CONFfi# ── 4. Valkey ────────────────────────────────────────────────────────────────────────────────++if install_file "$F/sysctl-valkey.conf" /etc/sysctl.d/60-openvibe-valkey.conf 644 root:root; then sysctl -q -p /etc/sysctl.d/60-openvibe-valkey.conf; fiinstall_file "$F/valkey-openvibe.conf" /etc/valkey/openvibe.conf 640 valkey:valkey && RESTART_VALKEY=1if ! grep -qx 'include /etc/valkey/openvibe.conf' /etc/valkey/valkey.conf; thenif [ "$CHECK" = 1 ]; then log "would include openvibe.conf in /etc/valkey/valkey.conf"@@@ -110,8 +111,8 @@ if [ "$CHECK" = 1 ]; then log "check done"; exit 0; fisystemctl enable -q postgresql valkey-server pgbouncerif [ "$RESTART_PG" = 1 ]; then log "restarting PostgreSQL"; systemctl restart "postgresql@$PGV-main"; elif [ "$RELOAD_PG" = 1 ]; then systemctl reload "postgresql@$PGV-main"; fisystemctl is-active -q "postgresql@$PGV-main" || systemctl start "postgresql@$PGV-main"--[ "$RESTART_VALKEY" = 1 ] && { log "restarting Valkey"; systemctl restart valkey-server; }--systemctl is-active -q valkey-server || systemctl start valkey-server++[ "$RESTART_VALKEY" = 1 ] && { log "restarting Valkey"; systemctl reset-failed valkey-server 2>/dev/null || true; systemctl restart valkey-server; }++systemctl is-active -q valkey-server || { systemctl reset-failed valkey-server 2>/dev/null || true; systemctl start valkey-server; }# Roles every data host has: the PgBouncer auth user (and its lookup function) and the monitoring user.BOUNCER_PW=$(secret PGBOUNCER_AUTH_PASSWORD); PGMON_PW=$(secret PG_MONITOR_PASSWORD)@@@ -36,6 +36,7 @@ runTests([assert.match(vk, /^bind 127\.0\.0\.1 -::1/m);assert.match(vk, /^maxmemory-policy volatile-lru/m);assert.match(vk, /^aclfile /m);++ assert.ok(vk.split('\n').every((l) => l.startsWith('#') || !/\s#/.test(l)), 'Valkey takes no end-of-line comments');}),test('exporters bind loopback, archiving goes through pgBackRest, and secrets are never echoed', () => {const p = read('provision.sh');
new file mode 100644
new file mode 100644
@@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
+# OpenVibe data role (ADR-035): Valkey forks for background saves; without overcommit a fork can fail
+# under memory pressure (Valkey's own startup warning recommends this).
+vm.overcommit_memory = 1
@@ -1,10 +1,11 @@
@@ -1,10 +1,11 @@
# OpenVibe data role (ADR-035): Valkey is shared and never authoritative (ADR-007 2026-09-24 rule 4).
# OpenVibe data role (ADR-035): Valkey is shared and never authoritative (ADR-007 2026-09-24 rule 4).
-# Included from /etc/valkey/valkey.conf by roles/data/provision.sh.
+# Included from /etc/valkey/valkey.conf by roles/data/provision.sh. Valkey takes no end-of-line comments.
bind 127.0.0.1 -::1
bind 127.0.0.1 -::1
port 6379
port 6379
protected-mode yes
protected-mode yes
maxmemory 768mb
maxmemory 768mb
-maxmemory-policy volatile-lru # only keys with a TTL (caches) are evicted; queues and counters are not
+# Only keys with a TTL (caches) are evicted; queues and counters are not.
+maxmemory-policy volatile-lru
appendonly yes
appendonly yes
appendfsync everysec
appendfsync everysec
aclfile /etc/valkey/users.acl
aclfile /etc/valkey/users.acl
@@ -94,6 +94,7 @@ CONF
@@ -94,6 +94,7 @@ CONF
fi
fi
# ── 4. Valkey ────────────────────────────────────────────────────────────────────────────────
# ── 4. Valkey ────────────────────────────────────────────────────────────────────────────────
+if install_file "$F/sysctl-valkey.conf" /etc/sysctl.d/60-openvibe-valkey.conf 644 root:root; then sysctl -q -p /etc/sysctl.d/60-openvibe-valkey.conf; fi
install_file "$F/valkey-openvibe.conf" /etc/valkey/openvibe.conf 640 valkey:valkey && RESTART_VALKEY=1
install_file "$F/valkey-openvibe.conf" /etc/valkey/openvibe.conf 640 valkey:valkey && RESTART_VALKEY=1
if ! grep -qx 'include /etc/valkey/openvibe.conf' /etc/valkey/valkey.conf; then
if ! grep -qx 'include /etc/valkey/openvibe.conf' /etc/valkey/valkey.conf; then
if [ "$CHECK" = 1 ]; then log "would include openvibe.conf in /etc/valkey/valkey.conf"
if [ "$CHECK" = 1 ]; then log "would include openvibe.conf in /etc/valkey/valkey.conf"
@@ -110,8 +111,8 @@ if [ "$CHECK" = 1 ]; then log "check done"; exit 0; fi
@@ -110,8 +111,8 @@ if [ "$CHECK" = 1 ]; then log "check done"; exit 0; fi
systemctl enable -q postgresql valkey-server pgbouncer
systemctl enable -q postgresql valkey-server pgbouncer
if [ "$RESTART_PG" = 1 ]; then log "restarting PostgreSQL"; systemctl restart "postgresql@$PGV-main"; elif [ "$RELOAD_PG" = 1 ]; then systemctl reload "postgresql@$PGV-main"; fi
if [ "$RESTART_PG" = 1 ]; then log "restarting PostgreSQL"; systemctl restart "postgresql@$PGV-main"; elif [ "$RELOAD_PG" = 1 ]; then systemctl reload "postgresql@$PGV-main"; fi
systemctl is-active -q "postgresql@$PGV-main" || systemctl start "postgresql@$PGV-main"
systemctl is-active -q "postgresql@$PGV-main" || systemctl start "postgresql@$PGV-main"
-[ "$RESTART_VALKEY" = 1 ] && { log "restarting Valkey"; systemctl restart valkey-server; }
-systemctl is-active -q valkey-server || systemctl start valkey-server
+[ "$RESTART_VALKEY" = 1 ] && { log "restarting Valkey"; systemctl reset-failed valkey-server 2>/dev/null || true; systemctl restart valkey-server; }
+systemctl is-active -q valkey-server || { systemctl reset-failed valkey-server 2>/dev/null || true; systemctl start valkey-server; }
# Roles every data host has: the PgBouncer auth user (and its lookup function) and the monitoring user.
# Roles every data host has: the PgBouncer auth user (and its lookup function) and the monitoring user.
BOUNCER_PW=$(secret PGBOUNCER_AUTH_PASSWORD); PGMON_PW=$(secret PG_MONITOR_PASSWORD)
BOUNCER_PW=$(secret PGBOUNCER_AUTH_PASSWORD); PGMON_PW=$(secret PG_MONITOR_PASSWORD)
@@ -36,6 +36,7 @@ runTests([
@@ -36,6 +36,7 @@ runTests([
assert.match(vk, /^bind 127\.0\.0\.1 -::1/m);
assert.match(vk, /^bind 127\.0\.0\.1 -::1/m);
assert.match(vk, /^maxmemory-policy volatile-lru/m);
assert.match(vk, /^maxmemory-policy volatile-lru/m);
assert.match(vk, /^aclfile /m);
assert.match(vk, /^aclfile /m);
+ assert.ok(vk.split('\n').every((l) => l.startsWith('#') || !/\s#/.test(l)), 'Valkey takes no end-of-line comments');
}),
}),
test('exporters bind loopback, archiving goes through pgBackRest, and secrets are never echoed', () => {
test('exporters bind loopback, archiving goes through pgBackRest, and secrets are never echoed', () => {
const p = read('provision.sh');
const p = read('provision.sh');