-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess-compose.yml
More file actions
122 lines (113 loc) · 4.1 KB
/
process-compose.yml
File metadata and controls
122 lines (113 loc) · 4.1 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
version: "0.5"
# All ports and paths are set by bin/dev via environment variables.
# See bin/dev for the BLIT_DEV_INSTANCE mechanism that makes it easy to
# run multiple stacks side-by-side.
#
# BLIT_DEV_SOCK blit server Unix socket (default: /tmp/blit-dev.sock)
# BLIT_DEV_UI_PORT Vite UI dev-server port (default: 10000)
# BLIT_DEV_GW_PORT Gateway listen port (default: 10001)
# BLIT_DEV_SITE_PORT Astro website dev port (default: 10002)
processes:
build:
command: cargo build -p blit-cli --profile profiling
browser-wasm:
command: cargo watch -w crates/browser/src -w crates/remote/src -s "cd crates/browser && wasm-pack build --target web --release --out-dir pkg"
availability:
restart: always
readiness_probe:
exec:
command: test -f crates/browser/pkg/blit_browser.js
period_seconds: 2
failure_threshold: 300
js-deps:
command: cd js && pnpm install --frozen-lockfile
depends_on:
browser-wasm:
condition: process_healthy
server:
# Remove the stale socket *before* starting the server. The old
# server's UnixListener::drop does not unlink the socket file, so
# without this the readiness probe (`test -S`) gives a false
# positive while the new server is still spawning its compositor
# and audio pipeline — causing dependents (gateway, share) to
# connect to a dead socket and enter a restart loop.
command: rm -f ${BLIT_DEV_SOCK:-/tmp/blit-dev.sock} && exec ./target/profiling/blit server --verbose --socket ${BLIT_DEV_SOCK:-/tmp/blit-dev.sock}
depends_on:
build:
condition: process_completed_successfully
availability:
# on_failure (not "always") so a graceful SIGTERM exit (code 0)
# does not trigger an automatic restart. With "always", the
# flock-based server replacement (ipc_unix.rs) can create a
# restart loop: the old server exits 0, process-compose
# auto-starts another, which kills the replacement, etc.
restart: on_failure
backoff_seconds: 2
max_restarts: 5
readiness_probe:
exec:
command: test -S ${BLIT_DEV_SOCK:-/tmp/blit-dev.sock}
period_seconds: 2
failure_threshold: 300
shutdown:
# SIGTERM gives the server time to broadcast S2C_QUIT to clients
# and run AudioPipeline::drop (which kills dbus/pipewire/pw-cat
# children in order). 15 s is generous — normal shutdown takes
# < 1 s, but a slow audio teardown can take a few seconds.
signal: 15
timeout_seconds: 15
gateway:
command: ./target/profiling/blit gateway
environment:
- BLIT_ADDR=127.0.0.1:${BLIT_DEV_GW_PORT:-10001}
- BLIT_CORS=*
- BLIT_GATEWAY_WEBRTC=${BLIT_GATEWAY_WEBRTC:-0}
- BLIT_PASSPHRASE=${BLIT_PASSPHRASE:-dev}
- BLIT_PROXY=0
- BLIT_QUIC=0
- BLIT_SOCK=${BLIT_DEV_SOCK:-/tmp/blit-dev.sock}
- BLIT_STORE_CONFIG=1
depends_on:
build:
condition: process_completed_successfully
server:
condition: process_healthy
availability:
restart: always
readiness_probe:
http_get:
host: 127.0.0.1
port: ${BLIT_DEV_GW_PORT:-10001}
path: /
period_seconds: 2
failure_threshold: 300
share:
command: >-
if [ -z "${BLIT_DEV_SHARE:-}" ]; then exit 0; fi;
exec ./target/profiling/blit share --quiet
environment:
- BLIT_SOCK=${BLIT_DEV_SOCK:-/tmp/blit-dev.sock}
- BLIT_PROXY=0
depends_on:
build:
condition: process_completed_successfully
server:
condition: process_healthy
availability:
restart: on_failure
ui:
command: cd js/ui && pnpm exec vite --host --port ${BLIT_DEV_UI_PORT:-10000}
environment:
- BLIT_DEV_GW_PORT=${BLIT_DEV_GW_PORT:-10001}
depends_on:
js-deps:
condition: process_completed_successfully
availability:
restart: always
website:
command: cd js/website && pnpm exec astro dev --host --port ${BLIT_DEV_SITE_PORT:-3267}
depends_on:
js-deps:
condition: process_completed_successfully
availability:
restart: always