From 9d4dd509a2ae528e225f2dbc7dd184089205c6b2 Mon Sep 17 00:00:00 2001 From: Abhishek Malvankar Date: Wed, 12 Jul 2023 11:37:25 -0400 Subject: [PATCH 1/3] add role for qst --- deployment/mcad-controller/templates/deployment.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deployment/mcad-controller/templates/deployment.yaml b/deployment/mcad-controller/templates/deployment.yaml index 7990a71f9..cfaa0a887 100644 --- a/deployment/mcad-controller/templates/deployment.yaml +++ b/deployment/mcad-controller/templates/deployment.yaml @@ -111,6 +111,7 @@ metadata: rules: - apiGroups: - mcad.ibm.com + - ibm.com resources: - xqueuejobs - queuejobs @@ -118,6 +119,7 @@ rules: - appwrappers - appwrappers/finalizers - appwrappers/status + - quotasubtrees verbs: - create - delete From 25b339723e5e9acdb5374a3b711e934fd8d5feb2 Mon Sep 17 00:00:00 2001 From: Abhishek Malvankar Date: Tue, 18 Jul 2023 09:59:44 -0400 Subject: [PATCH 2/3] hack to enable preemption --- .../qm_lib_backend_with_quotasubt_mgr.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr.go b/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr.go index d1c9b96dc..394cfd54e 100644 --- a/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr.go +++ b/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr.go @@ -541,7 +541,14 @@ func (qm *QuotaManager) Fits(aw *arbv1.AppWrapper, awResDemands *clusterstateapi qm.removeConsumer(consumerID) return doesFit, preemptIds, strings.TrimSpace(allocResponse.GetMessage()) } - preemptIds = qm.getAppWrappers(allocResponse.GetPreemptedIds()) + if len(allocResponse.GetPreemptedIds()) > 0 { + preemptIds = qm.getAppWrappers(allocResponse.GetPreemptedIds()) + } else { + var s []string + s = append(s, allocResponse.GetConsumerID()) + preemptIds = qm.getAppWrappers(s) + } + return doesFit, preemptIds, strings.TrimSpace(allocResponse.GetMessage()) } From 1f8801b035968afb6f05bd93de0b64cc599a2963 Mon Sep 17 00:00:00 2001 From: Abhishek Malvankar Date: Thu, 20 Jul 2023 10:26:21 -0400 Subject: [PATCH 3/3] Revert "hack to enable preemption" This reverts commit 25b339723e5e9acdb5374a3b711e934fd8d5feb2. --- .../qm_lib_backend_with_quotasubt_mgr.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr.go b/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr.go index 394cfd54e..d1c9b96dc 100644 --- a/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr.go +++ b/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr.go @@ -541,14 +541,7 @@ func (qm *QuotaManager) Fits(aw *arbv1.AppWrapper, awResDemands *clusterstateapi qm.removeConsumer(consumerID) return doesFit, preemptIds, strings.TrimSpace(allocResponse.GetMessage()) } - if len(allocResponse.GetPreemptedIds()) > 0 { - preemptIds = qm.getAppWrappers(allocResponse.GetPreemptedIds()) - } else { - var s []string - s = append(s, allocResponse.GetConsumerID()) - preemptIds = qm.getAppWrappers(s) - } - + preemptIds = qm.getAppWrappers(allocResponse.GetPreemptedIds()) return doesFit, preemptIds, strings.TrimSpace(allocResponse.GetMessage()) }