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.
- {aipmodel-0.2.70 → aipmodel-0.2.71}/PKG-INFO +1 -1
- {aipmodel-0.2.70 → aipmodel-0.2.71}/aipmodel/CephS3Manager.py +33 -7
- {aipmodel-0.2.70 → aipmodel-0.2.71}/aipmodel/__init__.py +1 -1
- {aipmodel-0.2.70 → aipmodel-0.2.71}/aipmodel.egg-info/PKG-INFO +1 -1
- {aipmodel-0.2.70 → aipmodel-0.2.71}/setup.py +1 -1
- {aipmodel-0.2.70 → aipmodel-0.2.71}/MANIFEST.in +0 -0
- {aipmodel-0.2.70 → aipmodel-0.2.71}/README.md +0 -0
- {aipmodel-0.2.70 → aipmodel-0.2.71}/aipmodel/acl_manager.py +0 -0
- {aipmodel-0.2.70 → aipmodel-0.2.71}/aipmodel/exceptions.py +0 -0
- {aipmodel-0.2.70 → aipmodel-0.2.71}/aipmodel/model_registry.py +0 -0
- {aipmodel-0.2.70 → aipmodel-0.2.71}/aipmodel/template.py +0 -0
- {aipmodel-0.2.70 → aipmodel-0.2.71}/aipmodel/update_checker.py +0 -0
- {aipmodel-0.2.70 → aipmodel-0.2.71}/aipmodel.egg-info/SOURCES.txt +0 -0
- {aipmodel-0.2.70 → aipmodel-0.2.71}/aipmodel.egg-info/dependency_links.txt +0 -0
- {aipmodel-0.2.70 → aipmodel-0.2.71}/aipmodel.egg-info/requires.txt +0 -0
- {aipmodel-0.2.70 → aipmodel-0.2.71}/aipmodel.egg-info/top_level.txt +0 -0
- {aipmodel-0.2.70 → aipmodel-0.2.71}/requirements.txt +0 -0
- {aipmodel-0.2.70 → aipmodel-0.2.71}/setup.cfg +0 -0
|
@@ -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=
|
|
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
|
-
|
|
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")
|
|
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
|