mirror of
https://github.com/clearml/clearml
synced 2025-02-07 13:23:40 +00:00
Fix clearml-task exit with error when failing to verify output_uri (output warning instead)
This commit is contained in:
parent
08f01967ce
commit
63c3e446a3
@ -168,16 +168,14 @@ class CreateAndPopulate(object):
|
||||
print('Cloning task {}'.format(self.base_task_id))
|
||||
task = Task.clone(source_task=self.base_task_id, project=Task.get_project_id(self.project_name))
|
||||
|
||||
if self.output_uri:
|
||||
task.output_uri = self.output_uri
|
||||
self._set_output_uri(task)
|
||||
else:
|
||||
# noinspection PyProtectedMember
|
||||
task = Task._create(
|
||||
task_name=self.task_name, project_name=self.project_name,
|
||||
task_type=self.task_type or Task.TaskTypes.training)
|
||||
|
||||
if self.output_uri:
|
||||
task.output_uri = self.output_uri
|
||||
self._set_output_uri(task)
|
||||
|
||||
# if there is nothing to populate, return
|
||||
if not any([
|
||||
@ -334,6 +332,15 @@ class CreateAndPopulate(object):
|
||||
self.task = task
|
||||
return task
|
||||
|
||||
def _set_output_uri(self, task):
|
||||
if self.output_uri:
|
||||
try:
|
||||
task.output_uri = self.output_uri
|
||||
except ValueError:
|
||||
getLogger().warning('Could not verify permission for output_uri: "{}"'.format(self.output_uri))
|
||||
# do not verify the output uri (it might not be valid when we are creating the Task)
|
||||
task.storage_uri = self.output_uri
|
||||
|
||||
def update_task_args(self, args=None):
|
||||
# type: (Optional[Union[Sequence[str], Sequence[Tuple[str, str]]]]) -> ()
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user