-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.example.toml
More file actions
242 lines (209 loc) · 7.82 KB
/
Copy pathConfig.example.toml
File metadata and controls
242 lines (209 loc) · 7.82 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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# ─────────────────────────────────────────────────────────────────────────────
# Bria — Multi-pipeline job orchestrator
# Universal namespaced configuration (schema version 1)
# ─────────────────────────────────────────────────────────────────────────────
#
# Standalone usage:
# bria --config Config.toml
# BRIA_CONFIG=Config.toml bria
#
# For standalone Bria, a config may include only shared sections that Bria
# references plus the [bria] namespace. It is also valid to use this file as
# part of a merged universal config with shared profiles defined elsewhere.
#
# Environment variables:
# ${VAR_NAME} — required; load fails if unset
# ${VAR_NAME:-default} — optional; uses default if unset
#
# Shared profile references (resolved at load time, not preserved at runtime):
# store = "<id>" resolves [stores.<id>]
# path_ref = "<id>" resolves [paths.<id>]
# transport = "<id>" resolves [transports.<transport_kind>.<id>]
#
# See README.md for the full parameter reference.
#
# The optional HTTP server is internal worker/control infrastructure. Artur
# applies public authentication, payment, and challenge policy before calling it.
# Bria accepts Idempotency-Key or X-Correlation-ID as opaque correlation metadata.
version = 1
# ─── Shared root: logging (optional, inherited by [bria.global.log]) ─────────
[log]
level = "info"
format = "json"
file = ""
# ─── Shared root: runtime (optional, inherited by [bria.global]) ─────────────
[runtime]
worker_threads = 0
shutdown_timeout_secs = 30
# Omit to use the operating system temporary directory; this example overrides it.
tmp_dir = "data/tmp"
max_payload_bytes = 10485760
# ─── Shared root: HTTP defaults (optional, inherited by [bria.server]) ───────
[http]
bind = "0.0.0.0"
prefix = "v1"
# ─── Shared root: stores. Bria's state backend resolves from [stores.bria]. ──
# SQLite is the default. Postgres requires --features pg or --features postgres.
[stores.bria]
driver = "sqlite"
url = "sqlite://data/bria/bria-state.db"
migrate = true
connect_timeout_secs = 10
max_connections = 1
# ─── Shared root: path profiles for file sources/sinks ───────────────────────
[paths.bria_jobs]
kind = "file"
path = "data/bria/jobs/images.jsonl"
format = "jsonl"
create_parent_dirs = true
[paths.bria_results]
kind = "file"
path = "data/bria/results.jsonl"
format = "jsonl"
create_parent_dirs = true
# ─── Shared root: AMQP transport profile ────────────────────────────────────
[transports.amqp.local]
url = "amqp://localhost:5672"
reconnect_secs = 5
qos_prefetch = 100
# ══════════════════════════════════════════════════════════════════════════════
# BRI A NAMESPACE
# ══════════════════════════════════════════════════════════════════════════════
[bria]
enabled = true
# ─── Global defaults ──────────────────────────────────────────────────────────
[bria.global]
worker_threads = 0
shutdown_timeout_secs = 30
tmp_dir = "data/bria/tmp"
max_payload_bytes = 10485760
cancel_signal_ttl_secs = 3600
[bria.global.state]
backend = "sqlite"
store = "bria" # resolves [stores.bria]
sqlite_path = "data/bria/bria-state.db"
[bria.global.retry]
max_attempts = 0
base_delay_ms = 1000
max_delay_ms = 30000
jitter = 0.2
[bria.global.timeout]
step_secs = 300
action = "term"
kill_grace_secs = 5
# ─── HTTP server (requires --features server) ─────────────────────────────────
[bria.server]
enabled = false
bind = "0.0.0.0"
port = 4000
prefix = "v1"
api_key = ""
dashboard_path_ref = "" # optional; resolves [paths.<id>] and serves it at /v1/dashboard
shutdown_timeout_secs = 5
max_body_bytes = 52428800
# ─── Sources ──────────────────────────────────────────────────────────────────
[[bria.sources]]
id = "image-file"
type = "file"
path_ref = "bria_jobs" # resolves [paths.bria_jobs]
poll_interval_secs = 2
track_cursor = true
id_field = "job_id"
authoritative = false # true makes the file contents authoritative and cancels removed IDs
max_body_bytes = 1048576
[bria.sources.labels]
team = "ml-platform"
env = "local"
[[bria.sources]]
id = "image-http"
type = "http"
enabled = false # enable with [bria.server].enabled = true
path = "jobs/images"
poll_interval_secs = 2
max_body_bytes = 1048576
[[bria.sources]]
id = "queue-jobs"
type = "queue"
enabled = false # disabled example; requires --features amqp
transport = "local" # resolves [transports.amqp.local]
exchange = "bria.jobs"
submit_routing_key = "job.submit"
cancel_routing_key = "job.cancel"
consumer_tag = "bria"
# ─── Tasks ────────────────────────────────────────────────────────────────────
[[bria.tasks]]
id = "add-red-balloon"
driver = "local"
cmd = "npx"
args = ["-y", "add-red-balloon", "{{job.payload.s3_url}}", "{{job.payload.prompt}}"]
inherit_env = false
success_exit_codes = [0]
timeout_secs = 300
timeout_action = "term"
kill_grace_secs = 5
[bria.tasks.env]
NODE_ENV = "production"
[bria.tasks.stdin]
mode = "none"
[bria.tasks.stdout]
mode = "capture"
max_bytes = 10485760
[bria.tasks.stderr]
mode = "capture"
max_bytes = 1048576
[bria.tasks.retry]
max_attempts = 3
base_delay_ms = 1000
max_delay_ms = 30000
jitter = 0.2
# ─── Sinks ────────────────────────────────────────────────────────────────────
[[bria.sinks]]
id = "results-file"
type = "file"
path_ref = "bria_results" # resolves [paths.bria_results]
template = ""
[[bria.sinks]]
id = "results-webhook"
type = "webhook"
enabled = false # requires --features webhook
template = ""
[[bria.sinks]]
id = "results-sqlite"
type = "sqlite"
store = "bria" # resolves [stores.bria]
table_name = "pipeline_results"
path = "data/bria/results.db"
template = ""
[bria.sinks.db_table.columns]
result_id = "result_id"
job_id = "job_id"
pipeline_id = "pipeline_id"
step_id = "step_id"
occurred_at = "occurred_at"
exit_code = "exit_code"
stdout = "stdout"
stderr = "stderr"
duration_ms = "duration_ms"
attempt = "attempt"
status = "status"
# ─── Pipelines ────────────────────────────────────────────────────────────────
[[bria.pipelines]]
id = "image-pipeline"
source = "image-file"
concurrency = 4
queue_capacity = 1024
sinks = ["results-file"]
[bria.pipelines.failure]
action = "dead_letter"
sink = "results-file"
[[bria.pipelines.steps]]
id = "balloon"
type = "process"
task = "add-red-balloon"
depends_on = []
sinks = []
[bria.pipelines.steps.retry]
max_attempts = 3
base_delay_ms = 1000
max_delay_ms = 30000
jitter = 0.2