Split the worker into a distribution of its own

A cluster or GPU host installs `pip install fluksio-worker` and gets the
agent and the runner, not psycopg, numpy and the MCP SDK. The engine
depends on it as a workspace member, so the file it launches node code
with is the same file a remote worker runs — which is what keeps a node
unable to tell the difference. Copying the two files by hand still works.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-21 21:54:10 +02:00
co-authored by Claude Opus 5
parent 640654bd66
commit f8abd91fc0
17 changed files with 122 additions and 42 deletions
+5 -1
View File
@@ -26,11 +26,15 @@ from collections.abc import Callable
from pathlib import Path
from typing import Any
from fluksio_worker import worker_main as _worker_main
from fluksio.flow.events import EventBus
logger = logging.getLogger(__name__)
WORKER_MAIN = Path(__file__).with_name("worker_main.py")
#: The runner, in the worker distribution — the same file a remote worker runs,
#: so a node cannot tell which kind of worker it is on.
WORKER_MAIN = Path(_worker_main.__file__)
#: Importing what a node needs can be slow the first time; compiling is not
#: something a person is watching a spinner for.