This is an automated email from the ASF dual-hosted git repository.
ccondit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-core.git
The following commit(s) were added to refs/heads/master by this push:
new 685efbe9 [YUNIKORN-2798] MaxApplications should support static queues
(#941)
685efbe9 is described below
commit 685efbe95c1c9157d1b678a76b4546b6037e03d5
Author: qzhu <[email protected]>
AuthorDate: Mon Aug 12 15:11:46 2024 -0500
[YUNIKORN-2798] MaxApplications should support static queues (#941)
An oversight was discovered that prevented the MaxApplications
setting from being honored on static queues.
Closes: #941
Signed-off-by: Craig Condit <[email protected]>
---
pkg/scheduler/objects/queue.go | 3 ++-
pkg/scheduler/objects/queue_test.go | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/pkg/scheduler/objects/queue.go b/pkg/scheduler/objects/queue.go
index 35993238..c2cccef3 100644
--- a/pkg/scheduler/objects/queue.go
+++ b/pkg/scheduler/objects/queue.go
@@ -358,11 +358,12 @@ func (sq *Queue) applyConf(conf configs.QueueConfig)
error {
}
}
- // Load the max & guaranteed resources for all but the root queue
+ // Load the max & guaranteed resources and maxApps for all but the root
queue
if sq.Name != configs.RootQueue {
if err = sq.setResourcesFromConf(conf.Resources); err != nil {
return err
}
+ sq.maxRunningApps = conf.MaxApplications
}
sq.properties = conf.Properties
diff --git a/pkg/scheduler/objects/queue_test.go
b/pkg/scheduler/objects/queue_test.go
index fd673a64..bcf4a06b 100644
--- a/pkg/scheduler/objects/queue_test.go
+++ b/pkg/scheduler/objects/queue_test.go
@@ -1999,6 +1999,7 @@ func TestApplyConf(t *testing.T) {
Guaranteed: getResourceConf(),
},
},
+ MaxApplications: 100,
}
// case 0: leaf can't set template
@@ -2015,6 +2016,7 @@ func TestApplyConf(t *testing.T) {
assert.Assert(t, leaf.template == nil)
assert.Assert(t, leaf.maxResource != nil)
assert.Assert(t, leaf.guaranteedResource != nil)
+ assert.Equal(t, leaf.maxRunningApps, uint64(100))
// case 1-1: non-leaf queue can have template
queue, err := createManagedQueueWithProps(nil, "tmp", true, nil, nil)
@@ -2026,6 +2028,7 @@ func TestApplyConf(t *testing.T) {
assert.Assert(t, queue.template != nil)
assert.Assert(t, queue.maxResource != nil)
assert.Assert(t, queue.guaranteedResource != nil)
+ assert.Equal(t, queue.maxRunningApps, uint64(100))
// root can't set resources
root, err := createManagedQueueWithProps(nil, "root", true, nil, nil)
@@ -2035,6 +2038,7 @@ func TestApplyConf(t *testing.T) {
assert.NilError(t, err, "failed to apply conf: %v", err)
assert.Assert(t, root.maxResource == nil)
assert.Assert(t, root.guaranteedResource == nil)
+ assert.Equal(t, root.maxRunningApps, uint64(0))
}
func TestNewConfiguredQueue(t *testing.T) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]