|
15 | 15 |
|
16 | 16 | class MultipartEncoder(object): |
17 | 17 | def __init__(self, fields): |
18 | | - s3_encoder = encoder.MultipartEncoder(fields=fields) |
19 | | - self.monitor = encoder.MultipartEncoderMonitor(s3_encoder, callback=self._create_callback(s3_encoder)) |
| 18 | + mp_encoder = encoder.MultipartEncoder(fields=fields) |
| 19 | + self.monitor = encoder.MultipartEncoderMonitor(mp_encoder, callback=self._create_callback(mp_encoder)) |
20 | 20 |
|
21 | 21 | def get_monitor(self): |
22 | 22 | return self.monitor |
@@ -103,9 +103,14 @@ def handle(self, input_data): |
103 | 103 | if workspace_url: |
104 | 104 | return # nothing to do |
105 | 105 |
|
| 106 | + # Should be removed as soon it won't be necessary by PS_API |
| 107 | + if workspace_path == 'none': |
| 108 | + return 'none' |
106 | 109 | if workspace_archive: |
107 | 110 | archive_path = os.path.abspath(workspace_archive) |
108 | 111 | else: |
| 112 | + self.logger.log('Archiving your working directory for upload as your experiment workspace...' |
| 113 | + '(See https://docs.paperspace.com/gradient/experiments/run-experiments for more information.)') |
109 | 114 | archive_path = self._zip_workspace(workspace_path, ignore_files) |
110 | 115 | self.archive_path = archive_path |
111 | 116 | self.archive_basename = os.path.basename(archive_path) |
@@ -137,21 +142,9 @@ def __init__(self, experiments_api, logger=None): |
137 | 142 | self.experiments_api = experiments_api |
138 | 143 |
|
139 | 144 | def handle(self, input_data): |
140 | | - workspace_archive, workspace_path, workspace_url = self._validate_input(input_data) |
141 | | - ignore_files = input_data.get('ignore_files') |
142 | | - |
143 | | - if workspace_url: |
144 | | - return # nothing to do |
145 | | - |
146 | | - # Should be removed as soon it won't be necessary by PS_API |
147 | | - if workspace_path == 'none': |
148 | | - return 'none' |
149 | | - if workspace_archive: |
150 | | - archive_path = os.path.abspath(workspace_archive) |
151 | | - else: |
152 | | - self.logger.log('Archiving your working directory for upload as your experiment workspace...' |
153 | | - '(See https://docs.paperspace.com/gradient/experiments/run-experiments for more information.)') |
154 | | - archive_path = self._zip_workspace(workspace_path, ignore_files) |
| 145 | + archive_path = super(S3WorkspaceHandler, self).handle(input_data) |
| 146 | + if archive_path in ['none', None]: |
| 147 | + return archive_path |
155 | 148 |
|
156 | 149 | file_name = os.path.basename(archive_path) |
157 | 150 | project_handle = input_data['projectHandle'] |
|
0 commit comments