One image for the whole app: engine, API and dashboard on one port
The backend image now builds the SPA and serves it on the API's own origin (fluksio/spa.py), so an instance is a single container with no proxy, DNS, port 80 or .env: `docker compose up -d` with the new compose.yml runs it on localhost:8080. It starts on fluksio serve (persisted secret key, first admin printed once) and brings its own Redis when REDIS_HOST is unset. Slimmer: python:3.13-slim, no dev group, uv once, fastapi without the cloud CLI. Optional features are per-feature extras (mqtt, influx, email, sentry, ml, server for all) picked with the EXTRAS build argument; numpy moved to `ml`. ffmpeg left the image for imageio-ffmpeg via the Modules screen. The operator stack runs the same image with app. and api. routed to it; the nginx frontend service, the LAN nginx proxy and DOMAIN in the backend are gone, and the MCP issuer is FRONTEND_HOST. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def _influxdb() -> Any:
|
||||
"""The client library, which is a `fluksio[server]` extra.
|
||||
"""The client library, which is the `influx` extra.
|
||||
|
||||
Imported per use rather than at module level, because the node type is
|
||||
registered at boot and an instance with no InfluxDB behind it should
|
||||
@@ -25,7 +25,8 @@ def _influxdb() -> Any:
|
||||
import influxdb_client
|
||||
except ImportError:
|
||||
raise RuntimeError(
|
||||
"the influxdb node needs the server extra: pip install 'fluksio[server]'"
|
||||
"the influxdb node needs the influx extra: pip install 'fluksio[influx]', "
|
||||
"or build the image with EXTRAS=influx"
|
||||
) from None
|
||||
return influxdb_client
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import threading
|
||||
from collections.abc import Iterable
|
||||
from typing import Any
|
||||
|
||||
import numpy as np
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from fluksio.flow.messages import MessageSpec
|
||||
@@ -16,6 +15,22 @@ from fluksio.flow.nodes.base import Node
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def _numpy() -> Any:
|
||||
"""numpy, which is the `ml` extra.
|
||||
|
||||
Imported when a node is built rather than at boot, so an instance without
|
||||
it still offers every other type, and a node placed without it says so.
|
||||
"""
|
||||
try:
|
||||
import numpy
|
||||
except ImportError:
|
||||
raise RuntimeError(
|
||||
"the mlp node needs the ml extra: pip install 'fluksio[ml]', "
|
||||
"or build the image with EXTRAS=ml"
|
||||
) from None
|
||||
return numpy
|
||||
|
||||
|
||||
class MLPNode(Node):
|
||||
"""
|
||||
Multi-Layer Perceptron node for neural network processing in pipelines.
|
||||
@@ -72,6 +87,7 @@ class MLPNode(Node):
|
||||
)
|
||||
cfg = self.Params.model_validate(self.params)
|
||||
|
||||
np = self._np = _numpy()
|
||||
rng = np.random.default_rng(seed=cfg.seed)
|
||||
num_inputs = max(1, len(self.input_ports))
|
||||
num_outputs = max(1, len(self.output_ports))
|
||||
@@ -91,6 +107,7 @@ class MLPNode(Node):
|
||||
self.id,
|
||||
)
|
||||
|
||||
np = self._np
|
||||
if kwargs:
|
||||
input_array = np.array([float(v) for v in kwargs.values()])
|
||||
else:
|
||||
|
||||
@@ -21,7 +21,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def _aiomqtt() -> Any:
|
||||
"""The client library, which is a `fluksio[server]` extra.
|
||||
"""The client library, which is the `mqtt` extra.
|
||||
|
||||
Imported per use rather than at module level, because the node type is
|
||||
registered at boot and an instance that talks to no broker should not
|
||||
@@ -31,7 +31,8 @@ def _aiomqtt() -> Any:
|
||||
import aiomqtt
|
||||
except ImportError:
|
||||
raise RuntimeError(
|
||||
"the mqtt node needs the server extra: pip install 'fluksio[server]'"
|
||||
"the mqtt node needs the mqtt extra: pip install 'fluksio[mqtt]', "
|
||||
"or build the image with EXTRAS=mqtt"
|
||||
) from None
|
||||
return aiomqtt
|
||||
|
||||
|
||||
Reference in New Issue
Block a user