From 6d0eadcac25be7065189f432d98082396c2ce9c8 Mon Sep 17 00:00:00 2001
From: Sagar Arora <sagar.arora@openairinterface.org>
Date: Tue, 13 Dec 2022 22:19:48 +0100
Subject: [PATCH] (fix): Manually assign physim pods to nodes

The physim tests fail because, typically, the same tests gets assigned
to the same node which then is overloaded. This MR assigns pods to
different nodes to prevent this.
---
 .../charts/dlsim.100rb+tm2/templates/job.yaml |  5 ++++
 .../charts/dlsim.basic/templates/job.yaml     |  7 ++++-
 .../charts/ldpctest/templates/job.yaml        |  7 ++++-
 .../charts/nr-dlschsim/templates/job.yaml     |  7 ++++-
 .../charts/nr-dlsim.basic/templates/job.yaml  |  7 ++++-
 .../nr-dlsim.dmrs+ptrs/templates/job.yaml     |  7 ++++-
 .../nr-dlsim.mcs+mimo/templates/job.yaml      |  7 ++++-
 .../charts/nr-dlsim.offset/templates/job.yaml |  7 ++++-
 .../nr-pbchsim.106rb/templates/job.yaml       |  7 ++++-
 .../nr-pbchsim.217rb/templates/job.yaml       |  7 ++++-
 .../nr-pbchsim.273rb/templates/job.yaml       |  7 ++++-
 .../charts/nr-prachsim/templates/job.yaml     |  7 ++++-
 .../charts/nr-pucchsim/templates/job.yaml     |  7 ++++-
 .../charts/nr-ulschsim/templates/job.yaml     |  7 ++++-
 .../charts/nr-ulsim.3gpp/templates/job.yaml   |  7 ++++-
 .../charts/nr-ulsim.mimo/templates/job.yaml   |  7 ++++-
 .../charts/nr-ulsim.misc/templates/job.yaml   |  7 ++++-
 .../nr-ulsim.sc-fdma/templates/job.yaml       |  7 ++++-
 .../charts/polartest/templates/job.yaml       |  7 ++++-
 .../charts/smallblocktest/templates/job.yaml  |  7 ++++-
 .../physims/charts/ulsim/templates/job.yaml   |  7 ++++-
 charts/physims/values.yaml                    | 29 +++++++++++++++++--
 22 files changed, 151 insertions(+), 23 deletions(-)

diff --git a/charts/physims/charts/dlsim.100rb+tm2/templates/job.yaml b/charts/physims/charts/dlsim.100rb+tm2/templates/job.yaml
index d42742ffb81..fdd12deb8fe 100644
--- a/charts/physims/charts/dlsim.100rb+tm2/templates/job.yaml
+++ b/charts/physims/charts/dlsim.100rb+tm2/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
          {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.dlsim100rbtm2}}
+      nodeName: {{ .Values.global.nodeName.dlsim100rbtm2 }}
+      {{- end }}
diff --git a/charts/physims/charts/dlsim.basic/templates/job.yaml b/charts/physims/charts/dlsim.basic/templates/job.yaml
index 35e386b890a..3c6d726217f 100644
--- a/charts/physims/charts/dlsim.basic/templates/job.yaml
+++ b/charts/physims/charts/dlsim.basic/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }} 
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.dlsimbasic}}
+      nodeName: {{ .Values.global.nodeName.dlsimbasic }}
+      {{- end }}
diff --git a/charts/physims/charts/ldpctest/templates/job.yaml b/charts/physims/charts/ldpctest/templates/job.yaml
index 097c0216266..8a1060599fb 100644
--- a/charts/physims/charts/ldpctest/templates/job.yaml
+++ b/charts/physims/charts/ldpctest/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.ldpctest}}
+      nodeName: {{ .Values.global.nodeName.ldpctest }}
+      {{- end }}
diff --git a/charts/physims/charts/nr-dlschsim/templates/job.yaml b/charts/physims/charts/nr-dlschsim/templates/job.yaml
index c696eb906c1..e6d3b79f4af 100644
--- a/charts/physims/charts/nr-dlschsim/templates/job.yaml
+++ b/charts/physims/charts/nr-dlschsim/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.nrdlschsim}}
+      nodeName: {{ .Values.global.nodeName.nrdlschsim }}
+      {{- end }}
diff --git a/charts/physims/charts/nr-dlsim.basic/templates/job.yaml b/charts/physims/charts/nr-dlsim.basic/templates/job.yaml
index 46dbbff0fae..2bf2a337c25 100644
--- a/charts/physims/charts/nr-dlsim.basic/templates/job.yaml
+++ b/charts/physims/charts/nr-dlsim.basic/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.nrdlsimbasic}}
+      nodeName: {{ .Values.global.nodeName.nrdlsimbasic }}
+      {{- end }}
diff --git a/charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/job.yaml b/charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/job.yaml
index e319ae7b53b..bbf2ff30dea 100644
--- a/charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/job.yaml
+++ b/charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.nrdlsimdmrsptrs}}
+      nodeName: {{ .Values.global.nodeName.nrdlsimdmrsptrs }}
+      {{- end }}
diff --git a/charts/physims/charts/nr-dlsim.mcs+mimo/templates/job.yaml b/charts/physims/charts/nr-dlsim.mcs+mimo/templates/job.yaml
index 0649dc67b3d..55a0345da63 100644
--- a/charts/physims/charts/nr-dlsim.mcs+mimo/templates/job.yaml
+++ b/charts/physims/charts/nr-dlsim.mcs+mimo/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.nrdlsimmcsmimo}}
+      nodeName: {{ .Values.global.nodeName.nrdlsimmcsmimo }}
+      {{- end }}
diff --git a/charts/physims/charts/nr-dlsim.offset/templates/job.yaml b/charts/physims/charts/nr-dlsim.offset/templates/job.yaml
index 5a88c43ec2b..6dd3efb4cfe 100644
--- a/charts/physims/charts/nr-dlsim.offset/templates/job.yaml
+++ b/charts/physims/charts/nr-dlsim.offset/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.nrdlsimoffset}}
+      nodeName: {{ .Values.global.nodeName.nrdlsimoffset }}
+      {{- end }}
diff --git a/charts/physims/charts/nr-pbchsim.106rb/templates/job.yaml b/charts/physims/charts/nr-pbchsim.106rb/templates/job.yaml
index 1af0be82e56..44b795c7640 100644
--- a/charts/physims/charts/nr-pbchsim.106rb/templates/job.yaml
+++ b/charts/physims/charts/nr-pbchsim.106rb/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.nrpbschsim106rb}}
+      nodeName: {{ .Values.global.nodeName.nrpbschsim106rb }}
+      {{- end }}
diff --git a/charts/physims/charts/nr-pbchsim.217rb/templates/job.yaml b/charts/physims/charts/nr-pbchsim.217rb/templates/job.yaml
index cad15d1491c..bc5eef2db00 100644
--- a/charts/physims/charts/nr-pbchsim.217rb/templates/job.yaml
+++ b/charts/physims/charts/nr-pbchsim.217rb/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.nrpbchsim217rb}}
+      nodeName: {{ .Values.global.nodeName.nrpbchsim217rb }}
+      {{- end }}
diff --git a/charts/physims/charts/nr-pbchsim.273rb/templates/job.yaml b/charts/physims/charts/nr-pbchsim.273rb/templates/job.yaml
index 65be9e4caa3..a1c2afaa27c 100644
--- a/charts/physims/charts/nr-pbchsim.273rb/templates/job.yaml
+++ b/charts/physims/charts/nr-pbchsim.273rb/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.nrpbchsim273rb}}
+      nodeName: {{ .Values.global.nodeName.nrpbchsim273rb }}
+      {{- end }}
diff --git a/charts/physims/charts/nr-prachsim/templates/job.yaml b/charts/physims/charts/nr-prachsim/templates/job.yaml
index 872729550a5..fa9b8952a07 100644
--- a/charts/physims/charts/nr-prachsim/templates/job.yaml
+++ b/charts/physims/charts/nr-prachsim/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.nrprachsim}}
+      nodeName: {{ .Values.global.nodeName.nrprachsim }}
+      {{- end }}
diff --git a/charts/physims/charts/nr-pucchsim/templates/job.yaml b/charts/physims/charts/nr-pucchsim/templates/job.yaml
index a845215eeba..21f5e9a36a1 100644
--- a/charts/physims/charts/nr-pucchsim/templates/job.yaml
+++ b/charts/physims/charts/nr-pucchsim/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.nrpucchsim}}
+      nodeName: {{ .Values.global.nodeName.nrpucchsim }}
+      {{- end }}
diff --git a/charts/physims/charts/nr-ulschsim/templates/job.yaml b/charts/physims/charts/nr-ulschsim/templates/job.yaml
index 2916f0fc12c..57d19d41c62 100644
--- a/charts/physims/charts/nr-ulschsim/templates/job.yaml
+++ b/charts/physims/charts/nr-ulschsim/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.nrulschsim}}
+      nodeName: {{ .Values.global.nodeName.nrulschsim }}
+      {{- end }}
diff --git a/charts/physims/charts/nr-ulsim.3gpp/templates/job.yaml b/charts/physims/charts/nr-ulsim.3gpp/templates/job.yaml
index 2f8a445589e..a0cf170d8d0 100644
--- a/charts/physims/charts/nr-ulsim.3gpp/templates/job.yaml
+++ b/charts/physims/charts/nr-ulsim.3gpp/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.nrulsim3gpp}}
+      nodeName: {{ .Values.global.nodeName.nrulsim3gpp }}
+      {{- end }}
diff --git a/charts/physims/charts/nr-ulsim.mimo/templates/job.yaml b/charts/physims/charts/nr-ulsim.mimo/templates/job.yaml
index d385551fcb2..e37691a9385 100644
--- a/charts/physims/charts/nr-ulsim.mimo/templates/job.yaml
+++ b/charts/physims/charts/nr-ulsim.mimo/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.nrulsimmimo}}
+      nodeName: {{ .Values.global.nodeName.nrulsimmimo }}
+      {{- end }}
diff --git a/charts/physims/charts/nr-ulsim.misc/templates/job.yaml b/charts/physims/charts/nr-ulsim.misc/templates/job.yaml
index 492baab464f..ec59b4a3b3b 100644
--- a/charts/physims/charts/nr-ulsim.misc/templates/job.yaml
+++ b/charts/physims/charts/nr-ulsim.misc/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.nrulsimmisc}}
+      nodeName: {{ .Values.global.nodeName.nrulsimmisc }}
+      {{- end }}
diff --git a/charts/physims/charts/nr-ulsim.sc-fdma/templates/job.yaml b/charts/physims/charts/nr-ulsim.sc-fdma/templates/job.yaml
index 8283c65f5e3..d3b84cb3695 100644
--- a/charts/physims/charts/nr-ulsim.sc-fdma/templates/job.yaml
+++ b/charts/physims/charts/nr-ulsim.sc-fdma/templates/job.yaml
@@ -35,5 +35,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.nrulsimscfdma}}
+      nodeName: {{ .Values.global.nodeName.nrulsimscfdma }}
+      {{- end }}
diff --git a/charts/physims/charts/polartest/templates/job.yaml b/charts/physims/charts/polartest/templates/job.yaml
index 61e82957ce6..1b1d7d608e4 100644
--- a/charts/physims/charts/polartest/templates/job.yaml
+++ b/charts/physims/charts/polartest/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.polartest}}
+      nodeName: {{ .Values.global.nodeName.polartest }}
+      {{- end }}
diff --git a/charts/physims/charts/smallblocktest/templates/job.yaml b/charts/physims/charts/smallblocktest/templates/job.yaml
index f034db3e69a..70d9bd653f9 100644
--- a/charts/physims/charts/smallblocktest/templates/job.yaml
+++ b/charts/physims/charts/smallblocktest/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.smallblocktest}}
+      nodeName: {{ .Values.global.nodeName.smallblocktest }}
+      {{- end }}
diff --git a/charts/physims/charts/ulsim/templates/job.yaml b/charts/physims/charts/ulsim/templates/job.yaml
index d61d793c3b3..1ce4cf21f49 100644
--- a/charts/physims/charts/ulsim/templates/job.yaml
+++ b/charts/physims/charts/ulsim/templates/job.yaml
@@ -33,5 +33,10 @@ spec:
       schedulerName: default-scheduler
       serviceAccountName: {{ .Values.global.serviceAccountName }}
       terminationGracePeriodSeconds: 30
+      {{- if .Values.global.nodeSelector}}
       nodeSelector:
-         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
\ No newline at end of file
+         {{- toYaml .Values.global.nodeSelector | nindent 12 }}
+      {{- end }}
+      {{- if .Values.global.nodeName.ulsim}}
+      nodeName: {{ .Values.global.nodeName.ulsim }}
+      {{- end }}
diff --git a/charts/physims/values.yaml b/charts/physims/values.yaml
index 462f8ff59b9..bac4ed3eb54 100644
--- a/charts/physims/values.yaml
+++ b/charts/physims/values.yaml
@@ -11,6 +11,29 @@ global:
     version: TAG
     # pullPolicy: IfNotPresent or Never or Always
     pullPolicy: Always
-  nodeSelector:
-    worker: "telco"
-
+  # removing the node selector
+  nodeSelector: {}
+  # It is not a good way of assigning pods to the nodes: this way we bypass the scheduler. At the moment we don't provide the resource information of these pods.
+  # Therefore, Openshift assigns the pods to the same node because it thinks the pods don't consume much resources. This isn't the case, they consume a lot of resources.
+  nodeName:
+    dlsim100rbtm2: acamas
+    dlsimbasic: acamas
+    ldpctest: acamas
+    nrdlschsim: acamas
+    nrdlsimbasic: acamas
+    nrdlsimdmrsptrs: acamas
+    nrdlsimmcsmimo: acamas
+    nrdlsimoffset: dedale
+    nrpbschsim106rb: dedale
+    nrpbchsim217rb: dedale
+    nrpbchsim273rb: dedale
+    nrprachsim: dedale
+    nrpucchsim: dedale
+    nrulschsim: theseus
+    nrulsim3gpp: theseus
+    nrulsimmimo: theseus
+    nrulsimmisc: theseus
+    nrulsimscfdma: theseus
+    polartest: theseus
+    smallblocktest: theseus
+    ulsim: theseus
-- 
GitLab