JobReleaseTask Class

  • java.lang.Object
    • com.microsoft.azure.batch.protocol.models.JobReleaseTask

public class JobReleaseTask

A Job Release task to run on job completion on any compute node where the job has run. The Job Release task runs when the job ends, because of one of the following: The user calls the Terminate Job API, or the Delete Job API while the job is still active, the job's maximum wall clock time constraint is reached, and the job is still active, or the job's Job Manager task completed, and the job is configured to terminate when the Job Manager completes. The Job Release task runs on each compute node where tasks of the job have run and the Job Preparation task ran and completed. If you reimage a compute node after it has run the Job Preparation task, and the job ends without any further tasks of the job running on that compute node (and hence the Job Preparation task does not re-run), then the Job Release task does not run on that node. If a compute node reboots while the Job Release task is still running, the Job Release task runs again when the compute node starts up. The job is not marked as complete until all Job Release tasks have completed. The Job Release task runs in the background. It does not occupy a scheduling slot; that is, it does not count towards the maxTasksPerNode limit specified on the pool.

Method Summary

Modifier and Type Method and Description
String commandLine()

Get the command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables).

TaskContainerSettings containerSettings()

Get when this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.

List<EnvironmentSetting> environmentSettings()

Get the environmentSettings value.

String id()

Get the ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other task in the job can have the same ID as the Job Release task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict).

Period maxWallClockTime()

Get the maxWallClockTime value.

List<ResourceFile> resourceFiles()

Get files listed under this element are located in the task's working directory.

Period retentionTime()

Get the default is 7 days, i.e. the task directory will be retained for 7 days unless the compute node is removed or the job is deleted.

UserIdentity userIdentity()

Get if omitted, the task runs as a non-administrative user unique to the task.

JobReleaseTask withCommandLine(String commandLine)

Set the command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables).

JobReleaseTask withContainerSettings(TaskContainerSettings containerSettings)

Set when this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.

JobReleaseTask withEnvironmentSettings(List<EnvironmentSetting> environmentSettings)

Set the environmentSettings value.

JobReleaseTask withId(String id)

Set the ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other task in the job can have the same ID as the Job Release task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict).

JobReleaseTask withMaxWallClockTime(Period maxWallClockTime)

Set the maxWallClockTime value.

JobReleaseTask withResourceFiles(List<ResourceFile> resourceFiles)

Set files listed under this element are located in the task's working directory.

JobReleaseTask withRetentionTime(Period retentionTime)

Set the default is 7 days, i.e. the task directory will be retained for 7 days unless the compute node is removed or the job is deleted.

JobReleaseTask withUserIdentity(UserIdentity userIdentity)

Set if omitted, the task runs as a non-administrative user unique to the task.

Method Details

commandLine

public String commandLine()

Get the command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables).

Returns:

the commandLine value

containerSettings

public TaskContainerSettings containerSettings()

Get when this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.

Returns:

the containerSettings value

environmentSettings

public List environmentSettings()

Get the environmentSettings value.

Returns:

the environmentSettings value

id

public String id()

Get the ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other task in the job can have the same ID as the Job Release task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict).

Returns:

the id value

maxWallClockTime

public Period maxWallClockTime()

Get the maxWallClockTime value.

Returns:

the maxWallClockTime value

resourceFiles

public List resourceFiles()

Get files listed under this element are located in the task's working directory.

Returns:

the resourceFiles value

retentionTime

public Period retentionTime()

Get the default is 7 days, i.e. the task directory will be retained for 7 days unless the compute node is removed or the job is deleted.

Returns:

the retentionTime value

userIdentity

public UserIdentity userIdentity()

Get if omitted, the task runs as a non-administrative user unique to the task.

Returns:

the userIdentity value

withCommandLine

public JobReleaseTask withCommandLine(String commandLine)

Set the command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables).

Parameters:

commandLine - the commandLine value to set

Returns:

the JobReleaseTask object itself.

withContainerSettings

public JobReleaseTask withContainerSettings(TaskContainerSettings containerSettings)

Set when this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.

Parameters:

containerSettings - the containerSettings value to set

Returns:

the JobReleaseTask object itself.

withEnvironmentSettings

public JobReleaseTask withEnvironmentSettings(List environmentSettings)

Set the environmentSettings value.

Parameters:

environmentSettings - the environmentSettings value to set

Returns:

the JobReleaseTask object itself.

withId

public JobReleaseTask withId(String id)

Set the ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other task in the job can have the same ID as the Job Release task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict).

Parameters:

id - the id value to set

Returns:

the JobReleaseTask object itself.

withMaxWallClockTime

public JobReleaseTask withMaxWallClockTime(Period maxWallClockTime)

Set the maxWallClockTime value.

Parameters:

maxWallClockTime - the maxWallClockTime value to set

Returns:

the JobReleaseTask object itself.

withResourceFiles

public JobReleaseTask withResourceFiles(List resourceFiles)

Set files listed under this element are located in the task's working directory.

Parameters:

resourceFiles - the resourceFiles value to set

Returns:

the JobReleaseTask object itself.

withRetentionTime

public JobReleaseTask withRetentionTime(Period retentionTime)

Set the default is 7 days, i.e. the task directory will be retained for 7 days unless the compute node is removed or the job is deleted.

Parameters:

retentionTime - the retentionTime value to set

Returns:

the JobReleaseTask object itself.

withUserIdentity

public JobReleaseTask withUserIdentity(UserIdentity userIdentity)

Set if omitted, the task runs as a non-administrative user unique to the task.

Parameters:

userIdentity - the userIdentity value to set

Returns:

the JobReleaseTask object itself.

Applies to