Deployment¶
How Lightfall is deployed at a facility and at a beamline: which services run once per facility, which run per beamline, and exactly what must be configured today. Lightfall is in testing at the COSMIC-Scattering beamline at the ALS — a production-class deployment scoped to a single beamline while the platform matures.
Note
A turnkey beamline profile (one file that captures a beamline’s full configuration) and a provisioning runbook are on the roadmap. Today, deployment means standing up the services below and setting preferences in each Lightfall installation by hand. This page documents what exists now.
Topology: facility vs. beamline¶
Most of the stack runs once per facility and is shared by every beamline:
Service |
Role |
Notes |
|---|---|---|
Keycloak |
Single sign-on; identity for both control and data access |
Lightfall authenticates via OIDC and maps Keycloak groups/roles to application roles |
Tiled server |
Data catalog; per-entry access enforcement |
The auth-v2 API-key contract ( |
Logbook server |
Facility logbook backend |
Lightfall’s |
Error tracking |
Sentry-compatible server (the ALS runs self-hosted GlitchTip) |
Optional; telemetry is disabled unless a DSN is configured |
Git hosting |
Repositories for beamline plugin packages |
Any git forge; plugin packages are ordinary Python packages |
Each beamline runs its own:
Component |
Role |
Notes |
|---|---|---|
Lightfall GUI |
The application itself, one process per operator console |
|
NATS subjects |
The beamline’s slice of the message bus |
The broker itself can be shared facility-wide; beamlines are separated by topic prefix (e.g. |
EPICS IOCs / devices |
The actual hardware layer |
Lightfall coexists with existing control systems — both address the same EPICS process variables over Channel Access, so adoption can be incremental |
Beamline plugin repository |
Beamline-specific panels, plans, settings, themes |
Installed into the Lightfall environment as a Python package; see External Packages |
Autonomous engine (optional) |
e.g. Tsuchinoko for adaptive experiments |
Connects over NATS like any external client |
What must be configured today¶
Preferences (per installation)¶
User-facing settings live in PreferencesManager and are edited in the Preferences dialog (File → Settings). The keys below are the deployment-relevant ones, verified against src/lightfall/ui/preferences/:
IPC / NATS (ipc_settings.py):
Key |
Default |
Description |
|---|---|---|
|
|
NATS broker URL; an empty string disables IPC entirely |
|
|
Prefix prepended to every published/subscribed subject — set this per beamline |
|
(empty) |
Human-readable name for this instance, shown to discovery clients |
Tiled (tiled_settings.py):
Key |
Default |
Description |
|---|---|---|
|
|
Enable the Tiled connection |
|
|
Tiled server URL |
|
|
|
|
(empty) |
Static API key, used when not authenticating via Keycloak |
|
(empty) |
Beamline identifier used in access tags and ESAF lookup |
|
|
alshub API used to resolve the active ESAF for access stamping |
Logbook (logbook_settings.py):
Key |
Default |
Description |
|---|---|---|
|
|
Enable the logbook subsystem |
|
|
Facility logbook server; entries are stored locally and synced here |
|
|
Keep entries local-only (no server sync) |
Devices (device_settings.py) — backends can be enabled independently:
Key |
Default |
Description |
|---|---|---|
|
|
Simulated devices (the out-of-the-box experience) |
|
|
Include noisy variants of the simulated signals |
|
|
ALS Beamline Control System backend |
|
|
BCS server address |
|
(empty) |
BCS beamline identifier |
|
|
BCS request timeout |
|
|
happi database backend |
|
(empty) |
Path to the happi database |
|
(empty) |
Filter to one beamline’s devices |
|
|
Instantiate Ophyd devices on load |
* The legacy single-valued device_backend key ("mock" / "bcs" / "happi") is still written for compatibility and seeds the per-backend defaults.
Connection behavior is tunable via device_instantiate_mode (default background), device_connection_timeout (default 5.0 s), and device_connect_on_startup (default true). For off-site use, the same page configures the CA tunnel (Enable CA tunnel for remote access plus a gateway address, default localhost:5099) — see Remote EPICS Access.
Authentication (YAML config)¶
The auth provider is configured in the layered YAML configuration (application.yaml), not in Preferences. Files merge in priority order: bundled package defaults → system-wide (/etc/ncs/ or %PROGRAMDATA%\ncs\) → per-user (~/.config/ncs/ or %APPDATA%\ncs\) → runtime session overrides.
auth:
provider:
type: keycloak # local | keycloak | pam
server_url: https://keycloak.example.org
realm: alsncs
client_id: LUCID
redirect_uri: http://localhost:8089/callback
Field names and defaults are defined in lightfall.config.schema.AuthProviderConfig. The NCS_AUTH environment variable overrides the provider type at launch (e.g. NCS_AUTH=local for development). With no Keycloak configured, local auth and guest login keep the application usable.
Telemetry (opt-in)¶
Error reporting is disabled unless a DSN is explicitly configured — there is no default endpoint. Provide one via either:
the
SENTRY_DSNenvironment variable (wins), orthe
telemetry_dsnpreference.
Any Sentry-compatible server works. With no DSN set, all reporting functions no-op.
Agent credentials¶
The embedded Claude agent needs Anthropic credentials on each machine: set the ANTHROPIC_API_KEY environment variable, or authenticate a Claude subscription with the Claude Code CLI (claude auth login). Everything else in the application works without it.
A minimal single-machine deployment¶
For evaluation, none of the facility services are required: install, launch, continue as guest, and use the mock device backend. Adding services is incremental from there —
Tiled — point
tiled_urlat a Tiled server; runs are cataloged and browseable. For evaluation, a stock local server works with the API-key auth mode:pip install "tiled[server]", thentiled serve catalog --temp --api-key=secret(see Your First Session).NATS — point
ipc_nats_urlat a broker and choose aipc_topic_prefix; external clients can now submit plans and watch runs.Keycloak — configure
auth.providerin YAML; logins now mint per-service API keys, and runs are access-stamped per user and ESAF.Logbook server — point
logbook_urlat the facility logbook; local entries begin syncing.Telemetry — set a DSN once an error-tracking server exists.
Preference changes for the IPC service take effect on the next restart; the service is not reconfigured at runtime.