ads.opctl.backend package¶
Submodules¶
ads.opctl.backend.ads_dataflow module¶
- class ads.opctl.backend.ads_dataflow.DataFlowBackend(config: Dict)[source]¶
Bases:
Backend
Initialize a MLJobBackend object given config dictionary.
- Parameters:
config (dict) – dictionary of configurations
- init(uri: str | None = None, overwrite: bool = False, runtime_type: str | None = None, **kwargs: Dict) str | None [source]¶
Generates a starter YAML specification for a Data Flow Application.
- Parameters:
overwrite ((bool, optional). Defaults to False.) – Overwrites the result specification YAML if exists.
uri ((str, optional), Defaults to None.) – The filename to save the resulting specification template YAML.
runtime_type ((str, optional). Defaults to None.) – The resource runtime type.
**kwargs (Dict) – The optional arguments.
- Returns:
The YAML specification for the given resource if uri was not provided. None otherwise.
- Return type:
Union[str, None]
- class ads.opctl.backend.ads_dataflow.DataFlowOperatorBackend(config: Dict, operator_info: OperatorInfo | None = None)[source]¶
Bases:
DataFlowBackend
Backend class to run operator on Data Flow Application.
- runtime_config¶
The runtime config for the operator.
- Type:
(Dict)
- operator_config¶
The operator specification config.
- Type:
(Dict)
Instantiates the operator backend.
- Parameters:
config ((Dict)) – The configuration file containing operator’s specification details and execution section.
operator_info ((OperatorInfo, optional)) – The operator’s detailed information extracted from the operator.__init__ file. Will be extracted from the operator type in case if not provided.
- class ads.opctl.backend.ads_dataflow.DataFlowRuntimeFactory[source]¶
Bases:
RuntimeFactory
Data Flow runtime factory.
ads.opctl.backend.ads_ml_job module¶
- class ads.opctl.backend.ads_ml_job.JobRuntimeFactory[source]¶
Bases:
RuntimeFactory
Job runtime factory.
- class ads.opctl.backend.ads_ml_job.MLJobBackend(config: Dict)[source]¶
Bases:
Backend
Initialize a MLJobBackend object given config dictionary.
- Parameters:
config (dict) – dictionary of configurations
- init(uri: str | None = None, overwrite: bool = False, runtime_type: str | None = None, **kwargs: Dict) str | None [source]¶
Generates a starter YAML specification for a Data Science Job.
- Parameters:
overwrite ((bool, optional). Defaults to False.) – Overwrites the result specification YAML if exists.
uri ((str, optional), Defaults to None.) – The filename to save the resulting specification template YAML.
runtime_type ((str, optional). Defaults to None.) – The resource runtime type.
**kwargs (Dict) – The optional arguments.
- Returns:
The YAML specification for the given resource if uri was not provided. None otherwise.
- Return type:
Union[str, None]
- class ads.opctl.backend.ads_ml_job.MLJobDistributedBackend(config: Dict)[source]¶
Bases:
MLJobBackend
Initialize a MLJobDistributedBackend object given config dictionary.
- Parameters:
config (dict) – dictionary of configurations
- DIAGNOSTIC_COMMAND = 'python -m ads.opctl.diagnostics -t distributed'¶
- run(cluster_info, dry_run=False) None [source]¶
Creates Job Definition and starts main and worker jobruns from that job definition
The Job Definition will contain all the environment variables defined at the cluster/spec/config level, environment variables defined by the user at runtime/spec/env level and OCI__ derived from the yaml specification
The Job Run will have overrides provided by the user under cluster/spec/{main|worker}/config section and `OCI__MODE`={MASTER|WORKER} depending on the run type
- class ads.opctl.backend.ads_ml_job.MLJobOperatorBackend(config: Dict, operator_info: OperatorInfo | None = None)[source]¶
Bases:
MLJobBackend
Backend class to run operator on Data Science Jobs. Currently supported two scenarios:
Running operator within container runtime.
Running operator within python runtime.
- runtime_config¶
The runtime config for the operator.
- Type:
(Dict)
- operator_config¶
The operator specification config.
- Type:
(Dict)
- operator_info¶
The detailed information about the operator.
- Type:
OperatorInfo
Instantiates the operator backend.
- Parameters:
config ((Dict)) – The configuration file containing operator’s specification details and execution section.
operator_info ((OperatorInfo, optional)) – The operator’s detailed information extracted from the operator.__init__ file. Will be extracted from the operator type in case if not provided.
ads.opctl.backend.ads_ml_pipeline module¶
- class ads.opctl.backend.ads_ml_pipeline.PipelineBackend(config: Dict)[source]¶
Bases:
Backend
Initialize a MLPipeline object given config dictionary.
- Parameters:
config (dict) – dictionary of configurations
- init(uri: str | None = None, overwrite: bool = False, runtime_type: str | None = None, **kwargs: Dict) str | None [source]¶
Generates a starter YAML specification for an MLPipeline.
- Parameters:
overwrite ((bool, optional). Defaults to False.) – Overwrites the result specification YAML if exists.
uri ((str, optional), Defaults to None.) – The filename to save the resulting specification template YAML.
runtime_type ((str, optional). Defaults to None.) – The resource runtime type.
**kwargs (Dict) – The optional arguments.
- Returns:
The YAML specification for the given resource if uri was not provided. None otherwise.
- Return type:
Union[str, None]
ads.opctl.backend.base module¶
- class ads.opctl.backend.base.Backend(config: Dict)[source]¶
Bases:
object
Interface for backend
ads.opctl.backend.local module¶
- class ads.opctl.backend.local.LocalBackend(config: Dict)[source]¶
Bases:
Backend
Initialize a LocalBackend object with given config.
- Parameters:
config (dict) – dictionary of configurations
- class ads.opctl.backend.local.LocalBackendDistributed(config: Dict)[source]¶
Bases:
LocalBackend
Initialize a LocalBackendDistributed object with given config. This serves local single node(docker) testing for Distributed Tranining
- Parameters:
config (dict) – dictionary of configurations
- class ads.opctl.backend.local.LocalModelDeploymentBackend(config: Dict)[source]¶
Bases:
LocalBackend
Initialize a LocalModelDeploymentBackend object with given config.
- Parameters:
config (dict) – dictionary of configurations
- class ads.opctl.backend.local.LocalOperatorBackend(config: Dict | None, operator_info: OperatorInfo | None = None)[source]¶
Bases:
Backend
The local operator backend to execute operator in the local environment. Currently supported two scenarios:
Running operator within local conda environment.
Running operator within local container.
- runtime_config¶
The runtime config for the operator.
- Type:
(Dict)
- operator_config¶
The operator specification config.
- Type:
(Dict)
- operator_info¶
The detailed information about the operator.
- Type:
OperatorInfo
Instantiates the operator backend.
- Parameters:
config ((Dict)) – The configuration file containing operator’s specification details and execution section.
operator_info ((OperatorInfo, optional)) – The operator’s detailed information extracted from the operator.__init__ file. Will be extracted from the operator type in case if not provided.
- init(uri: str | None = None, overwrite: bool = False, runtime_type: str | None = None, **kwargs: Dict) str | None [source]¶
Generates a starter YAML specification for the operator local runtime.
- Parameters:
overwrite ((bool, optional). Defaults to False.) – Overwrites the result specification YAML if exists.
uri ((str, optional), Defaults to None.) – The filename to save the resulting specification template YAML.
runtime_type ((str, optional). Defaults to None.) – The resource runtime type.
**kwargs (Dict) – The optional arguments.
- Returns:
The YAML specification for the given resource if uri was not provided. None otherwise.
- Return type:
Union[str, None]
- class ads.opctl.backend.local.LocalPipelineBackend(config: Dict)[source]¶
Bases:
Backend
Initialize a LocalPipelineBackend object with given config.
- Parameters:
config (dict) – dictionary of configurations
- DEFAULT_PARALLEL_CONTAINER_MAXIMUM = 4¶
- DEFAULT_STATUS_POLL_INTERVAL_SECONDS = 5¶
- LOG_PREFIX = 'Local Pipeline:'¶