JobSpecification¶
A specification of a Job
data class JobSpecification(
    val application: NameAndVersion,
    val product: ProductReference,
    val name: String?,
    val replicas: Int?,
    val allowDuplicateJob: Boolean?,
    val parameters: JsonObject?,
    val resources: List<AppParameterValue>?,
    val timeAllocation: SimpleDuration?,
    val openedFile: String?,
    val restartOnExit: Boolean?,
    val sshEnabled: Boolean?,
)
Properties
application: NameAndVersion
NameAndVersion
product: ProductReference
ProductReference
name: String?
String?The name can help a user identify why and with which parameters a job was started. This value is suitable for display in user interfaces.
replicas: Int?
Int?The resources supplied will be mounted in every replica. Some resources might only be supported in an ‘exclusive use’ mode. This will cause the job to fail if replicas != 1.
allowDuplicateJob: Boolean?
Boolean?By default, UCloud will prevent you from accidentally starting two jobs with identical configuration. This field must be set to true to allow you to create two jobs with identical configuration.
parameters: JsonObject?
JsonObject?The available parameters are defined by the application. This attribute is not included by default unless includeParameters is specified.
resources: List<AppParameterValue>?
List<AppParameterValue>?This attribute is not included by default unless includeParameters is specified. Note: Not all resources can be attached to a job. UCloud supports the following parameter types as resources:
- file
- peer
- network
- block_storage
- ingress
timeAllocation: SimpleDuration?
SimpleDuration?This value can be null which signifies that the job should not (automatically) expire. Note that some providers do not support null. When this value is not null it means that the job will be terminated, regardless of result, after the duration has expired. Some providers support extended this duration via the extend operation.
openedFile: String?
String?This value is null if the application is not launched using the “Open with…” feature. The value of this
is passed to the compute environment in a provider specific way. We encourage providers to expose this as
an environment variable named UCLOUD_OPEN_WITH_FILE containing the absolute path of the file (in the
current environment). Remember that this path is the UCloud path to the file and not the provider’s path.
restartOnExit: Boolean?
Boolean?Not all providers support this feature and the Job will be rejected if not supported. This information can also be queried through the product support feature.
If this flag is true then the Job will automatically be restarted when the provider notifies the
orchestrator about process termination. It is the responsibility of the orchestrator to notify the provider
about restarts. If the restarts are triggered by the provider, then the provider must not notify the
orchestrator about the termination. The orchestrator will trigger a new create request in a timely manner.
The orchestrator decides when to trigger a new create. For example, if a process is terminating often,
then the orchestrator might decide to wait before issuing a new create.
sshEnabled: Boolean?
Boolean?This flag can only be true of the application itself is marked as SSH enabled. When this flag is true, an SSH server will be started which allows the end-user direct access to the associated compute workload.