aipmodel 0.2.72__tar.gz → 0.2.73__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {aipmodel-0.2.72 → aipmodel-0.2.73}/PKG-INFO +1 -1
- {aipmodel-0.2.72 → aipmodel-0.2.73}/aipmodel/__init__.py +1 -1
- {aipmodel-0.2.72 → aipmodel-0.2.73}/aipmodel/model_registry.py +28 -1
- {aipmodel-0.2.72 → aipmodel-0.2.73}/aipmodel.egg-info/PKG-INFO +1 -1
- {aipmodel-0.2.72 → aipmodel-0.2.73}/setup.py +1 -1
- {aipmodel-0.2.72 → aipmodel-0.2.73}/MANIFEST.in +0 -0
- {aipmodel-0.2.72 → aipmodel-0.2.73}/README.md +0 -0
- {aipmodel-0.2.72 → aipmodel-0.2.73}/aipmodel/CephS3Manager.py +0 -0
- {aipmodel-0.2.72 → aipmodel-0.2.73}/aipmodel/acl_manager.py +0 -0
- {aipmodel-0.2.72 → aipmodel-0.2.73}/aipmodel/exceptions.py +0 -0
- {aipmodel-0.2.72 → aipmodel-0.2.73}/aipmodel/template.py +0 -0
- {aipmodel-0.2.72 → aipmodel-0.2.73}/aipmodel/update_checker.py +0 -0
- {aipmodel-0.2.72 → aipmodel-0.2.73}/aipmodel.egg-info/SOURCES.txt +0 -0
- {aipmodel-0.2.72 → aipmodel-0.2.73}/aipmodel.egg-info/dependency_links.txt +0 -0
- {aipmodel-0.2.72 → aipmodel-0.2.73}/aipmodel.egg-info/requires.txt +0 -0
- {aipmodel-0.2.72 → aipmodel-0.2.73}/aipmodel.egg-info/top_level.txt +0 -0
- {aipmodel-0.2.72 → aipmodel-0.2.73}/requirements.txt +0 -0
- {aipmodel-0.2.72 → aipmodel-0.2.73}/setup.cfg +0 -0
|
@@ -1677,7 +1677,8 @@ class MLOpsManager:
|
|
|
1677
1677
|
|
|
1678
1678
|
Returns:
|
|
1679
1679
|
{
|
|
1680
|
-
"model_id", "model_name",
|
|
1680
|
+
"model_id", "model_name",
|
|
1681
|
+
"status": "ok"|"missing_files"|"orphan_files"|"empty",
|
|
1681
1682
|
"versions": [{"version","path","files_exist","status"}...],
|
|
1682
1683
|
"orphan_folders": [<S3 folders under the model not referenced by any version>],
|
|
1683
1684
|
}
|
|
@@ -1733,6 +1734,15 @@ class MLOpsManager:
|
|
|
1733
1734
|
report["status"] = "missing_files"
|
|
1734
1735
|
elif report["orphan_folders"]:
|
|
1735
1736
|
report["status"] = "orphan_files"
|
|
1737
|
+
elif not versions_map:
|
|
1738
|
+
# Registry holds the model container but NO versions and NO files.
|
|
1739
|
+
# This is the shell an interrupted add leaves behind when the process
|
|
1740
|
+
# is hard-killed mid-upload (pod rollout, OOM, node eviction) — the
|
|
1741
|
+
# in-process rollback in add_model never runs in that case. Surface it
|
|
1742
|
+
# (it was previously reported "ok") so it can be cleaned up or the add
|
|
1743
|
+
# retried. Note: a version add still in flight shows its temp folder as
|
|
1744
|
+
# an orphan_folder above, so it reports "orphan_files", not "empty".
|
|
1745
|
+
report["status"] = "empty"
|
|
1736
1746
|
return report
|
|
1737
1747
|
|
|
1738
1748
|
def verify_all_models(self):
|
|
@@ -1813,6 +1823,23 @@ class MLOpsManager:
|
|
|
1813
1823
|
self.delete_model(model_name=model_name, version=version)
|
|
1814
1824
|
print(f"[SDK_SUCCESS] Synced: removed zombie version '{version}' of '{model_name}' from registry.")
|
|
1815
1825
|
|
|
1826
|
+
def remove_empty_model(self, model_name=None, model_id=None):
|
|
1827
|
+
"""
|
|
1828
|
+
Sync-repair for an EMPTY model container: the registry holds the model
|
|
1829
|
+
but it has no versions and no stored files — the shell an interrupted /
|
|
1830
|
+
hard-killed add leaves behind. Deletes the container so the registry is
|
|
1831
|
+
clean. Refuses to run if the model actually has versions or files (so a
|
|
1832
|
+
real model, or an add still in flight, is never removed by mistake).
|
|
1833
|
+
"""
|
|
1834
|
+
report = self.verify_model_integrity(model_name=model_name, model_id=model_id)
|
|
1835
|
+
if report["status"] != "empty":
|
|
1836
|
+
raise ValueError(
|
|
1837
|
+
f"Model '{report['model_name']}' is not empty (status={report['status']}); "
|
|
1838
|
+
f"refusing to remove it. Use delete_model for a real delete."
|
|
1839
|
+
)
|
|
1840
|
+
self.delete_model(model_id=report["model_id"])
|
|
1841
|
+
print(f"[SDK_SUCCESS] Removed empty model shell '{report['model_name']}'.")
|
|
1842
|
+
|
|
1816
1843
|
def purge_orphan_folders(self, model_name=None, model_id=None):
|
|
1817
1844
|
"""
|
|
1818
1845
|
Sync-repair for ORPHAN folders inside a registered model: S3 folders
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|