-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsupervisord.conf
More file actions
184 lines (171 loc) · 6.41 KB
/
Copy pathsupervisord.conf
File metadata and controls
184 lines (171 loc) · 6.41 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# supervisord configuration for forever-claude-template background services.
#
# `uv run bootstrap` runs first-boot setup and then execs `supervisord -n -c
# supervisord.conf` from the repo root (/mngr/code) in the bootstrap tmux
# window. supervisord then starts and supervises every [program:*] below.
#
# Conventions:
# - Services inherit the agent environment (MNGR_AGENT_STATE_DIR,
# CLAUDE_CONFIG_DIR, MNGR_HOST_DIR, MNGR_AGENT_ID, GH_TOKEN, ...) from the
# bootstrap shell that exec'd supervisord -- there is no per-service
# `environment=` enumeration.
# - All commands run from the repo root (directory=/mngr/code).
# - Commands that chain with `&&` (or set inline env) are wrapped in
# `bash -c "..."` because supervisord exec's the command directly (no shell).
# - Logs are container-local under /var/log/supervisor (created by bootstrap),
# rotated by supervisord, with separate stdout/stderr files per service.
# They are deliberately NOT under runtime/ -- they are not backed up.
#
# To add/remove/change a service, edit this file and run
# `supervisorctl reread && supervisorctl update` (see the edit-services skill).
[unix_http_server]
file=/var/run/supervisor.sock
chmod=0700
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisord]
nodaemon=true
# We intentionally run as root (the agent container/VM has no separate service
# user); set user=root so supervisord doesn't emit a CRIT about not dropping privs.
user=root
logfile=/var/log/supervisor/supervisord.log
logfile_maxbytes=10MB
logfile_backups=3
pidfile=/var/run/supervisord.pid
childlogdir=/var/log/supervisor
# Default knobs shared by every [program:*] section below. supervisord has no
# global program defaults, so each program restates these.
# autostart=true start on supervisord boot
# autorestart=true restart a long-lived daemon whenever it exits
# startretries=... cap crash-loop retries per supervisord run
# stopasgroup/killasgroup signal the whole bash -c process group on stop
# stdout/stderr_logfile separate, rotated, container-local log files
[program:system_interface]
command=bash -c "python3 scripts/forward_port.py --url http://localhost:8000 --name system_interface && system-interface"
directory=/mngr/code
autostart=true
autorestart=true
startretries=1000000
stopasgroup=true
killasgroup=true
stdout_logfile=/var/log/supervisor/system_interface-stdout.log
stderr_logfile=/var/log/supervisor/system_interface-stderr.log
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=3
stderr_logfile_backups=3
[program:web]
command=bash -c "python3 scripts/forward_port.py --url http://localhost:8080 --name web && uv run web-server"
directory=/mngr/code
autostart=true
autorestart=true
startretries=1000000
stopasgroup=true
killasgroup=true
stdout_logfile=/var/log/supervisor/web-stdout.log
stderr_logfile=/var/log/supervisor/web-stderr.log
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=3
stderr_logfile_backups=3
[program:cloudflared]
command=uv run cloudflare-tunnel
directory=/mngr/code
autostart=true
autorestart=true
startretries=1000000
stopasgroup=true
killasgroup=true
stdout_logfile=/var/log/supervisor/cloudflared-stdout.log
stderr_logfile=/var/log/supervisor/cloudflared-stderr.log
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=3
stderr_logfile_backups=3
[program:app-watcher]
command=uv run app-watcher
directory=/mngr/code
autostart=true
autorestart=true
startretries=1000000
stopasgroup=true
killasgroup=true
stdout_logfile=/var/log/supervisor/app-watcher-stdout.log
stderr_logfile=/var/log/supervisor/app-watcher-stderr.log
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=3
stderr_logfile_backups=3
# Periodically commits + pushes runtime/ to mindsbackup/$MNGR_AGENT_ID so that
# Claude memory, ticket state, transcripts, etc. survive container loss. The
# runtime/ worktree is created by bootstrap before supervisord starts, so this
# service always finds it in place. See libs/runtime_backup/README.md.
[program:runtime-backup]
command=uv run runtime-backup
directory=/mngr/code
autostart=true
autorestart=true
startretries=1000000
stopasgroup=true
killasgroup=true
stdout_logfile=/var/log/supervisor/runtime-backup-stdout.log
stderr_logfile=/var/log/supervisor/runtime-backup-stderr.log
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=3
stderr_logfile_backups=3
# Continuous restic-based backup of the full host_dir (/mngr/) to a remote
# repository. backup.toml + runtime/secrets/restic.env are seeded by bootstrap
# on first boot. See libs/host_backup/README.md.
[program:host-backup]
command=uv run host-backup
directory=/mngr/code
autostart=true
autorestart=true
startretries=1000000
stopasgroup=true
killasgroup=true
stdout_logfile=/var/log/supervisor/host-backup-stdout.log
stderr_logfile=/var/log/supervisor/host-backup-stderr.log
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=3
stderr_logfile_backups=3
# Terminal-over-web (ttyd). Registers its port via forward_port.py, then execs
# ttyd. Previously an extra_window; now a supervised service like the rest.
[program:terminal]
command=bash scripts/run_ttyd.sh
directory=/mngr/code
autostart=true
autorestart=true
startretries=1000000
stopasgroup=true
killasgroup=true
stdout_logfile=/var/log/supervisor/terminal-stdout.log
stderr_logfile=/var/log/supervisor/terminal-stderr.log
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=3
stderr_logfile_backups=3
# One-shot, idempotent install of deferred packages (currently Playwright +
# Chromium + apt libs) on first container boot. autorestart=false + exitcodes=0
# make it run exactly once per boot and stay stopped after a clean exit; it
# skips its own work on subsequent boots via per-package marker files under
# /var/lib/minds/deferred-install/. See scripts/deferred_install.sh.
[program:deferred-install]
command=bash scripts/deferred_install.sh
directory=/mngr/code
autostart=true
autorestart=false
startsecs=0
exitcodes=0
stopasgroup=true
killasgroup=true
stdout_logfile=/var/log/supervisor/deferred-install-stdout.log
stderr_logfile=/var/log/supervisor/deferred-install-stderr.log
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=3
stderr_logfile_backups=3