accli 1.1.3__tar.gz → 1.1.4__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.
- {accli-1.1.3 → accli-1.1.4}/PKG-INFO +1 -1
- {accli-1.1.3 → accli-1.1.4}/accli/AcceleratorTerminalCliProjectService.py +22 -9
- {accli-1.1.3 → accli-1.1.4}/accli/_version.py +1 -1
- {accli-1.1.3 → accli-1.1.4}/accli.egg-info/PKG-INFO +1 -1
- {accli-1.1.3 → accli-1.1.4}/LICENSE +0 -0
- {accli-1.1.3 → accli-1.1.4}/README.md +0 -0
- {accli-1.1.3 → accli-1.1.4}/accli/AcceleratorJobProjectService.py +0 -0
- {accli-1.1.3 → accli-1.1.4}/accli/AcceleratorTaskDispatcher.py +0 -0
- {accli-1.1.3 → accli-1.1.4}/accli/CsvRegionalTimeseriesValidator.py +0 -0
- {accli-1.1.3 → accli-1.1.4}/accli/__init__.py +0 -0
- {accli-1.1.3 → accli-1.1.4}/accli/__main__.py +0 -0
- {accli-1.1.3 → accli-1.1.4}/accli/cli.py +0 -0
- {accli-1.1.3 → accli-1.1.4}/accli/common.py +0 -0
- {accli-1.1.3 → accli-1.1.4}/accli/token.py +0 -0
- {accli-1.1.3 → accli-1.1.4}/accli.egg-info/SOURCES.txt +0 -0
- {accli-1.1.3 → accli-1.1.4}/accli.egg-info/dependency_links.txt +0 -0
- {accli-1.1.3 → accli-1.1.4}/accli.egg-info/entry_points.txt +0 -0
- {accli-1.1.3 → accli-1.1.4}/accli.egg-info/requires.txt +0 -0
- {accli-1.1.3 → accli-1.1.4}/accli.egg-info/top_level.txt +0 -0
- {accli-1.1.3 → accli-1.1.4}/pyproject.toml +0 -0
- {accli-1.1.3 → accli-1.1.4}/setup.cfg +0 -0
|
@@ -4,6 +4,7 @@ import json
|
|
|
4
4
|
import os
|
|
5
5
|
|
|
6
6
|
import requests
|
|
7
|
+
from requests.adapters import HTTPAdapter
|
|
7
8
|
import urllib3
|
|
8
9
|
from typing import List, Tuple
|
|
9
10
|
|
|
@@ -21,7 +22,12 @@ class AccAPIError(Exception):
|
|
|
21
22
|
self.status_code = status_code
|
|
22
23
|
|
|
23
24
|
|
|
24
|
-
retries = urllib3.util.Retry(
|
|
25
|
+
retries = urllib3.util.Retry(
|
|
26
|
+
total=10,
|
|
27
|
+
backoff_factor=1,
|
|
28
|
+
status_forcelist=[408, 429, 500, 502, 503, 504],
|
|
29
|
+
allowed_methods=["HEAD", "GET", "OPTIONS", "PUT"]
|
|
30
|
+
)
|
|
25
31
|
|
|
26
32
|
http_client = urllib3.poolmanager.PoolManager(
|
|
27
33
|
num_pools=20, retries=retries, maxsize=2000, block=True
|
|
@@ -41,8 +47,9 @@ class AcceleratorTerminalCliProjectService:
|
|
|
41
47
|
):
|
|
42
48
|
|
|
43
49
|
self.user_token = user_token
|
|
50
|
+
self.verify_cert = verify_cert
|
|
44
51
|
|
|
45
|
-
if verify_cert:
|
|
52
|
+
if self.verify_cert:
|
|
46
53
|
self.http_client = http_client
|
|
47
54
|
else:
|
|
48
55
|
self.http_client = http_client_wo_cert_verification
|
|
@@ -264,16 +271,22 @@ class AcceleratorTerminalCliProjectService:
|
|
|
264
271
|
project_slug, app_bucket_id, uniqified_filename, upload_id, part_number
|
|
265
272
|
)
|
|
266
273
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
274
|
+
session = requests.Session()
|
|
275
|
+
adapter = HTTPAdapter(max_retries=retries)
|
|
276
|
+
session.mount("https://", adapter)
|
|
277
|
+
session.verify = self.verify_cert
|
|
278
|
+
|
|
279
|
+
with session.put(
|
|
280
|
+
put_presigned_url,
|
|
281
|
+
data=part_data,
|
|
282
|
+
timeout=120
|
|
283
|
+
) as part_upload_response:
|
|
284
|
+
part_upload_response.raise_for_status()
|
|
285
|
+
|
|
286
|
+
etag = part_upload_response.headers.get("etag").replace('"', "")
|
|
273
287
|
|
|
274
288
|
progress.update(task, advance=len(part_data))
|
|
275
289
|
|
|
276
|
-
etag = part_upload_response.headers.get("etag").replace('"', "")
|
|
277
290
|
return part_number, etag
|
|
278
291
|
|
|
279
292
|
def upload_filestream_to_accelerator(self, project_slug, filename, file_stream, progress, task,
|
|
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
|