Skip to content

switching to madsci - #1

Open
tginsbu1 wants to merge 1 commit into
mainfrom
madsci_update
Open

tginsbu1 wants to merge 1 commit into
mainfrom
madsci_update

Conversation

@tginsbu1

Copy link
Copy Markdown

Summary

Replaces the WEI-based KLA REST node with a MADSci 0.8 node module. The layout follows our other MADSci modules (a4s_sealer, brooks_xpeel).

Node

  • KLANode subclasses MADSci's RestNode, replacing the hand-written FastAPI app and its global state.
  • Actions:
    • load_protocol(protocol_files: list[str], message: str | None)
    • run_protocol(protocol_files: list[str], message: str | None)
    • check_status(): asks the device whether a sample run is in progress
  • Settings (KLANodeConfig): kla_url and request_timeout. These can be set with CLI flags (--kla_url still works), NODE_* environment variables, or .env.

Driver

  • HTTP and connection errors now raise. Before, they were printed and turned into None, so failed requests showed up as successful actions.
  • Request types are now an enum (KLARequestType).
  • Requests have a timeout.
  • Fixed the broken __main__ example, which passed hostname= instead of url=.

Infrastructure

  • The Docker image is based on ghcr.io/ad-sdl/madsci:v0.8.0 and installs with uv.
  • compose.yaml uses host networking. Node identity and URL come from NODE_NAME, NODE_URL, and KLA_URL in .env (see example.env).
  • Removed WEI-only files: wei.compose.yaml, the workcell and workflow YAMLs, src/test/, and the Makefile. A .justfile replaces the Makefile, matching our other modules.
  • Dependencies are now madsci.*~=0.8.0 instead of ad_sdl.wei, and Python 3.10 or newer is required.
  • The CI test workflow runs pytest directly instead of starting the WEI Docker stack.

Breaking changes

  • get_output_file is removed. The driver method was an empty stub and never returned a file. It can come back as a Path-returning action once the KLA server supports sending output.
  • protocol_files is now required for load_protocol and run_protocol. The old node ignored action arguments, so these actions always failed with "Protocol file list was not provided". Workflows calling them need to pass protocol_files.

Testing

  • New unit tests mock the KLA server, so no hardware is needed. They cover the request format, rejection of an empty protocol list, error propagation, action discovery, and action success and failure through the REST API. All 7 pass, and ruff is clean.
  • Checked that kla_url can be set with both --kla_url and NODE_KLA_URL.
  • Not yet tested: building the Docker image, or running against the real instrument.

Reviewer notes

  • load_protocol still sends request type 4 ("go to load sample"), as the old code did. Please confirm that's what the instrument expects for this action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant