Repository navigation
Expand file tree
/
Copy pathcompose.yml
More file actions
116 lines (111 loc) · 4.14 KB
/
Copy pathcompose.yml
File metadata and controls
116 lines (111 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: dirge-vigil-lev
# End-to-end vigil + lev System One gate — an INTEGRATION test that proves the
# lev sidecar can answer the on-vigil-rite noul question and that the vigil
# keeper dispatches a verdict for it.
#
# lev needs at least one model: the `english` encoder (~800 MB), prepared with
# `jolt prepare`, or a thinker GGUF.
#
# One-time model prep — download the english checkpoint, then convert it into
# the shared lev-data volume:
#
# mkdir -p compose/laya/tokenizer compose/laya/encoder
# cd compose/laya && for f in model.safetensors tokenizer/tokenizer.json \
# tokenizer/tokenizer_config.json encoder/config.json rl_agent_config.json; do
# curl -fL -o "$f" "https://huggingface.co/convaiinnovations/laya/resolve/main/$f"; done
# cd ../.. && podman-compose --profile prepare run --rm lev-prepare
#
# `podman-compose up --build` will HANG at the lev healthcheck until the model
# is prepared above — the prep step is a hard prerequisite, not optional.
#
# Then run the integration test (one toll vigil through the lev rite gate):
#
# podman-compose up --build
#
# Verdict semantics: the vigil's gate.policy cost matrix (defaults C_fp=4,
# C_fn=1) derives a wake threshold tau=0.8. lev's noul for an empty heartbeat
# (~0.08) is BELOW that threshold, so the gate SHROUDS and no observance
# fires. The pass criterion is the "on-vigil-rite gate blocked" log line, not
# a clean exit — dirge bails non-zero after its 180s observance timeout, so
# the test kills it early and greps the log. To exercise the PASS path
# instead, drop the threshold to 0 (add `"gate":{"false_positive_cost":0,
# "false_negative_cost":1}` to lev-rite.json): the observance then fires and
# requires a live DeepSeek call (DEEPSEEK_API_KEY).
#
# For the continuous TUI vigil runtime use:
#
# podman-compose run --rm vigil dirge --vigil
services:
lev:
build:
context: ./compose/lev
environment:
LEV_HOST: 0.0.0.0
PORT: "8080"
LEV_API_KEY: ${LEV_API_KEY:-s3cret}
LEV_DATA: /models/data
LEV_DEFAULT_MODEL: english
LEV_BACKEND: cpu
LEV_DTYPE: f32
volumes:
- lev-data:/models
ports:
- "${LEV_PORT:-18080}:8080"
healthcheck:
test: ["CMD", "curl", "-fsS", "-H", "Authorization: Bearer ${LEV_API_KEY:-s3cret}", "http://127.0.0.1:8080/v1/models"]
interval: 10s
timeout: 5s
retries: 12
start_period: 30s
# One-shot: `jolt prepare` the checkpoints in LEV_CHECKPOINTS_DIR into the
# shared lev-data volume. Run once before `up` (profile "prepare").
lev-prepare:
build:
context: ./compose/lev
profiles: ["prepare"]
environment:
LEV_CHECKPOINTS: /checkpoints
LEV_DATA: /models/data
volumes:
- ${LEV_CHECKPOINTS_DIR:-./compose/laya}:/checkpoints:ro
- lev-data:/models
command: ["jolt", "prepare"]
vigil:
build:
context: ./compose/vigil
user: "${UID:-1000}:${GID:-1000}"
working_dir: /work
environment:
HOME: /tmp
DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY:?set DEEPSEEK_API_KEY in the environment or a .env file}
DIRGE_PROVIDER: deepseek
DIRGE_MODEL: deepseek-v4-pro
LEV_URL: http://lev:8080
LEV_API_KEY: ${LEV_API_KEY:-s3cret}
RUST_LOG: warn
DIRGE_LOG: /tmp/dirge.log
volumes:
- ${DIRGE_BIN:-./target/debug/dirge}:/usr/local/bin/dirge:ro
- ./plugins/vigil_lev.janet:/work/.dirge/plugins/vigil_lev.janet:ro
- ./plugins/lev_classify.janet:/work/.dirge/plugins/lev_classify.janet:ro
- ./plugins/vigil_fire.janet:/work/.dirge/plugins/vigil_fire.janet:ro
- ./compose/vigils:/work/compose/vigils:ro
depends_on:
lev:
condition: service_healthy
command:
- sh
- -c
- |
timeout 30 dirge --vigil-once \
--vigil-config /work/compose/vigils/lev-rite.json \
> /tmp/dirge-stdout.log 2>&1 || true
echo "=== dirge stdout/stderr ==="
cat /tmp/dirge-stdout.log 2>/dev/null
echo "=== dirge.log ==="
cat /tmp/dirge.log 2>/dev/null
grep -qE 'on-vigil-rite gate blocked|vigil observance for' \
/tmp/dirge-stdout.log /tmp/dirge.log
restart: "no"
volumes:
lev-data: