Class RunSpecification.Builder
java.lang.Object
co.yellowdog.platform.model.builders.ValidatedBuilder<RunSpecification>
co.yellowdog.platform.model.RunSpecification.Builder
- Enclosing class:
RunSpecification
A builder that can be used to build a new RunSpecification that is automatically validated on build.
-
Method Summary
Modifier and TypeMethodDescriptionBuilds the object without enforcing validation constraints.Deprecated.disablePreallocation(Boolean disablePreallocation) If true, tasks are only allocated to nodes as workers become idle and are not queued on the node.failurePolicy(FailurePolicy failurePolicy) An optionalFailurePolicyforTasks.instancePricingPreference(InstancePricingPreference instancePricingPreference) The preferredInstancePricingof the machine instances to use.instanceType(@NotBlank String instanceType) instanceTypes(Collection<? extends @NotBlank String> instanceTypes) maximumTaskRetries(Integer maximumTaskRetries) Deprecated.maxWorkers(Integer maxWorkers) The maximum number of Workers that can be claimed for the associated TaskGroup.minWorkers(Integer minWorkers) The minimum number of Workers that the YellowDog Scheduler aims to keep claimed for the associated TaskGroup while it isTaskGroupStatus.RUNNING.namespace(@NotBlank @Namespace String namespace) namespaces(Collection<? extends @NotBlank @Namespace String> namespaces) provider(@NotNull CloudProvider provider) providers(Collection<? extends @NotNull CloudProvider> providers) ram(DoubleRange ram) Range constraint on GB of RAM that are required to execute tasksregions(Collection<? extends @NotBlank String> regions) retryableError(TaskErrorMatcher retryableError) Deprecated.retryableErrors(Collection<? extends TaskErrorMatcher> retryableErrors) Deprecated.retryPolicy(RetryPolicy retryPolicy) ARetryPolicyforTasks.tasksPerWorker(Integer tasksPerWorker) Determines the number of worker claims based on splitting the number of unfinished tasks across workers.taskTimeout(Duration taskTimeout) The maximum time that a worker should attempt to execute a task for before failing it.taskTypes(Collection<? extends @NotBlank String> taskTypes) toString()vcpus(DoubleRange vcpus) Range constraint on number of vCPUs that are required to execute tasksworkerTags(Collection<? extends @NotBlank @Size(max=200) String> workerTags) Methods inherited from class ValidatedBuilder
build, validateModifier and TypeMethodDescriptionbuild()Builds and validates the object.Set<jakarta.validation.ConstraintViolation<RunSpecification>> validate()Performs validation based on the current builder properties and returns the ConstraintViolations without throwing.
-
Method Details
-
instanceType
-
instanceTypes
-
clearInstanceTypes
-
instancePricingPreference
public RunSpecification.Builder instancePricingPreference(InstancePricingPreference instancePricingPreference) The preferredInstancePricingof the machine instances to use.- Parameters:
instancePricingPreference- the preferredInstancePricingof the machine instances to use- Returns:
this.
-
vcpus
Range constraint on number of vCPUs that are required to execute tasks- Parameters:
vcpus- range constraint on required number of vCPUs- Returns:
this.
-
ram
Range constraint on GB of RAM that are required to execute tasks- Parameters:
ram- range constraint on GB of RAM- Returns:
this.
-
taskType
-
taskTypes
-
clearTaskTypes
-
minWorkers
The minimum number of Workers that the YellowDog Scheduler aims to keep claimed for the associated TaskGroup while it isTaskGroupStatus.RUNNING. This does not delay the TaskGroup starting, and is no longer applied once the TaskGroup isTaskGroupStatus.FINISHING.- Parameters:
minWorkers- defines the minimum number of Workers required- Returns:
this.
-
maxWorkers
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- Returns:
this.
-
tasksPerWorker
Determines the number of worker claims based on splitting the number of unfinished tasks across workers. This is only used until the YellowDog Scheduler has estimated how long the associated TaskGroup's tasks take, after which claims are sized from that estimate instead.- Parameters:
tasksPerWorker- how many unfinished tasks per worker to determine the number of worker claims- Returns:
this.
-
maximumTaskRetries
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- Returns:
this.
-
taskTimeout
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- Returns:
this.
-
provider
-
providers
-
clearProviders
-
region
-
regions
-
clearRegions
-
workerTag
public RunSpecification.Builder workerTag(@NotBlank @Size(max=200) @NotBlank @Size(max=200) String workerTag) -
workerTags
public RunSpecification.Builder workerTags(Collection<? extends @NotBlank @Size(max=200) String> workerTags) -
clearWorkerTags
-
namespace
public RunSpecification.Builder namespace(@NotBlank @Namespace @NotBlank @Namespace String namespace) -
namespaces
public RunSpecification.Builder namespaces(Collection<? extends @NotBlank @Namespace String> namespaces) -
clearNamespaces
-
retryableError
Deprecated. -
retryableErrors
@Deprecated public RunSpecification.Builder retryableErrors(Collection<? extends TaskErrorMatcher> retryableErrors) Deprecated. -
clearRetryableErrors
Deprecated. -
disablePreallocation
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- Returns:
this.
-
retryPolicy
ARetryPolicyforTasks. This must not be used in combination with the deprecatedretryableErrorsormaximumTaskRetries.- Parameters:
retryPolicy- Policy describing howTasks should be retried, can be null ifTasks should not be retried using theRetryPolicy- Returns:
this.
-
failurePolicy
An optionalFailurePolicyforTasks.- Parameters:
failurePolicy- policy describing what to do when aTaskfails, can be null if no further actions should be taken.- Returns:
this.
-
buildUnchecked
Description copied from class:ValidatedBuilderBuilds the object without enforcing validation constraints. Use this when the object is validated later, for example as part of an enclosing object built withValidatedBuilder.build(), or when it does not need to be valid on its own.- Overrides:
buildUncheckedin classValidatedBuilder<RunSpecification>- Returns:
- the object being built
-
toString
-
retryPolicyinstead