Artifact sweep keeps digests named in node settings
A Service's weights or a wren node's model held only in a setting were swept once the run that produced them was deleted. Claude-Session: https://claude.ai/code/session_01H89mFby73wwhthP9htfcuB
This commit is contained in:
@@ -11,7 +11,7 @@ from fluksio.core.db import engine as db_engine
|
||||
from fluksio.flow.artifacts import ArtifactStore, VolatileStore
|
||||
from fluksio.flow.messages import MessageSpec
|
||||
from fluksio.flow.runs import new_run_id, sweep_artifacts
|
||||
from fluksio.flow.schemas import FlowDef, FlowInput
|
||||
from fluksio.flow.schemas import FlowDef, FlowInput, NodeDef
|
||||
from fluksio.flow.state import MemoryState
|
||||
from fluksio.flow.store import FlowStore
|
||||
from fluksio.models import Run, RunArtifact
|
||||
@@ -136,6 +136,20 @@ def test_a_sweep_keeps_what_a_flow_input_starts_with(store, tmp_path):
|
||||
assert store.path(kept["digest"]) is not None
|
||||
|
||||
|
||||
def test_a_sweep_keeps_what_a_node_setting_names(store, tmp_path):
|
||||
"""A Service's weights outlive the run that produced them."""
|
||||
weights = store.put([b"weights"])
|
||||
orphan = store.put([b"referred to by nothing"])
|
||||
|
||||
flows = FlowStore(tmp_path / "flows")
|
||||
params = {"nested": [{"weights": weights["digest"]}]}
|
||||
flows.write_flow(FlowDef(name="f", nodes=[NodeDef(id="n", params=params)]))
|
||||
|
||||
assert sweep_artifacts(store, MemoryState(), grace_s=0, flows=flows) == 1
|
||||
assert store.path(orphan["digest"]) is None
|
||||
assert store.path(weights["digest"]) is not None
|
||||
|
||||
|
||||
def test_a_ring_drops_the_oldest_once_it_is_full(tmp_path):
|
||||
"""What makes a camera affordable: the room is fixed, not the history."""
|
||||
ring = VolatileStore(tmp_path / "ring", limit_bytes=3000)
|
||||
|
||||
Reference in New Issue
Block a user