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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aipmodel
3
- Version: 0.2.72
3
+ Version: 0.2.73
4
4
  Summary: SDK for model registration, versioning, and storage
5
5
  Home-page: https://github.com/AIP-MLOPS/model-registry
6
6
  Author: AIP MLOPS Team
@@ -11,5 +11,5 @@ if _os.environ.get("AIPMODEL_UPDATE_CHECK", "").lower() in ("1", "true", "yes"):
11
11
 
12
12
  __all__ = ["MLOpsManager", "CephS3Manager"]
13
13
 
14
- __version__ = "0.2.72"
14
+ __version__ = "0.2.73"
15
15
  __description__ = "SDK for model registration, versioning, and storage"
@@ -1677,7 +1677,8 @@ class MLOpsManager:
1677
1677
 
1678
1678
  Returns:
1679
1679
  {
1680
- "model_id", "model_name", "status": "ok"|"missing_files"|"orphan_files",
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aipmodel
3
- Version: 0.2.72
3
+ Version: 0.2.73
4
4
  Summary: SDK for model registration, versioning, and storage
5
5
  Home-page: https://github.com/AIP-MLOPS/model-registry
6
6
  Author: AIP MLOPS Team
@@ -31,7 +31,7 @@ version, description = read_meta()
31
31
 
32
32
  setup(
33
33
  name="aipmodel",
34
- version="0.2.72",
34
+ version="0.2.73",
35
35
  description=description,
36
36
  author="AIP MLOPS Team",
37
37
  author_email="mohmmadweb@gmail.com",
File without changes
File without changes
File without changes
File without changes