Skip to content

Commit 640d137

Browse files
author
RPL
committed
Update to MADSci v0.8
Lifts the module from v0.5 (the previous release on main) through v0.6 to v0.8 in one go for the RAPID 446 grimm rebuild. The v0.5 -> v0.6 work was carried in the working tree but never landed upstream; layering v0.8 changes on top here brings everything together. This branch is preferred over the existing `madsci_0_7` branch, which had the API rename done but commented out the entire `startup_handler` resource-creation block (deck / slots / mounts) -- a regression we explicitly avoided. v0.5 -> v0.6 (carried forward): - Resource names now in v0.8 convention: {node_name}.deck, {node_name}.deck.nest_{i}, {node_name}.{mount}_mount. - `slot_count` -> `nest_count` in the deck container attributes. - `add_to_database=True` dropped from sub-templates (parent's `add_to_database=True` handles them). - `STOPPED` value added to the RobotStatus enum. - `rate_limit_requests: int = 500` config option added. v0.6 -> v0.8 (this round): - pyproject.toml + pdm.lock: pin madsci.{node_module,client,common}~=0.8.0; bump requires-python to >=3.10. - src/ot2_rest_node.py: rename self.node_definition.{node_name,node_id} -> self.node_info.* (20 sites: 4 in startup_handler for protocols path + deck/slot/mount names, 8 in _create_ot2_templates for created_by=, 8 in execute() for log messages). - Dockerfile rewritten on the v0.8 base: - Pin to ghcr.io/ad-sdl/madsci:v0.8.0. - `uv pip install --python ${MADSCI_VENV}/bin/python -e ./ot2_module` so the editable install lands in the venv the runtime actually uses. - **No `USER` directive** -- the base entrypoint runs userdel/useradd as root to remap UID/GID to the host's, then drops to madsci itself. A trailing `USER madsci` breaks the entrypoint with "usermod: cannot lock /etc/passwd; try again later." - No dialout groups baked in -- OT-2s and Flex are network-only. Verified end-to-end on grimm with all three OT2-family nodes: ot2_spongebob /status -> ready: true, /state ot2_status_code: idle ot2_patrick /status -> ready: true, /state ot2_status_code: idle otflex_sandy /status -> ready: true, /state ot2_status_code: failed (Flex's hardware state, not a container-side problem) 45 deck/slot/mount resources auto-created in postgres with the v0.8 `{node_name}.deck.nest_N` naming. ULIDs preserved via registry for all three nodes.
1 parent 552ad11 commit 640d137

5 files changed

Lines changed: 158 additions & 42 deletions

File tree

Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/ad-sdl/madsci
1+
FROM ghcr.io/ad-sdl/madsci:v0.8.0
22

33
LABEL org.opencontainers.image.source=https://github.com/AD-SDL/ot2_module
44
LABEL org.opencontainers.image.description="Drivers and REST API's for the Opentrons OT2 LiquidHandling robots"
@@ -13,10 +13,14 @@ RUN mkdir -p ot2_module
1313
COPY ./src ot2_module/src
1414
COPY ./README.md ot2_module/README.md
1515
COPY ./pyproject.toml ot2_module/pyproject.toml
16-
COPY ./tests ot2_module/tests
1716

17+
# Install into the madsci venv (system pip would land in /usr/lib site-packages,
18+
# invisible to the venv interpreter the entrypoint actually runs).
1819
RUN --mount=type=cache,target=/root/.cache \
19-
pip install -e ./ot2_module
20+
uv pip install --python ${MADSCI_VENV}/bin/python -e ./ot2_module
21+
22+
# Note: do not switch USER here — the base entrypoint runs userdel/useradd as
23+
# root to remap UID/GID to the host's, then drops to the madsci user itself.
2024

2125
CMD ["python", "ot2_module/src/ot2_rest_node.py"]
2226

pdm.lock

Lines changed: 122 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "ot2_module"
3-
version = "2.0.0"
3+
version = "2.0.1"
44
description = "Software for automatting an OT2 liquid_handler"
55
authors = [
66
{name = "Ryan D. Lewis", email="ryan.lewis@anl.gov"},
@@ -9,11 +9,11 @@ authors = [
99
{name = "Tobias Ginsburg", email = "tginsburg@anl.gov"},
1010
]
1111
dependencies = [
12-
"madsci.node_module~=0.5.0",
13-
"madsci.client~=0.5.0",
14-
"madsci.common~=0.5.0"
12+
"madsci.node_module~=0.8.0",
13+
"madsci.client~=0.8.0",
14+
"madsci.common~=0.8.0"
1515
]
16-
requires-python = ">=3.9.1"
16+
requires-python = ">=3.10"
1717
readme = "README.md"
1818
license = {text = "MIT"}
1919

src/ot2_interface/ot2_driver_http.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class RobotStatus(Enum):
2323
FAILED = "failed"
2424
PAUSED = "paused"
2525
OFFLINE = "offline"
26+
STOPPED = "stopped"
2627

2728

2829
class RunStatus(Enum):

0 commit comments

Comments
 (0)