aipmodel 0.2.70__tar.gz → 0.2.71__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.70
3
+ Version: 0.2.71
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
@@ -81,17 +81,32 @@ class CephS3Manager:
81
81
  print(f"[SDK_INFO] Bucket: {self.bucket_name}")
82
82
  print("[SDK_DEBUG] Creating S3 client...")
83
83
 
84
+ _cfg = {
85
+ "retries": {
86
+ "max_attempts": int(os.environ.get("S3_BOTO_MAX_ATTEMPTS", 10)),
87
+ "mode": "adaptive",
88
+ }
89
+ }
90
+ try:
91
+ # boto3 >= 1.36 defaults to CRC32 checksums, which MinIO/Ceph RGW
92
+ # reject on DeleteObjects ("MissingContentMD5"). "when_required"
93
+ # restores the classic Content-MD5 behavior those backends expect.
94
+ client_config = Config(
95
+ request_checksum_calculation="when_required",
96
+ response_checksum_validation="when_required",
97
+ **_cfg,
98
+ )
99
+ except TypeError:
100
+ # older botocore (< 1.36) doesn't know the checksum params — and
101
+ # doesn't need them (it already sends Content-MD5).
102
+ client_config = Config(**_cfg)
103
+
84
104
  self.s3 = boto3.client(
85
105
  "s3",
86
106
  endpoint_url=CEPH_ENDPOINT_URL,
87
107
  aws_access_key_id=CEPH_ADMIN_ACCESS_KEY,
88
108
  aws_secret_access_key=CEPH_ADMIN_SECRET_KEY,
89
- config=Config(
90
- retries={
91
- "max_attempts": int(os.environ.get("S3_BOTO_MAX_ATTEMPTS", 10)),
92
- "mode": "adaptive",
93
- }
94
- ),
109
+ config=client_config,
95
110
  )
96
111
 
97
112
  if self.verbose:
@@ -832,7 +847,18 @@ class CephS3Manager:
832
847
 
833
848
  for i in range(0, len(objs), 1000):
834
849
  chunk = objs[i:i+1000]
835
- self.s3.delete_objects(Bucket=self.bucket_name, Delete={"Objects": chunk})
850
+ try:
851
+ self.s3.delete_objects(Bucket=self.bucket_name, Delete={"Objects": chunk})
852
+ except ClientError as e:
853
+ # boto3 >= 1.36 sends CRC32 checksums that MinIO/Ceph RGW
854
+ # reject on the batch API ("MissingContentMD5"). Fall back
855
+ # to per-object deletes, which need no checksum header.
856
+ if e.response.get("Error", {}).get("Code") != "MissingContentMD5":
857
+ raise
858
+ if self.verbose:
859
+ print("[SDK_WARN] Batch delete rejected (MissingContentMD5); falling back to per-object deletes")
860
+ for obj in chunk:
861
+ self.s3.delete_object(Bucket=self.bucket_name, Key=obj["Key"])
836
862
 
837
863
  if self.verbose:
838
864
  print("[SDK_SUCCESS] Folder deleted")
@@ -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.70"
14
+ __version__ = "0.2.71"
15
15
  __description__ = "SDK for model registration, versioning, and storage"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aipmodel
3
- Version: 0.2.70
3
+ Version: 0.2.71
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.70",
34
+ version="0.2.71",
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