Service node: a server kept running on a worker (openpanel V2)

- `service` node type: command, port, worker label, health path, env and
  weights (an artifact digest the worker fetches as {weights}). Its flow
  starts it; it restarts with backoff, reads degraded while starting or
  without a worker and down after three starts that never got healthy, and
  publishes http://<worker>:<port> once /health answers 200, "" when it ends.
- Worker protocol 3: a `serve` call, every call in its own process group,
  killed when the engine ends the call, the socket drops or the agent gets
  SIGTERM. `--service-host` overrides the address the engine sees.
- Services and compiles take no `--parallel` slot, and a flow's detail is
  built off the event loop, so a save no longer stalls the engine.
This commit is contained in:
Melvin Strobl
2026-10-19 18:43:04 +02:00
parent 80e0201612
commit 85dad39973
16 changed files with 757 additions and 34 deletions
+8
View File
@@ -56,6 +56,7 @@ from fluksio.flow.nodes import (
Node,
NtfyNode,
RbeNode,
ServiceNode,
SwitchNode,
WebSocketNode,
WrenNode,
@@ -425,6 +426,13 @@ NODE_TYPES: dict[str, NodeType] = {
runs_code=True,
params_schema=_schema_of(ExecNode),
),
"service": NodeType(
title="Service",
description="Keep a server running on a worker, and publish its url.",
cls=ServiceNode,
runs_code=True,
params_schema=_schema_of(ServiceNode),
),
"file": NodeType(
title="File",
description="Read a file into the flow, or write one out of it.",