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 TypeMethodDescriptionbatchAllocation(Boolean batchAllocation) Enables the batch allocation of tasks to nodes.Builds the object without enforcing validation constraints.disablePreallocation(Boolean disablePreallocation) If true, tasks are only allocated to nodes as workers become idle and are not queued on the node.exclusiveWorkers(Boolean exclusiveWorkers) If true, then do not allow claimed Workers to be shared with other task groups; otherwise, Workers can be shared.instanceType(@NotBlank String instanceType) instanceTypes(Collection<? extends @NotBlank String> instanceTypes) maximumTaskRetries(int maximumTaskRetries) The maximum number of times a task can be retried after it has failed.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 associated TaskGroup requires.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) retryableErrors(Collection<? extends TaskErrorMatcher> retryableErrors) 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, validate
-
Method Details
-
instanceType
-
instanceTypes
-
clearInstanceTypes
-
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 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- 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.- Parameters:
tasksPerWorker- how many unfinished tasks per worker to determine the number of worker claims- Returns:
this.
-
exclusiveWorkers
If true, then do not allow claimed Workers to be shared with other task groups; otherwise, Workers can be shared.- Parameters:
exclusiveWorkers- if true, then do not allow claimed Workers to be shared with other task groups; otherwise, Workers can be shared- Returns:
this.
-
maximumTaskRetries
The maximum number of times a task can be retried after it has failed.- 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
-
retryableErrors
public RunSpecification.Builder retryableErrors(Collection<? extends TaskErrorMatcher> retryableErrors) -
clearRetryableErrors
-
batchAllocation
Enables the batch allocation of tasks to nodes. Nodes will maintain local task queues and request batches of tasks as these queues are drained by workers. This can increase throughput for short-running tasks by reducing the latency between a worker completing a task and starting the next one. It can also enable larger numbers of workers to be efficiently utilised by reducing overall load on the YellowDog Scheduler service.- Parameters:
batchAllocation- true to enable batch allocation of tasks; otherwise, false, the default, to enable single allocation of tasks- Returns:
this.
-
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.
-
buildUnchecked
Description copied from class:ValidatedBuilderBuilds the object without enforcing validation constraints. This should only be used for testing purposes- Overrides:
buildUncheckedin classValidatedBuilder<RunSpecification>- Returns:
- the object being built
-
toString
-