From 723cf64d80b233baf47fa334d0742961938e185e Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Mon, 10 Feb 2025 19:28:52 +0000 Subject: [PATCH] Remove all non-resourcelist gogo annotations from schedulerobjects (#4189) * wip * converted to scheduling info * fix tests * resourceRequirements * tolerations * jobschedulinginfo timestamp * remove deterministic * executor update time * node last_seen * node taints * job run state * typo * fixes * fix merge conflict * deep copyjob_scheduling_info * lint * fix tests --- .golangci.yml | 2 +- internal/common/eventutil/eventutil.go | 2 +- internal/common/ingest/testfixtures/event.go | 11 +- internal/scheduler/adapters/adapters.go | 9 +- internal/scheduler/api.go | 10 +- internal/scheduler/api_test.go | 21 +- .../scheduler/database/executor_repository.go | 2 +- .../database/executor_repository_test.go | 16 +- .../scheduler/database/job_repository_test.go | 2 +- .../internaltypes/job_scheduling_info.go | 34 +- internal/scheduler/internaltypes/node.go | 9 +- .../podutils.go | 14 +- .../podutils_test.go | 237 +++++----- internal/scheduler/jobdb/job.go | 7 +- internal/scheduler/jobdb/job_run_test.go | 4 +- internal/scheduler/jobdb/jobdb.go | 7 +- internal/scheduler/jobdb/jobdb_test.go | 3 +- internal/scheduler/metrics.go | 7 +- internal/scheduler/scheduler.go | 5 +- .../schedulerobjects/schedulerobjects.pb.go | 404 ++++++++++-------- .../schedulerobjects/schedulerobjects.proto | 22 +- internal/scheduler/scheduling/context/job.go | 5 +- .../scheduling/context/scheduling.go | 11 +- .../scheduler/scheduling/gang_scheduler.go | 3 +- .../scheduling/gang_scheduler_test.go | 4 +- .../scheduler/scheduling/queue_scheduler.go | 3 +- .../scheduler/scheduling/scheduling_algo.go | 4 +- .../scheduling/scheduling_algo_test.go | 11 +- internal/scheduler/simulator/simulator.go | 10 +- internal/scheduler/simulator/simulator.pb.go | 205 ++++----- internal/scheduler/simulator/simulator.proto | 4 +- .../scheduler/simulator/simulator_test.go | 12 +- internal/scheduler/simulator/test_utils.go | 8 +- internal/scheduler/submitcheck_test.go | 2 +- .../scheduler/testfixtures/testfixtures.go | 2 +- internal/scheduleringester/instructions.go | 2 +- .../scheduleringester/instructions_test.go | 11 +- .../event/conversion/conversions_test.go | 2 +- pkg/api/util.go | 4 +- pkg/api/util_test.go | 8 +- pkg/executorapi/util.go | 20 +- 41 files changed, 603 insertions(+), 556 deletions(-) rename internal/scheduler/{schedulerobjects => internaltypes}/podutils.go (96%) rename internal/scheduler/{schedulerobjects => internaltypes}/podutils_test.go (65%) diff --git a/.golangci.yml b/.golangci.yml index b7d8b3f0d22..82b47d7f346 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,7 +2,7 @@ issues: max-issues-per-linter: 0 max-same-issues: 0 exclude-rules: - - path: internal/scheduler/schedulerobjects/podutils_test.go + - path: internal/scheduler/internaltypes/podutils_test.go linters: - lll diff --git a/internal/common/eventutil/eventutil.go b/internal/common/eventutil/eventutil.go index fa126b155e5..61c684bfb60 100644 --- a/internal/common/eventutil/eventutil.go +++ b/internal/common/eventutil/eventutil.go @@ -184,7 +184,7 @@ func ApiJobFromLogSubmitJob(ownerId string, groups []string, queueName string, j PodSpec: podSpec, PodSpecs: podSpecs, - SchedulingResourceRequirements: &schedulingResourceRequirements, + SchedulingResourceRequirements: schedulingResourceRequirements, Created: protoutil.ToTimestamp(time), Owner: ownerId, diff --git a/internal/common/ingest/testfixtures/event.go b/internal/common/ingest/testfixtures/event.go index 12358ce8e36..fcb3769b6bd 100644 --- a/internal/common/ingest/testfixtures/event.go +++ b/internal/common/ingest/testfixtures/event.go @@ -9,6 +9,7 @@ import ( "k8s.io/apimachinery/pkg/api/resource" protoutil "github.com/armadaproject/armada/internal/common/proto" + armadaslices "github.com/armadaproject/armada/internal/common/slices" "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" "github.com/armadaproject/armada/internal/scheduler/testfixtures" "github.com/armadaproject/armada/internal/server/configuration" @@ -167,7 +168,7 @@ var Leased = &armadaevents.EventSequence_Event{ ScheduledAtPriority: 15, UpdateSequenceNumber: 1, PodRequirementsOverlay: &schedulerobjects.PodRequirements{ - Tolerations: []v1.Toleration{ + Tolerations: []*v1.Toleration{ { Key: "whale", Value: "true", @@ -290,11 +291,13 @@ var JobRequeued = &armadaevents.EventSequence_Event{ { Requirements: &schedulerobjects.ObjectRequirements_PodRequirements{ PodRequirements: &schedulerobjects.PodRequirements{ - NodeSelector: NodeSelector, - Tolerations: Tolerations, + NodeSelector: NodeSelector, + Tolerations: armadaslices.Map(Tolerations, func(t v1.Toleration) *v1.Toleration { + return &t + }), PreemptionPolicy: "PreemptLowerPriority", Affinity: Affinity, - ResourceRequirements: v1.ResourceRequirements{ + ResourceRequirements: &v1.ResourceRequirements{ Limits: map[v1.ResourceName]resource.Quantity{ "memory": resource.MustParse("64Mi"), "cpu": resource.MustParse("150m"), diff --git a/internal/scheduler/adapters/adapters.go b/internal/scheduler/adapters/adapters.go index 68a08d58c66..8157afa71a0 100644 --- a/internal/scheduler/adapters/adapters.go +++ b/internal/scheduler/adapters/adapters.go @@ -4,6 +4,7 @@ import ( v1 "k8s.io/api/core/v1" k8sResource "k8s.io/apimachinery/pkg/api/resource" + armadaslices "github.com/armadaproject/armada/internal/common/slices" "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" "github.com/armadaproject/armada/pkg/api" ) @@ -17,9 +18,11 @@ func PodRequirementsFromPodSpec(podSpec *v1.PodSpec) *schedulerobjects.PodRequir preemptionPolicy = string(*podSpec.PreemptionPolicy) } return &schedulerobjects.PodRequirements{ - NodeSelector: podSpec.NodeSelector, - Affinity: podSpec.Affinity, - Tolerations: podSpec.Tolerations, + NodeSelector: podSpec.NodeSelector, + Affinity: podSpec.Affinity, + Tolerations: armadaslices.Map(podSpec.Tolerations, func(t v1.Toleration) *v1.Toleration { + return &t + }), PreemptionPolicy: preemptionPolicy, ResourceRequirements: api.SchedulingResourceRequirementsFromPodSpec(podSpec), } diff --git a/internal/scheduler/api.go b/internal/scheduler/api.go index 608faa82a85..0004141e9e7 100644 --- a/internal/scheduler/api.go +++ b/internal/scheduler/api.go @@ -4,6 +4,8 @@ import ( "context" "strconv" + protoutil "github.com/armadaproject/armada/internal/common/proto" + "github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/types" "github.com/pkg/errors" @@ -296,7 +298,7 @@ func addNodeSelector(podSpec *armadaevents.PodSpecWithAvoidList, key string, val } } -func addTolerations(job *armadaevents.SubmitJob, tolerations []v1.Toleration) { +func addTolerations(job *armadaevents.SubmitJob, tolerations []*v1.Toleration) { if job == nil || len(tolerations) == 0 { return } @@ -304,7 +306,9 @@ func addTolerations(job *armadaevents.SubmitJob, tolerations []v1.Toleration) { switch typed := job.MainObject.Object.(type) { case *armadaevents.KubernetesMainObject_PodSpec: if typed.PodSpec != nil && typed.PodSpec.PodSpec != nil { - typed.PodSpec.PodSpec.Tolerations = append(typed.PodSpec.PodSpec.Tolerations, tolerations...) + for _, toleration := range tolerations { + typed.PodSpec.PodSpec.Tolerations = append(typed.PodSpec.PodSpec.Tolerations, *toleration) + } } } } @@ -381,7 +385,7 @@ func (srv *ExecutorApi) executorFromLeaseRequest(ctx *armadacontext.Context, req Id: req.ExecutorId, Pool: req.Pool, Nodes: nodes, - LastUpdateTime: now, + LastUpdateTime: protoutil.ToTimestamp(now), UnassignedJobRuns: req.UnassignedJobRunIds, } } diff --git a/internal/scheduler/api_test.go b/internal/scheduler/api_test.go index 9094a48f55c..a05f9c083d3 100644 --- a/internal/scheduler/api_test.go +++ b/internal/scheduler/api_test.go @@ -18,9 +18,10 @@ import ( "github.com/armadaproject/armada/internal/common/armadaerrors" "github.com/armadaproject/armada/internal/common/auth/permission" "github.com/armadaproject/armada/internal/common/compress" - mocks "github.com/armadaproject/armada/internal/common/mocks" + "github.com/armadaproject/armada/internal/common/mocks" protoutil "github.com/armadaproject/armada/internal/common/proto" "github.com/armadaproject/armada/internal/common/slices" + armadaslices "github.com/armadaproject/armada/internal/common/slices" "github.com/armadaproject/armada/internal/common/types" "github.com/armadaproject/armada/internal/common/util" schedulerconfig "github.com/armadaproject/armada/internal/scheduler/configuration" @@ -29,7 +30,7 @@ import ( "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" "github.com/armadaproject/armada/internal/scheduler/testfixtures" "github.com/armadaproject/armada/internal/server/configuration" - mocks2 "github.com/armadaproject/armada/internal/server/mocks" + servermocks "github.com/armadaproject/armada/internal/server/mocks" "github.com/armadaproject/armada/internal/server/permissions" "github.com/armadaproject/armada/pkg/api" "github.com/armadaproject/armada/pkg/armadaevents" @@ -92,11 +93,11 @@ func TestExecutorApi_LeaseJobRuns(t *testing.T) { Resources: nil, }, }, - LastSeen: testClock.Now().UTC(), + LastSeen: protoutil.ToTimestamp(testClock.Now().UTC()), ReportingNodeType: "node-type-1", }, }, - LastUpdateTime: testClock.Now().UTC(), + LastUpdateTime: protoutil.ToTimestamp(testClock.Now().UTC()), UnassignedJobRuns: []string{runId3}, } @@ -181,7 +182,9 @@ func TestExecutorApi_LeaseJobRuns(t *testing.T) { SubmitMessage: compressedSubmit, PodRequirementsOverlay: protoutil.MustMarshall( &schedulerobjects.PodRequirements{ - Tolerations: tolerations, + Tolerations: armadaslices.Map(tolerations, func(t v1.Toleration) *v1.Toleration { + return &t + }), Annotations: map[string]string{configuration.PoolAnnotation: "test-pool", "runtime_gang_cardinality": "3"}, }, ), @@ -310,7 +313,7 @@ func TestExecutorApi_LeaseJobRuns(t *testing.T) { mockJobRepository := schedulermocks.NewMockJobRepository(ctrl) mockExecutorRepository := schedulermocks.NewMockExecutorRepository(ctrl) mockStream := schedulermocks.NewMockExecutorApi_LeaseJobRunsServer(ctrl) - mockAuthorizer := mocks2.NewMockActionAuthorizer(ctrl) + mockAuthorizer := servermocks.NewMockActionAuthorizer(ctrl) runIds, err := runIdsFromLeaseRequest(tc.request) require.NoError(t, err) @@ -377,7 +380,7 @@ func TestExecutorApi_LeaseJobRuns_Unauthorised(t *testing.T) { mockJobRepository := schedulermocks.NewMockJobRepository(ctrl) mockExecutorRepository := schedulermocks.NewMockExecutorRepository(ctrl) mockStream := schedulermocks.NewMockExecutorApi_LeaseJobRunsServer(ctrl) - mockAuthorizer := mocks2.NewMockActionAuthorizer(ctrl) + mockAuthorizer := servermocks.NewMockActionAuthorizer(ctrl) // set up mocks mockStream.EXPECT().Context().Return(ctx).AnyTimes() @@ -504,7 +507,7 @@ func TestExecutorApi_Publish(t *testing.T) { mockPulsarPublisher := mocks.NewMockPublisher[*armadaevents.EventSequence](ctrl) mockJobRepository := schedulermocks.NewMockJobRepository(ctrl) mockExecutorRepository := schedulermocks.NewMockExecutorRepository(ctrl) - mockAuthorizer := mocks2.NewMockActionAuthorizer(ctrl) + mockAuthorizer := servermocks.NewMockActionAuthorizer(ctrl) // capture all sent messages var capturedEvents []*armadaevents.EventSequence @@ -549,7 +552,7 @@ func TestExecutorApi_Publish_Unauthorised(t *testing.T) { mockPulsarPublisher := mocks.NewMockPublisher[*armadaevents.EventSequence](ctrl) mockJobRepository := schedulermocks.NewMockJobRepository(ctrl) mockExecutorRepository := schedulermocks.NewMockExecutorRepository(ctrl) - mockAuthorizer := mocks2.NewMockActionAuthorizer(ctrl) + mockAuthorizer := servermocks.NewMockActionAuthorizer(ctrl) sequences := []*armadaevents.EventSequence{ { diff --git a/internal/scheduler/database/executor_repository.go b/internal/scheduler/database/executor_repository.go index 433e21c7389..989a23936ae 100644 --- a/internal/scheduler/database/executor_repository.go +++ b/internal/scheduler/database/executor_repository.go @@ -90,7 +90,7 @@ func (r *PostgresExecutorRepository) StoreExecutor(ctx *armadacontext.Context, e err = queries.UpsertExecutor(ctx, UpsertExecutorParams{ ExecutorID: executor.Id, LastRequest: compressed, - UpdateTime: executor.LastUpdateTime, + UpdateTime: protoutil.ToStdTime(executor.LastUpdateTime), }) if err != nil { return errors.WithStack(err) diff --git a/internal/scheduler/database/executor_repository_test.go b/internal/scheduler/database/executor_repository_test.go index b31bd67caef..aea5f1927d0 100644 --- a/internal/scheduler/database/executor_repository_test.go +++ b/internal/scheduler/database/executor_repository_test.go @@ -10,11 +10,13 @@ import ( "golang.org/x/exp/slices" "github.com/armadaproject/armada/internal/common/armadacontext" + protoutil "github.com/armadaproject/armada/internal/common/proto" "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" ) func TestExecutorRepository_LoadAndSave(t *testing.T) { t1 := time.Now().UTC().Round(1 * time.Microsecond) // postgres only stores times with micro precision + t1Proto := protoutil.ToTimestamp(t1) tests := map[string]struct { executors []*schedulerobjects.Executor }{ @@ -26,10 +28,10 @@ func TestExecutorRepository_LoadAndSave(t *testing.T) { Nodes: []*schedulerobjects.Node{ { Id: "test-node-1", - LastSeen: t1, + LastSeen: t1Proto, }, }, - LastUpdateTime: t1, + LastUpdateTime: t1Proto, UnassignedJobRuns: []string{"run1", "run2"}, }, { @@ -38,10 +40,10 @@ func TestExecutorRepository_LoadAndSave(t *testing.T) { Nodes: []*schedulerobjects.Node{ { Id: "test-node-2", - LastSeen: t1, + LastSeen: t1Proto, }, }, - LastUpdateTime: t1, + LastUpdateTime: t1Proto, UnassignedJobRuns: []string{"run3", "run4"}, }, }, @@ -86,7 +88,9 @@ func TestExecutorRepository_LoadAndSave(t *testing.T) { func TestExecutorRepository_GetLastUpdateTimes(t *testing.T) { t1 := time.Now().UTC().Round(1 * time.Microsecond) // postgres only stores times with micro precision + t1Proto := protoutil.ToTimestamp(t1) t2 := t1.Add(-1 * time.Second) + t2Proto := protoutil.ToTimestamp(t2) tests := map[string]struct { executors []*schedulerobjects.Executor expectedUpdateTimes map[string]time.Time @@ -95,11 +99,11 @@ func TestExecutorRepository_GetLastUpdateTimes(t *testing.T) { executors: []*schedulerobjects.Executor{ { Id: "test-executor-1", - LastUpdateTime: t1, + LastUpdateTime: t1Proto, }, { Id: "test-executor-2", - LastUpdateTime: t2, + LastUpdateTime: t2Proto, }, }, expectedUpdateTimes: map[string]time.Time{"test-executor-1": t1, "test-executor-2": t2}, diff --git a/internal/scheduler/database/job_repository_test.go b/internal/scheduler/database/job_repository_test.go index 4a29c508337..9f060d41620 100644 --- a/internal/scheduler/database/job_repository_test.go +++ b/internal/scheduler/database/job_repository_test.go @@ -589,7 +589,7 @@ func TestFetchJobRunLeases(t *testing.T) { Pool: "test-pool", PodRequirementsOverlay: protoutil.MustMarshall( &schedulerobjects.PodRequirements{ - Tolerations: []v1.Toleration{ + Tolerations: []*v1.Toleration{ { Key: "whale", Value: "true", diff --git a/internal/scheduler/internaltypes/job_scheduling_info.go b/internal/scheduler/internaltypes/job_scheduling_info.go index 39ec45a6794..8e248b24978 100644 --- a/internal/scheduler/internaltypes/job_scheduling_info.go +++ b/internal/scheduler/internaltypes/job_scheduling_info.go @@ -8,6 +8,7 @@ import ( "golang.org/x/exp/maps" v1 "k8s.io/api/core/v1" + protoutil "github.com/armadaproject/armada/internal/common/proto" armadaslices "github.com/armadaproject/armada/internal/common/slices" "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" ) @@ -73,17 +74,24 @@ func FromSchedulerObjectsJobSchedulingInfo(j *schedulerobjects.JobSchedulingInfo if podRequirements == nil { return nil, errors.Errorf("job must have pod requirements") } + rr := podRequirements.GetResourceRequirements().DeepCopy() + if rr == nil { + rr = &v1.ResourceRequirements{} + } return &JobSchedulingInfo{ Lifetime: j.Lifetime, PriorityClassName: j.PriorityClassName, - SubmitTime: j.SubmitTime, + SubmitTime: protoutil.ToStdTime(j.SubmitTime), Priority: j.Priority, PodRequirements: &PodRequirements{ - NodeSelector: podRequirements.NodeSelector, - Affinity: podRequirements.Affinity, - Tolerations: podRequirements.Tolerations, - Annotations: podRequirements.Annotations, - ResourceRequirements: podRequirements.ResourceRequirements, + NodeSelector: maps.Clone(podRequirements.NodeSelector), + Affinity: proto.Clone(podRequirements.Affinity).(*v1.Affinity), + Tolerations: armadaslices.Map(podRequirements.Tolerations, func(t *v1.Toleration) v1.Toleration { + cloned := proto.Clone(t).(*v1.Toleration) + return *cloned + }), + Annotations: maps.Clone(podRequirements.Annotations), + ResourceRequirements: *rr, }, Version: j.Version, }, nil @@ -94,17 +102,19 @@ func ToSchedulerObjectsJobSchedulingInfo(j *JobSchedulingInfo) *schedulerobjects return &schedulerobjects.JobSchedulingInfo{ Lifetime: j.Lifetime, PriorityClassName: j.PriorityClassName, - SubmitTime: j.SubmitTime, + SubmitTime: protoutil.ToTimestamp(j.SubmitTime), Priority: j.Priority, ObjectRequirements: []*schedulerobjects.ObjectRequirements{ { Requirements: &schedulerobjects.ObjectRequirements_PodRequirements{ PodRequirements: &schedulerobjects.PodRequirements{ - NodeSelector: podRequirements.NodeSelector, - Affinity: podRequirements.Affinity, - Tolerations: podRequirements.Tolerations, - Annotations: podRequirements.Annotations, - ResourceRequirements: podRequirements.ResourceRequirements, + NodeSelector: maps.Clone(podRequirements.NodeSelector), + Affinity: podRequirements.Affinity.DeepCopy(), + Tolerations: armadaslices.Map(podRequirements.Tolerations, func(t v1.Toleration) *v1.Toleration { + return proto.Clone(&t).(*v1.Toleration) + }), + Annotations: maps.Clone(podRequirements.Annotations), + ResourceRequirements: podRequirements.ResourceRequirements.DeepCopy(), }, }, }, diff --git a/internal/scheduler/internaltypes/node.go b/internal/scheduler/internaltypes/node.go index cc1910b2489..6264ad047a9 100644 --- a/internal/scheduler/internaltypes/node.go +++ b/internal/scheduler/internaltypes/node.go @@ -81,6 +81,13 @@ func FromSchedulerObjectsNode(node *schedulerobjects.Node, } allocatableByPriority[EvictedPriority] = allocatableResources + taints := make([]v1.Taint, 0, len(node.Taints)) + for _, t := range node.Taints { + if t != nil { + taints = append(taints, *t) + } + } + return CreateNodeAndType( node.Id, nodeIndex, @@ -88,7 +95,7 @@ func FromSchedulerObjectsNode(node *schedulerobjects.Node, node.Name, node.Pool, node.Unschedulable, - node.Taints, + taints, node.Labels, indexedTaints, indexedNodeLabels, diff --git a/internal/scheduler/schedulerobjects/podutils.go b/internal/scheduler/internaltypes/podutils.go similarity index 96% rename from internal/scheduler/schedulerobjects/podutils.go rename to internal/scheduler/internaltypes/podutils.go index 1892c959b5b..bed4b824085 100644 --- a/internal/scheduler/schedulerobjects/podutils.go +++ b/internal/scheduler/internaltypes/podutils.go @@ -1,4 +1,4 @@ -package schedulerobjects +package internaltypes import ( "crypto/rand" @@ -16,18 +16,6 @@ type SchedulingKey [highwayhash.Size]byte var EmptySchedulingKey SchedulingKey -func (req *PodRequirements) GetAffinityNodeSelector() *v1.NodeSelector { - affinity := req.Affinity - if affinity == nil { - return nil - } - nodeAffinity := affinity.NodeAffinity - if nodeAffinity == nil { - return nil - } - return nodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution -} - // SchedulingKeyGenerator is used to generate scheduling keys efficiently. // A scheduling key is the canonical hash of the scheduling requirements of a job. // All memory is allocated up-front and re-used. Thread-safe. diff --git a/internal/scheduler/schedulerobjects/podutils_test.go b/internal/scheduler/internaltypes/podutils_test.go similarity index 65% rename from internal/scheduler/schedulerobjects/podutils_test.go rename to internal/scheduler/internaltypes/podutils_test.go index 45822c4cfa4..dff810710cb 100644 --- a/internal/scheduler/schedulerobjects/podutils_test.go +++ b/internal/scheduler/internaltypes/podutils_test.go @@ -1,4 +1,4 @@ -package schedulerobjects +package internaltypes import ( "testing" @@ -134,7 +134,7 @@ func TestPodRequirementsSerialiser_AffinityDocsUnchanged(t *testing.T) { func benchmarkPodRequirementsSerialiser(b *testing.B, jobSchedulingInfo *JobSchedulingInfo) { skg := NewPodRequirementsSerialiser() - req := (jobSchedulingInfo.ObjectRequirements[0]).GetPodRequirements() + req := jobSchedulingInfo.PodRequirements out := make([]byte, 0, 1024) b.ResetTimer() for n := 0; n < b.N; n++ { @@ -160,7 +160,7 @@ func BenchmarkPodRequirementsSerialiser_Affinity(b *testing.B) { func benchmarkSchedulingKey(b *testing.B, jobSchedulingInfo *JobSchedulingInfo) { skg := NewSchedulingKeyGenerator() - req := (jobSchedulingInfo.ObjectRequirements[0]).GetPodRequirements() + req := jobSchedulingInfo.PodRequirements b.ResetTimer() for n := 0; n < b.N; n++ { skg.Key( @@ -183,46 +183,37 @@ func BenchmarkSchedulingKey_Affinity(b *testing.B) { func getBenchmarkJobSchedulingSchedulingInfo() *JobSchedulingInfo { return &JobSchedulingInfo{ - Lifetime: 1, - AtMostOnce: true, - Preemptible: true, - ConcurrencySafe: true, + Lifetime: 1, + PriorityClassName: "armada-default", Priority: 10, - ObjectRequirements: []*ObjectRequirements{ - { - Requirements: &ObjectRequirements_PodRequirements{ - PodRequirements: &PodRequirements{ - NodeSelector: map[string]string{ - "property1": "value1", - "property3": "value3", - }, - Tolerations: []v1.Toleration{{ - Key: "a", - Operator: "b", - Value: "b", - Effect: "d", - TolerationSeconds: pointer.Int64(1), - }}, - Annotations: map[string]string{ - "foo": "bar", - "fish": "chips", - "salt": "pepper", - }, - PreemptionPolicy: "abc", - ResourceRequirements: v1.ResourceRequirements{ - Limits: map[v1.ResourceName]resource.Quantity{ - "cpu": resource.MustParse("1"), - "memory": resource.MustParse("2"), - "nvidia.com/gpu": resource.MustParse("3"), - }, - Requests: map[v1.ResourceName]resource.Quantity{ - "cpu": resource.MustParse("2"), - "memory": resource.MustParse("2"), - "nvidia.com/gpu": resource.MustParse("2"), - }, - }, - }, + PodRequirements: &PodRequirements{ + NodeSelector: map[string]string{ + "property1": "value1", + "property3": "value3", + }, + Tolerations: []v1.Toleration{{ + Key: "a", + Operator: "b", + Value: "b", + Effect: "d", + TolerationSeconds: pointer.Int64(1), + }}, + Annotations: map[string]string{ + "foo": "bar", + "fish": "chips", + "salt": "pepper", + }, + ResourceRequirements: v1.ResourceRequirements{ + Limits: map[v1.ResourceName]resource.Quantity{ + "cpu": resource.MustParse("1"), + "memory": resource.MustParse("2"), + "nvidia.com/gpu": resource.MustParse("3"), + }, + Requests: map[v1.ResourceName]resource.Quantity{ + "cpu": resource.MustParse("2"), + "memory": resource.MustParse("2"), + "nvidia.com/gpu": resource.MustParse("2"), }, }, }, @@ -232,107 +223,97 @@ func getBenchmarkJobSchedulingSchedulingInfo() *JobSchedulingInfo { func getBenchmarkJobSchedulingSchedulingInfoWithAffinity() *JobSchedulingInfo { return &JobSchedulingInfo{ Lifetime: 1, - AtMostOnce: true, - Preemptible: true, - ConcurrencySafe: true, PriorityClassName: "armada-default", Priority: 10, - ObjectRequirements: []*ObjectRequirements{ - { - Requirements: &ObjectRequirements_PodRequirements{ - PodRequirements: &PodRequirements{ - NodeSelector: map[string]string{ - "property1": "value1", - "property3": "value3", - }, - Affinity: &v1.Affinity{ - NodeAffinity: &v1.NodeAffinity{ - RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{ - NodeSelectorTerms: []v1.NodeSelectorTerm{ - { - MatchExpressions: []v1.NodeSelectorRequirement{ - { - Key: "k1", - Operator: "o1", - Values: []string{"v1", "v2"}, - }, - }, - MatchFields: []v1.NodeSelectorRequirement{ - { - Key: "k2", - Operator: "o2", - Values: []string{"v10", "v20"}, - }, - }, - }, + PodRequirements: &PodRequirements{ + NodeSelector: map[string]string{ + "property1": "value1", + "property3": "value3", + }, + Affinity: &v1.Affinity{ + NodeAffinity: &v1.NodeAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{ + NodeSelectorTerms: []v1.NodeSelectorTerm{ + { + MatchExpressions: []v1.NodeSelectorRequirement{ + { + Key: "k1", + Operator: "o1", + Values: []string{"v1", "v2"}, }, }, - }, - PodAffinity: &v1.PodAffinity{ - RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ + MatchFields: []v1.NodeSelectorRequirement{ { - LabelSelector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "label1": "labelval1", - "label2": "labelval2", - "label3": "labelval3", - }, - MatchExpressions: []metav1.LabelSelectorRequirement{ - { - Key: "k1", - Operator: "o1", - Values: []string{"v1", "v2", "v3"}, - }, - }, - }, - Namespaces: []string{"n1, n2, n3"}, - TopologyKey: "topkey1", - NamespaceSelector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "label10": "labelval1", - "label20": "labelval2", - "label30": "labelval3", - }, - MatchExpressions: []metav1.LabelSelectorRequirement{ - { - Key: "k10", - Operator: "o10", - Values: []string{"v10", "v20", "v30"}, - }, - }, - }, + Key: "k2", + Operator: "o2", + Values: []string{"v10", "v20"}, }, }, }, - PodAntiAffinity: nil, }, - Tolerations: []v1.Toleration{{ - Key: "a", - Operator: "b", - Value: "b", - Effect: "d", - TolerationSeconds: pointer.Int64(1), - }}, - Annotations: map[string]string{ - "foo": "bar", - "fish": "chips", - "salt": "pepper", - }, - PreemptionPolicy: "abc", - ResourceRequirements: v1.ResourceRequirements{ - Limits: map[v1.ResourceName]resource.Quantity{ - "cpu": resource.MustParse("1"), - "memory": resource.MustParse("2"), - "nvidia.com/gpu": resource.MustParse("3"), + }, + }, + PodAffinity: &v1.PodAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ + { + LabelSelector: &metav1.LabelSelector{ + MatchLabels: map[string]string{ + "label1": "labelval1", + "label2": "labelval2", + "label3": "labelval3", + }, + MatchExpressions: []metav1.LabelSelectorRequirement{ + { + Key: "k1", + Operator: "o1", + Values: []string{"v1", "v2", "v3"}, + }, + }, }, - Requests: map[v1.ResourceName]resource.Quantity{ - "cpu": resource.MustParse("2"), - "memory": resource.MustParse("2"), - "nvidia.com/gpu": resource.MustParse("2"), + Namespaces: []string{"n1, n2, n3"}, + TopologyKey: "topkey1", + NamespaceSelector: &metav1.LabelSelector{ + MatchLabels: map[string]string{ + "label10": "labelval1", + "label20": "labelval2", + "label30": "labelval3", + }, + MatchExpressions: []metav1.LabelSelectorRequirement{ + { + Key: "k10", + Operator: "o10", + Values: []string{"v10", "v20", "v30"}, + }, + }, }, }, }, }, + PodAntiAffinity: nil, + }, + Tolerations: []v1.Toleration{{ + Key: "a", + Operator: "b", + Value: "b", + Effect: "d", + TolerationSeconds: pointer.Int64(1), + }}, + Annotations: map[string]string{ + "foo": "bar", + "fish": "chips", + "salt": "pepper", + }, + ResourceRequirements: v1.ResourceRequirements{ + Limits: map[v1.ResourceName]resource.Quantity{ + "cpu": resource.MustParse("1"), + "memory": resource.MustParse("2"), + "nvidia.com/gpu": resource.MustParse("3"), + }, + Requests: map[v1.ResourceName]resource.Quantity{ + "cpu": resource.MustParse("2"), + "memory": resource.MustParse("2"), + "nvidia.com/gpu": resource.MustParse("2"), + }, }, }, } diff --git a/internal/scheduler/jobdb/job.go b/internal/scheduler/jobdb/job.go index 86f583be597..0b55afc293f 100644 --- a/internal/scheduler/jobdb/job.go +++ b/internal/scheduler/jobdb/job.go @@ -14,7 +14,6 @@ import ( "github.com/armadaproject/armada/internal/common/types" "github.com/armadaproject/armada/internal/scheduler/adapters" "github.com/armadaproject/armada/internal/scheduler/internaltypes" - "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" ) // Job is the scheduler-internal representation of a job. @@ -40,7 +39,7 @@ type Job struct { // I.e., the value returned by time.UnixNano(). submittedTime int64 // Hash of the scheduling requirements of the job. - schedulingKey schedulerobjects.SchedulingKey + schedulingKey internaltypes.SchedulingKey // True if the job has been validated by the scheduler. // Any job that fails validation will be rejected. validated bool @@ -388,7 +387,7 @@ func (job *Job) PriorityClass() types.PriorityClass { } // SchedulingKey returns the scheduling key associated with a job. -func (job *Job) SchedulingKey() schedulerobjects.SchedulingKey { +func (job *Job) SchedulingKey() internaltypes.SchedulingKey { return job.schedulingKey } @@ -836,7 +835,7 @@ func copyJob(j Job) *Job { return &j } -func SchedulingKeyFromJob(skg *schedulerobjects.SchedulingKeyGenerator, job *Job) schedulerobjects.SchedulingKey { +func SchedulingKeyFromJob(skg *internaltypes.SchedulingKeyGenerator, job *Job) internaltypes.SchedulingKey { return skg.Key( job.NodeSelector(), job.Affinity(), diff --git a/internal/scheduler/jobdb/job_run_test.go b/internal/scheduler/jobdb/job_run_test.go index 53474e95615..a7bc69c821f 100644 --- a/internal/scheduler/jobdb/job_run_test.go +++ b/internal/scheduler/jobdb/job_run_test.go @@ -10,7 +10,7 @@ import ( "github.com/armadaproject/armada/internal/common/stringinterner" "github.com/armadaproject/armada/internal/common/types" - "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" + "github.com/armadaproject/armada/internal/scheduler/internaltypes" ) const ( @@ -30,7 +30,7 @@ var ( PriorityClass3: {Priority: 3, Preemptible: false}, } TestDefaultPriorityClass = PriorityClass3 - SchedulingKeyGenerator = schedulerobjects.NewSchedulingKeyGeneratorWithKey(make([]byte, 32)) + SchedulingKeyGenerator = internaltypes.NewSchedulingKeyGeneratorWithKey(make([]byte, 32)) testClock = clock.NewFakeClock(time.Now()) jobDb = NewJobDbWithSchedulingKeyGenerator( TestPriorityClasses, diff --git a/internal/scheduler/jobdb/jobdb.go b/internal/scheduler/jobdb/jobdb.go index 790c0a4cb0d..66d5c1d4530 100644 --- a/internal/scheduler/jobdb/jobdb.go +++ b/internal/scheduler/jobdb/jobdb.go @@ -16,7 +16,6 @@ import ( "github.com/armadaproject/armada/internal/common/types" "github.com/armadaproject/armada/internal/scheduler/adapters" "github.com/armadaproject/armada/internal/scheduler/internaltypes" - "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" ) type JobSortOrder int @@ -76,7 +75,7 @@ type JobDb struct { priorityClasses map[string]types.PriorityClass // Priority class assigned to jobs with a priorityClassName not in jobDb.priorityClasses. defaultPriorityClass types.PriorityClass - schedulingKeyGenerator *schedulerobjects.SchedulingKeyGenerator + schedulingKeyGenerator *internaltypes.SchedulingKeyGenerator // We intern strings to save memory. stringInterner *stringinterner.StringInterner // Mutexes protecting the jobDb. @@ -111,7 +110,7 @@ func NewJobDb(priorityClasses map[string]types.PriorityClass, return NewJobDbWithSchedulingKeyGenerator( priorityClasses, defaultPriorityClassName, - schedulerobjects.NewSchedulingKeyGenerator(), + internaltypes.NewSchedulingKeyGenerator(), stringInterner, resourceListFactory, ) @@ -120,7 +119,7 @@ func NewJobDb(priorityClasses map[string]types.PriorityClass, func NewJobDbWithSchedulingKeyGenerator( priorityClasses map[string]types.PriorityClass, defaultPriorityClassName string, - skg *schedulerobjects.SchedulingKeyGenerator, + skg *internaltypes.SchedulingKeyGenerator, stringInterner *stringinterner.StringInterner, resourceListFactory *internaltypes.ResourceListFactory, ) *JobDb { diff --git a/internal/scheduler/jobdb/jobdb_test.go b/internal/scheduler/jobdb/jobdb_test.go index 71f4a103735..dd737fa422e 100644 --- a/internal/scheduler/jobdb/jobdb_test.go +++ b/internal/scheduler/jobdb/jobdb_test.go @@ -18,7 +18,6 @@ import ( "github.com/armadaproject/armada/internal/common/types" "github.com/armadaproject/armada/internal/common/util" "github.com/armadaproject/armada/internal/scheduler/internaltypes" - "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" ) func NewTestJobDb() *JobDb { @@ -1190,7 +1189,7 @@ func TestJobDb_SchedulingKey(t *testing.T) { } for name, tc := range tests { t.Run(name, func(t *testing.T) { - skg := schedulerobjects.NewSchedulingKeyGenerator() + skg := internaltypes.NewSchedulingKeyGenerator() jobSchedulingInfoA := jobSchedulingInfo.DeepCopy() jobSchedulingInfoA.PriorityClassName = tc.priorityClassNameA diff --git a/internal/scheduler/metrics.go b/internal/scheduler/metrics.go index f51f82b7573..edcd2c2b207 100644 --- a/internal/scheduler/metrics.go +++ b/internal/scheduler/metrics.go @@ -17,6 +17,7 @@ import ( "github.com/armadaproject/armada/internal/scheduler/configuration" "github.com/armadaproject/armada/internal/scheduler/database" "github.com/armadaproject/armada/internal/scheduler/floatingresources" + "github.com/armadaproject/armada/internal/scheduler/internaltypes" "github.com/armadaproject/armada/internal/scheduler/jobdb" "github.com/armadaproject/armada/internal/scheduler/queue" "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" @@ -150,7 +151,7 @@ func (c *MetricsCollector) updateQueueMetrics(ctx *armadacontext.Context) ([]pro provider := metricProvider{queueStates: make(map[string]*queueState, len(queues))} queuedJobsCount := make(map[string]int, len(queues)) - schedulingKeysByQueue := make(map[string]map[schedulerobjects.SchedulingKey]bool, len(queues)) + schedulingKeysByQueue := make(map[string]map[internaltypes.SchedulingKey]bool, len(queues)) for _, queue := range queues { provider.queueStates[queue.Name] = &queueState{ @@ -159,7 +160,7 @@ func (c *MetricsCollector) updateQueueMetrics(ctx *armadacontext.Context) ([]pro queue: queue, } queuedJobsCount[queue.Name] = 0 - schedulingKeysByQueue[queue.Name] = map[schedulerobjects.SchedulingKey]bool{} + schedulingKeysByQueue[queue.Name] = map[internaltypes.SchedulingKey]bool{} } currentTime := c.clock.Now() @@ -225,7 +226,7 @@ func (c *MetricsCollector) updateQueueMetrics(ctx *armadacontext.Context) ([]pro } } - queuedDistinctSchedulingKeysCount := armadamaps.MapValues(schedulingKeysByQueue, func(schedulingKeys map[schedulerobjects.SchedulingKey]bool) int { + queuedDistinctSchedulingKeysCount := armadamaps.MapValues(schedulingKeysByQueue, func(schedulingKeys map[internaltypes.SchedulingKey]bool) int { return len(schedulingKeys) }) diff --git a/internal/scheduler/scheduler.go b/internal/scheduler/scheduler.go index fac52e687af..23e73ade572 100644 --- a/internal/scheduler/scheduler.go +++ b/internal/scheduler/scheduler.go @@ -13,6 +13,7 @@ import ( "github.com/armadaproject/armada/internal/common/armadacontext" protoutil "github.com/armadaproject/armada/internal/common/proto" + armadaslices "github.com/armadaproject/armada/internal/common/slices" "github.com/armadaproject/armada/internal/scheduler/database" "github.com/armadaproject/armada/internal/scheduler/internaltypes" "github.com/armadaproject/armada/internal/scheduler/jobdb" @@ -574,7 +575,9 @@ func AppendEventSequencesFromScheduledJobs(eventSequences []*armadaevents.EventS HasScheduledAtPriority: hasScheduledAtPriority, ScheduledAtPriority: scheduledAtPriority, PodRequirementsOverlay: &schedulerobjects.PodRequirements{ - Tolerations: jctx.AdditionalTolerations, + Tolerations: armadaslices.Map(jctx.AdditionalTolerations, func(t v1.Toleration) *v1.Toleration { + return &t + }), }, Pool: run.Pool(), }, diff --git a/internal/scheduler/schedulerobjects/schedulerobjects.pb.go b/internal/scheduler/schedulerobjects/schedulerobjects.pb.go index 031b1aa097c..55e15292eb8 100644 --- a/internal/scheduler/schedulerobjects/schedulerobjects.pb.go +++ b/internal/scheduler/schedulerobjects/schedulerobjects.pb.go @@ -8,11 +8,9 @@ import ( io "io" math "math" math_bits "math/bits" - time "time" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" types "github.com/gogo/protobuf/types" v1 "k8s.io/api/core/v1" resource "k8s.io/apimachinery/pkg/api/resource" @@ -22,7 +20,6 @@ import ( var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf -var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -73,7 +70,7 @@ type Executor struct { // The nodes available for scheduling via this executor. Nodes []*Node `protobuf:"bytes,3,rep,name=nodes,proto3" json:"nodes,omitempty"` // Last time the executor provided a heartbeat to say it was still accepting job. - LastUpdateTime time.Time `protobuf:"bytes,5,opt,name=lastUpdateTime,proto3,stdtime" json:"lastUpdateTime"` + LastUpdateTime *types.Timestamp `protobuf:"bytes,5,opt,name=lastUpdateTime,proto3" json:"lastUpdateTime,omitempty"` // Jobs that are owned by the cluster but are not assigned to any node. UnassignedJobRuns []string `protobuf:"bytes,9,rep,name=unassigned_job_runs,json=unassignedJobRuns,proto3" json:"unassignedJobRuns,omitempty"` } @@ -132,11 +129,11 @@ func (m *Executor) GetNodes() []*Node { return nil } -func (m *Executor) GetLastUpdateTime() time.Time { +func (m *Executor) GetLastUpdateTime() *types.Timestamp { if m != nil { return m.LastUpdateTime } - return time.Time{} + return nil } func (m *Executor) GetUnassignedJobRuns() []string { @@ -156,9 +153,9 @@ type Node struct { Executor string `protobuf:"bytes,19,opt,name=executor,proto3" json:"executor,omitempty"` // Time at which this node was last updated. // Used to garbage collect nodes that have been removed. - LastSeen time.Time `protobuf:"bytes,2,opt,name=last_seen,json=lastSeen,proto3,stdtime" json:"lastSeen"` + LastSeen *types.Timestamp `protobuf:"bytes,2,opt,name=last_seen,json=lastSeen,proto3" json:"lastSeen,omitempty"` // Kubernetes taints. - Taints []v1.Taint `protobuf:"bytes,5,rep,name=taints,proto3" json:"taints"` + Taints []*v1.Taint `protobuf:"bytes,5,rep,name=taints,proto3" json:"taints,omitempty"` // Kubernetes labels. Labels map[string]string `protobuf:"bytes,6,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Total resources on this node. @@ -168,13 +165,13 @@ type Node struct { // where available resources = unused resources + resources assigned to lower-priority jobs. AllocatableByPriorityAndResource map[int32]ResourceList `protobuf:"bytes,8,rep,name=allocatable_by_priority_and_resource,json=allocatableByPriorityAndResource,proto3" json:"allocatableByPriorityAndResource" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Deprecated: Do not use. // Ids of the job runs currently assigned to this node and their current state. - StateByJobRunId map[string]JobRunState `protobuf:"bytes,9,rep,name=state_by_job_run_id,json=stateByJobRunId,proto3" json:"stateByJobRunId" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=schedulerobjects.JobRunState"` + StateByJobRunId map[string]JobRunState `protobuf:"bytes,9,rep,name=state_by_job_run_id,json=stateByJobRunId,proto3" json:"stateByJobRunId,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=schedulerobjects.JobRunState"` // Resource allocated to non-Armada pods on this node. UnallocatableResources map[int32]ResourceList `protobuf:"bytes,13,rep,name=unallocatable_resources,json=unallocatableResources,proto3" json:"unallocatableResources" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // If true, no new jobs should be scheduled onto this node, e.g., because the node has been cordoned. Unschedulable bool `protobuf:"varint,15,opt,name=unschedulable,proto3" json:"unschedulable,omitempty"` // This should only be used for metrics - // This is the type the node should be reported as. It is simple a label to categorise the group the node belongs to + // This is the type the node should be reported as. It is simply a label to categorise the group the node belongs to ReportingNodeType string `protobuf:"bytes,17,opt,name=reporting_node_type,json=reportingNodeType,proto3" json:"reportingNodeType,omitempty"` // The pool that this node belongs to, this is used for scheduling purposes Pool string `protobuf:"bytes,18,opt,name=pool,proto3" json:"pool,omitempty"` @@ -235,14 +232,14 @@ func (m *Node) GetExecutor() string { return "" } -func (m *Node) GetLastSeen() time.Time { +func (m *Node) GetLastSeen() *types.Timestamp { if m != nil { return m.LastSeen } - return time.Time{} + return nil } -func (m *Node) GetTaints() []v1.Taint { +func (m *Node) GetTaints() []*v1.Taint { if m != nil { return m.Taints } @@ -419,12 +416,12 @@ func (m *ResourceList) GetResources() map[string]resource.Quantity { // Minimal job representation used by the scheduler. type JobSchedulingInfo struct { - Lifetime uint32 `protobuf:"varint,1,opt,name=lifetime,proto3" json:"lifetime,omitempty"` - AtMostOnce bool `protobuf:"varint,2,opt,name=at_most_once,json=atMostOnce,proto3" json:"atMostOnce,omitempty"` - Preemptible bool `protobuf:"varint,3,opt,name=preemptible,proto3" json:"preemptible,omitempty"` - ConcurrencySafe bool `protobuf:"varint,4,opt,name=concurrency_safe,json=concurrencySafe,proto3" json:"concurrencySafe,omitempty"` - PriorityClassName string `protobuf:"bytes,6,opt,name=priority_class_name,json=priorityClassName,proto3" json:"priorityClassName,omitempty"` - SubmitTime time.Time `protobuf:"bytes,7,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submitTime"` + Lifetime uint32 `protobuf:"varint,1,opt,name=lifetime,proto3" json:"lifetime,omitempty"` + AtMostOnce bool `protobuf:"varint,2,opt,name=at_most_once,json=atMostOnce,proto3" json:"atMostOnce,omitempty"` + Preemptible bool `protobuf:"varint,3,opt,name=preemptible,proto3" json:"preemptible,omitempty"` + ConcurrencySafe bool `protobuf:"varint,4,opt,name=concurrency_safe,json=concurrencySafe,proto3" json:"concurrencySafe,omitempty"` + PriorityClassName string `protobuf:"bytes,6,opt,name=priority_class_name,json=priorityClassName,proto3" json:"priorityClassName,omitempty"` + SubmitTime *types.Timestamp `protobuf:"bytes,7,opt,name=submit_time,json=submitTime,proto3" json:"submitTime,omitempty"` // In-queue priority. I.e., not the priority class priority. Priority uint32 `protobuf:"varint,8,opt,name=priority,proto3" json:"priority,omitempty"` // Kubernetes objects that make up this job and their respective scheduling requirements. @@ -442,12 +439,16 @@ func (m *JobSchedulingInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *JobSchedulingInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + if deterministic { + return xxx_messageInfo_JobSchedulingInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return b[:n], nil } func (m *JobSchedulingInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_JobSchedulingInfo.Merge(m, src) @@ -496,11 +497,11 @@ func (m *JobSchedulingInfo) GetPriorityClassName() string { return "" } -func (m *JobSchedulingInfo) GetSubmitTime() time.Time { +func (m *JobSchedulingInfo) GetSubmitTime() *types.Timestamp { if m != nil { return m.SubmitTime } - return time.Time{} + return nil } func (m *JobSchedulingInfo) GetPriority() uint32 { @@ -604,14 +605,14 @@ type PodRequirements struct { // Kubernetes scheduling requirements. Affinity *v1.Affinity `protobuf:"bytes,2,opt,name=affinity,proto3" json:"affinity,omitempty"` // Kubernetes tolerations. - Tolerations []v1.Toleration `protobuf:"bytes,3,rep,name=tolerations,proto3" json:"tolerations"` + Tolerations []*v1.Toleration `protobuf:"bytes,3,rep,name=tolerations,proto3" json:"tolerations,omitempty"` // Kubernetes annotations. Included here since we use annotations with special meaning. Annotations map[string]string `protobuf:"bytes,7,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // One of Never, PreemptLowerPriority. // Defaults to PreemptLowerPriority if unset. PreemptionPolicy string `protobuf:"bytes,5,opt,name=preemptionPolicy,proto3" json:"preemptionPolicy,omitempty"` // Sum of the resource requirements for all containers that make up this pod. - ResourceRequirements v1.ResourceRequirements `protobuf:"bytes,6,opt,name=resourceRequirements,proto3" json:"resourceRequirements"` + ResourceRequirements *v1.ResourceRequirements `protobuf:"bytes,6,opt,name=resourceRequirements,proto3" json:"resourceRequirements,omitempty"` } func (m *PodRequirements) Reset() { *m = PodRequirements{} } @@ -661,7 +662,7 @@ func (m *PodRequirements) GetAffinity() *v1.Affinity { return nil } -func (m *PodRequirements) GetTolerations() []v1.Toleration { +func (m *PodRequirements) GetTolerations() []*v1.Toleration { if m != nil { return m.Tolerations } @@ -682,11 +683,11 @@ func (m *PodRequirements) GetPreemptionPolicy() string { return "" } -func (m *PodRequirements) GetResourceRequirements() v1.ResourceRequirements { +func (m *PodRequirements) GetResourceRequirements() *v1.ResourceRequirements { if m != nil { return m.ResourceRequirements } - return v1.ResourceRequirements{} + return nil } type ExecutorSettings struct { @@ -789,116 +790,119 @@ func init() { } var fileDescriptor_97dadc5fbd620721 = []byte{ - // 1737 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcd, 0x6f, 0xdb, 0xc8, - 0x15, 0x37, 0xfd, 0x29, 0x8d, 0xfc, 0x21, 0x8d, 0xbd, 0x09, 0xa3, 0x64, 0x45, 0x55, 0xbb, 0x5b, - 0x38, 0xdb, 0x2e, 0x85, 0xf5, 0xb6, 0x40, 0x90, 0x16, 0x05, 0xc4, 0xc4, 0x6d, 0x9c, 0x66, 0x65, - 0x47, 0x8e, 0x50, 0xb4, 0x40, 0x97, 0x18, 0x91, 0x63, 0x85, 0x6b, 0x6a, 0x86, 0x4b, 0x0e, 0xd3, - 0xb2, 0xf7, 0x1e, 0x8a, 0x5e, 0xb6, 0xc5, 0x16, 0x28, 0xd0, 0x53, 0xff, 0x8b, 0x5e, 0x8a, 0x5e, - 0x83, 0x9e, 0xf6, 0xd8, 0x13, 0x5b, 0x24, 0x37, 0xfe, 0x0b, 0xbd, 0x14, 0x33, 0x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c, 0x6e, 0x7c, 0x13, 0x00, 0x00, + // 1778 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x4f, 0x73, 0xe3, 0x48, + 0x15, 0x8f, 0x12, 0xc7, 0x91, 0xdb, 0x99, 0x44, 0xee, 0x64, 0x67, 0x34, 0x9e, 0x59, 0xcb, 0x78, + 0x77, 0xa9, 0xcc, 0xc2, 0xca, 0xb5, 0x59, 0xa8, 0x9a, 0x1a, 0x28, 0xaa, 0xac, 0x99, 0xb0, 0x13, + 0x33, 0x38, 0x19, 0x67, 0x5c, 0x14, 0x50, 0x20, 0xda, 0x52, 0xc7, 0xa3, 0x8d, 0xdc, 0xed, 0x95, + 0x5a, 0xc3, 0xfa, 0xc6, 0x85, 0x03, 0xc5, 0x05, 0x28, 0xe0, 0xc2, 0x67, 0xe0, 0xce, 0x85, 0xfb, + 0x16, 0xc5, 0x61, 0x8f, 0x9c, 0x54, 0xd4, 0xcc, 0x4d, 0x9f, 0x82, 0xea, 0x96, 0x64, 0xb5, 0xff, + 0x64, 0x9c, 0xcb, 0x16, 0xa7, 0xa4, 0x7f, 0xef, 0xbd, 0xdf, 0x7b, 0xfd, 0xfa, 0xf5, 0xeb, 0x27, + 0x83, 0x47, 0x1e, 0x61, 0x38, 0x20, 0xc8, 0x6f, 0x87, 0xce, 0x4b, 0xec, 0x46, 0x3e, 0x0e, 0x8a, + 0xff, 0xe8, 0xf0, 0x33, 0xec, 0xb0, 0x70, 0x09, 0x30, 0x27, 0x01, 0x65, 0x14, 0x6a, 0x8b, 0x78, + 0xdd, 0x18, 0x51, 0x3a, 0xf2, 0x71, 0x5b, 0xc8, 0x87, 0xd1, 0x65, 0x9b, 0x79, 0x63, 0x1c, 0x32, + 0x34, 0x9e, 0xa4, 0x26, 0xf5, 0xd6, 0xd5, 0xc3, 0xd0, 0xf4, 0x68, 0x1b, 0x4d, 0xbc, 0xb6,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0x1e, + 0x3f, 0x66, 0x20, 0x7c, 0x2e, 0xcc, 0x3a, 0xec, 0x86, 0x3f, 0x9a, 0xe4, 0x94, 0x9d, 0xc5, 0x57, + 0xa1, 0x60, 0xf9, 0xf0, 0x0c, 0x54, 0xa5, 0xc1, 0x13, 0x56, 0xc1, 0xce, 0xa0, 0xf7, 0xa3, 0xde, + 0xd9, 0x4f, 0x7a, 0xda, 0x06, 0x5f, 0x9c, 0x9f, 0xf4, 0x9e, 0x9c, 0xf6, 0x3e, 0xd5, 0x14, 0xbe, + 0xe8, 0x0f, 0x7a, 0x3d, 0xbe, 0xd8, 0x84, 0xb7, 0x40, 0xe5, 0x62, 0xf0, 0xf8, 0xf1, 0xc9, 0xc9, + 0x93, 0x93, 0x27, 0xda, 0x16, 0x04, 0xa0, 0xfc, 0xc3, 0xce, 0xe9, 0xb3, 0x93, 0x27, 0x5a, 0xc9, + 0xfa, 0xc5, 0x97, 0xaf, 0x1b, 0xca, 0x57, 0xaf, 0x1b, 0xca, 0x7f, 0x5f, 0x37, 0x94, 0x3f, 0xbc, + 0x69, 0x6c, 0x7c, 0xf5, 0xa6, 0xb1, 0xf1, 0x9f, 0x37, 0x8d, 0x8d, 0x9f, 0x3d, 0x96, 0x7e, 0xc0, + 0x42, 0xc1, 0x18, 0xb9, 0x68, 0x12, 0x50, 0x7e, 0x83, 0xb3, 0x55, 0xfb, 0x06, 0xbf, 0xd4, 0x0d, + 0xcb, 0x62, 0x9f, 0x9f, 0xfc, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x41, 0x01, 0x03, 0xd7, 0x13, + 0x00, 0x00, } func (m *Executor) Marshal() (dAtA []byte, err error) { @@ -930,14 +934,18 @@ func (m *Executor) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x4a } } - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastUpdateTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastUpdateTime):]) - if err1 != nil { - return 0, err1 + if m.LastUpdateTime != nil { + { + size, err := m.LastUpdateTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSchedulerobjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a } - i -= n1 - i = encodeVarintSchedulerobjects(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x2a if len(m.Nodes) > 0 { for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { { @@ -1153,14 +1161,18 @@ func (m *Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x2a } } - n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastSeen, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastSeen):]) - if err5 != nil { - return 0, err5 + if m.LastSeen != nil { + { + size, err := m.LastSeen.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSchedulerobjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - i -= n5 - i = encodeVarintSchedulerobjects(dAtA, i, uint64(n5)) - i-- - dAtA[i] = 0x12 if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) @@ -1297,14 +1309,18 @@ func (m *JobSchedulingInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x40 } - n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.SubmitTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.SubmitTime):]) - if err8 != nil { - return 0, err8 + if m.SubmitTime != nil { + { + size, err := m.SubmitTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSchedulerobjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a } - i -= n8 - i = encodeVarintSchedulerobjects(dAtA, i, uint64(n8)) - i-- - dAtA[i] = 0x3a if len(m.PriorityClassName) > 0 { i -= len(m.PriorityClassName) copy(dAtA[i:], m.PriorityClassName) @@ -1456,16 +1472,18 @@ func (m *PodRequirements) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x3a } } - { - size, err := m.ResourceRequirements.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.ResourceRequirements != nil { + { + size, err := m.ResourceRequirements.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSchedulerobjects(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintSchedulerobjects(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 } - i-- - dAtA[i] = 0x32 if len(m.PreemptionPolicy) > 0 { i -= len(m.PreemptionPolicy) copy(dAtA[i:], m.PreemptionPolicy) @@ -1618,8 +1636,10 @@ func (m *Executor) Size() (n int) { n += 1 + l + sovSchedulerobjects(uint64(l)) } } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastUpdateTime) - n += 1 + l + sovSchedulerobjects(uint64(l)) + if m.LastUpdateTime != nil { + l = m.LastUpdateTime.Size() + n += 1 + l + sovSchedulerobjects(uint64(l)) + } if len(m.UnassignedJobRuns) > 0 { for _, s := range m.UnassignedJobRuns { l = len(s) @@ -1639,8 +1659,10 @@ func (m *Node) Size() (n int) { if l > 0 { n += 1 + l + sovSchedulerobjects(uint64(l)) } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastSeen) - n += 1 + l + sovSchedulerobjects(uint64(l)) + if m.LastSeen != nil { + l = m.LastSeen.Size() + n += 1 + l + sovSchedulerobjects(uint64(l)) + } if len(m.Taints) > 0 { for _, e := range m.Taints { l = e.Size() @@ -1778,8 +1800,10 @@ func (m *JobSchedulingInfo) Size() (n int) { if l > 0 { n += 1 + l + sovSchedulerobjects(uint64(l)) } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.SubmitTime) - n += 1 + l + sovSchedulerobjects(uint64(l)) + if m.SubmitTime != nil { + l = m.SubmitTime.Size() + n += 1 + l + sovSchedulerobjects(uint64(l)) + } if m.Priority != 0 { n += 1 + sovSchedulerobjects(uint64(m.Priority)) } @@ -1841,8 +1865,10 @@ func (m *PodRequirements) Size() (n int) { if l > 0 { n += 1 + l + sovSchedulerobjects(uint64(l)) } - l = m.ResourceRequirements.Size() - n += 1 + l + sovSchedulerobjects(uint64(l)) + if m.ResourceRequirements != nil { + l = m.ResourceRequirements.Size() + n += 1 + l + sovSchedulerobjects(uint64(l)) + } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k @@ -2044,7 +2070,10 @@ func (m *Executor) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LastUpdateTime, dAtA[iNdEx:postIndex]); err != nil { + if m.LastUpdateTime == nil { + m.LastUpdateTime = &types.Timestamp{} + } + if err := m.LastUpdateTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2191,7 +2220,10 @@ func (m *Node) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LastSeen, dAtA[iNdEx:postIndex]); err != nil { + if m.LastSeen == nil { + m.LastSeen = &types.Timestamp{} + } + if err := m.LastSeen.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2224,7 +2256,7 @@ func (m *Node) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Taints = append(m.Taints, v1.Taint{}) + m.Taints = append(m.Taints, &v1.Taint{}) if err := m.Taints[len(m.Taints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3467,7 +3499,10 @@ func (m *JobSchedulingInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.SubmitTime, dAtA[iNdEx:postIndex]); err != nil { + if m.SubmitTime == nil { + m.SubmitTime = &types.Timestamp{} + } + if err := m.SubmitTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3836,7 +3871,7 @@ func (m *PodRequirements) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Tolerations = append(m.Tolerations, v1.Toleration{}) + m.Tolerations = append(m.Tolerations, &v1.Toleration{}) if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3902,6 +3937,9 @@ func (m *PodRequirements) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.ResourceRequirements == nil { + m.ResourceRequirements = &v1.ResourceRequirements{} + } if err := m.ResourceRequirements.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/internal/scheduler/schedulerobjects/schedulerobjects.proto b/internal/scheduler/schedulerobjects/schedulerobjects.proto index d4019c27fad..0ed5ac6313a 100644 --- a/internal/scheduler/schedulerobjects/schedulerobjects.proto +++ b/internal/scheduler/schedulerobjects/schedulerobjects.proto @@ -9,6 +9,7 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto"; // Executor represents an executor running on a worker cluster message Executor { + reserved 4,6,7,8; // Name of the executor. string id = 1; // Pool that the executor belongs to. @@ -16,13 +17,14 @@ message Executor { // The nodes available for scheduling via this executor. repeated Node nodes = 3; // Last time the executor provided a heartbeat to say it was still accepting job. - google.protobuf.Timestamp lastUpdateTime = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp lastUpdateTime = 5; // Jobs that are owned by the cluster but are not assigned to any node. repeated string unassigned_job_runs = 9; } // Node represents a node in a worker cluster. message Node { + reserved 3,4,10,11,14,16; // Id associated with the node. Must be unique across all clusters. string id = 1; // Kubernetes node name. Not guaranteed to be unique across clusters. @@ -31,9 +33,9 @@ message Node { string executor = 19; // Time at which this node was last updated. // Used to garbage collect nodes that have been removed. - google.protobuf.Timestamp last_seen = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp last_seen = 2; // Kubernetes taints. - repeated k8s.io.api.core.v1.Taint taints = 5 [(gogoproto.nullable) = false]; + repeated k8s.io.api.core.v1.Taint taints = 5; // Kubernetes labels. map labels = 6; // Total resources on this node. @@ -43,13 +45,13 @@ message Node { // where available resources = unused resources + resources assigned to lower-priority jobs. map allocatable_by_priority_and_resource = 8 [(gogoproto.nullable) = false, deprecated = true]; // Ids of the job runs currently assigned to this node and their current state. - map state_by_job_run_id = 9 [(gogoproto.nullable) = false]; + map state_by_job_run_id = 9; // Resource allocated to non-Armada pods on this node. map unallocatable_resources = 13 [(gogoproto.nullable) = false]; // If true, no new jobs should be scheduled onto this node, e.g., because the node has been cordoned. bool unschedulable = 15; // This should only be used for metrics - // This is the type the node should be reported as. It is simple a label to categorise the group the node belongs to + // This is the type the node should be reported as. It is simply a label to categorise the group the node belongs to string reporting_node_type = 17; // The pool that this node belongs to, this is used for scheduling purposes string pool = 18; @@ -76,19 +78,18 @@ message ResourceList { // Minimal job representation used by the scheduler. message JobSchedulingInfo { - option (gogoproto.stable_marshaler) = true; + reserved 10; uint32 lifetime = 1; bool at_most_once = 2; bool preemptible = 3; bool concurrency_safe = 4; string priority_class_name = 6; - google.protobuf.Timestamp submit_time = 7 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp submit_time = 7; // In-queue priority. I.e., not the priority class priority. uint32 priority = 8; // Kubernetes objects that make up this job and their respective scheduling requirements. repeated ObjectRequirements object_requirements = 5; uint32 version = 9; - // ordinal 10 was previously used for queue_ttl_seconds } // Message capturing the scheduling requirements of a particular Kubernetes object. @@ -101,20 +102,19 @@ message ObjectRequirements { // Captures the scheduling requirements of a pod. message PodRequirements { reserved 8; - // Kubernetes node selector. map nodeSelector = 1; // Kubernetes scheduling requirements. k8s.io.api.core.v1.Affinity affinity = 2; // Kubernetes tolerations. - repeated k8s.io.api.core.v1.Toleration tolerations = 3 [(gogoproto.nullable) = false]; + repeated k8s.io.api.core.v1.Toleration tolerations = 3; // Kubernetes annotations. Included here since we use annotations with special meaning. map annotations = 7; // One of Never, PreemptLowerPriority. // Defaults to PreemptLowerPriority if unset. string preemptionPolicy = 5; // Sum of the resource requirements for all containers that make up this pod. - k8s.io.api.core.v1.ResourceRequirements resourceRequirements = 6 [(gogoproto.nullable) = false]; + k8s.io.api.core.v1.ResourceRequirements resourceRequirements = 6; } message ExecutorSettings { diff --git a/internal/scheduler/scheduling/context/job.go b/internal/scheduler/scheduling/context/job.go index 8be8afa404d..ba69c95c3cc 100644 --- a/internal/scheduler/scheduling/context/job.go +++ b/internal/scheduler/scheduling/context/job.go @@ -19,7 +19,6 @@ import ( "github.com/armadaproject/armada/internal/scheduler/interfaces" "github.com/armadaproject/armada/internal/scheduler/internaltypes" "github.com/armadaproject/armada/internal/scheduler/jobdb" - "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" "github.com/armadaproject/armada/internal/server/configuration" ) @@ -90,9 +89,9 @@ func (jctx *JobSchedulingContext) String() string { // SchedulingKey returns the scheduling key of the embedded job. // If the jctx contains additional node selectors or tolerations, // the key is invalid and the second return value is false. -func (jctx *JobSchedulingContext) SchedulingKey() (schedulerobjects.SchedulingKey, bool) { +func (jctx *JobSchedulingContext) SchedulingKey() (internaltypes.SchedulingKey, bool) { if len(jctx.AdditionalNodeSelectors) != 0 || len(jctx.AdditionalTolerations) != 0 { - return schedulerobjects.EmptySchedulingKey, false + return internaltypes.EmptySchedulingKey, false } return jctx.Job.SchedulingKey(), true } diff --git a/internal/scheduler/scheduling/context/scheduling.go b/internal/scheduler/scheduling/context/scheduling.go index 8aa296ecf50..2f73c8b5ea7 100644 --- a/internal/scheduler/scheduling/context/scheduling.go +++ b/internal/scheduler/scheduling/context/scheduling.go @@ -18,7 +18,6 @@ import ( "github.com/armadaproject/armada/internal/common/util" "github.com/armadaproject/armada/internal/scheduler/internaltypes" "github.com/armadaproject/armada/internal/scheduler/jobdb" - "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" "github.com/armadaproject/armada/internal/scheduler/scheduling/fairness" ) @@ -57,11 +56,11 @@ type SchedulingContext struct { // Reason for why the scheduling round finished. TerminationReason string // Used to efficiently generate scheduling keys. - SchedulingKeyGenerator *schedulerobjects.SchedulingKeyGenerator + SchedulingKeyGenerator *internaltypes.SchedulingKeyGenerator // Record of job scheduling requirements known to be unfeasible. // Used to immediately reject new jobs with identical reqirements. // Maps to the JobSchedulingContext of a previous job attempted to schedule with the same key. - UnfeasibleSchedulingKeys map[schedulerobjects.SchedulingKey]*JobSchedulingContext + UnfeasibleSchedulingKeys map[internaltypes.SchedulingKey]*JobSchedulingContext SpotPrice float64 } @@ -80,13 +79,13 @@ func NewSchedulingContext( TotalResources: totalResources, ScheduledResources: internaltypes.ResourceList{}, EvictedResources: internaltypes.ResourceList{}, - SchedulingKeyGenerator: schedulerobjects.NewSchedulingKeyGenerator(), - UnfeasibleSchedulingKeys: make(map[schedulerobjects.SchedulingKey]*JobSchedulingContext), + SchedulingKeyGenerator: internaltypes.NewSchedulingKeyGenerator(), + UnfeasibleSchedulingKeys: make(map[internaltypes.SchedulingKey]*JobSchedulingContext), } } func (sctx *SchedulingContext) ClearUnfeasibleSchedulingKeys() { - sctx.UnfeasibleSchedulingKeys = make(map[schedulerobjects.SchedulingKey]*JobSchedulingContext) + sctx.UnfeasibleSchedulingKeys = make(map[internaltypes.SchedulingKey]*JobSchedulingContext) } func (sctx *SchedulingContext) AddQueueSchedulingContext( diff --git a/internal/scheduler/scheduling/gang_scheduler.go b/internal/scheduler/scheduling/gang_scheduler.go index e8e0c898f45..7893ed16cd5 100644 --- a/internal/scheduler/scheduling/gang_scheduler.go +++ b/internal/scheduler/scheduling/gang_scheduler.go @@ -10,7 +10,6 @@ import ( "github.com/armadaproject/armada/internal/scheduler/floatingresources" "github.com/armadaproject/armada/internal/scheduler/internaltypes" "github.com/armadaproject/armada/internal/scheduler/nodedb" - "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" schedulerconstraints "github.com/armadaproject/armada/internal/scheduler/scheduling/constraints" "github.com/armadaproject/armada/internal/scheduler/scheduling/context" ) @@ -87,7 +86,7 @@ func (sch *GangScheduler) updateGangSchedulingContextOnFailure(gctx *context.Gan if !sch.skipUnsuccessfulSchedulingKeyCheck && gctx.Cardinality() == 1 && globallyUnschedulable { jctx := gctx.JobSchedulingContexts[0] schedulingKey, ok := jctx.SchedulingKey() - if ok && schedulingKey != schedulerobjects.EmptySchedulingKey { + if ok && schedulingKey != internaltypes.EmptySchedulingKey { if _, ok := sch.schedulingContext.UnfeasibleSchedulingKeys[schedulingKey]; !ok { // Keep the first jctx for each unfeasible schedulingKey. sch.schedulingContext.UnfeasibleSchedulingKeys[schedulingKey] = jctx diff --git a/internal/scheduler/scheduling/gang_scheduler_test.go b/internal/scheduler/scheduling/gang_scheduler_test.go index d0566f64fd0..863e2dd9458 100644 --- a/internal/scheduler/scheduling/gang_scheduler_test.go +++ b/internal/scheduler/scheduling/gang_scheduler_test.go @@ -553,7 +553,7 @@ func TestGangScheduler(t *testing.T) { } } - expectedUnfeasibleJobSchedulingKeys := make([]schedulerobjects.SchedulingKey, 0) + expectedUnfeasibleJobSchedulingKeys := make([]internaltypes.SchedulingKey, 0) // We need to populate expectedUnfeasibleJobSchedulingKeys from the jobSchedulingContexts of the relevant // gangs, because it's hard to do within the testcase for _, unfeasibleGangIdx := range tc.ExpectedUnfeasibleSchedulingKeyIndices { @@ -562,7 +562,7 @@ func TestGangScheduler(t *testing.T) { require.Equal(t, 1, len(jctxs), fmt.Sprintf("gangs with cardinality greater than 1 don't have a single scheduling key: %v", gang)) jctx := jctxs[0] key, _ := jctx.SchedulingKey() - require.NotEqual(t, key, schedulerobjects.EmptySchedulingKey, "expected unfeasible scheduling key cannot be the empty key") + require.NotEqual(t, key, internaltypes.EmptySchedulingKey, "expected unfeasible scheduling key cannot be the empty key") expectedUnfeasibleJobSchedulingKeys = append(expectedUnfeasibleJobSchedulingKeys, key) } diff --git a/internal/scheduler/scheduling/queue_scheduler.go b/internal/scheduler/scheduling/queue_scheduler.go index 27a716414d3..691118a59e5 100644 --- a/internal/scheduler/scheduling/queue_scheduler.go +++ b/internal/scheduler/scheduling/queue_scheduler.go @@ -14,7 +14,6 @@ import ( "github.com/armadaproject/armada/internal/scheduler/floatingresources" "github.com/armadaproject/armada/internal/scheduler/internaltypes" "github.com/armadaproject/armada/internal/scheduler/nodedb" - "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" schedulerconstraints "github.com/armadaproject/armada/internal/scheduler/scheduling/constraints" schedulercontext "github.com/armadaproject/armada/internal/scheduler/scheduling/context" "github.com/armadaproject/armada/internal/scheduler/scheduling/fairness" @@ -299,7 +298,7 @@ func (it *QueuedGangIterator) Peek() (*schedulercontext.GangSchedulingContext, e // Skip this job if it's known to be unschedulable. if it.skipKnownUnschedulableJobs && len(it.schedulingContext.UnfeasibleSchedulingKeys) > 0 { schedulingKey, ok := jctx.SchedulingKey() - if ok && schedulingKey != schedulerobjects.EmptySchedulingKey { + if ok && schedulingKey != internaltypes.EmptySchedulingKey { if unsuccessfulJctx, ok := it.schedulingContext.UnfeasibleSchedulingKeys[schedulingKey]; ok { // Since jctx would fail to schedule for the same reason as unsuccessfulJctx, // set the unschedulable reason and pctx equal to that of unsuccessfulJctx. diff --git a/internal/scheduler/scheduling/scheduling_algo.go b/internal/scheduler/scheduling/scheduling_algo.go index dd1d1d9633e..fc71c745665 100644 --- a/internal/scheduler/scheduling/scheduling_algo.go +++ b/internal/scheduler/scheduling/scheduling_algo.go @@ -14,6 +14,7 @@ import ( "github.com/armadaproject/armada/internal/common/armadacontext" log "github.com/armadaproject/armada/internal/common/logging" armadamaps "github.com/armadaproject/armada/internal/common/maps" + protoutil "github.com/armadaproject/armada/internal/common/proto" armadaslices "github.com/armadaproject/armada/internal/common/slices" "github.com/armadaproject/armada/internal/scheduler/configuration" "github.com/armadaproject/armada/internal/scheduler/database" @@ -700,7 +701,8 @@ func (l *FairSchedulingAlgo) filterStaleExecutors(ctx *armadacontext.Context, ex activeExecutors := make([]*schedulerobjects.Executor, 0, len(executors)) cutoff := l.clock.Now().Add(-l.schedulingConfig.ExecutorTimeout) for _, executor := range executors { - if executor.LastUpdateTime.After(cutoff) { + lastUpdateTime := protoutil.ToStdTime(executor.LastUpdateTime) + if lastUpdateTime.After(cutoff) { activeExecutors = append(activeExecutors, executor) } else { ctx.Infof("Ignoring executor %s because it hasn't heartbeated since %s", executor.Id, executor.LastUpdateTime) diff --git a/internal/scheduler/scheduling/scheduling_algo_test.go b/internal/scheduler/scheduling/scheduling_algo_test.go index 6e8b260666a..e0cd0b774eb 100644 --- a/internal/scheduler/scheduling/scheduling_algo_test.go +++ b/internal/scheduler/scheduling/scheduling_algo_test.go @@ -15,6 +15,7 @@ import ( clock "k8s.io/utils/clock/testing" "github.com/armadaproject/armada/internal/common/armadacontext" + protoutil "github.com/armadaproject/armada/internal/common/proto" armadaslices "github.com/armadaproject/armada/internal/common/slices" "github.com/armadaproject/armada/internal/scheduler/configuration" "github.com/armadaproject/armada/internal/scheduler/internaltypes" @@ -734,7 +735,7 @@ func makeTestExecutorWithNodes(executorId string, nodes ...*schedulerobjects.Nod Id: executorId, Pool: testfixtures.TestPool, Nodes: nodes, - LastUpdateTime: testfixtures.BaseTime, + LastUpdateTime: testfixtures.BasetimeProto, } } @@ -747,7 +748,7 @@ func test1Node32CoreExecutor(executorId string) *schedulerobjects.Executor { Id: executorId, Pool: testfixtures.TestPool, Nodes: []*schedulerobjects.Node{node}, - LastUpdateTime: testfixtures.BaseTime, + LastUpdateTime: testfixtures.BasetimeProto, } } @@ -767,12 +768,12 @@ func makeTestExecutor(executorId string, nodePools ...string) *schedulerobjects. Id: executorId, Pool: testfixtures.TestPool, Nodes: nodes, - LastUpdateTime: testfixtures.BaseTime, + LastUpdateTime: testfixtures.BasetimeProto, } } func withLastUpdateTimeExecutor(lastUpdateTime time.Time, executor *schedulerobjects.Executor) *schedulerobjects.Executor { - executor.LastUpdateTime = lastUpdateTime + executor.LastUpdateTime = protoutil.ToTimestamp(lastUpdateTime) return executor } @@ -784,7 +785,7 @@ func testNodeWithPool(pool string) *schedulerobjects.Node { } func withLargeNodeTaint(node *schedulerobjects.Node) *schedulerobjects.Node { - node.Taints = append(node.Taints, v1.Taint{Key: "largeJobsOnly", Value: "true", Effect: v1.TaintEffectNoSchedule}) + node.Taints = append(node.Taints, &v1.Taint{Key: "largeJobsOnly", Value: "true", Effect: v1.TaintEffectNoSchedule}) return node } diff --git a/internal/scheduler/simulator/simulator.go b/internal/scheduler/simulator/simulator.go index 123ff100da7..952d9339bb8 100644 --- a/internal/scheduler/simulator/simulator.go +++ b/internal/scheduler/simulator/simulator.go @@ -477,13 +477,15 @@ func submitJobFromJobTemplate(jobId string, jobTemplate *JobTemplate, gangId str Object: &armadaevents.KubernetesMainObject_PodSpec{ PodSpec: &armadaevents.PodSpecWithAvoidList{ PodSpec: &v1.PodSpec{ - NodeSelector: jobTemplate.Requirements.NodeSelector, - Affinity: jobTemplate.Requirements.Affinity, - Tolerations: jobTemplate.Requirements.Tolerations, + NodeSelector: jobTemplate.Requirements.NodeSelector, + Affinity: jobTemplate.Requirements.Affinity, + Tolerations: armadaslices.Map(jobTemplate.Requirements.Tolerations, func(t *v1.Toleration) v1.Toleration { + return *t + }), PriorityClassName: jobTemplate.PriorityClassName, Containers: []v1.Container{ { - Resources: jobTemplate.Requirements.ResourceRequirements, + Resources: *jobTemplate.Requirements.ResourceRequirements, }, }, }, diff --git a/internal/scheduler/simulator/simulator.pb.go b/internal/scheduler/simulator/simulator.pb.go index 22f78aea673..f4873e8cdff 100644 --- a/internal/scheduler/simulator/simulator.pb.go +++ b/internal/scheduler/simulator/simulator.pb.go @@ -222,7 +222,7 @@ func (m *WorkloadSpec) GetQueues() []*Queue { type NodeTemplate struct { Number int64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` - Taints []v1.Taint `protobuf:"bytes,2,rep,name=taints,proto3" json:"taints"` + Taints []*v1.Taint `protobuf:"bytes,2,rep,name=taints,proto3" json:"taints,omitempty"` Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` TotalResources schedulerobjects.ResourceList `protobuf:"bytes,4,opt,name=total_resources,json=totalResources,proto3" json:"totalResources"` } @@ -267,7 +267,7 @@ func (m *NodeTemplate) GetNumber() int64 { return 0 } -func (m *NodeTemplate) GetTaints() []v1.Taint { +func (m *NodeTemplate) GetTaints() []*v1.Taint { if m != nil { return m.Taints } @@ -362,7 +362,7 @@ type JobTemplate struct { QueuePriority uint32 `protobuf:"varint,6,opt,name=queue_priority,json=queuePriority,proto3" json:"queuePriority,omitempty"` PriorityClassName string `protobuf:"bytes,7,opt,name=priority_class_name,json=priorityClassName,proto3" json:"priorityClassName,omitempty"` // Scheduling requirements for the pod embedded in the job. - Requirements schedulerobjects.PodRequirements `protobuf:"bytes,8,opt,name=requirements,proto3" json:"requirements"` + Requirements *schedulerobjects.PodRequirements `protobuf:"bytes,8,opt,name=requirements,proto3" json:"requirements,omitempty"` // List of template ids that must be completed before this template is submitted. Dependencies []string `protobuf:"bytes,9,rep,name=dependencies,proto3" json:"dependencies,omitempty"` // Earliest time at which jobs from this template are submitted. @@ -470,11 +470,11 @@ func (m *JobTemplate) GetPriorityClassName() string { return "" } -func (m *JobTemplate) GetRequirements() schedulerobjects.PodRequirements { +func (m *JobTemplate) GetRequirements() *schedulerobjects.PodRequirements { if m != nil { return m.Requirements } - return schedulerobjects.PodRequirements{} + return nil } func (m *JobTemplate) GetDependencies() []string { @@ -649,89 +649,89 @@ func init() { } var fileDescriptor_63baccdfe9127510 = []byte{ - // 1310 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x57, 0x41, 0x6f, 0x13, 0xc7, - 0x17, 0xcf, 0xc6, 0xe0, 0xe0, 0x49, 0x9c, 0x84, 0x49, 0x14, 0x16, 0x23, 0xbc, 0xc6, 0xe8, 0x8f, - 0xfc, 0xaf, 0xc2, 0x5a, 0x80, 0x54, 0x51, 0x54, 0x21, 0x75, 0x13, 0x10, 0xa2, 0x40, 0xc1, 0xa1, - 0x45, 0x2a, 0x87, 0xd5, 0xd8, 0xfb, 0xe2, 0x4c, 0xb2, 0xbb, 0x63, 0x66, 0x67, 0xa1, 0x3e, 0xf4, - 0x3b, 0xb4, 0x87, 0xa2, 0x7e, 0x88, 0x5e, 0x7a, 0xe1, 0xdc, 0x23, 0x47, 0x8e, 0x3d, 0x6d, 0x2b, - 0xb8, 0xed, 0xa7, 0xa8, 0x76, 0x66, 0xd6, 0x19, 0xe3, 0x00, 0xe1, 0x14, 0xcf, 0xef, 0xfd, 0xde, - 0xdb, 0xdf, 0xbc, 0x79, 0xef, 0xcd, 0x04, 0x6d, 0xd2, 0x58, 0x00, 0x8f, 0x49, 0xd8, 0x4d, 0x06, - 0x7b, 0x10, 0xa4, 0x21, 0xf0, 0x6e, 0x42, 0xa3, 0x34, 0x24, 0x82, 0x19, 0xbf, 0xdc, 0x11, 0x67, - 0x82, 0xe1, 0xda, 0x04, 0x68, 0x34, 0x87, 0x8c, 0x0d, 0x43, 0xe8, 0x4a, 0x43, 0x3f, 0xdd, 0xed, - 0x06, 0x29, 0x27, 0x82, 0xb2, 0x58, 0x51, 0x1b, 0xed, 0x83, 0xeb, 0x89, 0x4b, 0x59, 0x97, 0x8c, - 0x68, 0x77, 0xc0, 0x38, 0x74, 0x9f, 0x5f, 0xe9, 0x0e, 0x21, 0x06, 0x4e, 0x04, 0x04, 0x9a, 0x73, - 0x79, 0x48, 0xc5, 0x5e, 0xda, 0x77, 0x07, 0x2c, 0xea, 0x0e, 0xd9, 0x90, 0x1d, 0x06, 0x2b, 0x56, - 0x72, 0x21, 0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f, 0x5a, 0xda, 0xaf, 0x2c, 0xb4, 0xa0, 0xb3, - 0x78, 0xec, 0x33, 0xb9, 0x84, 0x4e, 0x8c, 0x18, 0x0b, 0x65, 0xae, 0x34, 0xaf, 0x58, 0x9b, 0xbc, - 0x62, 0x8d, 0x9f, 0xa2, 0xe5, 0x98, 0x05, 0xe0, 0x17, 0x60, 0x48, 0x04, 0x94, 0x27, 0x78, 0xc6, - 0xd8, 0xce, 0x03, 0x16, 0xc0, 0x63, 0x6d, 0xf7, 0xce, 0xe5, 0x99, 0x73, 0x26, 0x36, 0x10, 0xf3, - 0x2c, 0xeb, 0x53, 0x86, 0xf6, 0x9f, 0x16, 0x5a, 0x7a, 0xc2, 0xf8, 0x41, 0xc8, 0x48, 0xf0, 0x59, - 0x15, 0xf5, 0x15, 0x5a, 0xe4, 0x24, 0x0e, 0x58, 0xe4, 0x27, 0x00, 0x81, 0x3d, 0xdf, 0xb2, 0x3a, - 0x15, 0xcf, 0xce, 0x33, 0x67, 0x5d, 0xc1, 0x3b, 0x00, 0x81, 0xe1, 0x84, 0x0e, 0x51, 0x7c, 0x13, - 0x55, 0x9f, 0xa5, 0x90, 0x42, 0x62, 0x57, 0xe4, 0x46, 0x56, 0x8d, 0x8d, 0x3c, 0x2a, 0x0c, 0xde, - 0x7a, 0x9e, 0x39, 0xab, 0x8a, 0x63, 0xc4, 0xd0, 0x5e, 0xed, 0x97, 0x15, 0xb4, 0x64, 0x6e, 0x18, - 0x6f, 0xa2, 0x6a, 0x9c, 0x46, 0x7d, 0xe0, 0x52, 0x75, 0x45, 0xb9, 0x2b, 0xc4, 0x74, 0x57, 0x08, - 0xfe, 0x06, 0x55, 0x05, 0xa1, 0xb1, 0x28, 0xf3, 0x78, 0xd6, 0x55, 0x3d, 0xee, 0x92, 0x11, 0x75, - 0x8b, 0x1e, 0x77, 0x9f, 0x5f, 0x71, 0x1f, 0x17, 0x0c, 0x6f, 0x59, 0x97, 0x84, 0x76, 0xe8, 0xe9, - 0xb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, 0xb1, 0x7f, 0x3f, 0xfa, 0x55, 0x29, 0xe5, 0xda, - 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x00, 0x01, 0x6c, 0xa5, 0x0c, 0x00, 0x00, + // 1305 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x57, 0x4f, 0x6f, 0x13, 0x47, + 0x14, 0xcf, 0xc6, 0xe0, 0xe0, 0xb1, 0x9d, 0x84, 0x49, 0x14, 0x16, 0x23, 0xbc, 0xc6, 0xa8, 0xc8, + 0xad, 0xc2, 0x5a, 0x80, 0x54, 0x51, 0x54, 0x71, 0x70, 0x02, 0x45, 0x14, 0x28, 0x38, 0xb4, 0x48, + 0xed, 0x61, 0x35, 0xf6, 0xbe, 0x38, 0x93, 0xec, 0xee, 0x98, 0xd9, 0x59, 0xa8, 0x0f, 0xfd, 0x0e, + 0xed, 0xa1, 0x55, 0x0f, 0xfd, 0x08, 0xbd, 0xf4, 0xc2, 0x47, 0xa8, 0x38, 0x72, 0xec, 0x69, 0x5b, + 0xc1, 0x6d, 0x3f, 0x45, 0x35, 0x33, 0xbb, 0xce, 0x18, 0x07, 0x08, 0x37, 0xcf, 0xef, 0xfd, 0xde, + 0x6f, 0xdf, 0xbc, 0x3f, 0x33, 0x63, 0xb4, 0x49, 0x23, 0x01, 0x3c, 0x22, 0x41, 0x37, 0x1e, 0xee, + 0x81, 0x9f, 0x04, 0xc0, 0xbb, 0x31, 0x0d, 0x93, 0x80, 0x08, 0x66, 0xfc, 0x72, 0xc7, 0x9c, 0x09, + 0x86, 0x2b, 0x53, 0xa0, 0xd1, 0x1c, 0x31, 0x36, 0x0a, 0xa0, 0xab, 0x0c, 0x83, 0x64, 0xb7, 0xeb, + 0x27, 0x9c, 0x08, 0xca, 0x22, 0x4d, 0x6d, 0xb4, 0x0f, 0xae, 0xc7, 0x2e, 0x65, 0x5d, 0x32, 0xa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xf5, 0xf3, 0x9b, 0xe6, 0xc2, 0xab, 0x37, 0xcd, 0x85, 0x7f, 0xde, + 0x34, 0x17, 0xbe, 0xff, 0xd2, 0x78, 0xed, 0x13, 0x1e, 0x12, 0x9f, 0x8c, 0x39, 0x93, 0x87, 0x4f, + 0xbe, 0xea, 0xbe, 0xef, 0xaf, 0xc8, 0xa0, 0xac, 0x42, 0xb9, 0xf6, 0x7f, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x8e, 0x8f, 0xe5, 0xef, 0xb1, 0x0c, 0x00, 0x00, } func (m *ClusterSpec) Marshal() (dAtA []byte, err error) { @@ -1098,16 +1098,18 @@ func (m *JobTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x4a } } - { - size, err := m.Requirements.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.Requirements != nil { + { + size, err := m.Requirements.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSimulator(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintSimulator(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 } - i-- - dAtA[i] = 0x42 if len(m.PriorityClassName) > 0 { i -= len(m.PriorityClassName) copy(dAtA[i:], m.PriorityClassName) @@ -1391,8 +1393,10 @@ func (m *JobTemplate) Size() (n int) { if l > 0 { n += 1 + l + sovSimulator(uint64(l)) } - l = m.Requirements.Size() - n += 1 + l + sovSimulator(uint64(l)) + if m.Requirements != nil { + l = m.Requirements.Size() + n += 1 + l + sovSimulator(uint64(l)) + } if len(m.Dependencies) > 0 { for _, s := range m.Dependencies { l = len(s) @@ -1996,7 +2000,7 @@ func (m *NodeTemplate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Taints = append(m.Taints, v1.Taint{}) + m.Taints = append(m.Taints, &v1.Taint{}) if err := m.Taints[len(m.Taints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2552,6 +2556,9 @@ func (m *JobTemplate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.Requirements == nil { + m.Requirements = &schedulerobjects.PodRequirements{} + } if err := m.Requirements.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/internal/scheduler/simulator/simulator.proto b/internal/scheduler/simulator/simulator.proto index cc71e807855..355736f15d9 100644 --- a/internal/scheduler/simulator/simulator.proto +++ b/internal/scheduler/simulator/simulator.proto @@ -32,7 +32,7 @@ message WorkloadSpec { message NodeTemplate { int64 number = 1; - repeated k8s.io.api.core.v1.Taint taints = 2 [(gogoproto.nullable) = false]; + repeated k8s.io.api.core.v1.Taint taints = 2; map labels = 3; schedulerobjects.ResourceList total_resources = 4 [(gogoproto.nullable) = false]; } @@ -57,7 +57,7 @@ message JobTemplate { uint32 queue_priority = 6; string priority_class_name = 7; // Scheduling requirements for the pod embedded in the job. - schedulerobjects.PodRequirements requirements = 8 [(gogoproto.nullable) = false]; + schedulerobjects.PodRequirements requirements = 8; // List of template ids that must be completed before this template is submitted. repeated string dependencies = 9; // Earliest time at which jobs from this template are submitted. diff --git a/internal/scheduler/simulator/simulator_test.go b/internal/scheduler/simulator/simulator_test.go index 55116184548..a68e7513dd4 100644 --- a/internal/scheduler/simulator/simulator_test.go +++ b/internal/scheduler/simulator/simulator_test.go @@ -323,7 +323,7 @@ func TestSimulator(t *testing.T) { Name: "cluster", Clusters: func() []*Cluster { whaleNodeTemplate := NodeTemplateGpu(2) - whaleNodeTemplate.Taints = []v1.Taint{ + whaleNodeTemplate.Taints = []*v1.Taint{ {Key: "gpu-whale", Value: "true", Effect: v1.TaintEffectNoSchedule}, } return []*Cluster{ @@ -351,15 +351,15 @@ func TestSimulator(t *testing.T) { Number: 2, JobSet: "job-set-0", PriorityClassName: "armada-preemptible", - Requirements: schedulerobjects.PodRequirements{ - ResourceRequirements: v1.ResourceRequirements{ + Requirements: &schedulerobjects.PodRequirements{ + ResourceRequirements: &v1.ResourceRequirements{ Requests: v1.ResourceList{ "cpu": resource.MustParse("128"), "memory": resource.MustParse("4096Gi"), "nvidia.com/gpu": resource.MustParse("8"), }, }, - Tolerations: []v1.Toleration{ + Tolerations: []*v1.Toleration{ {Key: "gpu-whale", Value: "true", Effect: v1.TaintEffectNoSchedule}, }, }, @@ -377,8 +377,8 @@ func TestSimulator(t *testing.T) { Number: 32, JobSet: "job-set-1", PriorityClassName: "armada-preemptible-away", - Requirements: schedulerobjects.PodRequirements{ - ResourceRequirements: v1.ResourceRequirements{ + Requirements: &schedulerobjects.PodRequirements{ + ResourceRequirements: &v1.ResourceRequirements{ Requests: v1.ResourceList{ "cpu": resource.MustParse("16"), "memory": resource.MustParse("512Gi"), diff --git a/internal/scheduler/simulator/test_utils.go b/internal/scheduler/simulator/test_utils.go index d55b6437103..d6ae3fdae56 100644 --- a/internal/scheduler/simulator/test_utils.go +++ b/internal/scheduler/simulator/test_utils.go @@ -137,8 +137,8 @@ func JobTemplate32Cpu(n int64, jobSet, priorityClassName string) *JobTemplate { Number: n, JobSet: jobSet, PriorityClassName: priorityClassName, - Requirements: schedulerobjects.PodRequirements{ - ResourceRequirements: v1.ResourceRequirements{ + Requirements: &schedulerobjects.PodRequirements{ + ResourceRequirements: &v1.ResourceRequirements{ Requests: v1.ResourceList{ "cpu": resource.MustParse("32"), "memory": resource.MustParse("256Gi"), @@ -160,8 +160,8 @@ func JobTemplate1Cpu(n int64, jobSet, priorityClassName string) *JobTemplate { Number: n, JobSet: jobSet, PriorityClassName: priorityClassName, - Requirements: schedulerobjects.PodRequirements{ - ResourceRequirements: v1.ResourceRequirements{ + Requirements: &schedulerobjects.PodRequirements{ + ResourceRequirements: &v1.ResourceRequirements{ Requests: v1.ResourceList{ "cpu": resource.MustParse("1"), "memory": resource.MustParse("10Gi"), diff --git a/internal/scheduler/submitcheck_test.go b/internal/scheduler/submitcheck_test.go index 97b98f822b2..67e98aa98de 100644 --- a/internal/scheduler/submitcheck_test.go +++ b/internal/scheduler/submitcheck_test.go @@ -395,7 +395,7 @@ func GpuNode(pool string) *schedulerobjects.Node { "memory": resource.MustParse("512Gi"), "nvidia.com/gpu": resource.MustParse("8"), }) - node.Taints = []v1.Taint{ + node.Taints = []*v1.Taint{ { Key: "gpu", Value: "true", diff --git a/internal/scheduler/testfixtures/testfixtures.go b/internal/scheduler/testfixtures/testfixtures.go index 57e4a699439..52854773383 100644 --- a/internal/scheduler/testfixtures/testfixtures.go +++ b/internal/scheduler/testfixtures/testfixtures.go @@ -107,7 +107,7 @@ var ( // 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)) + SchedulingKeyGenerator = internaltypes.NewSchedulingKeyGeneratorWithKey(make([]byte, 32)) // Used for job creation. JobDb = NewJobDb(TestResourceListFactory) ) diff --git a/internal/scheduleringester/instructions.go b/internal/scheduleringester/instructions.go index d64a2f0b83e..ef732e84b13 100644 --- a/internal/scheduleringester/instructions.go +++ b/internal/scheduleringester/instructions.go @@ -519,7 +519,7 @@ func SchedulingInfoFromSubmitJob(submitJob *armadaevents.SubmitJob, submitTime t AtMostOnce: submitJob.AtMostOnce, Preemptible: submitJob.Preemptible, ConcurrencySafe: submitJob.ConcurrencySafe, - SubmitTime: submitTime, + SubmitTime: protoutil.ToTimestamp(submitTime), Priority: submitJob.Priority, Version: 0, } diff --git a/internal/scheduleringester/instructions_test.go b/internal/scheduleringester/instructions_test.go index ea79d2ae7f0..8ed1fcf5f51 100644 --- a/internal/scheduleringester/instructions_test.go +++ b/internal/scheduleringester/instructions_test.go @@ -14,6 +14,7 @@ import ( "github.com/armadaproject/armada/internal/common/ingest/metrics" f "github.com/armadaproject/armada/internal/common/ingest/testfixtures" protoutil "github.com/armadaproject/armada/internal/common/proto" + armadaslices "github.com/armadaproject/armada/internal/common/slices" schedulerdb "github.com/armadaproject/armada/internal/scheduler/database" "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" "github.com/armadaproject/armada/internal/server/configuration" @@ -404,15 +405,17 @@ func getExpectedSubmitMessageSchedulingInfo(t *testing.T) *schedulerobjects.JobS Version: 0, PriorityClassName: "test-priority", Priority: 3, - SubmitTime: f.BaseTime, + SubmitTime: protoutil.ToTimestamp(f.BaseTime), ObjectRequirements: []*schedulerobjects.ObjectRequirements{ { Requirements: &schedulerobjects.ObjectRequirements_PodRequirements{ PodRequirements: &schedulerobjects.PodRequirements{ - NodeSelector: f.NodeSelector, - Tolerations: f.Tolerations, + NodeSelector: f.NodeSelector, + Tolerations: armadaslices.Map(f.Tolerations, func(t v1.Toleration) *v1.Toleration { + return &t + }), PreemptionPolicy: "PreemptLowerPriority", - ResourceRequirements: v1.ResourceRequirements{ + ResourceRequirements: &v1.ResourceRequirements{ Limits: map[v1.ResourceName]resource.Quantity{ "memory": resource.MustParse("64Mi"), "cpu": resource.MustParse("150m"), diff --git a/internal/server/event/conversion/conversions_test.go b/internal/server/event/conversion/conversions_test.go index 95ae1ef6606..8cc18b136db 100644 --- a/internal/server/event/conversion/conversions_test.go +++ b/internal/server/event/conversion/conversions_test.go @@ -234,7 +234,7 @@ func TestConvertLeased(t *testing.T) { JobId: jobId, ExecutorId: executorId, PodRequirementsOverlay: &schedulerobjects.PodRequirements{ - Tolerations: []v1.Toleration{ + Tolerations: []*v1.Toleration{ { Key: "whale", Value: "true", diff --git a/pkg/api/util.go b/pkg/api/util.go index 7eb8ecbba0a..2a1adb43c6b 100644 --- a/pkg/api/util.go +++ b/pkg/api/util.go @@ -43,7 +43,7 @@ func JobRunStateFromApiJobState(s JobState) schedulerobjects.JobRunState { // ) // // This is because containers run in parallel, whereas initContainers run serially. -func SchedulingResourceRequirementsFromPodSpec(podSpec *v1.PodSpec) v1.ResourceRequirements { +func SchedulingResourceRequirementsFromPodSpec(podSpec *v1.PodSpec) *v1.ResourceRequirements { rv := v1.ResourceRequirements{ Requests: make(v1.ResourceList), Limits: make(v1.ResourceList), @@ -72,7 +72,7 @@ func SchedulingResourceRequirementsFromPodSpec(podSpec *v1.PodSpec) v1.ResourceR } } } - return rv + return &rv } func (job *Job) GetMainPodSpec() *v1.PodSpec { diff --git a/pkg/api/util_test.go b/pkg/api/util_test.go index d3acc84923d..21b45f7c1dc 100644 --- a/pkg/api/util_test.go +++ b/pkg/api/util_test.go @@ -11,7 +11,7 @@ import ( func TestSchedulingResourceRequirementsFromPodSpec(t *testing.T) { tests := map[string]struct { input *v1.PodSpec - expected v1.ResourceRequirements + expected *v1.ResourceRequirements }{ "containers and initContainers": { input: &v1.PodSpec{ @@ -90,7 +90,7 @@ func TestSchedulingResourceRequirementsFromPodSpec(t *testing.T) { }, }, }, - expected: v1.ResourceRequirements{ + expected: &v1.ResourceRequirements{ Requests: v1.ResourceList{ "cpu": QuantityWithMilliValue(10), "memory": QuantityWithMilliValue(10), @@ -150,7 +150,7 @@ func TestSchedulingResourceRequirementsFromPodSpec(t *testing.T) { }, }, }, - expected: v1.ResourceRequirements{ + expected: &v1.ResourceRequirements{ Requests: v1.ResourceList{ "cpu": QuantityWithMilliValue(11), "memory": QuantityWithMilliValue(7), @@ -210,7 +210,7 @@ func TestSchedulingResourceRequirementsFromPodSpec(t *testing.T) { }, }, }, - expected: v1.ResourceRequirements{ + expected: &v1.ResourceRequirements{ Requests: v1.ResourceList{ "cpu": QuantityWithMilliValue(10), "memory": QuantityWithMilliValue(5), diff --git a/pkg/executorapi/util.go b/pkg/executorapi/util.go index 571ac2cadd6..b11bfe87674 100644 --- a/pkg/executorapi/util.go +++ b/pkg/executorapi/util.go @@ -4,12 +4,11 @@ import ( "time" "github.com/pkg/errors" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" "github.com/armadaproject/armada/internal/common/armadaerrors" armadamaps "github.com/armadaproject/armada/internal/common/maps" - armadaslices "github.com/armadaproject/armada/internal/common/slices" + protoutil "github.com/armadaproject/armada/internal/common/proto" "github.com/armadaproject/armada/internal/scheduler/schedulerobjects" "github.com/armadaproject/armada/pkg/api" ) @@ -56,17 +55,12 @@ func NewNodeFromNodeInfo(nodeInfo *NodeInfo, executor string, allowedPriorities jobRunsByState[jobId] = api.JobRunStateFromApiJobState(state) } return &schedulerobjects.Node{ - Id: api.NodeIdFromExecutorAndNodeName(executor, nodeInfo.Name), - Name: nodeInfo.Name, - Executor: executor, - Pool: nodeInfo.Pool, - LastSeen: lastSeen, - Taints: armadaslices.Map(nodeInfo.GetTaints(), func(v *v1.Taint) v1.Taint { - if v != nil { - return *v - } - return v1.Taint{} - }), + Id: api.NodeIdFromExecutorAndNodeName(executor, nodeInfo.Name), + Name: nodeInfo.Name, + Executor: executor, + Pool: nodeInfo.Pool, + LastSeen: protoutil.ToTimestamp(lastSeen), + Taints: nodeInfo.GetTaints(), Labels: nodeInfo.GetLabels(), TotalResources: ResourceListFromProtoResources(nodeInfo.TotalResources), AllocatableByPriorityAndResource: allocatableByPriorityAndResource,