Skip to content

Commit

Permalink
comment out default exclusive affinities temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvegamyhre committed Oct 4, 2023
1 parent 80ace7a commit 278d01a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions pkg/controllers/jobset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,17 +596,18 @@ func constructJob(js *jobset.JobSet, rjob *jobset.ReplicatedJob, jobIdx int) (*b
}

// If this job should be exclusive per topology, configure the scheduling constraints accordingly.
if topologyDomain, ok := js.Annotations[jobset.ExclusiveKey]; ok {
if _, ok := js.Annotations[jobset.ExclusiveKey]; ok {
// If user has set the nodeSelectorStrategy annotation flag, add the job name label as a
// nodeSelector, and add a toleration for the no schedule taint.
// The node label and node taint must be added separately by a user/script.
if _, exists := js.Annotations[jobset.NodeSelectorStrategyKey]; exists {
addNamespacedJobNodeSelector(job)
addTaintToleration(job)
} else {
// Otherwise, default to using exclusive pod affinities/anti-affinities strategy.
setExclusiveAffinities(job, topologyDomain)
}
// else {
// // Otherwise, default to using exclusive pod affinities/anti-affinities strategy.
// setExclusiveAffinities(job, topologyDomain)
// }
}

// if Suspend is set, then we assume all jobs will be suspended also.
Expand Down
5 changes: 3 additions & 2 deletions pkg/controllers/jobset_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client/fake"

jobset "sigs.k8s.io/jobset/api/jobset/v1alpha2"
shared "sigs.k8s.io/jobset/pkg/util/shared"
testutils "sigs.k8s.io/jobset/pkg/util/testing"
)

Expand Down Expand Up @@ -328,7 +329,7 @@ func TestConstructJobsFromTemplate(t *testing.T) {
{
Key: jobset.JobKey,
Operator: metav1.LabelSelectorOpIn,
Values: []string{names.JobHashKey(ns, "test-jobset-replicated-job-0")},
Values: []string{shared.JobHashKey(ns, "test-jobset-replicated-job-0")},
},
}},
TopologyKey: topologyDomain,
Expand All @@ -347,7 +348,7 @@ func TestConstructJobsFromTemplate(t *testing.T) {
{
Key: jobset.JobKey,
Operator: metav1.LabelSelectorOpNotIn,
Values: []string{names.JobHashKey(ns, "test-jobset-replicated-job-0")},
Values: []string{shared.JobHashKey(ns, "test-jobset-replicated-job-0")},
},
}},
TopologyKey: topologyDomain,
Expand Down

0 comments on commit 278d01a

Please sign in to comment.