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:
  • Method Details

    • builder

      public static RunSpecification.Builder builder()
    • toBuilder

      public RunSpecification.Builder toBuilder()
    • getInstanceTypes

      public List<@NotBlank String> getInstanceTypes()
      The machine instance types that can be used to execute tasks
      Returns:
      the machine instance types that can be used to execute tasks
    • getVcpus

      public DoubleRange getVcpus()
      Range constraint on number of vCPUs that are required to execute tasks
      Returns:
      range constraint on required number of vCPUs
    • getRam

      public DoubleRange getRam()
      Range constraint on GB of RAM that are required to execute tasks
      Returns:
      range constraint on GB of RAM
    • getTaskTypes

      public List<@NotBlank String> getTaskTypes()
      The task types that will be used in the associated TaskGroup.
      Returns:
      the task types that will be used
    • getMinWorkers

      public Integer 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

      public Integer 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

      public Integer 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
    • getExclusiveWorkers

      public Boolean getExclusiveWorkers()
      If true, then do not allow claimed Workers to be shared with other task groups; otherwise, Workers can be shared.
      Returns:
      if true, then do not allow claimed Workers to be shared with other task groups; otherwise, Workers can be shared
    • getMaximumTaskRetries

      public int getMaximumTaskRetries()
      The maximum number of times a task can be retried after it has failed.
      Returns:
      the maximum number of times a task can be retried after it has failed
    • getTaskTimeout

      public Duration 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

      public List<@NotNull CloudProvider> 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

      public List<@NotBlank String> getRegions()
      Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup in the specified regions.
      Returns:
      the regions in which tasks can be executed
    • getWorkerTags

      public List<@NotBlank @Size(max=200) String> getWorkerTags()
      Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup on workers with a matching tag value.
      Returns:
      the tag values that constrain an allowed workers' tag
    • getNamespaces

      public List<@NotBlank @Namespace String> 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

      public List<TaskErrorMatcher> getRetryableErrors()
      Defines the errors that should result in a task retrying if encountered.
      Returns:
      the list of task error matchers
    • getBatchAllocation

      public Boolean getBatchAllocation()
      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.
      Returns:
      true if batch allocation of tasks is enabled; otherwise, false, the default, for single allocation of tasks
    • getDisablePreallocation

      public Boolean 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
    • setInstanceTypes

      public void setInstanceTypes(List<@NotBlank String> instanceTypes)
      The machine instance types that can be used to execute tasks
      Parameters:
      instanceTypes - the machine instance types that can be used to execute tasks
    • setVcpus

      public void setVcpus(DoubleRange vcpus)
      Range constraint on number of vCPUs that are required to execute tasks
      Parameters:
      vcpus - range constraint on required number of vCPUs
    • setRam

      public void setRam(DoubleRange ram)
      Range constraint on GB of RAM that are required to execute tasks
      Parameters:
      ram - range constraint on GB of RAM
    • setTaskTypes

      public void setTaskTypes(List<@NotBlank String> taskTypes)
      The task types that will be used in the associated TaskGroup.
      Parameters:
      taskTypes - the task types that will be used
    • setMinWorkers

      public void setMinWorkers(Integer 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
    • setMaxWorkers

      public void setMaxWorkers(Integer 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
    • setTasksPerWorker

      public void setTasksPerWorker(Integer 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
    • setExclusiveWorkers

      public void setExclusiveWorkers(Boolean 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
    • setMaximumTaskRetries

      public void setMaximumTaskRetries(int 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
    • setTaskTimeout

      public void setTaskTimeout(Duration 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
    • setProviders

      public void setProviders(List<@NotNull CloudProvider> providers)
      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

      public void setRegions(List<@NotBlank String> regions)
      Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup in the specified regions.
      Parameters:
      regions - the regions in which tasks can be executed
    • setWorkerTags

      public void setWorkerTags(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.
      Parameters:
      workerTags - the tag values that constrain an allowed workers' tags
    • setNamespaces

      public void setNamespaces(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.
      Parameters:
      workerTags - the namespaces
    • setRetryableErrors

      public void setRetryableErrors(List<TaskErrorMatcher> retryableErrors)
      Defines the errors that should result in a task retrying if encountered.
      Parameters:
      retryableErrors - the list of task error matchers
    • setBatchAllocation

      public void setBatchAllocation(Boolean 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
    • setDisablePreallocation

      public void setDisablePreallocation(Boolean 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
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object