diff --git a/CMakeLists.txt b/CMakeLists.txt index 81cc1edf76..7124548c39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2545,7 +2545,6 @@ target_link_libraries(nrscope ${XFORMS_LIBRARIES}) add_library(rfsimulator MODULE ${OPENAIR_DIR}/radio/rfsimulator/simulator.c ${OPENAIR_DIR}/radio/rfsimulator/apply_channelmod.c - ${OPENAIR_DIR}/radio/rfsimulator/new_channel_sim.c ${OPENAIR1_DIR}/PHY/TOOLS/signal_energy.c ) target_link_libraries(rfsimulator SIMU_COMMON ${ATLAS_LIBRARIES}) diff --git a/charts/physims/Chart.yaml b/charts/physims/Chart.yaml index bef28aac27..0a6abe4caa 100644 --- a/charts/physims/Chart.yaml +++ b/charts/physims/Chart.yaml @@ -16,7 +16,7 @@ icon: http://www.openairinterface.org/wp-content/uploads/2015/06/cropped-oai_fin # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 0.1.1 +version: 1.0.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. diff --git a/charts/physims/charts/dlsim.100rb+tm2/templates/NOTES.txt b/charts/physims/charts/dlsim.100rb+tm2/templates/NOTES.txt deleted file mode 100644 index 89f5185499..0000000000 --- a/charts/physims/charts/dlsim.100rb+tm2/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-dlsim-100rb-tm2.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-dlsim-100rb-tm2.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-dlsim-100rb-tm2.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-dlsim-100rb-tm2.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/dlsim.100rb+tm2/templates/deployment.yaml b/charts/physims/charts/dlsim.100rb+tm2/templates/job.yaml similarity index 70% rename from charts/physims/charts/dlsim.100rb+tm2/templates/deployment.yaml rename to charts/physims/charts/dlsim.100rb+tm2/templates/job.yaml index 88bf277a03..d42742ffb8 100644 --- a/charts/physims/charts/dlsim.100rb+tm2/templates/deployment.yaml +++ b/charts/physims/charts/dlsim.100rb+tm2/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-dlsim-100rb-tm2.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-dlsim-100rb-tm2.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-dlsim-100rb-tm2.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,8 +20,6 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim @@ -39,7 +29,9 @@ spec: cmake_targets/autotests/run_exec_autotests.bash -g "dlsim.100rb+tm2" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} diff --git a/charts/physims/charts/dlsim.100rb+tm2/templates/service.yaml b/charts/physims/charts/dlsim.100rb+tm2/templates/service.yaml deleted file mode 100644 index 377e567c9a..0000000000 --- a/charts/physims/charts/dlsim.100rb+tm2/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-dlsim-100rb-tm2.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-dlsim-100rb-tm2 - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-dlsim-100rb-tm2.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/dlsim.100rb+tm2/values.yaml b/charts/physims/charts/dlsim.100rb+tm2/values.yaml index f3d1aa3d74..aae621bd84 100644 --- a/charts/physims/charts/dlsim.100rb+tm2/values.yaml +++ b/charts/physims/charts/dlsim.100rb+tm2/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/dlsim.basic/templates/NOTES.txt b/charts/physims/charts/dlsim.basic/templates/NOTES.txt deleted file mode 100644 index 1111598300..0000000000 --- a/charts/physims/charts/dlsim.basic/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-dlsim-basic.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-dlsim-basic.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-dlsim-basic.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-dlsim-basic.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/dlsim.basic/templates/deployment.yaml b/charts/physims/charts/dlsim.basic/templates/job.yaml similarity index 68% rename from charts/physims/charts/dlsim.basic/templates/deployment.yaml rename to charts/physims/charts/dlsim.basic/templates/job.yaml index f74f504727..35e386b890 100644 --- a/charts/physims/charts/dlsim.basic/templates/deployment.yaml +++ b/charts/physims/charts/dlsim.basic/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-dlsim-basic.labels" . | nindent 4 }} + name: {{ .Chart.Name }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-dlsim-basic.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-dlsim-basic.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,8 +20,6 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim @@ -39,7 +29,9 @@ spec: cmake_targets/autotests/run_exec_autotests.bash -g "dlsim.basic" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler - serviceAccountName: {{ .Values.global.serviceAccountName }} + serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/dlsim.basic/templates/service.yaml b/charts/physims/charts/dlsim.basic/templates/service.yaml deleted file mode 100644 index 27e22a31d9..0000000000 --- a/charts/physims/charts/dlsim.basic/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-dlsim-basic.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-dlsim-basic - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-dlsim-basic.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/dlsim.basic/values.yaml b/charts/physims/charts/dlsim.basic/values.yaml index e36679ec2b..ae197e12ea 100644 --- a/charts/physims/charts/dlsim.basic/values.yaml +++ b/charts/physims/charts/dlsim.basic/values.yaml @@ -27,31 +27,15 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 + privileged: false -service: - type: ClusterIP - port: 80 - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi +resources: + limits: + cpu: 100m + memory: 128Mi + requests: + cpu: 100m + memory: 128Mi nodeSelector: {} diff --git a/charts/physims/charts/ldpctest/templates/NOTES.txt b/charts/physims/charts/ldpctest/templates/NOTES.txt deleted file mode 100644 index bda83c2f9e..0000000000 --- a/charts/physims/charts/ldpctest/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-ldpctest.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-ldpctest.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-ldpctest.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-ldpctest.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/ldpctest/templates/deployment.yaml b/charts/physims/charts/ldpctest/templates/job.yaml similarity index 70% rename from charts/physims/charts/ldpctest/templates/deployment.yaml rename to charts/physims/charts/ldpctest/templates/job.yaml index 8df3df5c46..097c021626 100644 --- a/charts/physims/charts/ldpctest/templates/deployment.yaml +++ b/charts/physims/charts/ldpctest/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-ldpctest.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-ldpctest.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-ldpctest.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,18 +20,18 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim command: ["/bin/sh", "-c"] args: - - > + - > cmake_targets/autotests/run_exec_autotests.bash -g "ldpctest" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/ldpctest/templates/service.yaml b/charts/physims/charts/ldpctest/templates/service.yaml deleted file mode 100644 index eb0db8ce00..0000000000 --- a/charts/physims/charts/ldpctest/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-ldpctest.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-ldpctest - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-ldpctest.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/ldpctest/values.yaml b/charts/physims/charts/ldpctest/values.yaml index 0ac20e6dd3..0ff1153a2c 100644 --- a/charts/physims/charts/ldpctest/values.yaml +++ b/charts/physims/charts/ldpctest/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/nr-dlschsim/templates/NOTES.txt b/charts/physims/charts/nr-dlschsim/templates/NOTES.txt deleted file mode 100644 index 1f88d64976..0000000000 --- a/charts/physims/charts/nr-dlschsim/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-nr-dlschsim.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-nr-dlschsim.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-nr-dlschsim.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-dlschsim.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/nr-dlschsim/templates/deployment.yaml b/charts/physims/charts/nr-dlschsim/templates/job.yaml similarity index 69% rename from charts/physims/charts/nr-dlschsim/templates/deployment.yaml rename to charts/physims/charts/nr-dlschsim/templates/job.yaml index 1016dbef56..c696eb906c 100644 --- a/charts/physims/charts/nr-dlschsim/templates/deployment.yaml +++ b/charts/physims/charts/nr-dlschsim/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-dlschsim.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-nr-dlschsim.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-nr-dlschsim.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,18 +20,18 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim command: ["/bin/sh", "-c"] args: - - > + - > cmake_targets/autotests/run_exec_autotests.bash -g "nr_dlschsim" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/nr-dlschsim/templates/service.yaml b/charts/physims/charts/nr-dlschsim/templates/service.yaml deleted file mode 100644 index 0dd065c9e0..0000000000 --- a/charts/physims/charts/nr-dlschsim/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-dlschsim.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-nr-dlschsim - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-nr-dlschsim.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/nr-dlschsim/values.yaml b/charts/physims/charts/nr-dlschsim/values.yaml index cb32095f76..a75437a0d6 100644 --- a/charts/physims/charts/nr-dlschsim/values.yaml +++ b/charts/physims/charts/nr-dlschsim/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/nr-dlsim.basic/templates/NOTES.txt b/charts/physims/charts/nr-dlsim.basic/templates/NOTES.txt deleted file mode 100644 index c8a7bbfd1b..0000000000 --- a/charts/physims/charts/nr-dlsim.basic/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-nr-dlsim-basic.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-nr-dlsim-basic.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-nr-dlsim-basic.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-dlsim-basic.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/nr-dlsim.basic/templates/deployment.yaml b/charts/physims/charts/nr-dlsim.basic/templates/job.yaml similarity index 70% rename from charts/physims/charts/nr-dlsim.basic/templates/deployment.yaml rename to charts/physims/charts/nr-dlsim.basic/templates/job.yaml index 72ae0406d0..46dbbff0fa 100644 --- a/charts/physims/charts/nr-dlsim.basic/templates/deployment.yaml +++ b/charts/physims/charts/nr-dlsim.basic/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-dlsim-basic.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-nr-dlsim-basic.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-nr-dlsim-basic.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,8 +20,6 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim @@ -39,7 +29,9 @@ spec: cmake_targets/autotests/run_exec_autotests.bash -g "nr_dlsim.basic" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/nr-dlsim.basic/templates/service.yaml b/charts/physims/charts/nr-dlsim.basic/templates/service.yaml deleted file mode 100644 index 5bf3baf772..0000000000 --- a/charts/physims/charts/nr-dlsim.basic/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-dlsim-basic.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-nr-dlsim-basic - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-nr-dlsim-basic.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/nr-dlsim.basic/values.yaml b/charts/physims/charts/nr-dlsim.basic/values.yaml index 4b9db13d7e..88e5a2caaa 100644 --- a/charts/physims/charts/nr-dlsim.basic/values.yaml +++ b/charts/physims/charts/nr-dlsim.basic/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/NOTES.txt b/charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/NOTES.txt deleted file mode 100644 index 5e8f9ba046..0000000000 --- a/charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-nr-dlsim-dmrs-ptrs.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-nr-dlsim-dmrs-ptrs.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-nr-dlsim-dmrs-ptrs.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-dlsim-dmrs-ptrs.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/deployment.yaml b/charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/job.yaml similarity index 69% rename from charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/deployment.yaml rename to charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/job.yaml index 847a1e1aee..e319ae7b53 100644 --- a/charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/deployment.yaml +++ b/charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-dlsim-dmrs-ptrs.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-nr-dlsim-dmrs-ptrs.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-nr-dlsim-dmrs-ptrs.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,8 +20,6 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim @@ -39,7 +29,9 @@ spec: cmake_targets/autotests/run_exec_autotests.bash -g "nr_dlsim.dmrs+ptrs" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/service.yaml b/charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/service.yaml deleted file mode 100644 index b2c3a43b55..0000000000 --- a/charts/physims/charts/nr-dlsim.dmrs+ptrs/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-dlsim-dmrs-ptrs.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-nr-dlsim-dmrs-ptrs - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-nr-dlsim-dmrs-ptrs.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/nr-dlsim.dmrs+ptrs/values.yaml b/charts/physims/charts/nr-dlsim.dmrs+ptrs/values.yaml index 8c1814f19d..357e6c2861 100644 --- a/charts/physims/charts/nr-dlsim.dmrs+ptrs/values.yaml +++ b/charts/physims/charts/nr-dlsim.dmrs+ptrs/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/nr-dlsim.mcs+mimo/templates/NOTES.txt b/charts/physims/charts/nr-dlsim.mcs+mimo/templates/NOTES.txt deleted file mode 100644 index 34e88d2136..0000000000 --- a/charts/physims/charts/nr-dlsim.mcs+mimo/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-nr-dlsim-mcs-mimo.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-nr-dlsim-mcs-mimo.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-nr-dlsim-mcs-mimo.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-dlsim-mcs-mimo.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/nr-dlsim.mcs+mimo/templates/deployment.yaml b/charts/physims/charts/nr-dlsim.mcs+mimo/templates/job.yaml similarity index 70% rename from charts/physims/charts/nr-dlsim.mcs+mimo/templates/deployment.yaml rename to charts/physims/charts/nr-dlsim.mcs+mimo/templates/job.yaml index c79eaf01a2..0649dc67b3 100644 --- a/charts/physims/charts/nr-dlsim.mcs+mimo/templates/deployment.yaml +++ b/charts/physims/charts/nr-dlsim.mcs+mimo/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-dlsim-mcs-mimo.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-nr-dlsim-mcs-mimo.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-nr-dlsim-mcs-mimo.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,8 +20,6 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim @@ -39,7 +29,9 @@ spec: cmake_targets/autotests/run_exec_autotests.bash -g "nr_dlsim.mcs+mimo" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/nr-dlsim.mcs+mimo/templates/service.yaml b/charts/physims/charts/nr-dlsim.mcs+mimo/templates/service.yaml deleted file mode 100644 index c1552fc314..0000000000 --- a/charts/physims/charts/nr-dlsim.mcs+mimo/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-dlsim-mcs-mimo.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-nr-dlsim-mcs-mimo - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-nr-dlsim-mcs-mimo.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/nr-dlsim.mcs+mimo/values.yaml b/charts/physims/charts/nr-dlsim.mcs+mimo/values.yaml index 5bb48ad15d..5ef75a1672 100644 --- a/charts/physims/charts/nr-dlsim.mcs+mimo/values.yaml +++ b/charts/physims/charts/nr-dlsim.mcs+mimo/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/nr-dlsim.offset/templates/NOTES.txt b/charts/physims/charts/nr-dlsim.offset/templates/NOTES.txt deleted file mode 100644 index 9a7d8f6013..0000000000 --- a/charts/physims/charts/nr-dlsim.offset/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-nr-dlsim-offset.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-nr-dlsim-offset.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-nr-dlsim-offset.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-dlsim-offset.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/nr-dlsim.offset/templates/deployment.yaml b/charts/physims/charts/nr-dlsim.offset/templates/job.yaml similarity index 70% rename from charts/physims/charts/nr-dlsim.offset/templates/deployment.yaml rename to charts/physims/charts/nr-dlsim.offset/templates/job.yaml index b952654c93..5a88c43ec2 100644 --- a/charts/physims/charts/nr-dlsim.offset/templates/deployment.yaml +++ b/charts/physims/charts/nr-dlsim.offset/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-dlsim-offset.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-nr-dlsim-offset.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-nr-dlsim-offset.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,8 +20,6 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim @@ -39,7 +29,9 @@ spec: cmake_targets/autotests/run_exec_autotests.bash -g "nr_dlsim.offset" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/nr-dlsim.offset/templates/service.yaml b/charts/physims/charts/nr-dlsim.offset/templates/service.yaml deleted file mode 100644 index dfcbc675a9..0000000000 --- a/charts/physims/charts/nr-dlsim.offset/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-dlsim-offset.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-nr-dlsim-offset - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-nr-dlsim-offset.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/nr-dlsim.offset/values.yaml b/charts/physims/charts/nr-dlsim.offset/values.yaml index 40c1a94efe..efef89ce4a 100644 --- a/charts/physims/charts/nr-dlsim.offset/values.yaml +++ b/charts/physims/charts/nr-dlsim.offset/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/nr-pbchsim.106rb/templates/NOTES.txt b/charts/physims/charts/nr-pbchsim.106rb/templates/NOTES.txt deleted file mode 100644 index 2e0d2ef627..0000000000 --- a/charts/physims/charts/nr-pbchsim.106rb/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-nr-pbchsim-106rb.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-nr-pbchsim-106rb.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-nr-pbchsim-106rb.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-pbchsim-106rb.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/nr-pbchsim.106rb/templates/deployment.yaml b/charts/physims/charts/nr-pbchsim.106rb/templates/job.yaml similarity index 70% rename from charts/physims/charts/nr-pbchsim.106rb/templates/deployment.yaml rename to charts/physims/charts/nr-pbchsim.106rb/templates/job.yaml index ed0f8f1570..1af0be82e5 100644 --- a/charts/physims/charts/nr-pbchsim.106rb/templates/deployment.yaml +++ b/charts/physims/charts/nr-pbchsim.106rb/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-pbchsim-106rb.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-nr-pbchsim-106rb.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-nr-pbchsim-106rb.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,8 +20,6 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim @@ -39,7 +29,9 @@ spec: cmake_targets/autotests/run_exec_autotests.bash -g "nr_pbchsim.106rb" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/nr-pbchsim.106rb/templates/service.yaml b/charts/physims/charts/nr-pbchsim.106rb/templates/service.yaml deleted file mode 100644 index da62687827..0000000000 --- a/charts/physims/charts/nr-pbchsim.106rb/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-pbchsim-106rb.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-nr-pbchsim-106rb - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-nr-pbchsim-106rb.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/nr-pbchsim.106rb/values.yaml b/charts/physims/charts/nr-pbchsim.106rb/values.yaml index 5632762245..8f8104146a 100644 --- a/charts/physims/charts/nr-pbchsim.106rb/values.yaml +++ b/charts/physims/charts/nr-pbchsim.106rb/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/nr-pbchsim.217rb/templates/NOTES.txt b/charts/physims/charts/nr-pbchsim.217rb/templates/NOTES.txt deleted file mode 100644 index 3e9e91db9b..0000000000 --- a/charts/physims/charts/nr-pbchsim.217rb/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-nr-pbchsim-217rb.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-nr-pbchsim-217rb.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-nr-pbchsim-217rb.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-pbchsim-217rb.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/nr-pbchsim.217rb/templates/deployment.yaml b/charts/physims/charts/nr-pbchsim.217rb/templates/job.yaml similarity index 70% rename from charts/physims/charts/nr-pbchsim.217rb/templates/deployment.yaml rename to charts/physims/charts/nr-pbchsim.217rb/templates/job.yaml index 513443deaa..cad15d1491 100644 --- a/charts/physims/charts/nr-pbchsim.217rb/templates/deployment.yaml +++ b/charts/physims/charts/nr-pbchsim.217rb/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-pbchsim-217rb.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-nr-pbchsim-217rb.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-nr-pbchsim-217rb.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,8 +20,6 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim @@ -39,7 +29,9 @@ spec: cmake_targets/autotests/run_exec_autotests.bash -g "nr_pbchsim.217rb" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/nr-pbchsim.217rb/templates/service.yaml b/charts/physims/charts/nr-pbchsim.217rb/templates/service.yaml deleted file mode 100644 index 696c889d15..0000000000 --- a/charts/physims/charts/nr-pbchsim.217rb/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-pbchsim-217rb.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-nr-pbchsim-217rb - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-nr-pbchsim-217rb.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/nr-pbchsim.217rb/values.yaml b/charts/physims/charts/nr-pbchsim.217rb/values.yaml index 7b44b982de..96b3f860df 100644 --- a/charts/physims/charts/nr-pbchsim.217rb/values.yaml +++ b/charts/physims/charts/nr-pbchsim.217rb/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/nr-pbchsim.273rb/templates/NOTES.txt b/charts/physims/charts/nr-pbchsim.273rb/templates/NOTES.txt deleted file mode 100644 index 999186deb2..0000000000 --- a/charts/physims/charts/nr-pbchsim.273rb/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-nr-pbchsim-273rb.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-nr-pbchsim-273rb.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-nr-pbchsim-273rb.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-pbchsim-273rb.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/nr-pbchsim.273rb/templates/deployment.yaml b/charts/physims/charts/nr-pbchsim.273rb/templates/job.yaml similarity index 70% rename from charts/physims/charts/nr-pbchsim.273rb/templates/deployment.yaml rename to charts/physims/charts/nr-pbchsim.273rb/templates/job.yaml index 512e212c07..65be9e4caa 100644 --- a/charts/physims/charts/nr-pbchsim.273rb/templates/deployment.yaml +++ b/charts/physims/charts/nr-pbchsim.273rb/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-pbchsim-273rb.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-nr-pbchsim-273rb.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-nr-pbchsim-273rb.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,8 +20,6 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim @@ -39,7 +29,9 @@ spec: cmake_targets/autotests/run_exec_autotests.bash -g "nr_pbchsim.273rb" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/nr-pbchsim.273rb/templates/service.yaml b/charts/physims/charts/nr-pbchsim.273rb/templates/service.yaml deleted file mode 100644 index 4106d1a12f..0000000000 --- a/charts/physims/charts/nr-pbchsim.273rb/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-pbchsim-273rb.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-nr-pbchsim-273rb - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-nr-pbchsim-273rb.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/nr-pbchsim.273rb/values.yaml b/charts/physims/charts/nr-pbchsim.273rb/values.yaml index 9cb5f6ebb5..36b62e0146 100644 --- a/charts/physims/charts/nr-pbchsim.273rb/values.yaml +++ b/charts/physims/charts/nr-pbchsim.273rb/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/nr-prachsim/templates/NOTES.txt b/charts/physims/charts/nr-prachsim/templates/NOTES.txt deleted file mode 100644 index 376694e7e4..0000000000 --- a/charts/physims/charts/nr-prachsim/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-nr-prachsim.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-nr-prachsim.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-nr-prachsim.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-prachsim.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/nr-prachsim/templates/deployment.yaml b/charts/physims/charts/nr-prachsim/templates/job.yaml similarity index 69% rename from charts/physims/charts/nr-prachsim/templates/deployment.yaml rename to charts/physims/charts/nr-prachsim/templates/job.yaml index 6bea044b86..872729550a 100644 --- a/charts/physims/charts/nr-prachsim/templates/deployment.yaml +++ b/charts/physims/charts/nr-prachsim/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-prachsim.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-nr-prachsim.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-nr-prachsim.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,18 +20,18 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim command: ["/bin/sh", "-c"] args: - - > + - > cmake_targets/autotests/run_exec_autotests.bash -g "nr_prachsim" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/nr-prachsim/templates/service.yaml b/charts/physims/charts/nr-prachsim/templates/service.yaml deleted file mode 100644 index 71bfe7b9fe..0000000000 --- a/charts/physims/charts/nr-prachsim/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-prachsim.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-nr-prachsim - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-nr-prachsim.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/nr-prachsim/values.yaml b/charts/physims/charts/nr-prachsim/values.yaml index 93789de637..8404ea4192 100644 --- a/charts/physims/charts/nr-prachsim/values.yaml +++ b/charts/physims/charts/nr-prachsim/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/nr-pucchsim/templates/NOTES.txt b/charts/physims/charts/nr-pucchsim/templates/NOTES.txt deleted file mode 100644 index 7c2cfa9155..0000000000 --- a/charts/physims/charts/nr-pucchsim/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-nr-pucchsim.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-nr-pucchsim.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-nr-pucchsim.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-pucchsim.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/nr-pucchsim/templates/deployment.yaml b/charts/physims/charts/nr-pucchsim/templates/job.yaml similarity index 69% rename from charts/physims/charts/nr-pucchsim/templates/deployment.yaml rename to charts/physims/charts/nr-pucchsim/templates/job.yaml index fce72ebc35..a845215eeb 100644 --- a/charts/physims/charts/nr-pucchsim/templates/deployment.yaml +++ b/charts/physims/charts/nr-pucchsim/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-pucchsim.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-nr-pucchsim.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-nr-pucchsim.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,18 +20,18 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim command: ["/bin/sh", "-c"] args: - - > + - > cmake_targets/autotests/run_exec_autotests.bash -g "nr_pucchsim" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/nr-pucchsim/templates/service.yaml b/charts/physims/charts/nr-pucchsim/templates/service.yaml deleted file mode 100644 index 9e8760e76b..0000000000 --- a/charts/physims/charts/nr-pucchsim/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-pucchsim.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-nr-pucchsim - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-nr-pucchsim.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/nr-pucchsim/values.yaml b/charts/physims/charts/nr-pucchsim/values.yaml index d4c869278b..1c2c822088 100644 --- a/charts/physims/charts/nr-pucchsim/values.yaml +++ b/charts/physims/charts/nr-pucchsim/values.yaml @@ -27,15 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 + privileged: false service: type: ClusterIP diff --git a/charts/physims/charts/nr-ulschsim/templates/NOTES.txt b/charts/physims/charts/nr-ulschsim/templates/NOTES.txt deleted file mode 100644 index 65566932cd..0000000000 --- a/charts/physims/charts/nr-ulschsim/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-nr-ulschsim.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-nr-ulschsim.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-nr-ulschsim.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-ulschsim.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/nr-ulschsim/templates/deployment.yaml b/charts/physims/charts/nr-ulschsim/templates/job.yaml similarity index 69% rename from charts/physims/charts/nr-ulschsim/templates/deployment.yaml rename to charts/physims/charts/nr-ulschsim/templates/job.yaml index d44b2b6463..2916f0fc12 100644 --- a/charts/physims/charts/nr-ulschsim/templates/deployment.yaml +++ b/charts/physims/charts/nr-ulschsim/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-ulschsim.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-nr-ulschsim.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-nr-ulschsim.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,18 +20,18 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim command: ["/bin/sh", "-c"] args: - - > + - > cmake_targets/autotests/run_exec_autotests.bash -g "nr_ulschsim" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/nr-ulschsim/templates/service.yaml b/charts/physims/charts/nr-ulschsim/templates/service.yaml deleted file mode 100644 index d34882700e..0000000000 --- a/charts/physims/charts/nr-ulschsim/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-ulschsim.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-nr-ulschsim - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-nr-ulschsim.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/nr-ulschsim/values.yaml b/charts/physims/charts/nr-ulschsim/values.yaml index b0529c818d..770cb43bb1 100644 --- a/charts/physims/charts/nr-ulschsim/values.yaml +++ b/charts/physims/charts/nr-ulschsim/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/nr-ulsim.3gpp/templates/NOTES.txt b/charts/physims/charts/nr-ulsim.3gpp/templates/NOTES.txt deleted file mode 100644 index aea103922e..0000000000 --- a/charts/physims/charts/nr-ulsim.3gpp/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-nr-ulsim-3gpp.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-nr-ulsim-3gpp.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-nr-ulsim-3gpp.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-ulsim-3gpp.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/nr-ulsim.3gpp/templates/deployment.yaml b/charts/physims/charts/nr-ulsim.3gpp/templates/job.yaml similarity index 70% rename from charts/physims/charts/nr-ulsim.3gpp/templates/deployment.yaml rename to charts/physims/charts/nr-ulsim.3gpp/templates/job.yaml index 7bf59eed4f..2f8a445589 100644 --- a/charts/physims/charts/nr-ulsim.3gpp/templates/deployment.yaml +++ b/charts/physims/charts/nr-ulsim.3gpp/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-ulsim-3gpp.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-nr-ulsim-3gpp.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-nr-ulsim-3gpp.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,8 +20,6 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim @@ -39,7 +29,9 @@ spec: cmake_targets/autotests/run_exec_autotests.bash -g "nr_ulsim.3gpp" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/nr-ulsim.3gpp/templates/service.yaml b/charts/physims/charts/nr-ulsim.3gpp/templates/service.yaml deleted file mode 100644 index fc5ce516ad..0000000000 --- a/charts/physims/charts/nr-ulsim.3gpp/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-ulsim-3gpp.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-nr-ulsim-3gpp - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-nr-ulsim-3gpp.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/nr-ulsim.3gpp/values.yaml b/charts/physims/charts/nr-ulsim.3gpp/values.yaml index 3d44bda9b8..b2aedcba03 100644 --- a/charts/physims/charts/nr-ulsim.3gpp/values.yaml +++ b/charts/physims/charts/nr-ulsim.3gpp/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/nr-ulsim.mimo/templates/NOTES.txt b/charts/physims/charts/nr-ulsim.mimo/templates/NOTES.txt deleted file mode 100644 index 46436c61f0..0000000000 --- a/charts/physims/charts/nr-ulsim.mimo/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-nr-ulsim-mimo.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-nr-ulsim-mimo.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-nr-ulsim-mimo.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-ulsim-mimo.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/nr-ulsim.mimo/templates/deployment.yaml b/charts/physims/charts/nr-ulsim.mimo/templates/job.yaml similarity index 70% rename from charts/physims/charts/nr-ulsim.mimo/templates/deployment.yaml rename to charts/physims/charts/nr-ulsim.mimo/templates/job.yaml index e8d6ecf7ce..d385551fcb 100644 --- a/charts/physims/charts/nr-ulsim.mimo/templates/deployment.yaml +++ b/charts/physims/charts/nr-ulsim.mimo/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-ulsim-mimo.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-nr-ulsim-mimo.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-nr-ulsim-mimo.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,8 +20,6 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim @@ -39,7 +29,9 @@ spec: cmake_targets/autotests/run_exec_autotests.bash -g "nr_ulsim.mimo" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/nr-ulsim.mimo/templates/service.yaml b/charts/physims/charts/nr-ulsim.mimo/templates/service.yaml deleted file mode 100644 index 6a2465cbbe..0000000000 --- a/charts/physims/charts/nr-ulsim.mimo/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-ulsim-mimo.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-nr-ulsim-mimo - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-nr-ulsim-mimo.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/nr-ulsim.mimo/values.yaml b/charts/physims/charts/nr-ulsim.mimo/values.yaml index 55bdcd6158..b2dd42d3be 100644 --- a/charts/physims/charts/nr-ulsim.mimo/values.yaml +++ b/charts/physims/charts/nr-ulsim.mimo/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/nr-ulsim.misc/templates/NOTES.txt b/charts/physims/charts/nr-ulsim.misc/templates/NOTES.txt deleted file mode 100644 index 8f882b73a3..0000000000 --- a/charts/physims/charts/nr-ulsim.misc/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-nr-ulsim-misc.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-nr-ulsim-misc.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-nr-ulsim-misc.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-ulsim-misc.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/nr-ulsim.misc/templates/deployment.yaml b/charts/physims/charts/nr-ulsim.misc/templates/job.yaml similarity index 70% rename from charts/physims/charts/nr-ulsim.misc/templates/deployment.yaml rename to charts/physims/charts/nr-ulsim.misc/templates/job.yaml index 56c25fbbc3..492baab464 100644 --- a/charts/physims/charts/nr-ulsim.misc/templates/deployment.yaml +++ b/charts/physims/charts/nr-ulsim.misc/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-ulsim-misc.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-nr-ulsim-misc.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-nr-ulsim-misc.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,8 +20,6 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim @@ -39,7 +29,9 @@ spec: cmake_targets/autotests/run_exec_autotests.bash -g "nr_ulsim.misc" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/nr-ulsim.misc/templates/service.yaml b/charts/physims/charts/nr-ulsim.misc/templates/service.yaml deleted file mode 100644 index d7e93fba72..0000000000 --- a/charts/physims/charts/nr-ulsim.misc/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-ulsim-misc.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-nr-ulsim-misc - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-nr-ulsim-misc.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/nr-ulsim.misc/values.yaml b/charts/physims/charts/nr-ulsim.misc/values.yaml index dcae7a2b66..8d15fca39e 100644 --- a/charts/physims/charts/nr-ulsim.misc/values.yaml +++ b/charts/physims/charts/nr-ulsim.misc/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/nr-ulsim.sc-fdma/templates/NOTES.txt b/charts/physims/charts/nr-ulsim.sc-fdma/templates/NOTES.txt deleted file mode 100644 index 1874b502a2..0000000000 --- a/charts/physims/charts/nr-ulsim.sc-fdma/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-nr-ulsim-sc-fdma.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-nr-ulsim-sc-fdma.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-nr-ulsim-sc-fdma.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-nr-ulsim-sc-fdma.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/nr-ulsim.sc-fdma/templates/deployment.yaml b/charts/physims/charts/nr-ulsim.sc-fdma/templates/job.yaml similarity index 73% rename from charts/physims/charts/nr-ulsim.sc-fdma/templates/deployment.yaml rename to charts/physims/charts/nr-ulsim.sc-fdma/templates/job.yaml index 3119950e20..8283c65f5e 100644 --- a/charts/physims/charts/nr-ulsim.sc-fdma/templates/deployment.yaml +++ b/charts/physims/charts/nr-ulsim.sc-fdma/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-ulsim-sc-fdma.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-nr-ulsim-sc-fdma.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-nr-ulsim-sc-fdma.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -39,7 +31,9 @@ spec: cmake_targets/autotests/run_exec_autotests.bash -g "nr_ulsim.sc-fdma" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/nr-ulsim.sc-fdma/templates/service.yaml b/charts/physims/charts/nr-ulsim.sc-fdma/templates/service.yaml deleted file mode 100644 index 5653ae5ad2..0000000000 --- a/charts/physims/charts/nr-ulsim.sc-fdma/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-nr-ulsim-sc-fdma.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-nr-ulsim-sc-fdma - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-nr-ulsim-sc-fdma.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/nr-ulsim.sc-fdma/values.yaml b/charts/physims/charts/nr-ulsim.sc-fdma/values.yaml index 0536fb03b6..c617eeafec 100644 --- a/charts/physims/charts/nr-ulsim.sc-fdma/values.yaml +++ b/charts/physims/charts/nr-ulsim.sc-fdma/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/polartest/templates/NOTES.txt b/charts/physims/charts/polartest/templates/NOTES.txt deleted file mode 100644 index 9c2c978de0..0000000000 --- a/charts/physims/charts/polartest/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-polartest.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-polartest.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-polartest.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-polartest.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/polartest/templates/deployment.yaml b/charts/physims/charts/polartest/templates/job.yaml similarity index 70% rename from charts/physims/charts/polartest/templates/deployment.yaml rename to charts/physims/charts/polartest/templates/job.yaml index 20dac8ebf7..61e82957ce 100644 --- a/charts/physims/charts/polartest/templates/deployment.yaml +++ b/charts/physims/charts/polartest/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-polartest.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-polartest.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-polartest.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,18 +20,18 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim command: ["/bin/sh", "-c"] args: - - > + - > cmake_targets/autotests/run_exec_autotests.bash -g "polartest" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/polartest/templates/service.yaml b/charts/physims/charts/polartest/templates/service.yaml deleted file mode 100644 index 40abb6769e..0000000000 --- a/charts/physims/charts/polartest/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-polartest.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-polartest - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-polartest.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/polartest/values.yaml b/charts/physims/charts/polartest/values.yaml index f7195dd572..12386f02bc 100644 --- a/charts/physims/charts/polartest/values.yaml +++ b/charts/physims/charts/polartest/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/smallblocktest/templates/NOTES.txt b/charts/physims/charts/smallblocktest/templates/NOTES.txt deleted file mode 100644 index c593dbfe22..0000000000 --- a/charts/physims/charts/smallblocktest/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-smallblocktest.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-smallblocktest.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-smallblocktest.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-smallblocktest.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/smallblocktest/templates/deployment.yaml b/charts/physims/charts/smallblocktest/templates/job.yaml similarity index 69% rename from charts/physims/charts/smallblocktest/templates/deployment.yaml rename to charts/physims/charts/smallblocktest/templates/job.yaml index aafb16e054..f034db3e69 100644 --- a/charts/physims/charts/smallblocktest/templates/deployment.yaml +++ b/charts/physims/charts/smallblocktest/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-smallblocktest.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-smallblocktest.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-smallblocktest.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,18 +20,18 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim command: ["/bin/sh", "-c"] args: - - > + - > cmake_targets/autotests/run_exec_autotests.bash -g "smallblocktest" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/smallblocktest/templates/service.yaml b/charts/physims/charts/smallblocktest/templates/service.yaml deleted file mode 100644 index d51bf21ce4..0000000000 --- a/charts/physims/charts/smallblocktest/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-smallblocktest.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-smallblocktest - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-smallblocktest.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/smallblocktest/values.yaml b/charts/physims/charts/smallblocktest/values.yaml index f08db5501a..7f116091ac 100644 --- a/charts/physims/charts/smallblocktest/values.yaml +++ b/charts/physims/charts/smallblocktest/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/charts/ulsim/templates/NOTES.txt b/charts/physims/charts/ulsim/templates/NOTES.txt deleted file mode 100644 index 91ab3ce0b7..0000000000 --- a/charts/physims/charts/ulsim/templates/NOTES.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "oai-ulsim.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "oai-ulsim.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "oai-ulsim.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "oai-ulsim.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/charts/physims/charts/ulsim/templates/deployment.yaml b/charts/physims/charts/ulsim/templates/job.yaml similarity index 70% rename from charts/physims/charts/ulsim/templates/deployment.yaml rename to charts/physims/charts/ulsim/templates/job.yaml index 3185b074b2..d61d793c3b 100644 --- a/charts/physims/charts/ulsim/templates/deployment.yaml +++ b/charts/physims/charts/ulsim/templates/job.yaml @@ -1,20 +1,12 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: batch/v1 +kind: Job metadata: name: {{ .Chart.Name }} - labels: - {{- include "oai-ulsim.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "oai-ulsim.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate template: metadata: labels: - {{- include "oai-ulsim.selectorLabels" . | nindent 8 }} + app: physim spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -28,18 +20,18 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - ports: - - containerPort: 80 env: - name: OPENAIR_DIR value: /opt/oai-physim command: ["/bin/sh", "-c"] args: - - > + - > cmake_targets/autotests/run_exec_autotests.bash -g "ulsim" -d bin/ && echo "FINISHED" && sleep infinity dnsPolicy: ClusterFirst - restartPolicy: Always + restartPolicy: Never schedulerName: default-scheduler serviceAccountName: {{ .Values.global.serviceAccountName }} terminationGracePeriodSeconds: 30 + nodeSelector: + {{- toYaml .Values.global.nodeSelector | nindent 12 }} \ No newline at end of file diff --git a/charts/physims/charts/ulsim/templates/service.yaml b/charts/physims/charts/ulsim/templates/service.yaml deleted file mode 100644 index dcc37d6299..0000000000 --- a/charts/physims/charts/ulsim/templates/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - {{- include "oai-ulsim.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} -{{- if contains "ClusterIP" .Values.service.type }} - clusterIP: None -{{- end }} - ports: - - name: oai-ulsim - # Port accessible outside cluster - port: {{ .Values.service.port }} - # Port to forward to inside the pod - targetPort: {{ .Values.service.Port }} - protocol: TCP - selector: - {{- include "oai-ulsim.selectorLabels" . | nindent 4 }} diff --git a/charts/physims/charts/ulsim/values.yaml b/charts/physims/charts/ulsim/values.yaml index 3e625f02c6..94038fa6df 100644 --- a/charts/physims/charts/ulsim/values.yaml +++ b/charts/physims/charts/ulsim/values.yaml @@ -27,19 +27,7 @@ podSecurityContext: runAsGroup: 0 securityContext: - privileged: true - capabilities: - add: - - SYS_CAP_PTRACE - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 + privileged: false resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/charts/physims/templates/rbac.yaml b/charts/physims/templates/rbac.yaml index b341744796..989988baca 100644 --- a/charts/physims/templates/rbac.yaml +++ b/charts/physims/templates/rbac.yaml @@ -6,7 +6,7 @@ rules: - apiGroups: - security.openshift.io resourceNames: - - privileged + - anyuid resources: - securitycontextconstraints verbs: diff --git a/charts/physims/templates/serviceaccount.yaml b/charts/physims/templates/serviceaccount.yaml index 21d094ad38..0810702f4f 100644 --- a/charts/physims/templates/serviceaccount.yaml +++ b/charts/physims/templates/serviceaccount.yaml @@ -1,4 +1,4 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ .Values.global.serviceAccountName }} + name: oai-physim-sa #{{ .Values.global.serviceAccountName }} diff --git a/charts/physims/values.yaml b/charts/physims/values.yaml index 7d0faa33ce..462f8ff59b 100644 --- a/charts/physims/values.yaml +++ b/charts/physims/values.yaml @@ -5,137 +5,12 @@ global: serviceAccountName: oai-physim-sa namespace: "OAICICD_PROJECT" - image: + image: registry: local repository: image-registry.openshift-image-registry.svc:5000/oaicicd-ran/oai-physim version: TAG # pullPolicy: IfNotPresent or Never or Always pullPolicy: Always + nodeSelector: + worker: "telco" -## Declaring values specific to coressponding physim to overwrite - -dlsim.basic: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -dlsim.100rb+tm2: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -ulsim: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -ldpctest: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -polartest: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -nr-pbchsim.106rb: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -nr-pbchsim.217rb: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -nr-pbchsim.273rb: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -nr-dlsim.basic: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -nr-dlsim.dmrs+ptrs: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -nr-dlsim.mcs+mimo: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -nr-dlsim.offset: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -nr-dlschsim: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -smallblocktest: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -nr-ulschsim: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -nr-pucchsim: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -nr-ulsim.3gpp: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -nr-ulsim.mimo: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -nr-ulsim.misc: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -nr-ulsim.sc-fdma: - replicaCount: 1 - service: - type: ClusterIP - port: 80 - -nr-prachsim: - replicaCount: 1 - service: - type: ClusterIP - port: 80 diff --git a/ci-scripts/cls_physim1.py b/ci-scripts/cls_physim1.py index 1cef2270c3..5bb64d250c 100644 --- a/ci-scripts/cls_physim1.py +++ b/ci-scripts/cls_physim1.py @@ -139,14 +139,14 @@ class PhySim: # Using helm charts deployment mySSH.command(f'grep -rl OAICICD_PROJECT ./charts/ | xargs sed -i -e "s#OAICICD_PROJECT#{ocProjectName}#"', '\$', 30) mySSH.command(f'sed -i -e "s#TAG#{imageTag}#g" ./charts/physims/values.yaml', '\$', 6) - mySSH.command('helm install physim ./charts/physims/ 2>&1 | tee -a cmake_targets/log/physim_helm_summary.txt', '\$', 30) + mySSH.command('helm install physim ./charts/physims/ --wait 2>&1 | tee -a cmake_targets/log/physim_helm_summary.txt', '\$', 30) if mySSH.getBefore().count('STATUS: deployed') == 0: logging.error('\u001B[1m Deploying PhySim Failed using helm chart on OC Cluster\u001B[0m') - mySSH.command('helm uninstall physim >> cmake_targets/log/physim_helm_summary.txt 2>&1', '\$', 30) + mySSH.command('helm uninstall physim | tee -a cmake_targets/log/physim_helm_summary.txt 2>&1', '\$', 30) isFinished1 = False while(isFinished1 == False): time.sleep(20) - mySSH.command('oc get pods -l app.kubernetes.io/instance=physim', '\$', 6, resync=True) + mySSH.command('oc get pods -l app=physim', '\$', 6, resync=True) if re.search('No resources found', mySSH.getBefore()): isFinished1 = True mySSH.command('oc logout', '\$', 30) @@ -158,24 +158,27 @@ class PhySim: logging.debug('\u001B[1m Deployed PhySim Successfully using helm chart\u001B[0m') isRunning = False count = 0 + # Check whether the containers are in Running state or not under 2 mins while(count < 2 and isRunning == False): time.sleep(60) - mySSH.command('oc get pods -o wide -l app.kubernetes.io/instance=physim | tee -a cmake_targets/log/physim_pods_summary.txt', '\$', 30, resync=True) - if mySSH.getBefore().count('Running') == 21: + mySSH.command('oc get pods -o wide -l app=physim | tee -a cmake_targets/log/physim_pods_summary.txt', '\$', 30, resync=True) + running_count = mySSH.getBefore().count('Running') + completed_count = mySSH.getBefore().count('Completed') + if (running_count + completed_count) == 21: logging.debug('\u001B[1m Running the physim test Scenarios\u001B[0m') isRunning = True podNames = re.findall('oai-[\S\d\w]+', mySSH.getBefore()) count +=1 if isRunning == False: - logging.error('\u001B[1m Some PODS Running FAILED \u001B[0m') - mySSH.command('oc get pods -l app.kubernetes.io/instance=physim 2>&1 | tee -a cmake_targets/log/physim_pods_summary.txt', '\$', 6) + logging.error('\u001B[1m Some pods are in Error state \u001B[0m') + mySSH.command('oc get pods -l app=physim 2>&1 | tee -a cmake_targets/log/physim_pods_summary.txt', '\$', 6) mySSH.command('for pod in $(oc get pods | tail -n +2 | awk \'{print $1}\'); do oc describe pod $pod >> cmake_targets/log/physim_pods_summary.txt; done', '\$', 10) - mySSH.command('helm uninstall physim 2>&1 >> cmake_targets/log/physim_helm_summary.txt', '\$', 6) + mySSH.command('helm uninstall physim | tee -a cmake_targets/log/physim_helm_summary.txt 2>&1', '\$', 6) self.AnalyzeLogFile_phySim() isFinished1 = False while(isFinished1 == False): time.sleep(20) - mySSH.command('oc get pods -l app.kubernetes.io/instance=physim', '\$', 6, resync=True) + mySSH.command('oc get pods -l app=physim', '\$', 6, resync=True) if re.search('No resources found', mySSH.getBefore()): isFinished1 = True mySSH.command('oc logout', '\$', 30) @@ -188,7 +191,7 @@ class PhySim: isFinished = False # doing a deep copy! tmpPodNames = podNames.copy() - while(count < 15 and isFinished == False): + while(count < 9 and isFinished == False): time.sleep(60) for podName in tmpPodNames: mySSH.command2(f'oc logs --tail=1 {podName} 2>&1', 6, silent=True) @@ -230,7 +233,7 @@ class PhySim: isFinished1 = False while(isFinished1 == False): time.sleep(20) - mySSH.command('oc get pods -l app.kubernetes.io/instance=physim', '\$', 6, resync=True) + mySSH.command('oc get pods -l app=physim', '\$', 6, resync=True) if re.search('No resources found', mySSH.getBefore()): isFinished1 = True if isFinished1 == True: diff --git a/cmake_targets/autotests/run_exec_autotests.bash b/cmake_targets/autotests/run_exec_autotests.bash index c00500cfc3..2bb42f3d4d 100755 --- a/cmake_targets/autotests/run_exec_autotests.bash +++ b/cmake_targets/autotests/run_exec_autotests.bash @@ -1,4 +1,5 @@ #!/bin/bash +#set -xv #/* # * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more # * contributor license agreements. See the NOTICE file distributed with @@ -68,7 +69,7 @@ function test_run() { mkdir -p $log_dir echo "" > $temp_exec_log - echo "" > $log_file + echo "start at $(date)" > "$log_file" #echo "log_dir = $log_dir" #echo "log_file = $log_file" #echo "exec_file = $exec_file" @@ -92,78 +93,61 @@ function test_run() { tags_array_index=0 for main_exec_args_array_index in "${main_exec_args_array[@]}" do - global_result=1 + global_result=PASS result_string="" PROPER_DESC=`echo ${desc_array[$tags_array_index]} | sed -e "s@^.*Test cases.*(Test@Test@" -e "s@^ *(@@" -e"s/)$//" -e "s/),$//"` echo_info "$PROPER_DESC" for (( run_index=1; run_index <= $nruns; run_index++ )) do - temp_exec_log=$log_dir/test.$test_case_name.${tags_array[$tags_array_index]}.run_$run_index - echo "" > $temp_exec_log - + temp_exec_log="$log_dir/test.$test_case_name.${tags_array[$tags_array_index]}.run_$run_index" echo "Executing test case $test_case_name.${tags_array[$tags_array_index]}, Run Index = $run_index, Execution Log file = $temp_exec_log" - echo "-----------------------------------------------------------------------------" >> $temp_exec_log 2>&1 - echo "" >> $temp_exec_log 2>&1 - echo "Executing $main_exec $main_exec_args_array_index " | tee $temp_exec_log - { uname -a ; eval "$main_exec $main_exec_args_array_index" ;} >> $temp_exec_log 2>&1 + echo "-----------------------------------------------------------------------------" > "$temp_exec_log" + echo "" >> "$temp_exec_log" + echo "Executing $main_exec $main_exec_args_array_index at $(date)" >> "$temp_exec_log" + uname -a >> "$temp_exec_log" + time "$main_exec" $main_exec_args_array_index >> "$temp_exec_log" 2>&1 & + done + wait + + for (( run_index=1; run_index <= $nruns; run_index++ )) + do echo "" >> $temp_exec_log 2>&1 - cat $temp_exec_log >> $log_file 2>&1 + cat "$temp_exec_log" >> "$log_file" 2>&1 - - result=1 + result=PASS for search_expr in "${search_expr_array[@]}" do - - search_result=`grep -E "$search_expr" $temp_exec_log` - - if [ -z "$search_result" ]; then - let "result = result & 0" - else - let "result = result & 1" - fi + grep -Eq "$search_expr" $temp_exec_log || result=FAIL done #If we find a negative search result then there is crash of program and test case is failed even if above condition is true - search_result=`grep -iE "$search_expr_negative" $temp_exec_log` - if [ -n "$search_result" ]; then - result=0 - fi - let "global_result = global_result & result" - - #echo "result = $result" - - if [ "$result" -eq "0" ]; then - result_string=$result_string" Run_$run_index =FAIL" + grep -q -iE "$search_expr_negative" $temp_exec_log && result=FAIL + + if [ "$result" != PASS ]; then echo_error "$test_case_name.${tags_array[$tags_array_index]} RUN = $run_index Result = FAIL" - fi - - if [ "$result" -eq "1" ]; then - result_string=$result_string" Run_$run_index =PASS" + else echo_success "$test_case_name.${tags_array[$tags_array_index]} RUN = $run_index Result = PASS" fi + result_string=$result_string" Run_$run_index =$result" + if [ $result != PASS ] ; then + global_result=FAIL + fi - done #End of for loop (nindex) + done #End of for loop (nindex) - echo " Result String = $result_string" + echo "END at $(date)" >> "$log_file" - if [ "$result_string" == "" ]; then - echo_error "execution $test_case_name.${tags_array[$tags_array_index]} {$PROPER_DESC} Run_Result = \"$result_string\" Result = FAIL" - xUnit_fail "execution" "$test_case_name.${tags_array[$tags_array_index]}" "FAIL" "$result_string" "$xmlfile_testcase" "$PROPER_DESC" - else - if [ "$global_result" == "0" ]; then + if [ "$global_result" != PASS ]; then echo_error "execution $test_case_name.${tags_array[$tags_array_index]} {$PROPER_DESC} Run_Result = \"$result_string\" Result = FAIL" xUnit_fail "execution" "$test_case_name.${tags_array[$tags_array_index]}" "FAIL" "$result_string" "$xmlfile_testcase" "$PROPER_DESC" - fi - - if [ "$global_result" == "1" ]; then + else echo_success "execution $test_case_name.${tags_array[$tags_array_index]} {$PROPER_DESC} Run_Result = \"$result_string\" Result = PASS " xUnit_success "execution" "$test_case_name.${tags_array[$tags_array_index]}" "PASS" "$result_string" "$xmlfile_testcase" "$PROPER_DESC" fi - fi let "tags_array_index++" done diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 759c145468..6f3f5dd5a0 100755 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -127,8 +127,8 @@ nr_pbchsim Test cases. (Test1: PBCH-only, 217 PRB), (Test2: PBCH and synchronization, 217 RPB) nr_pbchsim - -s-11 -S-8 -n10 -R217 - -s-11 -S-8 -n10 -o8000 -I -R217 + -s-10 -S-8 -n10 -R217 + -s-10 -S-8 -n10 -o8000 -I -R217 test1 test2 PBCH test OK segmentation fault|assertion|exiting|fatal @@ -139,8 +139,8 @@ nr_pbchsim Test cases. (Test1: PBCH-only, 273 PRB), (Test2: PBCH and synchronization, 273 PRB) nr_pbchsim - -s-11 -S-8 -n10 -R273 - -s-11 -S-8 -n10 -o8000 -I -R273 + -s-10 -S-8 -n10 -R273 + -s-10 -S-8 -n10 -o8000 -I -R273 test1 test2 PBCH test OK segmentation fault|assertion|exiting|fatal diff --git a/openair1/SIMULATION/TOOLS/multipath_channel.c b/openair1/SIMULATION/TOOLS/multipath_channel.c index 6adc33b646..992c6be461 100644 --- a/openair1/SIMULATION/TOOLS/multipath_channel.c +++ b/openair1/SIMULATION/TOOLS/multipath_channel.c @@ -38,7 +38,7 @@ uint8_t multipath_channel_nosigconv(channel_desc_t *desc) //#define CHANNEL_SSE #ifdef CHANNEL_SSE -void multipath_channel(channel_desc_t *desc, +void __attribute__ ((no_sanitize_address)) multipath_channel(channel_desc_t *desc, double tx_sig_re[NB_ANTENNAS_TX][30720*2], double tx_sig_im[NB_ANTENANS_TX][30720*2], double rx_sig_re[NB_ANTENNAS_RX][30720*2], @@ -160,8 +160,8 @@ void add_noise(c16_t **rxdata, for (int i = 0; i < length; i++) { for (int ap = 0; ap < nb_antennas_rx; ap++) { c16_t *rxd = &rxdata[ap][slot_offset + i + delay]; - rxd->r = r_re[ap][i] + sqrt(sigma / 2) * gaussdouble(0.0, 1.0); // convert to fixed point - rxd->i = r_im[ap][i] + sqrt(sigma / 2) * gaussdouble(0.0, 1.0); + rxd->r = r_re[ap][i] + sqrt(sigma / 2) * gaussZiggurat(0.0, 1.0); // convert to fixed point + rxd->i = r_im[ap][i] + sqrt(sigma / 2) * gaussZiggurat(0.0, 1.0); /* Add phase noise if enabled */ if (pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { phase_noise(ts, &rxdata[ap][slot_offset + i + delay].r, &rxdata[ap][slot_offset + i + delay].i); @@ -170,7 +170,7 @@ void add_noise(c16_t **rxdata, } } -void multipath_channel(channel_desc_t *desc, +void __attribute__ ((no_sanitize_address)) multipath_channel(channel_desc_t *desc, double *tx_sig_re[NB_ANTENNAS_TX], double *tx_sig_im[NB_ANTENNAS_TX], double *rx_sig_re[NB_ANTENNAS_RX], @@ -180,9 +180,6 @@ void multipath_channel(channel_desc_t *desc, int log_channel) { - int i,ii,j,l; - struct complexd rx_tmp,tx; - double path_loss = pow(10,desc->path_loss_dB/20); int dd; dd = abs(desc->channel_offset); @@ -204,29 +201,24 @@ void multipath_channel(channel_desc_t *desc, } #endif - for (i=0; i<((int)length-dd); i++) { - for (ii=0; iinb_rx; ii++) { - rx_tmp.r = 0; - rx_tmp.i = 0; - - for (j=0; jnb_tx; j++) { - for (l = 0; l<(int)desc->channel_length; l++) { + for (int i=0; i<((int)length-dd); i++) { + for (int ii=0; iinb_rx; ii++) { + struct complexd rx_tmp={0}; + for (int j=0; jnb_tx; j++) { + struct complexd *chan=desc->ch[ii+(j*desc->nb_rx)]; + for (int l = 0; l<(int)desc->channel_length; l++) { if ((i>=0) && (i-l)>=0) { + struct complexd tx; tx.r = tx_sig_re[j][i-l]; tx.i = tx_sig_im[j][i-l]; - } else { - tx.r =0; - tx.i =0; + rx_tmp.r += (tx.r * chan[l].r) - (tx.i * chan[l].i); + rx_tmp.i += (tx.i * chan[l].r) + (tx.r * chan[l].i); } - - rx_tmp.r += (tx.r * desc->ch[ii+(j*desc->nb_rx)][l].r) - (tx.i * desc->ch[ii+(j*desc->nb_rx)][l].i); - rx_tmp.i += (tx.i * desc->ch[ii+(j*desc->nb_rx)][l].r) + (tx.r * desc->ch[ii+(j*desc->nb_rx)][l].i); - if (i==0 && log_channel == 1) { printf("channel[%d][%d][%d] = %f dB \t(%e, %e)\n", - ii, j, l, 10*log10(pow(desc->ch[ii+(j*desc->nb_rx)][l].r,2.0)+pow(desc->ch[ii+(j*desc->nb_rx)][l].i,2.0)), - desc->ch[ii+(j*desc->nb_rx)][l].r, - desc->ch[ii+(j*desc->nb_rx)][l].i); + ii, j, l, 10*log10(pow(chan[l].r,2.0)+pow(chan[l].i,2.0)), + chan[l].r, + chan[l].i); } } //l } // j diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c index 8f7cc8ea0e..39c5e5f564 100644 --- a/openair1/SIMULATION/TOOLS/random_channel.c +++ b/openair1/SIMULATION/TOOLS/random_channel.c @@ -467,8 +467,9 @@ double get_normalization_ch_factor(channel_desc_t *desc) for (int l = 0; l < (int)desc->nb_taps; l++) { for (int aarx = 0; aarx < desc->nb_rx; aarx++) { for (int aatx = 0; aatx < desc->nb_tx; aatx++) { - anew[aarx + (aatx * desc->nb_rx)].r = sqrt(desc->ricean_factor * desc->amps[l] / 2) * gaussdouble(0.0, 1.0); - anew[aarx + (aatx * desc->nb_rx)].i = sqrt(desc->ricean_factor * desc->amps[l] / 2) * gaussdouble(0.0, 1.0); + struct complexd *anewp = &anew[aarx + (aatx * desc->nb_rx)]; + anewp->r = sqrt(desc->ricean_factor * desc->amps[l] / 2) * gaussZiggurat(0.0, 1.0); + anewp->i = sqrt(desc->ricean_factor * desc->amps[l] / 2) * gaussZiggurat(0.0, 1.0); if ((l == 0) && (desc->ricean_factor != 1.0)) { anew[aarx + (aatx * desc->nb_rx)].r += sqrt((1.0 - desc->ricean_factor) / 2); anew[aarx + (aatx * desc->nb_rx)].i += sqrt((1.0 - desc->ricean_factor) / 2); @@ -527,6 +528,12 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx, int32_t channel_offset, double path_loss_dB, float noise_power_dB) { + + // To create tables for normal distribution + struct timespec t; + clock_gettime(CLOCK_MONOTONIC, &t); + tableNor((long)(t.tv_nsec%INT_MAX)); + channel_desc_t *chan_desc = (channel_desc_t *)calloc(1,sizeof(channel_desc_t)); for(int i=0; inb_rx; aarx++) { for (aatx=0; aatxnb_tx; aatx++) { - anew[aarx + (aatx * desc->nb_rx)].r = sqrt(desc->ricean_factor * desc->amps[i] / 2) * gaussdouble(0.0, 1.0) * desc->normalization_ch_factor; - anew[aarx + (aatx * desc->nb_rx)].i = sqrt(desc->ricean_factor * desc->amps[i] / 2) * gaussdouble(0.0, 1.0) * desc->normalization_ch_factor; + struct complexd *anewp = &anew[aarx + (aatx * desc->nb_rx)]; + anewp->r = sqrt(desc->ricean_factor * desc->amps[i] / 2) * gaussZiggurat(0.0, 1.0) * desc->normalization_ch_factor; + anewp->i = sqrt(desc->ricean_factor * desc->amps[i] / 2) * gaussZiggurat(0.0, 1.0) * desc->normalization_ch_factor; if ((i==0) && (desc->ricean_factor != 1.0)) { if (desc->random_aoa==1) { diff --git a/openair1/SIMULATION/TOOLS/rangen_double.c b/openair1/SIMULATION/TOOLS/rangen_double.c index 0ba9e196b1..863012f69a 100644 --- a/openair1/SIMULATION/TOOLS/rangen_double.c +++ b/openair1/SIMULATION/TOOLS/rangen_double.c @@ -86,7 +86,7 @@ double uniformrandom(void) /*!\brief Gaussian random number generator based on modified Box-Muller transformation.Returns a double-precision floating-point number. */ -double gaussdouble(double mean, double variance) +double __attribute__ ((no_sanitize_address)) gaussdouble(double mean, double variance) { static int iset=0; static double gset; @@ -109,7 +109,85 @@ double gaussdouble(double mean, double variance) } } +// Ziggurat +static bool tableNordDone=false; +static double wn[128], fn[128]; +static uint32_t iz, jz, jsr = 123456789, kn[128]; +static int32_t hz; +#define SHR3 (jz = jsr, jsr ^= (jsr << 13), jsr ^= (jsr >> 17), jsr ^= (jsr << 5), jz + jsr) +#define UNI (0.5 + (signed)SHR3 * 0.2328306e-9) +double nfix(void) +{ + const double r = 3.442620; + static double x, y; + + for (;;) { + x = hz * wn[iz]; + + if (iz == 0) { + do { + x = -0.2904764 * log(UNI); + y = -log(UNI); + } while (y + y < x * x); + + return (hz > 0) ? r + x : -r - x; + } + + if (fn[iz] + UNI * (fn[iz - 1] - fn[iz]) < exp(-0.5 * x * x)) { + return x; + } + + hz = SHR3; + iz = hz & 127; + + if (abs(hz) < kn[iz]) { + return ((hz)*wn[iz]); + } + } +} + +/*!\Procedure to create tables for normal distribution kn,wn and fn. */ +void tableNor(unsigned long seed) +{ + jsr = seed; + double dn = 3.442619855899; + int i; + const double m1 = 2147483648.0; + double q; + double tn = 3.442619855899; + const double vn = 9.91256303526217E-03; + q = vn / exp(-0.5 * dn * dn); + kn[0] = ((dn / q) * m1); + kn[1] = 0; + wn[0] = (q / m1); + wn[127] = (dn / m1); + fn[0] = 1.0; + fn[127] = (exp(-0.5 * dn * dn)); + + for (i = 126; 1 <= i; i--) { + dn = sqrt(-2.0 * log(vn / dn + exp(-0.5 * dn * dn))); + kn[i + 1] = ((dn / tn) * m1); + tn = dn; + fn[i] = (exp(-0.5 * dn * dn)); + wn[i] = (dn / m1); + } + tableNordDone=true; + return; +} + +double __attribute__ ((no_sanitize_address)) gaussZiggurat(double mean, double variance) +{ + if (!tableNordDone) { + // let's make reasonnable constant tables + struct timespec t; + clock_gettime(CLOCK_MONOTONIC, &t); + tableNor((long)(t.tv_nsec%INT_MAX)); + } + hz = SHR3; + iz = hz & 127; + return abs(hz) < kn[iz] ? hz * wn[iz] : nfix(); +} #ifdef MAIN main(int argc,char **argv) diff --git a/openair1/SIMULATION/TOOLS/sim.h b/openair1/SIMULATION/TOOLS/sim.h index 9b3fd98ae6..1e2602650f 100644 --- a/openair1/SIMULATION/TOOLS/sim.h +++ b/openair1/SIMULATION/TOOLS/sim.h @@ -513,6 +513,8 @@ int gauss(unsigned int *gauss_LUT,unsigned char Nbits); double gaussdouble(double,double); void randominit(unsigned int seed_init); double uniformrandom(void); +double gaussZiggurat(double mean, double variance); +void tableNor(unsigned long seed); int freq_channel(channel_desc_t *desc,uint16_t nb_rb, int16_t n_samples,int scs); int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples,int scs); void term_freq_channel(void); diff --git a/radio/rfsimulator/new_channel_sim.c b/radio/rfsimulator/new_channel_sim.c deleted file mode 100644 index fcfa85265b..0000000000 --- a/radio/rfsimulator/new_channel_sim.c +++ /dev/null @@ -1,108 +0,0 @@ -/* -* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The OpenAirInterface Software Alliance licenses this file to You under -* the OAI Public License, Version 1.1 (the "License"); you may not use this file -* except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.openairinterface.org/?page_id=698 -* -* Author and copyright: Laurent Thomas, open-cells.com -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*------------------------------------------------------------------------------- -* For more information about the OpenAirInterface (OAI) Software Alliance: -* contact@openairinterface.org -*/ - - -#include -#include -#include -#include -#include -#include - - -#include -#include -#include -#include -#include "rfsimulator.h" - -// Ziggurat -static double wn[128],fn[128]; -static uint32_t iz,jz,jsr=123456789,kn[128]; -static int32_t hz; -#define SHR3 (jz=jsr, jsr^=(jsr<<13),jsr^=(jsr>>17),jsr^=(jsr<<5),jz+jsr) -#define UNI (0.5+(signed) SHR3 * 0.2328306e-9) - -double nfix(void) { - const double r = 3.442620; - static double x, y; - - for (;;) { - x=hz * wn[iz]; - - if (iz==0) { - do { - x = - 0.2904764 * log (UNI); - y = - log (UNI); - } while (y+y < x*x); - - return (hz>0)? r+x : -r-x; - } - - if (fn[iz]+UNI*(fn[iz-1]-fn[iz])