Job
This class encapsulates and extends the ROS resource type ALIYUN::PAIDLC::Job, which is used to create a Machine Learning Platform for AI (PAI) job to run in a cluster.
Initializers
import ros_cdk_paidlc
ros_cdk_paidlc.Job(
scope: Construct,
id: str,
display_name: typing.Union[str, IResolvable],
job_specs: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, JobSpecsProperty]]],
job_type: typing.Union[str, IResolvable],
user_command: typing.Union[str, IResolvable],
workspace_id: typing.Union[str, IResolvable],
code_source: typing.Union[IResolvable, CodeSourceProperty] = None,
data_sources: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, DataSourcesProperty]]] = None,
envs: typing.Union[str, IResolvable] = None,
job_max_running_time_minutes: typing.Union[typing.Union[int, float], IResolvable] = None,
options: typing.Union[str, IResolvable] = None,
priority: typing.Union[typing.Union[int, float], IResolvable] = None,
resource_id: typing.Union[str, IResolvable] = None,
settings: typing.Union[IResolvable, typing.Mapping[typing.Any]] = None,
success_policy: typing.Union[str, IResolvable] = None,
thirdparty_lib_dir: typing.Union[str, IResolvable] = None,
thirdparty_libs: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None,
user_vpc: typing.Union[IResolvable, UserVpcProperty] = None,
enable_resource_property_constraint: bool = None
)
| Name | Type | Description |
|---|---|---|
scope |
ros_cdk_core.Construct |
No description. |
id |
str |
No description. |
display_name |
typing.Union[str, ros_cdk_core.IResolvable] |
Property displayName: The name of the task is as follows: The name length does not exceed 256 characters. |
job_specs |
typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, JobSpecsProperty]]] |
Property jobSpecs: Jobspecs describes various configurations of tasks during the mission, such as mirror address, start command, node resource statement, number of copies, etc. |
job_type |
typing.Union[str, ros_cdk_core.IResolvable] |
Property jobType: The type of job. |
user_command |
typing.Union[str, ros_cdk_core.IResolvable] |
Property userCommand: Start commands of all nodes in the task. |
workspace_id |
typing.Union[str, ros_cdk_core.IResolvable] |
Property workspaceId: Work space ID, how to get working space ID, see listworkSpaces. |
code_source |
typing.Union[ros_cdk_core.IResolvable, CodeSourceProperty] |
Property codeSource: The code source used in this task.Before the mission node starts, the DLC will automatically download the code configured in the code source, and mount to the local directory of the container. |
data_sources |
typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, DataSourcesProperty]]] |
Property dataSources: List of data source used for task operation. |
envs |
typing.Union[str, ros_cdk_core.IResolvable] |
Property envs: Environment variable configuration. |
job_max_running_time_minutes |
typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] |
Property jobMaxRunningTimeMinutes: The longest running time is running, and the unit is minutes. |
options |
typing.Union[str, ros_cdk_core.IResolvable] |
Property options: The additional configuration of this task can adjust some of the behavior of the mounting data source through this parameter.If the task has a data source that mounted the OSS type, you can cover the default parameters of the jinofs by configure the configuration of this parameter to fs.OSS.DOWNLOAD.CONCURRENCY = 4, fs.oss.download.queue.size = 16. |
priority |
typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] |
Property priority: The priority of the task, optional parameter, default value 1, the range of parameter values is 1 ~ 9.in: 1 is the minimum priority. 9 is the highest priority. |
resource_id |
typing.Union[str, ros_cdk_core.IResolvable] |
Property resourceId: Resource group ID, optional parameter. |
settings |
typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]] |
Property settings: Job settings. |
success_policy |
typing.Union[str, ros_cdk_core.IResolvable] |
Property successPolicy: The successful strategy of distributed multi -machine tasks is currently only supported by TensorFlow's multi -machine task. |
thirdparty_lib_dir |
typing.Union[str, ros_cdk_core.IResolvable] |
Property thirdpartyLibDir: The name folder of the Requirements.txt file is located; before each node runs the specified usercommand, PAI -DLC will take the requirements.txt file from the specified folder and call the PIP Install -R installation. |
thirdparty_libs |
typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] |
Property thirdpartyLibs: Python third-party library list to be installed. |
user_vpc |
typing.Union[ros_cdk_core.IResolvable, UserVpcProperty] |
Property userVpc: User VPC configuration. |
enable_resource_property_constraint |
bool |
No description. |
scopeRequired
- Type: ros_cdk_core.Construct
idRequired
- Type: str
display_nameRequired
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property displayName: The name of the task is as follows: The name length does not exceed 256 characters.
Allow numbers, letters, lower strokes (_), English period (.) And short horizontal lines (-).
job_specsRequired
- Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, JobSpecsProperty]]]
Property jobSpecs: Jobspecs describes various configurations of tasks during the mission, such as mirror address, start command, node resource statement, number of copies, etc.
The DLC task consists of different types of nodes. The same type of nodes have exactly the same configuration. This configuration is called a Jobspec. Jobspecs describes the configuration of all types of nodes and is the array of Jobspec.
job_typeRequired
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property jobType: The type of job.
Values: TFJob, PyTorchJob, XGBoostJob, OneFlowJob, ElasticBatch
user_commandRequired
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property userCommand: Start commands of all nodes in the task.
workspace_idRequired
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property workspaceId: Work space ID, how to get working space ID, see listworkSpaces.
code_sourceOptional
- Type: typing.Union[ros_cdk_core.IResolvable, CodeSourceProperty]
Property codeSource: The code source used in this task.Before the mission node starts, the DLC will automatically download the code configured in the code source, and mount to the local directory of the container.
data_sourcesOptional
- Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, DataSourcesProperty]]]
Property dataSources: List of data source used for task operation.
envsOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property envs: Environment variable configuration.
job_max_running_time_minutesOptional
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property jobMaxRunningTimeMinutes: The longest running time is running, and the unit is minutes.
optionsOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property options: The additional configuration of this task can adjust some of the behavior of the mounting data source through this parameter.If the task has a data source that mounted the OSS type, you can cover the default parameters of the jinofs by configure the configuration of this parameter to fs.OSS.DOWNLOAD.CONCURRENCY = 4, fs.oss.download.queue.size = 16.
priorityOptional
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property priority: The priority of the task, optional parameter, default value 1, the range of parameter values is 1 ~ 9.in: 1 is the minimum priority. 9 is the highest priority.
resource_idOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property resourceId: Resource group ID, optional parameter.
The parameter value is empty indicating that submitted to the public resource group. If the current working space has been bound to a proprietary resource group, you can specify the corresponding resource group ID here; how to create a proprietary resource group and inquire about the proprietary resource group ID, please refer to the preparation and management of the DLC resource group cluster.
settingsOptional
- Type: typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]]
Property settings: Job settings.
success_policyOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property successPolicy: The successful strategy of distributed multi -machine tasks is currently only supported by TensorFlow's multi -machine task.
ChiefWorker: When it is specified as this value, as long as the Chief's POD is successful, it is considered that the entire task is successful. All workers: All workers must be successful to think that the entire task is successful.
thirdparty_lib_dirOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property thirdpartyLibDir: The name folder of the Requirements.txt file is located; before each node runs the specified usercommand, PAI -DLC will take the requirements.txt file from the specified folder and call the PIP Install -R installation.
thirdparty_libsOptional
- Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]]
Property thirdpartyLibs: Python third-party library list to be installed.
user_vpcOptional
- Type: typing.Union[ros_cdk_core.IResolvable, UserVpcProperty]
Property userVpc: User VPC configuration.
enable_resource_property_constraintOptional
- Type: bool
Methods
| Name | Description |
|---|---|
to_string |
Returns a string representation of this construct. |
synthesize |
Allows this construct to emit artifacts into the cloud assembly during synthesis. |
add_condition |
No description. |
add_count |
No description. |
add_dependency |
No description. |
add_resource_desc |
No description. |
apply_removal_policy |
No description. |
get_att |
No description. |
set_metadata |
No description. |
to_string
def to_string() -> str
Returns a string representation of this construct.
synthesize
def synthesize(
session: ISynthesisSession
) -> None
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack and Asset
as they participate in synthesizing the cloud assembly.
- Type: ros_cdk_core.ISynthesisSession
The synthesis session.
add_condition
def add_condition(
condition: RosCondition
) -> None
- Type: ros_cdk_core.RosCondition
add_count
def add_count(
count: typing.Union[typing.Union[int, float], IResolvable]
) -> None
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
add_dependency
def add_dependency(
resource: Resource
) -> None
- Type: ros_cdk_core.Resource
add_resource_desc
def add_resource_desc(
desc: str
) -> None
- Type: str
apply_removal_policy
def apply_removal_policy(
policy: RemovalPolicy
) -> None
- Type: ros_cdk_core.RemovalPolicy
get_att
def get_att(
name: str
) -> IResolvable
- Type: str
set_metadata
def set_metadata(
key: str,
value: typing.Any
) -> None
- Type: str
- Type: typing.Any
Static Functions
| Name | Description |
|---|---|
is_construct |
Return whether the given object is a Construct. |
is_construct
import ros_cdk_paidlc
ros_cdk_paidlc.Job.is_construct(
x: typing.Any
)
Return whether the given object is a Construct.
- Type: typing.Any
Properties
| Name | Type | Description |
|---|---|---|
node |
ros_cdk_core.ConstructNode |
The construct tree node associated with this construct. |
ref |
str |
No description. |
stack |
ros_cdk_core.Stack |
The stack in which this resource is defined. |
resource |
ros_cdk_core.RosResource |
No description. |
attr_job_id |
ros_cdk_core.IResolvable |
Attribute JobId: The task ID created this time. |
nodeRequired
node: ConstructNode
- Type: ros_cdk_core.ConstructNode
The construct tree node associated with this construct.
refRequired
ref: str
- Type: str
stackRequired
stack: Stack
- Type: ros_cdk_core.Stack
The stack in which this resource is defined.
resourceOptional
resource: RosResource
- Type: ros_cdk_core.RosResource
attr_job_idRequired
attr_job_id: IResolvable
- Type: ros_cdk_core.IResolvable
Attribute JobId: The task ID created this time.