mirror of
https://github.com/clearml/clearml
synced 2025-05-07 06:14:31 +00:00
Fix pipeline steps with empty configuration should try and take it from code
This commit is contained in:
parent
2d7dde93e2
commit
103f68e3e1
@ -1928,7 +1928,7 @@ class PipelineController(object):
|
||||
self._task._set_configuration(
|
||||
name=self._config_section, config_type='dictionary',
|
||||
description="pipeline state: {}".format(hash_dict(pipeline_dag)),
|
||||
config_text=json.dumps(pipeline_dag, indent=2))
|
||||
config_text=json.dumps(pipeline_dag, indent=2), force=True)
|
||||
|
||||
def _update_progress(self):
|
||||
# type: () -> ()
|
||||
|
@ -2129,7 +2129,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
||||
|
||||
# Since we ae using forced update, make sure he task status is valid
|
||||
status = self._data.status if self._data and self._reload_skip_flag else self.data.status
|
||||
if status not in (tasks.TaskStatusEnum.created, tasks.TaskStatusEnum.in_progress):
|
||||
if not kwargs.pop("force", False) and status not in (tasks.TaskStatusEnum.created, tasks.TaskStatusEnum.in_progress):
|
||||
# the exception being name/comment that we can always change.
|
||||
if kwargs and all(
|
||||
k in ("name", "project", "comment", "tags", "system_tags", "runtime") for k in kwargs.keys()
|
||||
@ -2174,7 +2174,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
||||
self.data.script = script
|
||||
self._edit(script=script)
|
||||
|
||||
def _set_configuration(self, name, description=None, config_type=None, config_text=None, config_dict=None):
|
||||
def _set_configuration(self, name, description=None, config_type=None, config_text=None, config_dict=None, **kwargs):
|
||||
# type: (str, Optional[str], Optional[str], Optional[str], Optional[Union[Mapping, list]]) -> None
|
||||
"""
|
||||
Set Task configuration text/dict. Multiple configurations are supported.
|
||||
@ -2203,7 +2203,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
||||
configuration = self.data.configuration or {}
|
||||
configuration[name] = tasks.ConfigurationItem(
|
||||
name=name, value=a_config, description=description or None, type=config_type or None)
|
||||
self._edit(configuration=configuration)
|
||||
self._edit(configuration=configuration, **kwargs)
|
||||
|
||||
def _get_configuration_text(self, name):
|
||||
# type: (str) -> Optional[str]
|
||||
|
@ -1467,14 +1467,19 @@ class Task(_Task):
|
||||
# noinspection PyProtectedMember
|
||||
task._set_model_config(config_dict=config_dict)
|
||||
|
||||
if not running_remotely() or not (self.is_main_task() or self._is_remote_main_task()):
|
||||
def get_dev_config(configuration_):
|
||||
if multi_config_support:
|
||||
self._set_configuration(
|
||||
name=name, description=description, config_type='dictionary', config_dict=configuration)
|
||||
name=name, description=description, config_type="dictionary", config_dict=configuration_
|
||||
)
|
||||
else:
|
||||
self._set_model_config(config_dict=configuration)
|
||||
if isinstance(configuration, dict):
|
||||
configuration = ProxyDictPostWrite(self, _update_config_dict, **configuration)
|
||||
if isinstance(configuration_, dict):
|
||||
configuration_ = ProxyDictPostWrite(self, _update_config_dict, **configuration_)
|
||||
return configuration_
|
||||
|
||||
if not running_remotely() or not (self.is_main_task() or self._is_remote_main_task()):
|
||||
configuration = get_dev_config(configuration)
|
||||
else:
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
@ -1494,7 +1499,9 @@ class Task(_Task):
|
||||
config_type='dictionary', config_dict=configuration)
|
||||
return configuration
|
||||
|
||||
if isinstance(configuration, dict):
|
||||
if not remote_configuration:
|
||||
configuration = get_dev_config(configuration)
|
||||
elif isinstance(configuration, dict):
|
||||
configuration.clear()
|
||||
configuration.update(remote_configuration)
|
||||
configuration = ProxyDictPreWrite(False, False, **configuration)
|
||||
|
Loading…
Reference in New Issue
Block a user