Class RunSpecification
java.lang.Object
co.yellowdog.platform.model.RunSpecification
- All Implemented Interfaces:
Serializable
@ValidatedBy(RunSpecificationValidator.class)
public class RunSpecification
extends Object
implements Serializable
Specifies the behaviours to be used by the YellowDog Scheduler when executing Tasks within the associated TaskGroup.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder that can be used to build a new RunSpecification that is automatically validated on build. -
Method Summary
Modifier and TypeMethodDescriptionstatic RunSpecification.Builderbuilder()protected booleanbooleanIf true, tasks are only allocated to nodes as workers become idle and are not queued on the node.An optionalFailurePolicyforTasks.The preferredInstancePricingof the machine instances to use.The machine instance types that can be used to execute tasksDeprecated.The maximum number of Workers that can be claimed for the associated TaskGroup.The minimum number of Workers that the associated TaskGroup requires.List<@NotBlank @Namespace String> Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup on nodes from worker pools in the specified namespaces.List<@NotNull CloudProvider> Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup on the specified providers.getRam()Range constraint on GB of RAM that are required to execute tasksConstrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup in the specified regions.Deprecated.UseretryPolicyinsteadARetryPolicyforTasks.Determines the number of worker claims based on splitting the number of unfinished tasks across workers.The maximum time that a worker should attempt to execute a task for before failing it.The task types that will be used in the associated TaskGroup.getVcpus()Range constraint on number of vCPUs that are required to execute tasksConstrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup on workers with a matching tag value.inthashCode()voidsetDisablePreallocation(Boolean disablePreallocation) If true, tasks are only allocated to nodes as workers become idle and are not queued on the node.voidsetFailurePolicy(FailurePolicy failurePolicy) An optionalFailurePolicyforTasks.voidsetInstancePricingPreference(InstancePricingPreference instancePricingPreference) The preferredInstancePricingof the machine instances to use.voidsetInstanceTypes(List<@NotBlank String> instanceTypes) The machine instance types that can be used to execute tasksvoidsetMaximumTaskRetries(Integer maximumTaskRetries) Deprecated.UseretryPolicyinsteadvoidsetMaxWorkers(Integer maxWorkers) The maximum number of Workers that can be claimed for the associated TaskGroup.voidsetMinWorkers(Integer minWorkers) The minimum number of Workers that the associated TaskGroup requires.voidsetNamespaces(List<@NotBlank @Namespace String> namespaces) Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup on nodes from worker pools in the specified namespaces.voidsetProviders(List<@NotNull CloudProvider> providers) Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup on the specified providers.voidsetRam(DoubleRange ram) Range constraint on GB of RAM that are required to execute tasksvoidsetRegions(List<@NotBlank String> regions) Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup in the specified regions.voidsetRetryableErrors(List<TaskErrorMatcher> retryableErrors) Deprecated.UseretryPolicyinsteadvoidsetRetryPolicy(RetryPolicy retryPolicy) ARetryPolicyforTasks.voidsetTasksPerWorker(Integer tasksPerWorker) Determines the number of worker claims based on splitting the number of unfinished tasks across workers.voidsetTaskTimeout(Duration taskTimeout) The maximum time that a worker should attempt to execute a task for before failing it.voidsetTaskTypes(List<@NotBlank String> taskTypes) The task types that will be used in the associated TaskGroup.voidsetVcpus(DoubleRange vcpus) Range constraint on number of vCPUs that are required to execute tasksvoidsetWorkerTags(List<@NotBlank @Size(max=200) String> workerTags) Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup on workers with a matching tag value.toString()
-
Method Details
-
builder
-
toBuilder
-
getInstanceTypes
-
getInstancePricingPreference
The preferredInstancePricingof the machine instances to use.- Returns:
- the preferred
InstancePricingof the machine instances to use
-
getVcpus
Range constraint on number of vCPUs that are required to execute tasks- Returns:
- range constraint on required number of vCPUs
-
getRam
Range constraint on GB of RAM that are required to execute tasks- Returns:
- range constraint on GB of RAM
-
getTaskTypes
-
getMinWorkers
The minimum number of Workers that the associated TaskGroup requires. This many workers must be claimed before the associated TaskGroup will start running.- Returns:
- defines the minimum number of Workers required
-
getMaxWorkers
The maximum number of Workers that can be claimed for the associated TaskGroup.- Returns:
- defines the maximum number of Workers that can be claimed
-
getTasksPerWorker
Determines the number of worker claims based on splitting the number of unfinished tasks across workers.- Returns:
- how many unfinished tasks per worker to determine the number of worker claims
-
getMaximumTaskRetries
Deprecated.UseretryPolicyinsteadThe maximum number of times a task can be retried after it has failed.To restrict which tasks can be retried based on the last error that was encountered, see
retryableErrors- Returns:
- the maximum number of times a task can be retried after it has failed
-
getTaskTimeout
The maximum time that a worker should attempt to execute a task for before failing it. NB: This value can be overridden on individual tasks when they are added.- Returns:
- the maximum time that a worker should attempt to execute a task for before failing it
-
getProviders
Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup on the specified providers.- Returns:
- the providers on which tasks can be executed
-
getRegions
-
getWorkerTags
-
getNamespaces
Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup on nodes from worker pools in the specified namespaces.- Returns:
- the namespaces
-
getRetryableErrors
Deprecated.UseretryPolicyinsteadDefines the errors that should result in a task retrying if encountered.- Returns:
- the list of task error matchers
-
getDisablePreallocation
If true, tasks are only allocated to nodes as workers become idle and are not queued on the node.- Returns:
- true, if tasks are only allocated to nodes as workers become idle; otherwise, false
-
getRetryPolicy
ARetryPolicyforTasks. This must not be used in combination with the deprecatedretryableErrors, this always overridesmaximumTaskRetries.- Returns:
- Policy describing how
Tasks should be retried, will be null ifTasks should not be retried using theRetryPolicy
-
getFailurePolicy
An optionalFailurePolicyforTasks.- Returns:
- Policy describing what to do when a
Taskfails, will be null if no further actions should be taken.
-
setInstanceTypes
-
setInstancePricingPreference
The preferredInstancePricingof the machine instances to use.- Parameters:
instancePricingPreference- the preferredInstancePricingof the machine instances to use
-
setVcpus
Range constraint on number of vCPUs that are required to execute tasks- Parameters:
vcpus- range constraint on required number of vCPUs
-
setRam
Range constraint on GB of RAM that are required to execute tasks- Parameters:
ram- range constraint on GB of RAM
-
setTaskTypes
-
setMinWorkers
The minimum number of Workers that the associated TaskGroup requires. This many workers must be claimed before the associated TaskGroup will start running.- Parameters:
minWorkers- defines the minimum number of Workers required
-
setMaxWorkers
The maximum number of Workers that can be claimed for the associated TaskGroup.- Parameters:
maxWorkers- defines the maximum number of Workers that can be claimed
-
setTasksPerWorker
Determines the number of worker claims based on splitting the number of unfinished tasks across workers.- Parameters:
tasksPerWorker- how many unfinished tasks per worker to determine the number of worker claims
-
setMaximumTaskRetries
Deprecated.UseretryPolicyinsteadThe maximum number of times a task can be retried after it has failed.To restrict which tasks can be retried based on the last error that was encountered, see
retryableErrors- Parameters:
maximumTaskRetries- the maximum number of times a task can be retried after it has failed
-
setTaskTimeout
The maximum time that a worker should attempt to execute a task for before failing it. NB: This value can be overridden on individual tasks when they are added.- Parameters:
taskTimeout- the maximum time that a worker should attempt to execute a task for before failing it
-
setProviders
Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup on the specified providers.- Parameters:
providers- the providers on which tasks can be executed
-
setRegions
-
setWorkerTags
-
setNamespaces
Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup on nodes from worker pools in the specified namespaces.- Parameters:
workerTags- the namespaces
-
setRetryableErrors
Deprecated.UseretryPolicyinsteadDefines the errors that should result in a task retrying if encountered.- Parameters:
retryableErrors- the list of task error matchers
-
setDisablePreallocation
If true, tasks are only allocated to nodes as workers become idle and are not queued on the node.- Parameters:
disablePreallocation- true, if tasks are only allocated to nodes as workers become idle; otherwise, false
-
setRetryPolicy
ARetryPolicyforTasks. This must not be used in combination with the deprecatedretryableErrors, this always overridesmaximumTaskRetries.- Parameters:
retryPolicy- Policy describing howTasks should be retried, can be null ifTasks should not be retried using theRetryPolicy
-
setFailurePolicy
An optionalFailurePolicyforTasks.- Parameters:
Policy- describing what to do when aTaskfails, can be null if no further actions should be taken.
-
equals
-
canEqual
-
hashCode
-
toString
-
retryPolicyinstead