Functions | |
| list | cold_study_members (str study_path) |
| Return numbered study members whose local payload was pruned. | |
| None | require_storage_payload_local (str root_path, str operation, int checkpoint=None, checkpoints=None) |
| Reject a workflow that requires payload currently held in cold storage. | |
| None | _require_free_space (str directory, int needed_bytes, str purpose) |
| Refuse to begin staging work the destination filesystem cannot hold. | |
| bool | _lock_owner_active (str metadata_path) |
| Conservatively determine whether a solver/post/storage owner marker is active. | |
| set | _collect_job_ids (payload) |
| Recursively collect submitted Slurm job IDs from scheduler metadata. | |
| dict | _slurm_activity (str root) |
| Query live Slurm state for every job recorded below an artifact scheduler directory. | |
| None | _assert_archive_safe (dict inventory) |
| Refuse to package a changing or scheduler-ambiguous artifact. | |
| storage_operation_lock (str root_path, str operation) | |
| Hold an exclusive local storage-operation marker for one artifact. | |
| runtime_stage_lock (str root_path, str stage) | |
| Mark a locally executed solver/post stage as active for storage safety. | |
| list picurv_cli.storage.safety.cold_study_members | ( | str | study_path | ) |
Return numbered study members whose local payload was pruned.
| [in] | study_path | Value supplied through the study_path argument. |
Definition at line 36 of file safety.py.
| None picurv_cli.storage.safety.require_storage_payload_local | ( | str | root_path, |
| str | operation, | ||
| int | checkpoint = None, |
||
checkpoints = None |
|||
| ) |
Reject a workflow that requires payload currently held in cold storage.
| [in] | root_path | Run or study-member directory checked by an existing workflow. |
| [in] | operation | Human-readable consuming operation. |
| [in] | checkpoint | Optional single required checkpoint step. |
| [in] | checkpoints | Optional iterable of every required checkpoint step. |
Definition at line 51 of file safety.py.
|
protected |
Refuse to begin staging work the destination filesystem cannot hold.
Packaging and restore both stage uncompressed bytes on disk before the verified result replaces or uploads them. Discovering the filesystem was too small only after chunks were partially written wastes the transfer and can leave a staging directory to clean up by hand; checking first turns that into an immediate, actionable refusal.
| [in] | directory | Directory whose filesystem free space is checked; must exist. |
| [in] | needed_bytes | Estimated peak bytes the operation holds on disk at once. |
| [in] | purpose | Short present-tense phrase describing the operation, for the message. |
| StorageError | when free space is smaller than the estimate. |
Definition at line 91 of file safety.py.
|
protected |
Conservatively determine whether a solver/post/storage owner marker is active.
| [in] | metadata_path | Value supplied through the metadata_path argument. |
Definition at line 116 of file safety.py.
|
protected |
Recursively collect submitted Slurm job IDs from scheduler metadata.
| [in] | payload | Value supplied through the payload argument. |
Definition at line 142 of file safety.py.
|
protected |
Query live Slurm state for every job recorded below an artifact scheduler directory.
| [in] | root | Value supplied through the root argument. |
Definition at line 160 of file safety.py.
|
protected |
Refuse to package a changing or scheduler-ambiguous artifact.
| [in] | inventory | Value supplied through the inventory argument. |
Definition at line 208 of file safety.py.
| picurv_cli.storage.safety.storage_operation_lock | ( | str | root_path, |
| str | operation | ||
| ) |
Hold an exclusive local storage-operation marker for one artifact.
| [in] | root_path | Value supplied through the root_path argument. |
| [in] | operation | Value supplied through the operation argument. |
Definition at line 233 of file safety.py.
| picurv_cli.storage.safety.runtime_stage_lock | ( | str | root_path, |
| str | stage | ||
| ) |
Mark a locally executed solver/post stage as active for storage safety.
| [in] | root_path | Run directory used as the runtime working directory. |
| [in] | stage | Runtime stage label; storage currently uses this for solver execution. |
Definition at line 264 of file safety.py.