Documentation ¶
Index ¶
- Constants
- Variables
- func GetTestSupportedResourceTypes() []schedulerconfiguration.ResourceType
- func IntRange(a, b int) []int
- func MakeTestExecutor(executorId string, nodePools ...string) *schedulerobjects.Executor
- func MakeTestExecutorWithNodes(executorId string, nodes ...*schedulerobjects.Node) *schedulerobjects.Executor
- func MakeTestFloatingResourceTypes(config []schedulerconfiguration.FloatingResourceConfig) *floatingresources.FloatingResourceTypes
- func MakeTestQueue() *api.Queue
- func MakeTestQueue2() *api.Queue
- func MakeTestQueueCordoned() *api.Queue
- func MakeTestResourceListFactory() *internaltypes.ResourceListFactory
- func N16Cpu128GiJobs(queue string, priorityClassName string, n int) []*jobdb.Job
- func N1Cpu16GiJobs(queue string, priorityClassName string, n int) []*jobdb.Job
- func N1Cpu4GiJobs(queue string, priorityClassName string, n int) []*jobdb.Job
- func N1Cpu4GiJobsWithPrice(queue string, bidPrice float64, n int) []*jobdb.Job
- func N1CpuPodReqs(queue string, priority int32, n int) []*schedulerobjects.PodRequirements
- func N1GpuJobs(queue string, priorityClassName string, n int) []*jobdb.Job
- func N32Cpu256GiJobs(queue string, priorityClassName string, n int) []*jobdb.Job
- func N32CpuNodes(n int, priorities []int32) []*schedulerobjects.Node
- func N8GpuNodes(n int, priorities []int32) []*schedulerobjects.Node
- func NTainted32CpuNodes(n int, priorities []int32) []*schedulerobjects.Node
- func NewJob(jobId string, jobSet string, queue string, priority uint32, price float64, ...) *jobdb.Job
- func NewJobDb(resourceListFactory *internaltypes.ResourceListFactory) *jobdb.JobDb
- func NewJobDbWithJobs(jobs []*jobdb.Job) *jobdb.JobDb
- func Repeat[T any](v T, n int) []T
- func SingleQueuePriorityOne(name string) []*api.Queue
- func Test16Cpu128GiJob(queue string, priorityClassName string) *jobdb.Job
- func Test16Cpu128GiPodReqs(queue string, jobId ulid.ULID, priority int32) *schedulerobjects.PodRequirements
- func Test1Cpu16GiJob(queue string, priorityClassName string) *jobdb.Job
- func Test1Cpu16GiPodReqs(queue string, jobId ulid.ULID, priority int32) *schedulerobjects.PodRequirements
- func Test1Cpu4GiJob(queue string, priorityClassName string) *jobdb.Job
- func Test1Cpu4GiPodReqs(queue string, jobId ulid.ULID, priority int32) *schedulerobjects.PodRequirements
- func Test1GpuJob(queue string, priorityClassName string) *jobdb.Job
- func Test1GpuPodReqs(queue string, jobId ulid.ULID, priority int32) *schedulerobjects.PodRequirements
- func Test1Node32CoreExecutor(executorId string) *schedulerobjects.Executor
- func Test32Cpu256GiJob(queue string, priorityClassName string) *jobdb.Job
- func Test32Cpu256GiPodReqs(queue string, jobId ulid.ULID, priority int32) *schedulerobjects.PodRequirements
- func Test32CpuNode(priorities []int32) *schedulerobjects.Node
- func Test8GpuNode(priorities []int32) *schedulerobjects.Node
- func TestCluster() []*schedulerobjects.Node
- func TestJob(queue string, jobId ulid.ULID, priorityClassName string, ...) *jobdb.Job
- func TestNode(priorities []int32, resources map[string]resource.Quantity) *schedulerobjects.Node
- func TestNodeWithPool(pool string) *schedulerobjects.Node
- func TestPodReqs(queue string, jobId ulid.ULID, priority int32, requests v1.ResourceList) *schedulerobjects.PodRequirements
- func TestQueuedJobDbJob() *jobdb.Job
- func TestRunningJobDbJob(startTime int64) *jobdb.Job
- func TestSchedulingConfig() schedulerconfiguration.SchedulingConfig
- func TestSchedulingConfigWithPools(pools []schedulerconfiguration.PoolConfig) schedulerconfiguration.SchedulingConfig
- func TestTainted32CpuNode(priorities []int32) *schedulerobjects.Node
- func TestUnitReqs() *schedulerobjects.PodRequirements
- func UUIDFromInt(i uint64) uuid.UUID
- func WithAnnotationsJobs(annotations map[string]string, jobs []*jobdb.Job) []*jobdb.Job
- func WithGangAnnotationsJobs(jobs []*jobdb.Job) []*jobdb.Job
- func WithGlobalSchedulingRateLimiterConfig(maximumSchedulingRate float64, maximumSchedulingBurst int, ...) schedulerconfiguration.SchedulingConfig
- func WithIndexedNodeLabelsConfig(indexedNodeLabels []string, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
- func WithIndexedResourcesConfig(indexResources []schedulerconfiguration.ResourceType, ...) schedulerconfiguration.SchedulingConfig
- func WithIndexedTaintsConfig(indexedTaints []string, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
- func WithLabelsNodes(labels map[string]string, nodes []*schedulerobjects.Node) []*schedulerobjects.Node
- func WithLargeNodeTaint(node *schedulerobjects.Node) *schedulerobjects.Node
- func WithLastUpdateTimeExecutor(lastUpdateTime time.Time, executor *schedulerobjects.Executor) *schedulerobjects.Executor
- func WithMaxLookbackPerQueueConfig(n uint, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
- func WithMaxQueueLookbackConfig(maxQueueLookback uint, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
- func WithMaxUnacknowledgedJobsPerExecutorConfig(v uint, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
- func WithNodeAffinityJobs(nodeSelectorTerms []v1.NodeSelectorTerm, jobs []*jobdb.Job) []*jobdb.Job
- func WithNodeSelectorJob(selector map[string]string, job *jobdb.Job) *jobdb.Job
- func WithNodeSelectorJobs(selector map[string]string, jobs []*jobdb.Job) []*jobdb.Job
- func WithNodeUniformityGangAnnotationsJobs(jobs []*jobdb.Job, nodeUniformityLabel string) []*jobdb.Job
- func WithNodeUniformityLabelAnnotationJobs(label string, jobs []*jobdb.Job) []*jobdb.Job
- func WithPerPriorityLimitsConfig(limits map[string]map[string]float64, ...) schedulerconfiguration.SchedulingConfig
- func WithPerQueueSchedulingLimiterConfig(maximumPerQueueSchedulingRate float64, maximumPerQueueSchedulingBurst int, ...) schedulerconfiguration.SchedulingConfig
- func WithPools(jobs []*jobdb.Job, pools []string) []*jobdb.Job
- func WithPriorityJobs(priority uint32, jobs []*jobdb.Job) []*jobdb.Job
- func WithProtectedFractionOfFairShareConfig(v float64, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
- func WithRequestsJobs(rl schedulerobjects.ResourceList, jobs []*jobdb.Job) []*jobdb.Job
- func WithRoundLimitsConfig(limits map[string]float64, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
- func WithRoundLimitsPoolConfig(limits map[string]map[string]float64, ...) schedulerconfiguration.SchedulingConfig
- func WithUsedResourcesNodes(p int32, rl schedulerobjects.ResourceList, nodes []*schedulerobjects.Node) []*schedulerobjects.Node
- type MockIDProvider
- type MockPassiveClock
Constants ¶
View Source
const ( TestJobset = "testJobset" TestQueue = "testQueue" TestQueue1 = "testQueue1" TestQueue2 = "testQueue2" TestPool = "testPool" TestPool2 = "testPool2" AwayPool = "awayPool" TestHostnameLabel = "kubernetes.io/hostname" ClusterNameLabel = "cluster" PoolNameLabel = "pool" NodeTypeLabel = "nodetype" PriorityClass0 = "priority-0" PriorityClass1 = "priority-1" PriorityClass2 = "priority-2" PriorityClass2NonPreemptible = "priority-2-non-preemptible" PriorityClass3 = "priority-3" PriorityClass4PreemptibleAway = "armada-preemptible-away" PriorityClass5PreemptibleAwayLowPriority = "armada-preemptible-away-lower" PriorityClass6Preemptible = "armada-preemptible" )
Variables ¶
View Source
var ( TestResourceListFactory = MakeTestResourceListFactory() TestEmptyFloatingResources = MakeTestFloatingResourceTypes(nil) TestFloatingResources = MakeTestFloatingResourceTypes(TestFloatingResourceConfig) TestFloatingResourceConfig = []schedulerconfiguration.FloatingResourceConfig{ { Name: "test-floating-resource", Pools: []schedulerconfiguration.FloatingResourcePoolConfig{ { Name: "pool", Quantity: resource.MustParse("10"), }, }, }, } BaseTime, _ = time.Parse("2006-01-02T15:04:05.000Z", "2022-03-01T15:04:05.000Z") BasetimeProto = protoutil.ToTimestamp(BaseTime) TestPriorityClasses = map[string]types.PriorityClass{ PriorityClass0: {Priority: 0, Preemptible: true}, PriorityClass1: {Priority: 1, Preemptible: true}, PriorityClass2: {Priority: 2, Preemptible: true}, PriorityClass2NonPreemptible: {Priority: 2, Preemptible: false}, PriorityClass3: {Priority: 3, Preemptible: false}, PriorityClass4PreemptibleAway: {Priority: 30000, Preemptible: true, AwayNodeTypes: []types.AwayNodeType{{Priority: 29000, WellKnownNodeTypeName: "gpu"}, {Priority: 29000, WellKnownNodeTypeName: "large"}}}, PriorityClass5PreemptibleAwayLowPriority: {Priority: 30000, Preemptible: true, AwayNodeTypes: []types.AwayNodeType{{Priority: 28000, WellKnownNodeTypeName: "gpu"}, {Priority: 28000, WellKnownNodeTypeName: "large"}}}, PriorityClass6Preemptible: {Priority: 30000, Preemptible: true}, } TestDefaultPriorityClass = PriorityClass3 TestPriorities = []int32{0, 1, 2, 3} TestResources = []schedulerconfiguration.ResourceType{ {Name: "cpu", Resolution: resource.MustParse("1")}, {Name: "memory", Resolution: resource.MustParse("128Mi")}, {Name: "nvidia.com/gpu", Resolution: resource.MustParse("1")}, } TestResourceNames = slices.Map( TestResources, func(v schedulerconfiguration.ResourceType) string { return v.Name }, ) TestIndexedTaints = []string{"largeJobsOnly", "gpu"} TestIndexedNodeLabels = []string{"largeJobsOnly", "gpu", ClusterNameLabel, PoolNameLabel, NodeTypeLabel} TestWellKnownNodeTypes = []schedulerconfiguration.WellKnownNodeType{ { Name: "gpu", Taints: []v1.Taint{{Key: "gpu", Value: "true", Effect: v1.TaintEffectNoSchedule}}, }, { Name: "large", Taints: []v1.Taint{{Key: "largeJobsOnly", Value: "true", Effect: v1.TaintEffectNoSchedule}}, }, } TestNodeFactory = internaltypes.NewNodeFactory(TestIndexedTaints, TestIndexedNodeLabels, TestResourceListFactory) // SchedulingKeyGenerator to use in testing. // Has to be consistent since creating one involves generating a random key. // If this key isn't consistent, scheduling keys generated are not either. // We use the all-zeros key here to ensure scheduling keys are cosnsitent between tests. SchedulingKeyGenerator = schedulerobjects.NewSchedulingKeyGeneratorWithKey(make([]byte, 32)) // Used for job creation. JobDb = NewJobDb(TestResourceListFactory) )
Functions ¶
func GetTestSupportedResourceTypes ¶ added in v0.4.48
func GetTestSupportedResourceTypes() []schedulerconfiguration.ResourceType
func MakeTestExecutor ¶ added in v0.9.0
func MakeTestExecutor(executorId string, nodePools ...string) *schedulerobjects.Executor
func MakeTestExecutorWithNodes ¶ added in v0.14.0
func MakeTestExecutorWithNodes(executorId string, nodes ...*schedulerobjects.Node) *schedulerobjects.Executor
func MakeTestFloatingResourceTypes ¶ added in v0.8.7
func MakeTestFloatingResourceTypes(config []schedulerconfiguration.FloatingResourceConfig) *floatingresources.FloatingResourceTypes
func MakeTestQueue ¶ added in v0.4.29
func MakeTestQueue2 ¶ added in v0.9.8
func MakeTestQueueCordoned ¶ added in v0.9.8
func MakeTestResourceListFactory ¶ added in v0.4.48
func MakeTestResourceListFactory() *internaltypes.ResourceListFactory
func N16Cpu128GiJobs ¶ added in v0.3.79
func N1Cpu16GiJobs ¶ added in v0.3.79
func N1Cpu4GiJobs ¶ added in v0.3.79
func N1Cpu4GiJobsWithPrice ¶ added in v0.15.7
func N1CpuPodReqs ¶ added in v0.3.69
func N1CpuPodReqs(queue string, priority int32, n int) []*schedulerobjects.PodRequirements
func N32Cpu256GiJobs ¶ added in v0.3.79
func N32CpuNodes ¶ added in v0.3.69
func N32CpuNodes(n int, priorities []int32) []*schedulerobjects.Node
func N8GpuNodes ¶ added in v0.3.69
func N8GpuNodes(n int, priorities []int32) []*schedulerobjects.Node
func NTainted32CpuNodes ¶ added in v0.3.69
func NTainted32CpuNodes(n int, priorities []int32) []*schedulerobjects.Node
func NewJobDb ¶ added in v0.4.0
func NewJobDb(resourceListFactory *internaltypes.ResourceListFactory) *jobdb.JobDb
NewJobDb returns a new default jobDb with defaults to use in tests.
func SingleQueuePriorityOne ¶ added in v0.4.29
func Test16Cpu128GiJob ¶ added in v0.3.79
func Test16Cpu128GiPodReqs ¶ added in v0.3.79
func Test16Cpu128GiPodReqs(queue string, jobId ulid.ULID, priority int32) *schedulerobjects.PodRequirements
func Test1Cpu16GiJob ¶ added in v0.3.79
func Test1Cpu16GiPodReqs ¶ added in v0.3.79
func Test1Cpu16GiPodReqs(queue string, jobId ulid.ULID, priority int32) *schedulerobjects.PodRequirements
func Test1Cpu4GiJob ¶ added in v0.3.79
func Test1Cpu4GiPodReqs ¶ added in v0.3.79
func Test1Cpu4GiPodReqs(queue string, jobId ulid.ULID, priority int32) *schedulerobjects.PodRequirements
func Test1GpuJob ¶ added in v0.3.69
func Test1GpuPodReqs ¶ added in v0.3.69
func Test1GpuPodReqs(queue string, jobId ulid.ULID, priority int32) *schedulerobjects.PodRequirements
func Test1Node32CoreExecutor ¶ added in v0.3.69
func Test1Node32CoreExecutor(executorId string) *schedulerobjects.Executor
func Test32Cpu256GiJob ¶ added in v0.3.79
func Test32Cpu256GiPodReqs ¶ added in v0.3.79
func Test32Cpu256GiPodReqs(queue string, jobId ulid.ULID, priority int32) *schedulerobjects.PodRequirements
func Test32CpuNode ¶ added in v0.3.69
func Test32CpuNode(priorities []int32) *schedulerobjects.Node
func Test8GpuNode ¶ added in v0.3.69
func Test8GpuNode(priorities []int32) *schedulerobjects.Node
func TestCluster ¶
func TestCluster() []*schedulerobjects.Node
func TestJob ¶ added in v0.3.69
func TestJob(queue string, jobId ulid.ULID, priorityClassName string, req *schedulerobjects.PodRequirements) *jobdb.Job
func TestNodeWithPool ¶ added in v0.14.0
func TestNodeWithPool(pool string) *schedulerobjects.Node
func TestPodReqs ¶ added in v0.3.69
func TestPodReqs(queue string, jobId ulid.ULID, priority int32, requests v1.ResourceList) *schedulerobjects.PodRequirements
func TestQueuedJobDbJob ¶
func TestRunningJobDbJob ¶
func TestSchedulingConfig ¶
func TestSchedulingConfig() schedulerconfiguration.SchedulingConfig
func TestSchedulingConfigWithPools ¶ added in v0.14.0
func TestSchedulingConfigWithPools(pools []schedulerconfiguration.PoolConfig) schedulerconfiguration.SchedulingConfig
func TestTainted32CpuNode ¶ added in v0.3.69
func TestTainted32CpuNode(priorities []int32) *schedulerobjects.Node
func TestUnitReqs ¶
func TestUnitReqs() *schedulerobjects.PodRequirements
func UUIDFromInt ¶ added in v0.4.12
func WithAnnotationsJobs ¶
func WithGlobalSchedulingRateLimiterConfig ¶ added in v0.3.92
func WithGlobalSchedulingRateLimiterConfig(maximumSchedulingRate float64, maximumSchedulingBurst int, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
func WithIndexedNodeLabelsConfig ¶
func WithIndexedNodeLabelsConfig(indexedNodeLabels []string, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
func WithIndexedResourcesConfig ¶ added in v0.3.71
func WithIndexedResourcesConfig(indexResources []schedulerconfiguration.ResourceType, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
func WithIndexedTaintsConfig ¶
func WithIndexedTaintsConfig(indexedTaints []string, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
func WithLabelsNodes ¶
func WithLabelsNodes(labels map[string]string, nodes []*schedulerobjects.Node) []*schedulerobjects.Node
func WithLargeNodeTaint ¶ added in v0.14.0
func WithLargeNodeTaint(node *schedulerobjects.Node) *schedulerobjects.Node
func WithLastUpdateTimeExecutor ¶ added in v0.3.70
func WithLastUpdateTimeExecutor(lastUpdateTime time.Time, executor *schedulerobjects.Executor) *schedulerobjects.Executor
func WithMaxLookbackPerQueueConfig ¶
func WithMaxLookbackPerQueueConfig(n uint, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
func WithMaxQueueLookbackConfig ¶ added in v0.3.66
func WithMaxQueueLookbackConfig(maxQueueLookback uint, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
func WithMaxUnacknowledgedJobsPerExecutorConfig ¶ added in v0.3.78
func WithMaxUnacknowledgedJobsPerExecutorConfig(v uint, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
func WithNodeAffinityJobs ¶ added in v0.3.78
func WithNodeSelectorJob ¶ added in v0.3.78
func WithNodeSelectorJobs ¶
func WithNodeUniformityGangAnnotationsJobs ¶ added in v0.9.0
func WithNodeUniformityLabelAnnotationJobs ¶ added in v0.3.79
func WithPerPriorityLimitsConfig ¶
func WithPerPriorityLimitsConfig(limits map[string]map[string]float64, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
func WithPerQueueSchedulingLimiterConfig ¶ added in v0.3.92
func WithPerQueueSchedulingLimiterConfig(maximumPerQueueSchedulingRate float64, maximumPerQueueSchedulingBurst int, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
func WithPriorityJobs ¶ added in v0.3.90
func WithProtectedFractionOfFairShareConfig ¶ added in v0.3.78
func WithProtectedFractionOfFairShareConfig(v float64, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
func WithRequestsJobs ¶ added in v0.3.78
func WithRequestsJobs(rl schedulerobjects.ResourceList, jobs []*jobdb.Job) []*jobdb.Job
func WithRoundLimitsConfig ¶
func WithRoundLimitsConfig(limits map[string]float64, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
func WithRoundLimitsPoolConfig ¶ added in v0.3.66
func WithRoundLimitsPoolConfig(limits map[string]map[string]float64, config schedulerconfiguration.SchedulingConfig) schedulerconfiguration.SchedulingConfig
func WithUsedResourcesNodes ¶
func WithUsedResourcesNodes(p int32, rl schedulerobjects.ResourceList, nodes []*schedulerobjects.Node) []*schedulerobjects.Node
Types ¶
type MockIDProvider ¶ added in v0.11.0
type MockIDProvider struct {
// contains filtered or unexported fields
}
func NewMockIDProvider ¶ added in v0.11.0
func NewMockIDProvider() *MockIDProvider
func (*MockIDProvider) New ¶ added in v0.11.0
func (p *MockIDProvider) New() string
type MockPassiveClock ¶ added in v0.4.12
type MockPassiveClock struct {
// contains filtered or unexported fields
}
func NewMockPassiveClock ¶ added in v0.4.12
func NewMockPassiveClock() *MockPassiveClock
func (*MockPassiveClock) Now ¶ added in v0.4.12
func (p *MockPassiveClock) Now() time.Time
Click to show internal directories.
Click to hide internal directories.