ciocore 8.3.2__py2.py3-none-any.whl → 9.1.0b1__py2.py3-none-any.whl
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.
Potentially problematic release.
This version of ciocore might be problematic. Click here for more details.
- ciocore/VERSION +1 -1
- ciocore/docsite/sitemap.xml.gz +0 -0
- ciocore/uploader/_uploader.py +27 -2
- ciocore/uploader/thread_queue_job.py +101 -0
- {ciocore-8.3.2.dist-info → ciocore-9.1.0b1.dist-info}/METADATA +7 -1
- {ciocore-8.3.2.dist-info → ciocore-9.1.0b1.dist-info}/RECORD +9 -8
- {ciocore-8.3.2.dist-info → ciocore-9.1.0b1.dist-info}/WHEEL +0 -0
- {ciocore-8.3.2.dist-info → ciocore-9.1.0b1.dist-info}/entry_points.txt +0 -0
- {ciocore-8.3.2.dist-info → ciocore-9.1.0b1.dist-info}/top_level.txt +0 -0
ciocore/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
9.1.0-beta.1
|
ciocore/docsite/sitemap.xml.gz
CHANGED
|
Binary file
|
ciocore/uploader/_uploader.py
CHANGED
|
@@ -2,6 +2,7 @@ import datetime
|
|
|
2
2
|
import json
|
|
3
3
|
import logging
|
|
4
4
|
import os
|
|
5
|
+
import pathlib
|
|
5
6
|
import requests.exceptions
|
|
6
7
|
import sys
|
|
7
8
|
import time
|
|
@@ -760,6 +761,31 @@ class Uploader(object):
|
|
|
760
761
|
file_map = {path: None for path in processed_filepaths}
|
|
761
762
|
self.handle_upload_response(project=None, upload_files=file_map)
|
|
762
763
|
|
|
764
|
+
if common.SIGINT_EXIT or self.cancel:
|
|
765
|
+
print("\nUpload cancelled\n")
|
|
766
|
+
|
|
767
|
+
else:
|
|
768
|
+
print("\nUpload of {} file completed\n".format(len(file_map)))
|
|
769
|
+
|
|
770
|
+
error_messages = []
|
|
771
|
+
|
|
772
|
+
for exception in self.error_messages:
|
|
773
|
+
error_messages.append(str(exception[1]))
|
|
774
|
+
print("".join(traceback.format_tb(exception[2])))
|
|
775
|
+
logger.error("".join(traceback.format_tb(exception[2])))
|
|
776
|
+
|
|
777
|
+
if error_messages:
|
|
778
|
+
|
|
779
|
+
log_file = loggeria.LOG_PATH
|
|
780
|
+
sys.stderr.write("\nError uploading files:\n")
|
|
781
|
+
|
|
782
|
+
for err_msg in error_messages:
|
|
783
|
+
sys.stderr.write("\t{}\n".format(err_msg))
|
|
784
|
+
|
|
785
|
+
sys.stderr.write("\nSee log {} for more details\n\n".format(log_file))
|
|
786
|
+
|
|
787
|
+
self.error_messages = []
|
|
788
|
+
|
|
763
789
|
def handle_upload_response(self, project, upload_files, upload_id=None):
|
|
764
790
|
"""
|
|
765
791
|
This is a really confusing method and should probably be split into to clear logic
|
|
@@ -818,8 +844,7 @@ class Uploader(object):
|
|
|
818
844
|
time.sleep(5)
|
|
819
845
|
|
|
820
846
|
# Shutdown the manager once all jobs are done
|
|
821
|
-
if not self.cancel
|
|
822
|
-
logger.debug("Waiting for Manager to join")
|
|
847
|
+
if not (self.cancel or self.manager.error or common.SIGINT_EXIT):
|
|
823
848
|
self.manager.join()
|
|
824
849
|
|
|
825
850
|
upload_stats = UploadStats.create(
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from ciocore import loggeria
|
|
3
|
+
|
|
4
|
+
logger = logging.getLogger("{}.uploader".format(loggeria.CONDUCTOR_LOGGER_NAME))
|
|
5
|
+
|
|
6
|
+
class ThreadQueueJob():
|
|
7
|
+
pass
|
|
8
|
+
|
|
9
|
+
class UploadThreadQueueJob(ThreadQueueJob):
|
|
10
|
+
|
|
11
|
+
def __init__(self, path, file_size, presigned_url, file_md5=None, upload_id=None, part_size=None, total_parts=1, part_index=1, kms_key_name=None):
|
|
12
|
+
|
|
13
|
+
super().__init__()
|
|
14
|
+
|
|
15
|
+
self.path = path
|
|
16
|
+
self.file_size = file_size
|
|
17
|
+
self.upload_id = upload_id
|
|
18
|
+
self.presigned_url = presigned_url
|
|
19
|
+
self.file_md5 = file_md5
|
|
20
|
+
self.part_size = part_size
|
|
21
|
+
self.part_index = part_index
|
|
22
|
+
self.total_parts = total_parts
|
|
23
|
+
self.kms_key_name = kms_key_name
|
|
24
|
+
|
|
25
|
+
logger.info("Creating %s (%s): %s", str(self.__class__), str(self), str(self.__dict__))
|
|
26
|
+
|
|
27
|
+
def is_multipart(self):
|
|
28
|
+
return self.total_parts != 1
|
|
29
|
+
|
|
30
|
+
def is_vendor_aws(self):
|
|
31
|
+
return "amazonaws" in self.presigned_url
|
|
32
|
+
|
|
33
|
+
def is_vendor_cw(self):
|
|
34
|
+
return "coreweave" in self.presigned_url
|
|
35
|
+
|
|
36
|
+
@classmethod
|
|
37
|
+
def create_from_response(cls, response):
|
|
38
|
+
|
|
39
|
+
new_thread_queue_jobs = []
|
|
40
|
+
|
|
41
|
+
for part_type, file_request_list in response.items():
|
|
42
|
+
|
|
43
|
+
for file_request in file_request_list:
|
|
44
|
+
if part_type == "multiPartURLs":
|
|
45
|
+
|
|
46
|
+
for part in file_request["parts"]:
|
|
47
|
+
new_tqj = cls( path=file_request['filePath'],
|
|
48
|
+
file_size = file_request['filePath'],
|
|
49
|
+
presigned_url = file_request['preSignedURL'],
|
|
50
|
+
file_md5 = file_request['preSignedURL'],
|
|
51
|
+
upload_id = file_request['preSignedURL'],
|
|
52
|
+
part_size = file_request['preSignedURL'],
|
|
53
|
+
part_index = file_request['preSignedURL'])
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
else:
|
|
57
|
+
new_tqj = cls( path=file_request['filePath'],
|
|
58
|
+
file_size = file_request['filePath'],
|
|
59
|
+
presigned_url = file_request['preSignedURL'])
|
|
60
|
+
|
|
61
|
+
new_thread_queue_jobs.append(new_tqj)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class MultiPartThreadQueueJob(ThreadQueueJob):
|
|
66
|
+
|
|
67
|
+
def __init__(self, path, md5, total_parts=1, part_index=1):
|
|
68
|
+
|
|
69
|
+
super().__init__()
|
|
70
|
+
|
|
71
|
+
self.upload_id = None
|
|
72
|
+
self.md5 = md5
|
|
73
|
+
self.project = None
|
|
74
|
+
self.path = path
|
|
75
|
+
self.part_index = part_index
|
|
76
|
+
self.etag = None
|
|
77
|
+
self.total_parts = total_parts
|
|
78
|
+
|
|
79
|
+
logger.info("Creating %s (%s): %s", str(self.__class__), str(self), str(self.__dict__))
|
|
80
|
+
|
|
81
|
+
def is_multipart(self):
|
|
82
|
+
return self.total_parts != 1
|
|
83
|
+
|
|
84
|
+
# def __str__(self):
|
|
85
|
+
# return
|
|
86
|
+
|
|
87
|
+
@staticmethod
|
|
88
|
+
def aggregate_parts(parts):
|
|
89
|
+
"""
|
|
90
|
+
Helper function to take all the parts of a multipart upload and put
|
|
91
|
+
them into a format that's expected for the HTTP call.
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
completed_parts_payload = []
|
|
95
|
+
|
|
96
|
+
for part in parts:
|
|
97
|
+
completed_parts_payload.append({'partNumber': part.part,
|
|
98
|
+
'etag': part.etag}
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
return completed_parts_payload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ciocore
|
|
3
|
-
Version:
|
|
3
|
+
Version: 9.1.0b1
|
|
4
4
|
Summary: Core functionality for Conductor's client tools
|
|
5
5
|
Home-page: https://github.com/ConductorTechnologies/ciocore
|
|
6
6
|
Author: conductor
|
|
@@ -51,6 +51,12 @@ See [CONTRIBUTING](CONTRIBUTING.md)
|
|
|
51
51
|
|
|
52
52
|
## Changelog
|
|
53
53
|
|
|
54
|
+
## Unreleased:
|
|
55
|
+
* Adds required changes to parallelize multi-part uploads
|
|
56
|
+
* Cleans up the output when explicit paths are uploaded
|
|
57
|
+
* Fixes logic so managers doesn't erroneously try and call join a second time if cancelled
|
|
58
|
+
|
|
59
|
+
|
|
54
60
|
## Version:8.3.2 -- 01 Oct 2024
|
|
55
61
|
|
|
56
62
|
* Tweak to package order behavior for markdown package query
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
ciocore/VERSION,sha256=
|
|
1
|
+
ciocore/VERSION,sha256=TCUlj36m9-VV6atKK8EETx-2I8BQY_6CSKTVDGTHeqo,12
|
|
2
2
|
ciocore/__init__.py,sha256=aTP7LeeosQA8BZE67gDV4jgfTK5zxmwZRjiTRu_ZWj0,646
|
|
3
3
|
ciocore/api_client.py,sha256=SBxEwAiwn2XtH7T_ipefUbWhczXjoNdNbQBur1RV-Bw,32810
|
|
4
4
|
ciocore/cli.py,sha256=jZ1lOKQiUcrMhsVmD9SVmPMFwHtgDF4SaoAf2-PBS54,15449
|
|
@@ -26,7 +26,7 @@ ciocore/docsite/index.html,sha256=NEK4HaX2yaetTajVtQuTmS9C5cPnkAtxgeKEj7wQ9t0,20
|
|
|
26
26
|
ciocore/docsite/logo.png,sha256=gArgFFWdw8w985-0TkuGIgU_pW9sziEMZdqytXb5WLo,2825
|
|
27
27
|
ciocore/docsite/objects.inv,sha256=XwmLactPEWWC4fAWqHNPBXGsluRxLLTrwDLQqq51ONY,775
|
|
28
28
|
ciocore/docsite/sitemap.xml,sha256=M_V85zl0y2adRvzJAnoCxlZH_Hl7TLnIb1A-6l_xGmI,109
|
|
29
|
-
ciocore/docsite/sitemap.xml.gz,sha256=
|
|
29
|
+
ciocore/docsite/sitemap.xml.gz,sha256=mThGdpcFPBqhVOOM7T3lZOZMuSVSoDrSjqxs4psAmeY,127
|
|
30
30
|
ciocore/docsite/apidoc/api_client/index.html,sha256=TvoSl4iqdXhBVfesDxe_sBPA6G-Jt1-gpWA40xXspa0,188372
|
|
31
31
|
ciocore/docsite/apidoc/apidoc/index.html,sha256=GOSvv6KZPOtgekgshRE4j7aDvJkkaiBQLwA_By9J94g,26171
|
|
32
32
|
ciocore/docsite/apidoc/config/index.html,sha256=WDqy4MLR3EMp9T_2-Z9Op61rTFkvb0aTWmtjiR8sbjA,72559
|
|
@@ -95,7 +95,8 @@ ciocore/downloader/perpetual_downloader.py,sha256=cD7lnBH75-c-ZVVPHZc1vSnDhgJOnG
|
|
|
95
95
|
ciocore/downloader/registry.py,sha256=_JIOuqpWkJkgJGN33nt-DCvqN9Gw3xeFhzPq4RUxIoE,2903
|
|
96
96
|
ciocore/downloader/reporter.py,sha256=p1NK9k6iQ-jt7lRvZR0xFz0cGb2yo8tQcjlvYKR9SWM,4501
|
|
97
97
|
ciocore/uploader/__init__.py,sha256=hxRFJf5Lo86rtRObFXSjjot8nybQd-SebSfYCbgZwow,24
|
|
98
|
-
ciocore/uploader/_uploader.py,sha256=
|
|
98
|
+
ciocore/uploader/_uploader.py,sha256=Xz1sos76FK-BKsgPuErlKQ8HsCAtBKp3pLbCtRVrr9E,38250
|
|
99
|
+
ciocore/uploader/thread_queue_job.py,sha256=MzOcetttfWtDfwy-M0_ARwUf8_OjaGjyy-dA_WgNTPE,3416
|
|
99
100
|
ciocore/uploader/upload_stats/__init__.py,sha256=Lg1y4zq1i0cwc6Hh2K1TAQDYymLff49W-uIo1xjcvdI,5309
|
|
100
101
|
ciocore/uploader/upload_stats/stats_formats.py,sha256=giNirtObU66VALWghPFSRhg3q_vw5MvESsnXhb_I3y8,2402
|
|
101
102
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -121,8 +122,8 @@ tests/test_uploader.py,sha256=B1llTJt_fqR6e_V_Jxfw9z73QgkFlEPU87xLYGzt-TQ,2914
|
|
|
121
122
|
tests/test_validator.py,sha256=2fY66ayNc08PGyj2vTI-V_1yeCWJDngkj2zkUM5TTCI,1526
|
|
122
123
|
tests/mocks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
123
124
|
tests/mocks/glob.py,sha256=J2MH7nqi6NJOHuGdVWxhfeBd700_Ckj6cLh_8jSNkfg,215
|
|
124
|
-
ciocore-
|
|
125
|
-
ciocore-
|
|
126
|
-
ciocore-
|
|
127
|
-
ciocore-
|
|
128
|
-
ciocore-
|
|
125
|
+
ciocore-9.1.0b1.dist-info/METADATA,sha256=jd_61cbX9eiHy2SgX19hXCdf-gqvcvaOJP_gOwZVG-M,19085
|
|
126
|
+
ciocore-9.1.0b1.dist-info/WHEEL,sha256=qUzzGenXXuJTzyjFah76kDVqDvnk-YDzY00svnrl84w,109
|
|
127
|
+
ciocore-9.1.0b1.dist-info/entry_points.txt,sha256=cCqcALMYbC4d8545V9w0Zysfg9MVuKWhzDQ2er4UfGE,47
|
|
128
|
+
ciocore-9.1.0b1.dist-info/top_level.txt,sha256=SvlM5JlqULzAz00JZWfiUhfjhqDzYzSWssA87zdJl0o,14
|
|
129
|
+
ciocore-9.1.0b1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|