|
18 | 18 |
|
19 | 19 | class HttpTransportMixin(object):
|
20 | 20 | """HTTP operations transport."""
|
21 |
| - MAX_UPLOAD_SIZE = 1024 * 1024 * 150 |
22 |
| - |
23 | 21 | @property
|
24 | 22 | def session(self):
|
25 | 23 | if not hasattr(self, '_session'):
|
@@ -119,13 +117,23 @@ def upload(self,
|
119 | 117 | headers=None,
|
120 | 118 | session=None):
|
121 | 119 |
|
122 |
| - if files_size > self.MAX_UPLOAD_SIZE: |
| 120 | + if files_size > settings.WARN_UPLOAD_SIZE: |
| 121 | + logger.warning( |
| 122 | + "You are uploading %s, there's a hard limit of %s.\n" |
| 123 | + "If you have data files in the current directory, " |
| 124 | + "please make sure to add them to .polyaxonignore or " |
| 125 | + "add them directly to your data volume, or upload them " |
| 126 | + "separately using `polyaxon data` command and remove them from here.\n", |
| 127 | + self.format_sizeof(settings.WARN_UPLOAD_SIZE), |
| 128 | + self.format_sizeof(settings.MAX_UPLOAD_SIZE)) |
| 129 | + |
| 130 | + if files_size > settings.MAX_UPLOAD_SIZE: |
123 | 131 | raise PolyaxonShouldExitError(
|
124 | 132 | "Files too large to sync, please keep it under {}.\n"
|
125 | 133 | "If you have data files in the current directory, "
|
126 | 134 | "please add them directly to your data volume, or upload them "
|
127 | 135 | "separately using `polyaxon data` command and remove them from here.\n".format(
|
128 |
| - self.format_sizeof(self.MAX_UPLOAD_SIZE))) |
| 136 | + self.format_sizeof(settings.MAX_UPLOAD_SIZE))) |
129 | 137 |
|
130 | 138 | files = to_list(files)
|
131 | 139 | if json_data:
|
|
0 commit comments