forked from Blizaine/Maestro
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.js
More file actions
43 lines (43 loc) · 1.24 KB
/
Copy pathstart.js
File metadata and controls
43 lines (43 loc) · 1.24 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
module.exports = async (kernel) => {
let port = await kernel.port()
// SERVER_NAME is intentionally NOT set here. The host-binding
// decision lives in launch.py, which reads PINOKIO_SHARE_LOCAL
// from the merged shell env (per-app ENVIRONMENT overrides global
// there). kernel.envs in this start.js context only exposes the
// global ENVIRONMENT, so a per-app override of PINOKIO_SHARE_LOCAL
// wouldn't be visible if we made the decision here. See launch.py
// bottom for the full priority chain.
return {
requires: {
bundle: "ai",
},
daemon: true,
run: [
// SAM service starts on demand (launched by the backend when inpaint is used)
// — not started here to avoid holding a CUDA context that wastes VRAM
{
method: "shell.run",
params: {
venv: "env",
env: {
SERVER_PORT: port
},
path: "app",
message: [
"python launch.py {{args.compile ? '--compile' : ''}}"
],
on: [{
"event": "/(http:\/\/[0-9.:]+)/",
"done": true
}]
}
},
{
method: "local.set",
params: {
url: "{{input.event[1]}}"
}
}
]
}
}