_job.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 JobConfigurationBase(BaseEntity):
  18. def __init__(self, dsl=None, runtime_conf=None, **kwargs):
  19. self._dsl = dsl if dsl else kwargs.get("job_dsl")
  20. self._runtime_conf = runtime_conf if runtime_conf else kwargs.get("job_runtime_conf")
  21. @property
  22. def dsl(self):
  23. return self._dsl
  24. @property
  25. def runtime_conf(self):
  26. return self._runtime_conf
  27. class JobConfiguration(JobConfigurationBase):
  28. def __init__(self, dsl, runtime_conf, runtime_conf_on_party, train_runtime_conf, **kwargs):
  29. super().__init__(dsl, runtime_conf, **kwargs)
  30. self._runtime_conf_on_party = runtime_conf_on_party
  31. self._train_runtime_conf = train_runtime_conf
  32. @property
  33. def runtime_conf_on_party(self):
  34. return self._runtime_conf_on_party
  35. @property
  36. def train_runtime_conf(self):
  37. return self._train_runtime_conf