A node's worker label is worker, so a device is only a paired one
- NodeDef `device`/`device_policy` become `worker`/`worker_policy`, the issue `ignored_device` becomes `ignored_worker`, and the SDK's `@node` takes `worker=` and `worker_policy=` - FlowStore._migrate renames the keys in published and draft documents once, bumping their version; a queued run's `needs` reads the old key - placement passes the label as `label`, client regenerated - docs: worker placement wording, MCP issuer without DOMAIN, device rows in the CLI data directory and the API table, device links in compose comments Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f8011d2a8a
commit
a9d453c9d9
@@ -1,3 +1,4 @@
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
from datetime import UTC, datetime
|
||||
@@ -173,3 +174,22 @@ def test_opening_the_store_renames_the_mqtt_publish_queue_size(store: FlowStore)
|
||||
assert published.nodes[0].params == {"send_queue_size": 8}
|
||||
assert published.version == 2
|
||||
assert commit_count(store) == commits + 1
|
||||
|
||||
|
||||
def test_opening_the_store_renames_a_nodes_device_to_worker(store: FlowStore):
|
||||
"""`device` names a paired device now, so a node's worker label moves over."""
|
||||
store.write_flow(FlowDef(name="lab", nodes=[NodeDef(id="fit")]))
|
||||
path = store.root / "lab" / "flow.json"
|
||||
data = json.loads(path.read_text())
|
||||
node = data["nodes"][0]
|
||||
del node["worker"], node["worker_policy"]
|
||||
node.update(device="gpu", device_policy="prefer")
|
||||
path.write_text(json.dumps(data))
|
||||
|
||||
published = FlowStore(store.root).read_flow("lab")
|
||||
|
||||
assert (published.nodes[0].worker, published.nodes[0].worker_policy) == (
|
||||
"gpu",
|
||||
"prefer",
|
||||
)
|
||||
assert published.version == 2
|
||||
|
||||
Reference in New Issue
Block a user