Skip to content

AccelerationConsortium/agilent-hplcms-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agilent-hplcms-server

Read-only status sidecar for the Agilent UPLC-MS instrument (SDL2_LC1290) on this lab PC. Runs alongside the existing moses Python controller and the always-on Agilent OpenLab CDS supervisor; observes them but never opens its own session against the instrument.

Conforms to the AC Organic Self-Driving Lab status contract: see docs/STATUS_SPEC.md (v1.0).

What this is (and is not)

This is a small FastAPI service that exposes:

  • GET /{equipment_id, equipment_name, protocol_version}
  • GET /health{status: "healthy"}
  • GET /status → an EquipmentStatus envelope per STATUS_SPEC v1.0
  • GET /openapi.json → generated by FastAPI

It is a sidecar in the strictest sense:

  • It does not import or share an environment with the existing moses HPLC-MS controller package.
  • It does not open any session against the Agilent OpenLab CDS .NET SDK, named pipe, instrument, serial port, or COM port.
  • It does not modify any vendor configuration.
  • GET /status is side-effect-free and always returns HTTP 200 when the process is alive (requires_init, error, etc. are reported in-band per spec).

It only reads:

  1. OS process presence of OpenLab CDS supervisor processes (psutil).
  2. The newest *.sirslt directory mtime under C:\CDSProjects\Installation\Results\ (acquisition output is the strongest "is data being written right now" signal).
  3. Any python.exe under C:\Users\sdl2\anaconda3\envs\moses*\ currently running (additive busy signal — moses is launched per-batch, not as a daemon).
  4. The trailing portion of C:\ProgramData\Agilent\LogFiles\InstrumentService.log and the newest AcquisitionServer-*.log for recent ERROR / CRITICAL / FATAL events.

Install / run interactively

C:\SDL_Tools\uv.exe sync --extra dev
C:\SDL_Tools\uv.exe run pytest -q
C:\SDL_Tools\uv.exe run agilent-hplcms-server-serve --host 0.0.0.0 --port 8010

Loopback verification:

curl http://127.0.0.1:8010/
curl http://127.0.0.1:8010/health
curl http://127.0.0.1:8010/status

Tailscale verification (from another tailnet device):

curl http://sdl2-pc-06-uplc.tail6a1dd7.ts.net:8010/health
curl http://sdl2-pc-06-uplc.tail6a1dd7.ts.net:8010/status

Configuration (env vars)

Variable Default Purpose
PORT 8010 Bind port for uvicorn.
HOST 0.0.0.0 Bind host for uvicorn.
DASHBOARD_ORIGIN * CORS allow origin. Set to dashboard origin in production.
OPENLAB_LOG_DIR C:\ProgramData\Agilent\LogFiles Where OpenLab writes live logs.
CDS_RESULTS_DIR C:\CDSProjects\Installation\Results Acquisition output root (*.sirslt directories).
MOSES_ENV_GLOB C:\Users\sdl2\anaconda3\envs\moses* Glob matched against python.exe ExecutablePath.
BUSY_THRESHOLD_S 90 *.sirslt mtime within this many seconds → busy.
ERROR_WINDOW_S 300 Look-back window for tail-log error severity.
OPENLAB_INSTRUMENT_NAME SDL2_LC1290 Surfaced in details.instrument_label.

STATUS_SPEC compliance

  • equipment_kind = "hplc". equipment_id = "agilent_uplc_ms". equipment_name = "Agilent UPLC-MS".
  • All timestamps are UTC ISO-8601 with timezone.
  • Snake_case field names, identical to the spec.
  • No secrets, no PII, no network identity in /status.
  • Conforms to lab status spec v1.0.

State mapping (v0.1)

equipment_status Trigger
requires_init Any required OpenLab core process missing.
error An ERROR / CRITICAL / FATAL event in the last ERROR_WINDOW_S of OpenLab logs.
busy Newest *.sirslt mtime within BUSY_THRESHOLD_S, or a moses-env python.exe is running.
ready OpenLab core processes up, no recent error event, no recent acquisition activity.
unknown Probe could not stat the OpenLab log dir or the CDS results dir.

Out of scope (v0.1)

  • No SharedServices read (no live pump_pressure / flow_rate / column_temp metrics yet). Planned for v0.2 via subprocess into the moses_v4 env, calling only SharedServices(connstring).status — never Agilent(...) (which grabs a control ticket).
  • No NSSM Windows Service install. Run interactively this session; service install is handled in a follow-up.
  • No edits to ac-organic-lab/equipment.yaml. Once this sidecar is reachable, the dashboard repo flips agilent_uplc_ms from adapter: mock to adapter: http with base_url: http://sdl2-pc-06-uplc.tail6a1dd7.ts.net:8010.

See also

  • STATUS_SPEC.md — v1.0 contract this repo implements.
  • DEVICE_PC_SETUP.md — canonical Windows install recipe (uv at C:\SDL_Tools\uv.exe, NSSM, lab-user run, log paths).

About

Server that runs on the HPLC-MS computer with REST API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages