feat: add guarded periodic resource monitoring
Add checks-only scheduling, read-only status, private authenticated persistence and guarded PID1 lifecycle. Keep strategy selection/recovery and remote fault acceptance out of scope. Co-authored-by: GPT-6 <gpt-6@openai.com>
This commit is contained in:
1 parent
cfce8170d7
commit
4efc066625
16 files changed
+2307
-103
No files matched your search
@@ -59,21 +59,24 @@ assert " stop_grace_period: 240s\n" in compose
|
||||
assert 'bounded_wait "$monitor_pid" 45' in entrypoint
|
||||
assert '/bin/sh /opt/managed-target-supervision.sh --watchdog' in entrypoint
|
||||
assert 'setsid /bin/sh /opt/managed-target-supervision.sh --monitor' in entrypoint
|
||||
assert entrypoint.index('if ! cleanup_session; then') < entrypoint.index('if timeout -k 5 45 /usr/local/bin/zapret-autotune managed reconcile; then')
|
||||
assert entrypoint.index('if ! cleanup_session; then') < entrypoint.index('if cleanup_command 45 /usr/local/bin/zapret-autotune managed reconcile; then')
|
||||
assert 'COPY managed-target-supervision.sh /opt/managed-target-supervision.sh' in (directory.parents[1] / 'Dockerfile.target').read_text()
|
||||
assert '!managed-target-supervision.sh' in (directory.parents[1] / '.dockerignore').read_text()
|
||||
assert '"$count" -lt 3' in entrypoint
|
||||
assert '"$count" -ge 3' in entrypoint
|
||||
assert 'BLOCKED: generic target restart budget; checks paused' in entrypoint
|
||||
assert '"$((now - started))" -lt 21600' in entrypoint
|
||||
assert "backoff=15" in entrypoint
|
||||
assert "systemctl" not in entrypoint and "docker " not in entrypoint
|
||||
assert "timeout -k 5 30 /opt/zapret2/init.d/sysv/zapret2 stop" in entrypoint
|
||||
assert "cleanup_command 30 /opt/zapret2/init.d/sysv/zapret2 stop" in entrypoint
|
||||
assert 'generic_cleanup_deadline=$(($(date +%s) + 80))' in entrypoint
|
||||
assert 'timeout -k 1 "$cleanup_command_cap" "$@"' in entrypoint
|
||||
for command, seconds in (("/usr/local/bin/zapret-autotune managed init", 45),
|
||||
("/usr/local/bin/zapret-autotune managed reconcile", 45),
|
||||
("/opt/zapret2/init.d/sysv/zapret2 start", 30)):
|
||||
assert f"timeout -k 5 {seconds} {command} || exit 78" in entrypoint
|
||||
assert entrypoint.index("managed reconcile || exit 78") < entrypoint.index("zapret2 start || exit 78")
|
||||
assert f"timeout -k 5 {seconds} {command} || return 78" in entrypoint
|
||||
assert entrypoint.index("managed reconcile || return 78") < entrypoint.index("zapret2 start || return 78")
|
||||
experimental = 'managed apply --googlevideo-experiment native-circular --googlevideo-scope experimental_googlevideo_suffix --googlevideo-request startup || exit 78'
|
||||
assert entrypoint.index('zapret2 start || exit 78') < entrypoint.index(experimental)
|
||||
assert entrypoint.index('zapret2 start || return 78') < entrypoint.index(experimental)
|
||||
assert entrypoint.index(experimental) < entrypoint.index('setsid /bin/sh /opt/managed-target-supervision.sh --monitor')
|
||||
assert entrypoint.index('managed experimental-request-check || exit 78') < entrypoint.index('managed init || exit 78')
|
||||
assert entrypoint.index('managed experimental-request-check || return 78') < entrypoint.index('managed init || return 78')
|
||||
assert 'rm "${ZAPRET_CONFIG%/*}/.autotune-experimental-suffix-request"' not in entrypoint
|
||||
Reference in new issue
Block a user