PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
 
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
picurv_cli.storage.models Namespace Reference

Data Structures

class  StorageError
 User-facing storage workflow failure. More...
 

Functions

str _utc_now ()
 Return a stable UTC timestamp for storage metadata.
 
str _human_bytes (int value)
 Format a byte count for concise command output.
 
str _sha256_file (str path)
 Calculate SHA-256 without loading a potentially large file into memory.
 
None _atomic_write_json (str path, dict payload)
 Atomically replace a JSON state or manifest file.
 
 _read_json (str path)
 Read a JSON mapping when present, otherwise return None.
 
 read_artifact_manifest (str root_path)
 Read a local artifact's own identity manifest, run or study.
 
dict read_artifact_identity (str root_path)
 Resolve what a local artifact directory is, and what it calls itself.
 
 _find_upwards (str start, str filename)
 Find the nearest named file at or above a filesystem anchor.
 
str storage_workspace_root (str start=None)
 Locate the initialized workspace a storage command is standing in.
 
str storage_config_origin (str config_path, str workspace_root=None)
 Classify where an active storage configuration came from.
 
str resolve_storage_config_path (str explicit_path=None, bool require=True)
 Resolve an explicit or nearest workspace storage configuration.
 
dict load_storage_profile (str profile_name=None, str config_path=None)
 Load and validate one non-secret rclone storage profile.
 
str _state_path (str root_path)
 Return the local storage state marker path for an artifact root.
 
 read_storage_state (str root_path)
 Read the nearest applicable storage marker for a run, study, or study member.
 
bool is_artifact_cold (str root_path)
 Return whether a local artifact marker says payload data was pruned.
 
dict storage_state_summary (str root_path)
 Return a compact storage status for summarize and status commands.
 
dict _parse_tags (raw_tags)
 Parse repeatable KEY=VALUE tags into deterministic metadata.
 

Variables

str STORAGE_CONFIG_FILENAME = ".picurv-storage.yml"
 
str STORAGE_STATE_FILENAME = ".picurv-storage.json"
 
str STORAGE_LOCK_FILENAME = ".picurv-storage.lock.json"
 
int STORAGE_SCHEMA_VERSION = 2
 
str REMOTE_OBJECTS_DIRECTORY = "objects"
 
str REMOTE_BLOBS_DIRECTORY = "blobs"
 
str REMOTE_MANIFEST_FILENAME = "manifest.json"
 
tuple STORAGE_ARTIFACT_TYPES = ("run", "study", "study-case")
 
str RUN_MANIFEST_FILENAME = "manifest.json"
 
str STUDY_MANIFEST_FILENAME = "study_manifest.json"
 
str REMOTE_COMPLETE_FILENAME = "COMPLETE"
 
str DEFAULT_PROFILE_NAME = "archive"
 
float DEFAULT_CHUNK_SIZE_GIB = 8.0
 
 DEFAULT_STORAGE_WORKERS = max(1, min(8, os.cpu_count() or 1))
 
int AUTO_NO_COMPRESSION_BYTES = 256 * 1024 * 1024
 
int AUTO_MAXIMUM_COMPRESSION_BYTES = 20 * 1024 * 1024 * 1024
 
 CHECKPOINT_DIRECTORY_PATTERN = re.compile(r"^step_(\d{12})$")
 
 INCOMPLETE_CHECKPOINT_PATTERN = re.compile(r"^\.step_\d{12}\.incomplete\.")
 
 ARCHIVE_ID_PATTERN = re.compile(r"^[0-9a-f]{32}$")
 
int KNOWN_CHECKPOINT_VERSION = 1
 
str UNCLASSIFIED_COMPONENT = "unclassified"
 
str WORKSPACE_CONFIG_FILENAME = ".picurv-workspace.yml"
 
tuple WORKSPACE_EXCLUDED_ROOTS = ("runs", "studies")
 
 ALWAYS_RETAINED_COMPONENTS
 
tuple STORAGE_RESTORE_COMPONENTS
 
 ALWAYS_RESTORED_COMPONENTS = frozenset({"metadata", "workspace-config"})
 
dict _PARALLEL_GZIP_VALUES = {"fast", "balanced"}
 
tuple CLI_OUTPUT_FORMATS = ("text", "json")
 
tuple STORAGE_COMPRESSION_POLICIES = ("auto", "none", "fast", "balanced", "maximum")
 
tuple STORAGE_OFFLOAD_POLICIES = ("metadata-only", "restart-ready", "analysis-ready")
 
tuple STORAGE_RETENTION_COMPONENTS
 
dict STORAGE_COMPRESSION_EXTENSIONS
 

Function Documentation

◆ _utc_now()

str picurv_cli.storage.models._utc_now ( )
protected

Return a stable UTC timestamp for storage metadata.

Returns
Result produced by this operation.

Definition at line 143 of file models.py.

143def _utc_now() -> str:
144 """!
145 @brief Return a stable UTC timestamp for storage metadata.
146 @return Result produced by this operation.
147 """
148 return datetime.datetime.now(datetime.timezone.utc).isoformat()
149
150

◆ _human_bytes()

str picurv_cli.storage.models._human_bytes ( int  value)
protected

Format a byte count for concise command output.

Parameters
[in]valueValue supplied through the value argument.
Returns
Result produced by this operation.

Definition at line 151 of file models.py.

151def _human_bytes(value: int) -> str:
152 """!
153 @brief Format a byte count for concise command output.
154 @param[in] value Value supplied through the `value` argument.
155 @return Result produced by this operation.
156 """
157 size = float(value)
158 for suffix in ("B", "KiB", "MiB", "GiB", "TiB", "PiB"):
159 if size < 1024.0 or suffix == "PiB":
160 return f"{size:.1f} {suffix}" if suffix != "B" else f"{int(size)} B"
161 size /= 1024.0
162 return f"{int(value)} B"
163
164

◆ _sha256_file()

str picurv_cli.storage.models._sha256_file ( str  path)
protected

Calculate SHA-256 without loading a potentially large file into memory.

Parameters
[in]pathValue supplied through the path argument.
Returns
Result produced by this operation.

Definition at line 165 of file models.py.

165def _sha256_file(path: str) -> str:
166 """!
167 @brief Calculate SHA-256 without loading a potentially large file into memory.
168 @param[in] path Value supplied through the `path` argument.
169 @return Result produced by this operation.
170 """
171 digest = hashlib.sha256()
172 with open(path, "rb") as stream:
173 while True:
174 block = stream.read(8 * 1024 * 1024)
175 if not block:
176 break
177 digest.update(block)
178 return digest.hexdigest()
179
180

◆ _atomic_write_json()

None picurv_cli.storage.models._atomic_write_json ( str  path,
dict  payload 
)
protected

Atomically replace a JSON state or manifest file.

Parameters
[in]pathValue supplied through the path argument.
[in]payloadValue supplied through the payload argument.

Definition at line 181 of file models.py.

181def _atomic_write_json(path: str, payload: dict) -> None:
182 """!
183 @brief Atomically replace a JSON state or manifest file.
184 @param[in] path Value supplied through the `path` argument.
185 @param[in] payload Value supplied through the `payload` argument.
186 """
187 path_abs = os.path.abspath(path)
188 os.makedirs(os.path.dirname(path_abs), exist_ok=True)
189 temporary = f"{path_abs}.tmp.{os.getpid()}"
190 with open(temporary, "w", encoding="utf-8") as stream:
191 json.dump(payload, stream, indent=2, sort_keys=True)
192 stream.write("\n")
193 stream.flush()
194 os.fsync(stream.fileno())
195 os.replace(temporary, path_abs)
196
197

◆ _read_json()

picurv_cli.storage.models._read_json ( str  path)
protected

Read a JSON mapping when present, otherwise return None.

Parameters
[in]pathValue supplied through the path argument.
Returns
Result produced by this operation.

Definition at line 198 of file models.py.

198def _read_json(path: str):
199 """!
200 @brief Read a JSON mapping when present, otherwise return None.
201 @param[in] path Value supplied through the `path` argument.
202 @return Result produced by this operation.
203 """
204 try:
205 with open(path, "r", encoding="utf-8") as stream:
206 payload = json.load(stream)
207 except (OSError, ValueError):
208 return None
209 return payload if isinstance(payload, dict) else None
210
211

◆ read_artifact_manifest()

picurv_cli.storage.models.read_artifact_manifest ( str  root_path)

Read a local artifact's own identity manifest, run or study.

Parameters
[in]root_pathRun, study, or study-member directory.
Returns
The parsed manifest mapping, or None when the directory has none.

Definition at line 212 of file models.py.

212def read_artifact_manifest(root_path: str):
213 """!
214 @brief Read a local artifact's own identity manifest, run or study.
215 @param[in] root_path Run, study, or study-member directory.
216 @return The parsed manifest mapping, or None when the directory has none.
217 """
218 root = os.path.abspath(root_path)
219 for filename in (RUN_MANIFEST_FILENAME, STUDY_MANIFEST_FILENAME):
220 payload = _read_json(os.path.join(root, filename))
221 if payload:
222 return payload
223 return None
224
225
Here is the caller graph for this function:

◆ read_artifact_identity()

dict picurv_cli.storage.models.read_artifact_identity ( str  root_path)

Resolve what a local artifact directory is, and what it calls itself.

The manifest is authoritative. The directory basename is a last resort, reported as such through identity_source, so a caller can tell a real identity from a guess instead of both looking the same.

Parameters
[in]root_pathRun, study, or study-member directory.
Returns
Mapping with artifact_type, run_id, study_id, case_id, and identity_source ("manifest" or "directory-name").

Definition at line 226 of file models.py.

226def read_artifact_identity(root_path: str) -> dict:
227 """!
228 @brief Resolve what a local artifact directory is, and what it calls itself.
229
230 @details The manifest is authoritative. The directory basename is a last resort,
231 reported as such through `identity_source`, so a caller can tell a real
232 identity from a guess instead of both looking the same.
233 @param[in] root_path Run, study, or study-member directory.
234 @return Mapping with `artifact_type`, `run_id`, `study_id`, `case_id`, and
235 `identity_source` ("manifest" or "directory-name").
236 """
237 root = os.path.abspath(root_path)
238 manifest = read_artifact_manifest(root)
239 if manifest:
240 artifact_type = manifest.get("artifact_type")
241 if artifact_type in STORAGE_ARTIFACT_TYPES:
242 return {
243 "artifact_type": artifact_type,
244 "run_id": manifest.get("run_id"),
245 "study_id": manifest.get("study_id"),
246 "case_id": manifest.get("case_id"),
247 "paths": manifest.get("paths") or {},
248 "identity_source": "manifest",
249 }
250 return {
251 "artifact_type": None,
252 "run_id": os.path.basename(root),
253 "study_id": os.path.basename(root),
254 "case_id": None,
255 "paths": {},
256 "identity_source": "directory-name",
257 }
258
259
260
Here is the call graph for this function:

◆ _find_upwards()

picurv_cli.storage.models._find_upwards ( str  start,
str  filename 
)
protected

Find the nearest named file at or above a filesystem anchor.

Parameters
[in]startValue supplied through the start argument.
[in]filenameValue supplied through the filename argument.
Returns
Result produced by this operation.

Definition at line 261 of file models.py.

261def _find_upwards(start: str, filename: str):
262 """!
263 @brief Find the nearest named file at or above a filesystem anchor.
264 @param[in] start Value supplied through the `start` argument.
265 @param[in] filename Value supplied through the `filename` argument.
266 @return Result produced by this operation.
267 """
268 current = os.path.abspath(start)
269 if os.path.isfile(current):
270 current = os.path.dirname(current)
271 while True:
272 candidate = os.path.join(current, filename)
273 if os.path.isfile(candidate):
274 return candidate
275 parent = os.path.dirname(current)
276 if parent == current:
277 return None
278 current = parent
279
280

◆ storage_workspace_root()

str picurv_cli.storage.models.storage_workspace_root ( str   start = None)

Locate the initialized workspace a storage command is standing in.

Parameters
[in]startDirectory to search from; defaults to the current directory.
Returns
Absolute workspace root, or None when the command is not inside one.

Definition at line 281 of file models.py.

281def storage_workspace_root(start: str = None) -> str:
282 """!
283 @brief Locate the initialized workspace a storage command is standing in.
284 @param[in] start Directory to search from; defaults to the current directory.
285 @return Absolute workspace root, or None when the command is not inside one.
286 """
287 marker = _find_upwards(start or os.getcwd(), WORKSPACE_CONFIG_FILENAME)
288 return os.path.dirname(marker) if marker else None
289
290

◆ storage_config_origin()

str picurv_cli.storage.models.storage_config_origin ( str  config_path,
str   workspace_root = None 
)

Classify where an active storage configuration came from.

Discovery walks upward without stopping at the workspace boundary, which is deliberate: one configuration is meant to be shareable across a directory of campaigns. What makes that dangerous is silence, not sharing. An offload uploads to the remote this file names and then prunes local payload, so which file answered has to be visible at the point of use.

Parameters
[in]config_pathResolved storage configuration path.
[in]workspace_rootOwning workspace, or None to discover it from the cwd.
Returns
"workspace" when the file belongs to the workspace in scope, "shared" when it was inherited from above it, and "unowned" when there is no workspace.

Definition at line 291 of file models.py.

291def storage_config_origin(config_path: str, workspace_root: str = None) -> str:
292 """!
293 @brief Classify where an active storage configuration came from.
294
295 @details Discovery walks upward without stopping at the workspace boundary, which
296 is deliberate: one configuration is meant to be shareable across a
297 directory of campaigns. What makes that dangerous is silence, not sharing.
298 An offload uploads to the remote this file names and then prunes local
299 payload, so which file answered has to be visible at the point of use.
300 @param[in] config_path Resolved storage configuration path.
301 @param[in] workspace_root Owning workspace, or None to discover it from the cwd.
302 @return "workspace" when the file belongs to the workspace in scope, "shared" when
303 it was inherited from above it, and "unowned" when there is no workspace.
304 """
305 if not config_path:
306 return "unowned"
307 root = workspace_root if workspace_root is not None else storage_workspace_root()
308 if not root:
309 return "unowned"
310 resolved = os.path.abspath(config_path)
311 root = os.path.abspath(root)
312 return "workspace" if os.path.dirname(resolved) == root else "shared"
313
314

◆ resolve_storage_config_path()

str picurv_cli.storage.models.resolve_storage_config_path ( str   explicit_path = None,
bool   require = True 
)

Resolve an explicit or nearest workspace storage configuration.

Parameters
[in]explicit_pathOptional user-selected YAML path.
[in]requireWhether a missing configuration is an error.
Returns
Result produced by this operation.

Definition at line 315 of file models.py.

315def resolve_storage_config_path(explicit_path: str = None, require: bool = True) -> str:
316 """!
317 @brief Resolve an explicit or nearest workspace storage configuration.
318 @param[in] explicit_path Optional user-selected YAML path.
319 @param[in] require Whether a missing configuration is an error.
320 @return Result produced by this operation.
321 """
322 if explicit_path:
323 result = os.path.abspath(explicit_path)
324 else:
325 result = _find_upwards(os.getcwd(), STORAGE_CONFIG_FILENAME)
326 if result and os.path.isfile(result):
327 return result
328 if require:
329 raise StorageError(
330 "No PICurv storage configuration was found. Run "
331 "'picurv storage setup --remote <rclone-remote:path>' first or pass --storage-config."
332 )
333 return os.path.abspath(explicit_path or os.path.join(os.getcwd(), STORAGE_CONFIG_FILENAME))
334
335

◆ load_storage_profile()

dict picurv_cli.storage.models.load_storage_profile ( str   profile_name = None,
str   config_path = None 
)

Load and validate one non-secret rclone storage profile.

Parameters
[in]profile_nameValue supplied through the profile_name argument.
[in]config_pathValue supplied through the config_path argument.
Returns
Result produced by this operation.

Definition at line 336 of file models.py.

336def load_storage_profile(profile_name: str = None, config_path: str = None) -> dict:
337 """!
338 @brief Load and validate one non-secret rclone storage profile.
339 @param[in] profile_name Value supplied through the `profile_name` argument.
340 @param[in] config_path Value supplied through the `config_path` argument.
341 @return Result produced by this operation.
342 """
343 resolved_config = resolve_storage_config_path(config_path)
344 with open(resolved_config, "r", encoding="utf-8") as stream:
345 payload = yaml.safe_load(stream) or {}
346 profiles = payload.get("profiles")
347 if not isinstance(profiles, dict):
348 raise StorageError(f"Storage config has no 'profiles' mapping: {resolved_config}")
349 selected = profile_name or payload.get("default_profile") or DEFAULT_PROFILE_NAME
350 profile = profiles.get(selected)
351 if not isinstance(profile, dict):
352 raise StorageError(f"Storage profile '{selected}' does not exist in {resolved_config}.")
353 remote = profile.get("remote")
354 if not isinstance(remote, str) or not remote.strip():
355 raise StorageError(f"Storage profile '{selected}' requires a non-empty remote.")
356 result = dict(profile)
357 result["name"] = selected
358 result["remote"] = remote.rstrip("/")
359 result["config_path"] = resolved_config
360 try:
361 chunk_size_gib = float(result.get("chunk_size_gib", DEFAULT_CHUNK_SIZE_GIB))
362 except (TypeError, ValueError) as exc:
363 raise StorageError(f"Storage profile '{selected}' chunk_size_gib must be numeric.") from exc
364 if chunk_size_gib <= 0.0:
365 raise StorageError(f"Storage profile '{selected}' chunk_size_gib must be positive.")
366 result["chunk_size_bytes"] = int(chunk_size_gib * 1024 ** 3)
367 try:
368 workers = int(result.get("workers", DEFAULT_STORAGE_WORKERS))
369 except (TypeError, ValueError) as exc:
370 raise StorageError(f"Storage profile '{selected}' workers must be an integer.") from exc
371 if workers <= 0:
372 raise StorageError(f"Storage profile '{selected}' workers must be positive.")
373 result["workers"] = workers
374 offload_policy = str(result.get("offload_policy", "metadata-only"))
375 if offload_policy not in STORAGE_OFFLOAD_POLICIES:
376 raise StorageError(
377 f"Storage profile '{selected}' offload_policy must be one of: "
378 + ", ".join(STORAGE_OFFLOAD_POLICIES)
379 )
380 result["offload_policy"] = offload_policy
381 result["keep_latest_checkpoint"] = bool(result.get("keep_latest_checkpoint", False))
382 return result
383
384

◆ _state_path()

str picurv_cli.storage.models._state_path ( str  root_path)
protected

Return the local storage state marker path for an artifact root.

Parameters
[in]root_pathValue supplied through the root_path argument.
Returns
Result produced by this operation.

Definition at line 385 of file models.py.

385def _state_path(root_path: str) -> str:
386 """!
387 @brief Return the local storage state marker path for an artifact root.
388 @param[in] root_path Value supplied through the `root_path` argument.
389 @return Result produced by this operation.
390 """
391 return os.path.join(os.path.abspath(root_path), STORAGE_STATE_FILENAME)
392
393

◆ read_storage_state()

picurv_cli.storage.models.read_storage_state ( str  root_path)

Read the nearest applicable storage marker for a run, study, or study member.

Parameters
[in]root_pathValue supplied through the root_path argument.
Returns
Result produced by this operation.

Definition at line 394 of file models.py.

394def read_storage_state(root_path: str):
395 """!
396 @brief Read the nearest applicable storage marker for a run, study, or study member.
397 @param[in] root_path Value supplied through the `root_path` argument.
398 @return Result produced by this operation.
399 """
400 root = Path(os.path.abspath(root_path))
401 state = _read_json(_state_path(str(root)))
402 if state:
403 return state
404 # A whole-study archive owns every numbered member. Let ordinary run
405 # workflows see that parent state without treating unrelated ancestors as
406 # storage owners.
407 if root.parent.name == "cases":
408 return _read_json(_state_path(str(root.parent.parent)))
409 return None
410
411

◆ is_artifact_cold()

bool picurv_cli.storage.models.is_artifact_cold ( str  root_path)

Return whether a local artifact marker says payload data was pruned.

Parameters
[in]root_pathValue supplied through the root_path argument.
Returns
Result produced by this operation.

Definition at line 412 of file models.py.

412def is_artifact_cold(root_path: str) -> bool:
413 """!
414 @brief Return whether a local artifact marker says payload data was pruned.
415 @param[in] root_path Value supplied through the `root_path` argument.
416 @return Result produced by this operation.
417 """
418 state = read_storage_state(root_path)
419 return bool(state and state.get("local_pruned"))
420
421

◆ storage_state_summary()

dict picurv_cli.storage.models.storage_state_summary ( str  root_path)

Return a compact storage status for summarize and status commands.

Parameters
[in]root_pathValue supplied through the root_path argument.
Returns
Result produced by this operation.

Definition at line 422 of file models.py.

422def storage_state_summary(root_path: str) -> dict:
423 """!
424 @brief Return a compact storage status for summarize and status commands.
425 @param[in] root_path Value supplied through the `root_path` argument.
426 @return Result produced by this operation.
427 """
428 state = read_storage_state(root_path)
429 if not state:
430 # A marker that exists but cannot be read is worse than none: the artifact
431 # claims a remote copy nobody can locate.
432 if os.path.exists(_state_path(root_path)):
433 return {"state": "BROKEN", "archive_id": None, "label": None,
434 "detail": "storage marker is present but unreadable"}
435 return {"state": "LOCAL", "archive_id": None, "label": None}
436 if not state.get("archive_id"):
437 return {"state": "BROKEN", "archive_id": None, "label": state.get("label"),
438 "detail": "storage marker names no archive"}
439 if state.get("local_pruned"):
440 status = "PARTIAL" if state.get("restored_components") else "COLD"
441 else:
442 status = "PROTECTED"
443 return {
444 "state": status,
445 "archive_id": state.get("archive_id"),
446 "label": state.get("label"),
447 "profile": state.get("profile"),
448 "remote": state.get("remote"),
449 }
450
451
452#: Output encodings shared with the rest of the CLI. Storage does not own this set.

◆ _parse_tags()

dict picurv_cli.storage.models._parse_tags (   raw_tags)
protected

Parse repeatable KEY=VALUE tags into deterministic metadata.

Parameters
[in]raw_tagsValue supplied through the raw_tags argument.
Returns
Result produced by this operation.

Definition at line 482 of file models.py.

482def _parse_tags(raw_tags) -> dict:
483 """!
484 @brief Parse repeatable KEY=VALUE tags into deterministic metadata.
485 @param[in] raw_tags Value supplied through the `raw_tags` argument.
486 @return Result produced by this operation.
487 """
488 tags = {}
489 for item in raw_tags or []:
490 key, separator, value = str(item).partition("=")
491 if not separator or not key.strip() or not value.strip():
492 raise StorageError(f"Invalid tag {item!r}; expected KEY=VALUE.")
493 tags[key.strip()] = value.strip()
494 return tags

Variable Documentation

◆ STORAGE_CONFIG_FILENAME

str picurv_cli.storage.models.STORAGE_CONFIG_FILENAME = ".picurv-storage.yml"

Definition at line 27 of file models.py.

◆ STORAGE_STATE_FILENAME

str picurv_cli.storage.models.STORAGE_STATE_FILENAME = ".picurv-storage.json"

Definition at line 30 of file models.py.

◆ STORAGE_LOCK_FILENAME

str picurv_cli.storage.models.STORAGE_LOCK_FILENAME = ".picurv-storage.lock.json"

Definition at line 33 of file models.py.

◆ STORAGE_SCHEMA_VERSION

int picurv_cli.storage.models.STORAGE_SCHEMA_VERSION = 2

Definition at line 38 of file models.py.

◆ REMOTE_OBJECTS_DIRECTORY

str picurv_cli.storage.models.REMOTE_OBJECTS_DIRECTORY = "objects"

Definition at line 41 of file models.py.

◆ REMOTE_BLOBS_DIRECTORY

str picurv_cli.storage.models.REMOTE_BLOBS_DIRECTORY = "blobs"

Definition at line 45 of file models.py.

◆ REMOTE_MANIFEST_FILENAME

str picurv_cli.storage.models.REMOTE_MANIFEST_FILENAME = "manifest.json"

Definition at line 48 of file models.py.

◆ STORAGE_ARTIFACT_TYPES

tuple picurv_cli.storage.models.STORAGE_ARTIFACT_TYPES = ("run", "study", "study-case")

Definition at line 53 of file models.py.

◆ RUN_MANIFEST_FILENAME

str picurv_cli.storage.models.RUN_MANIFEST_FILENAME = "manifest.json"

Definition at line 60 of file models.py.

◆ STUDY_MANIFEST_FILENAME

str picurv_cli.storage.models.STUDY_MANIFEST_FILENAME = "study_manifest.json"

Definition at line 64 of file models.py.

◆ REMOTE_COMPLETE_FILENAME

str picurv_cli.storage.models.REMOTE_COMPLETE_FILENAME = "COMPLETE"

Definition at line 67 of file models.py.

◆ DEFAULT_PROFILE_NAME

str picurv_cli.storage.models.DEFAULT_PROFILE_NAME = "archive"

Definition at line 70 of file models.py.

◆ DEFAULT_CHUNK_SIZE_GIB

float picurv_cli.storage.models.DEFAULT_CHUNK_SIZE_GIB = 8.0

Definition at line 73 of file models.py.

◆ DEFAULT_STORAGE_WORKERS

picurv_cli.storage.models.DEFAULT_STORAGE_WORKERS = max(1, min(8, os.cpu_count() or 1))

Definition at line 76 of file models.py.

◆ AUTO_NO_COMPRESSION_BYTES

int picurv_cli.storage.models.AUTO_NO_COMPRESSION_BYTES = 256 * 1024 * 1024

Definition at line 79 of file models.py.

◆ AUTO_MAXIMUM_COMPRESSION_BYTES

int picurv_cli.storage.models.AUTO_MAXIMUM_COMPRESSION_BYTES = 20 * 1024 * 1024 * 1024

Definition at line 82 of file models.py.

◆ CHECKPOINT_DIRECTORY_PATTERN

picurv_cli.storage.models.CHECKPOINT_DIRECTORY_PATTERN = re.compile(r"^step_(\d{12})$")

Definition at line 85 of file models.py.

◆ INCOMPLETE_CHECKPOINT_PATTERN

picurv_cli.storage.models.INCOMPLETE_CHECKPOINT_PATTERN = re.compile(r"^\.step_\d{12}\.incomplete\.")

Definition at line 88 of file models.py.

◆ ARCHIVE_ID_PATTERN

picurv_cli.storage.models.ARCHIVE_ID_PATTERN = re.compile(r"^[0-9a-f]{32}$")

Definition at line 91 of file models.py.

◆ KNOWN_CHECKPOINT_VERSION

int picurv_cli.storage.models.KNOWN_CHECKPOINT_VERSION = 1

Definition at line 94 of file models.py.

◆ UNCLASSIFIED_COMPONENT

str picurv_cli.storage.models.UNCLASSIFIED_COMPONENT = "unclassified"

Definition at line 99 of file models.py.

◆ WORKSPACE_CONFIG_FILENAME

str picurv_cli.storage.models.WORKSPACE_CONFIG_FILENAME = ".picurv-workspace.yml"

Definition at line 104 of file models.py.

◆ WORKSPACE_EXCLUDED_ROOTS

tuple picurv_cli.storage.models.WORKSPACE_EXCLUDED_ROOTS = ("runs", "studies")

Definition at line 110 of file models.py.

◆ ALWAYS_RETAINED_COMPONENTS

picurv_cli.storage.models.ALWAYS_RETAINED_COMPONENTS
Initial value:
1= frozenset(
2 {UNCLASSIFIED_COMPONENT, "workspace-config", "workspace-inputs", "assets"}
3)

Definition at line 118 of file models.py.

◆ STORAGE_RESTORE_COMPONENTS

tuple picurv_cli.storage.models.STORAGE_RESTORE_COMPONENTS
Initial value:
1= (
2 "inputs", "raw-output", "analysis", "visualization", "logs", "assets",
3 UNCLASSIFIED_COMPONENT, "workspace-config", "workspace-inputs",
4)

Definition at line 123 of file models.py.

◆ ALWAYS_RESTORED_COMPONENTS

picurv_cli.storage.models.ALWAYS_RESTORED_COMPONENTS = frozenset({"metadata", "workspace-config"})

Definition at line 133 of file models.py.

◆ _PARALLEL_GZIP_VALUES

dict picurv_cli.storage.models._PARALLEL_GZIP_VALUES = {"fast", "balanced"}
protected

Definition at line 136 of file models.py.

◆ CLI_OUTPUT_FORMATS

tuple picurv_cli.storage.models.CLI_OUTPUT_FORMATS = ("text", "json")

Definition at line 453 of file models.py.

◆ STORAGE_COMPRESSION_POLICIES

tuple picurv_cli.storage.models.STORAGE_COMPRESSION_POLICIES = ("auto", "none", "fast", "balanced", "maximum")

Definition at line 458 of file models.py.

◆ STORAGE_OFFLOAD_POLICIES

tuple picurv_cli.storage.models.STORAGE_OFFLOAD_POLICIES = ("metadata-only", "restart-ready", "analysis-ready")

Definition at line 461 of file models.py.

◆ STORAGE_RETENTION_COMPONENTS

tuple picurv_cli.storage.models.STORAGE_RETENTION_COMPONENTS
Initial value:
1= (
2 "checkpoints", "logs", "analysis", "visualization", "inputs", "raw-output",
3)

Definition at line 470 of file models.py.

◆ STORAGE_COMPRESSION_EXTENSIONS

dict picurv_cli.storage.models.STORAGE_COMPRESSION_EXTENSIONS
Initial value:
1= {
2 "none": ".tar", "fast": ".tar.gz", "balanced": ".tar.gz", "maximum": ".tar.xz",
3}

Definition at line 477 of file models.py.