_run_parameters.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #
  2. # Copyright 2019 The FATE Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. from ._base import BaseEntity
  17. class RunParameters(BaseEntity):
  18. def __init__(self, **kwargs):
  19. self.job_type = "train"
  20. self.inheritance_info = {} # job_id, component_list
  21. self.computing_engine = None
  22. self.federation_engine = None
  23. self.storage_engine = None
  24. self.engines_address = {}
  25. self.federated_mode = None
  26. self.federation_info = None
  27. self.task_cores = None
  28. self.task_parallelism = None
  29. self.computing_partitions = None
  30. self.federated_status_collect_type = None
  31. self.federated_data_exchange_type = None # not use in v1.5.0
  32. self.model_id = None
  33. self.model_version = None
  34. self.dsl_version = None
  35. self.auto_retries = None
  36. self.auto_retry_delay = None
  37. self.timeout = None
  38. self.eggroll_run = {}
  39. self.spark_run = {}
  40. self.rabbitmq_run = {}
  41. self.pulsar_run = {}
  42. self.adaptation_parameters = {}
  43. self.assistant_role = None
  44. self.map_table_name = None
  45. self.map_namespace = None
  46. for k, v in kwargs.items():
  47. if hasattr(self, k):
  48. setattr(self, k, v)
  49. def to_dict(self):
  50. d = {}
  51. for k, v in self.__dict__.items():
  52. if v is None:
  53. continue
  54. d[k] = v
  55. return d
  56. def __str__(self):
  57. return str(self.to_dict())