bladekit 4.63.0__tar.gz → 4.63.2__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.
- {bladekit-4.63.0 → bladekit-4.63.2}/PKG-INFO +1 -1
- {bladekit-4.63.0 → bladekit-4.63.2}/pyproject.toml +1 -1
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_client.py +25 -3
- {bladekit-4.63.0 → bladekit-4.63.2}/.gitignore +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/README.md +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/__init__.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_app.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_banner.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_batch.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_bucket.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_build.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_bundle.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_cls.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_constants.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_cron.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_dict.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_env.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_exported_metrics.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_image.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_loader.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_map.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_metrics_cli.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_preempt.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_queue.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_render.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_runner_api.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_sandbox.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_secret.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_serialize.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_serve.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_volume.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/_webhook.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/cli.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/config.py +0 -0
- {bladekit-4.63.0 → bladekit-4.63.2}/src/bladekit/exceptions.py +0 -0
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
# uninstalled during an upgrade, and `forge` is a different project's name on
|
|
17
17
|
# public PyPI.
|
|
18
18
|
name = "bladekit"
|
|
19
|
-
version = "4.63.
|
|
19
|
+
version = "4.63.2"
|
|
20
20
|
description = "Blade AI Fabric SDK + CLI — run Python functions on Blade's GPU fleet."
|
|
21
21
|
readme = "README.md"
|
|
22
22
|
requires-python = ">=3.10"
|
|
@@ -147,6 +147,28 @@ def _version_lt(current: str, minimum: str) -> bool:
|
|
|
147
147
|
return _version_tuple(current) < _version_tuple(minimum)
|
|
148
148
|
|
|
149
149
|
|
|
150
|
+
# Outlasts an object-store 5xx blip; a presigned PUT of the whole object is idempotent.
|
|
151
|
+
_OBJECT_STORE_DELAYS = (0.5, 1.0, 2.0, 4.0, 8.0)
|
|
152
|
+
_OBJECT_STORE_TRANSIENT = frozenset({429, 500, 502, 503, 504})
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def _object_store_call(method: str, url: str, **kwargs: Any):
|
|
156
|
+
"""One presigned object-store request, retried on 429/5xx and transport errors."""
|
|
157
|
+
import httpx
|
|
158
|
+
|
|
159
|
+
for delay in (*_OBJECT_STORE_DELAYS, None):
|
|
160
|
+
try:
|
|
161
|
+
resp = httpx.request(method, url, timeout=300.0, **kwargs)
|
|
162
|
+
except httpx.TransportError as e:
|
|
163
|
+
# A read/write timeout already spent 300 s; retrying it would stretch a hang to 30 min.
|
|
164
|
+
if delay is None or isinstance(e, (httpx.ReadTimeout, httpx.WriteTimeout)):
|
|
165
|
+
raise
|
|
166
|
+
else:
|
|
167
|
+
if resp.status_code not in _OBJECT_STORE_TRANSIENT or delay is None:
|
|
168
|
+
return resp
|
|
169
|
+
time.sleep(delay)
|
|
170
|
+
|
|
171
|
+
|
|
150
172
|
def _retry_after(headers: Optional[Mapping[str, str]]) -> Optional[float]:
|
|
151
173
|
"""``Retry-After`` in seconds (delta-seconds form only), else ``None``."""
|
|
152
174
|
if not headers:
|
|
@@ -349,8 +371,8 @@ class Client:
|
|
|
349
371
|
import httpx
|
|
350
372
|
|
|
351
373
|
try:
|
|
352
|
-
resp =
|
|
353
|
-
url, content=data, headers={"Content-Type": content_type}
|
|
374
|
+
resp = _object_store_call(
|
|
375
|
+
"PUT", url, content=data, headers={"Content-Type": content_type}
|
|
354
376
|
)
|
|
355
377
|
except httpx.HTTPError as e:
|
|
356
378
|
raise exc.ConnectionFailed(f"upload to object store failed: {e}") from e
|
|
@@ -363,7 +385,7 @@ class Client:
|
|
|
363
385
|
import httpx
|
|
364
386
|
|
|
365
387
|
try:
|
|
366
|
-
resp =
|
|
388
|
+
resp = _object_store_call("GET", url)
|
|
367
389
|
except httpx.HTTPError as e:
|
|
368
390
|
raise exc.ConnectionFailed(f"download from object store failed: {e}") from e
|
|
369
391
|
if resp.status_code >= 400:
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|