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 Classes
    Modifier and Type
    Class
    Description
    static class 
    A builder that can be used to build a new RunSpecification that is automatically validated on build.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    protected boolean
     
    boolean
     
    If true, then do not allow claimed Workers to be shared with other task groups; otherwise, Workers can be shared.
    List<@NotBlank String>
    The machine instance types that can be used to execute tasks
    int
    The maximum number of times a task can be retried after it has failed.
    The maximum number of Workers that can be claimed for the associated TaskGroup.
    The minimum number of Workers that the associated TaskGroup requires.
    Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup on nodes from worker pools in the specified namespaces.
    Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup on the specified providers.
    Range constraint on GB of RAM that are required to execute tasks
    List<@NotBlank String>
    Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup in the specified regions.
    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.
    List<@NotBlank String>
    The task types that will be used in the associated TaskGroup.
    Range constraint on number of vCPUs that are required to execute tasks
    List<@NotBlank @Size(max=200) String>
    Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup on workers with a matching tag value.
    int
     
    void
    setExclusiveWorkers(Boolean exclusiveWorkers)
    If true, then do not allow claimed Workers to be shared with other task groups; otherwise, Workers can be shared.
    void
    setInstanceTypes(List<@NotBlank String> instanceTypes)
    The machine instance types that can be used to execute tasks
    void
    setMaximumTaskRetries(int maximumTaskRetries)
    The maximum number of times a task can be retried after it has failed.
    void
    setMaxWorkers(Integer maxWorkers)
    The maximum number of Workers that can be claimed for the associated TaskGroup.
    void
    setMinWorkers(Integer minWorkers)
    The minimum number of Workers that the associated TaskGroup requires.
    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.
    void
    setProviders(List<@NotNull CloudProvider> providers)
    Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup on the specified providers.
    void
    Range constraint on GB of RAM that are required to execute tasks
    void
    setRegions(List<@NotBlank String> regions)
    Constrains the YellowDog Scheduler to only execute tasks from the associated TaskGroup in the specified regions.
    void
    setTasksPerWorker(Integer tasksPerWorker)
    Determines the number of worker claims based on splitting the number of unfinished tasks across workers.
    void
    setTaskTimeout(Duration taskTimeout)
    The maximum time that a worker should attempt to execute a task for before failing it.
    void
    setTaskTypes(List<@NotBlank String> taskTypes)
    The task types that will be used in the associated TaskGroup.
    void
    Range constraint on number of vCPUs that are required to execute tasks
    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.
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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
    • 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
    • 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