feat(runtime): bound recovery and add safe release supervision
Co-authored-by: GPT-6 <gpt-6@openai.com>
This commit is contained in:
1 parent
780ca71e17
commit
b1e458a0a5
16 files changed
+941
-66
No files matched your search
@@ -7,10 +7,12 @@ directory = Path(__file__).resolve().parent
|
||||
compose = (directory / "compose.yaml").read_text()
|
||||
entrypoint = (directory.parents[1] / "managed-target-entrypoint.sh").read_text()
|
||||
readme = (directory / "README.md").read_text()
|
||||
unit = (directory / "zapret-autotune.service").read_text()
|
||||
|
||||
# ponytail: checks the committed Compose shape, not arbitrary YAML; use a YAML
|
||||
# parser if this definition grows beyond its single target service.
|
||||
assert " privileged: false\n" in compose
|
||||
assert " image: ${ZAPRET_AUTOTUNE_IMAGE:-zapret-autotune-managed-target:local}\n" in compose
|
||||
assert " cap_drop: [ALL]\n" in compose
|
||||
assert " cap_add: [NET_ADMIN, NET_RAW, SETUID, SETGID, KILL]\n" in compose
|
||||
assert compose.count(" - type: bind\n") == 1
|
||||
@@ -26,3 +28,18 @@ assert "export SS_PASSWORD" not in entrypoint
|
||||
assert "Docker administrators/root can still read container" in readme
|
||||
assert "removed\nfrom the entrypoint environment" in readme
|
||||
assert "No host networking" in readme
|
||||
assert ' restart: "no"\n' in compose
|
||||
assert " stop_grace_period: 120s\n" in compose
|
||||
directives = dict(line.split("=", 1) for line in unit.splitlines() if "=" in line)
|
||||
assert directives["Restart"] == "no"
|
||||
assert directives["RestartForceExitStatus"] == "75"
|
||||
assert "RestartPreventExitStatus" not in directives
|
||||
assert directives["StartLimitIntervalSec"] == "6h"
|
||||
assert directives["StartLimitBurst"] == "3"
|
||||
assert directives["TimeoutStopSec"] == "180s"
|
||||
assert directives["WorkingDirectory"] == "/opt/zapret2-autotune"
|
||||
assert directives["WantedBy"] == "multi-user.target"
|
||||
compose_command = "/usr/bin/docker compose --env-file deploy/managed-target/.env -f deploy/managed-target/compose.yaml"
|
||||
assert directives["ExecStart"] == compose_command + " up --no-build --abort-on-container-exit --exit-code-from target target"
|
||||
assert directives["ExecStop"] == compose_command + " stop target"
|
||||
assert "timeout -k 5 30 /opt/zapret2/init.d/sysv/zapret2 stop" in entrypoint
|
||||
Reference in new issue
Block a user