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/README.md b/README.md index 2077b3d20b..c82eff8f36 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,20 @@ Please see [NOTICE](NOTICE.md) file for third party software that is included in * [How to build](./doc/BUILD.md) * [How to run the modems](./doc/RUNMODEM.md) +More information and documentation can be found in the [doc folder](./doc). +Unfortunately, not all information is available there, and information for +specific sub-systems might be available in the corresponding sub-directories. +To find all READMEs, this command might be handy: + +``` +find . -iname "readme*" +``` + # RAN repository structure # The OpenAirInterface (OAI) software is composed of the following parts: -
+```
 openairinterface5g
 ├── ci-scripts        : Meta-scripts used by the OSA CI process. Contains also configuration files used day-to-day by CI.
 ├── cmake_targets     : Build utilities to compile (simulation, emulation and real-time platforms), and generated build files.
@@ -88,5 +97,6 @@ openairinterface5g
 │   ├── TEST
 │   ├── UDP
 │   └── UTILS
+├── radio             : drivers for various radios such as USRP, AW2S, RFsim, ...
 └── targets           : Top-level wrappers for unitary simulation for PHY channels, system-level emulation (eNB-UE with and without S1), and realtime eNB and UE and RRH GW.
-
+``` 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/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index cc35cb4625..9d95049afb 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -332,7 +332,7 @@ pipeline { script { if (doMandatoryTests) { dir ('archives') { - sh "if [ -d rf_sim/test ] || [ -d l2_sim/test ]; then zip -r -qq vm_tests_logs.zip */test ; fi" + sh "if [ -d rf_sim/test ] || [ -d rf5g_sim/test ] || [ -d l2_sim/test ]; then zip -r -qq vm_tests_logs.zip */test ; fi" } if(fileExists('archives/vm_tests_logs.zip')) { archiveArtifacts artifacts: 'archives/vm_tests_logs.zip' 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/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf index 78b5d56b73..907b89a274 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf @@ -211,8 +211,8 @@ MACRLCs = ( num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 250; - pucch_TargetSNRx10 = 250; + pusch_TargetSNRx10 = 220; + pucch_TargetSNRx10 = 220; ulsch_max_frame_inactivity = 10; } ); diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index d9e4ed0f3a..bb9c525772 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -25,7 +25,6 @@ gNBs = pdsch_AntennaPorts_XP = 2; pusch_AntennaPorts = 2; - ul_prbblacklist = "51,52,53,54" do_SRS = 1; pdcch_ConfigSIB1 = ( @@ -210,8 +209,8 @@ MACRLCs = ( num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; -# pusch_TargetSNRx10 = 200; -# pucch_TargetSNRx10 = 150; + pusch_TargetSNRx10 = 220; + pucch_TargetSNRx10 = 200; ulsch_max_frame_inactivity = 0; } ); @@ -220,7 +219,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - prach_dtx_threshold = 120; + prach_dtx_threshold = 150; # pucch0_dtx_threshold = 150; } ); @@ -234,7 +233,7 @@ RUs = ( att_rx = 0; bands = [78]; max_pdschReferenceSignalPower = -27; - max_rxgain = 75; + max_rxgain = 68; eNB_instances = [0]; ##beamforming 1x2 matrix: 1 layer x 2 antennas bf_weights = [0x00007fff, 0x0000]; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf index b34dc2fbe5..a7c1679593 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf @@ -209,8 +209,8 @@ MACRLCs = ( num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; -# pusch_TargetSNRx10 = 200; -# pucch_TargetSNRx10 = 150; + pusch_TargetSNRx10 = 220; + pucch_TargetSNRx10 = 200; ulsch_max_frame_inactivity = 0; } ); @@ -219,7 +219,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - prach_dtx_threshold = 120; + prach_dtx_threshold = 150; # pucch0_dtx_threshold = 150; } ); @@ -233,7 +233,7 @@ RUs = ( att_rx = 0; bands = [78]; max_pdschReferenceSignalPower = -27; - max_rxgain = 75; + max_rxgain = 68; eNB_instances = [0]; ##beamforming 1x2 matrix: 1 layer x 2 antennas bf_weights = [0x00007fff, 0x0000]; diff --git a/ci-scripts/datalog_rt_stats.2x2.yaml b/ci-scripts/datalog_rt_stats.2x2.yaml index 8caf0201aa..1805d8ab2f 100644 --- a/ci-scripts/datalog_rt_stats.2x2.yaml +++ b/ci-scripts/datalog_rt_stats.2x2.yaml @@ -8,7 +8,7 @@ ColNames : - Average vs Reference Deviation (Reference Value; Acceptability Threshold) Ref : feprx : 120.0 - feptx_prec : 16.0 + feptx_prec : 30.0 feptx_ofdm : 50.0 feptx_total : 120.0 L1 Tx processing : 300.0 diff --git a/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml b/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml index c5bbf97a1e..4933e63199 100644 --- a/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml +++ b/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml @@ -45,7 +45,7 @@ Initialize_eNB Initialize gNB - -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf --sa -q --usrp-tx-thread-config 1 --T_stdout 2 --tune-offset 30000000 --log_config.global_log_options level,nocolor,time + -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf --sa -q --usrp-tx-thread-config 1 --T_stdout 2 --tune-offset 30000000 --thread-pool 1,3,5,7,9,11,13,15 --log_config.global_log_options level,nocolor,time 0 0 nr @@ -53,6 +53,7 @@ yes datalog_rt_stats.2x2.yaml 172.21.19.14 + numactl --cpunodebind=netdev:ens2f0np0 --membind=netdev:ens2f0np0 diff --git a/ci-scripts/xml_files/fr1_sa_quectel.xml b/ci-scripts/xml_files/fr1_sa_quectel.xml index cdae3678f9..0a9d17b63d 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel.xml @@ -119,8 +119,8 @@ Iperf - iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) - -u -b 3M -t 60 + iperf (UL/7Mbps/UDP)(60 sec)(single-ue profile) + -u -b 7M -t 60 UL nrmodule2_quectel 5 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/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h index 81eef5d7e7..b356599546 100644 --- a/common/utils/threadPool/thread-pool.h +++ b/common/utils/threadPool/thread-pool.h @@ -237,7 +237,7 @@ static inline void abortNotifiedFIFO(notifiedFIFO_t *nf) { if (nf->outF == NULL) nf->inF = NULL; mutexunlock(nf->lockF); - condsignal(nf->notifF); + condbroadcast(nf->notifF); } struct one_thread { diff --git a/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md b/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md index d0eab6c53a..fccab23cf8 100644 --- a/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md +++ b/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md @@ -17,11 +17,11 @@ [[_TOC_]] # 1. Scenario -In this tutorial we describe how to configure and run a 5G end-to-end setup with OAI CN5G, OAI gNB and COTS UE. +In this tutorial we describe how to configure and run a 5G end-to-end setup with OAI CN5G, OAI gNB, OAI UE and COTS UE. Minimum hardware requirements: - Laptop/Desktop/Server for OAI CN5G and OAI gNB - - Operating System: [Ubuntu 20.04.5 LTS](https://releases.ubuntu.com/20.04/ubuntu-20.04.5-desktop-amd64.iso) + - Operating System: [Ubuntu 22.04.1 LTS](https://releases.ubuntu.com/22.04.1/ubuntu-22.04.1-desktop-amd64.iso) - CPU: 8 cores x86_64 @ 3.5 GHz - RAM: 32 GB - Laptop for UE @@ -54,7 +54,7 @@ sudo usermod -a -G docker $(whoami) reboot # https://docs.docker.com/compose/install/ -sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose +sudo curl -L "https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose ``` @@ -100,7 +100,7 @@ wget -O ~/oai-cn5g-fed/docker-compose/database/oai_db.sql https://gitlab.eurecom Program SIM Card with [Open Cells Project](https://open-cells.com/) application [uicc-v2.6](https://open-cells.com/d5138782a8739209ec5760865b1e53b0/uicc-v2.6.tgz). ```bash -sudo ./program_uicc --adm 12345678 --imsi 208990000000001 --isdn 00000001 --acc 0001 --key fec86ba6eb707ed08905757b1bb44b8f --opc C42449363BBAD02B66D16BC975D77CC1 -spn "OpenAirInterface" --authenticate +sudo ./program_uicc --adm 12345678 --imsi 001010000000001 --isdn 00000001 --acc 0001 --key fec86ba6eb707ed08905757b1bb44b8f --opc C42449363BBAD02B66D16BC975D77CC1 -spn "OpenAirInterface" --authenticate ``` @@ -114,7 +114,7 @@ sudo apt install -y libboost-all-dev libusb-1.0-0-dev doxygen python3-docutils p git clone https://github.com/EttusResearch/uhd.git ~/uhd cd ~/uhd -git checkout v4.0.0.0 +git checkout v4.3.0.0 cd host mkdir build cd build @@ -134,7 +134,7 @@ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git ~/openairinterfac cd ~/openairinterface5g git checkout develop -# Install dependencies in Ubuntu 20.04 +# Install OAI dependencies cd ~/openairinterface5g source oaienv cd cmake_targets @@ -147,28 +147,6 @@ cd cmake_targets ./build_oai -w USRP --ninja --nrUE --gNB --build-lib all -c ``` -## 3.3 USRP N300 and X300 Ethernet Tuning - -Please also refer to the official [USRP Host Performance Tuning Tips and Tricks](https://kb.ettus.com/USRP_Host_Performance_Tuning_Tips_and_Tricks) tuning guide. - -The following steps are recommended. Please change the network interface(s) as required. Also, you should have 10Gbps interface(s): if you use two cables, you should have the XG interface. Refer to the [N300 Getting Started Guide](https://kb.ettus.com/USRP_N300/N310/N320/N321_Getting_Started_Guide) for more information. - -* Use an MTU of 9000: how to change this depends on the network management tool. In the case of Network Manager, this can be done from the GUI. -* Increase the kernel socket buffer (also done by the USRP driver in OAI) -* Increase Ethernet Ring Buffers: `sudo ethtool -G rx 4096 tx 4096` -* Disable hyper-threading in the BIOS (This step is optional) -* Optional: Disable KPTI Protections for Spectre/Meltdown for more performance. **This is a security risk.** Add `mitigations=off nosmt` in your grub config and update grub. (This step is optional) - -Example code to run: -``` -for ((i=0;i<$(nproc);i++)); do sudo cpufreq-set -c $i -r -g performance; done -sudo sysctl -w net.core.wmem_max=62500000 -sudo sysctl -w net.core.rmem_max=62500000 -sudo sysctl -w net.core.wmem_default=62500000 -sudo sysctl -w net.core.rmem_default=62500000 -sudo ethtool -G enp1s0f0 tx 4096 rx 4096 -``` - # 4. Run OAI CN5G and OAI gNB ## 4.1 Run OAI CN5G @@ -203,9 +181,18 @@ cd cmake_targets/ran_build/build sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf --sa --usrp-tx-thread-config 1 -E --continuous-tx ``` -# 5. Testing with Quectel RM500Q +### RFsimulator +```bash +cd ~/openairinterface5g +source oaienv +cd cmake_targets/ran_build/build +sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 --rfsim --sa +``` -## 5.1 Setup Quectel +# 5. Run UE +## 5.1 Testing with Quectel RM500Q + +### 5.1.1 Setup Quectel With [PuTTY](https://the.earth.li/~sgtatham/putty/latest/w64/putty.exe), send the following AT commands to the module using a serial interface (ex: COM2) at 115200 bps: ```bash # MUST be sent at least once everytime there is a firmware upgrade! @@ -222,7 +209,7 @@ AT+CGPADDR=1 AT+QPING=1,"openairinterface.org" ``` -## 5.2 Ping test +### 5.1.2 Ping test - UE host ```bash ping 192.168.70.135 -t -S 12.1.1.2 @@ -232,7 +219,7 @@ ping 192.168.70.135 -t -S 12.1.1.2 docker exec -it oai-ext-dn ping 12.1.1.2 ``` -## 5.3 Downlink iPerf test +### 5.1.3 Downlink iPerf test - UE host - Download iPerf for Microsoft Windows from [here](https://iperf.fr/download/windows/iperf-2.0.9-win64.zip). - Extract to Desktop and run with Command Prompt: @@ -246,8 +233,65 @@ iperf -s -u -i 1 -B 12.1.1.2 docker exec -it oai-ext-dn iperf -u -t 86400 -i 1 -fk -B 192.168.70.135 -b 100M -c 12.1.1.2 ``` -# 6. Advanced configuration (optional) +## 5.2 Testing with OAI UE +### 5.2.1 Testing with OAI UE with USRP B210 +Important notes: +- This should be run in a second Ubuntu 20.04 host, other than gNB +- It only applies when running OAI gNB with USRP B210 +Run OAI UE +```bash +cd ~/openairinterface5g +source oaienv +cd cmake_targets/ran_build/build +sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --nokrnmod --ue-fo-compensation --sa -E --uicc0.imsi 001010000000001 --uicc0.nssai_sd 1 +``` + +### 5.2.2 Testing with OAI UE with RFsimulator +Important notes: +- This should be run on the same host as the OAI gNB +- It only applies when running OAI gNB with RFsimulator + +Run OAI UE with RFsimulator +```bash +cd ~/openairinterface5g +source oaienv +cd cmake_targets/ran_build/build +sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --nokrnmod --rfsim --sa --uicc0.imsi 001010000000001 --uicc0.nssai_sd 1 +``` + +### 5.2.3 Ping test +- UE host +```bash +ping 192.168.70.135 -I oaitun_ue1 +``` + +# 6. Advanced configurations (optional) + +## 6.1 USRP N300 and X300 Ethernet Tuning + +Please also refer to the official [USRP Host Performance Tuning Tips and Tricks](https://kb.ettus.com/USRP_Host_Performance_Tuning_Tips_and_Tricks) tuning guide. + +The following steps are recommended. Please change the network interface(s) as required. Also, you should have 10Gbps interface(s): if you use two cables, you should have the XG interface. Refer to the [N300 Getting Started Guide](https://kb.ettus.com/USRP_N300/N310/N320/N321_Getting_Started_Guide) for more information. + +* Use an MTU of 9000: how to change this depends on the network management tool. In the case of Network Manager, this can be done from the GUI. +* Increase the kernel socket buffer (also done by the USRP driver in OAI) +* Increase Ethernet Ring Buffers: `sudo ethtool -G rx 4096 tx 4096` +* Disable hyper-threading in the BIOS (This step is optional) +* Optional: Disable KPTI Protections for Spectre/Meltdown for more performance. **This is a security risk.** Add `mitigations=off nosmt` in your grub config and update grub. (This step is optional) + +Example code to run: +``` +for ((i=0;i<$(nproc);i++)); do sudo cpufreq-set -c $i -r -g performance; done +sudo sysctl -w net.core.wmem_max=62500000 +sudo sysctl -w net.core.rmem_max=62500000 +sudo sysctl -w net.core.wmem_default=62500000 +sudo sysctl -w net.core.rmem_default=62500000 +sudo ethtool -G enp1s0f0 tx 4096 rx 4096 +``` + +## 6.2 Real-time performance workarounds - If you get real-time problems on heavy UL traffic, reduce the maximum UL MCS using an additional command-line switch: `--MACRLCs.[0].ul_max_mcs 14`. +## 6.3 Uplink issues related with noise on the DC carriers - There is noise on the DC carriers on N300 and especially the X300 in UL. To avoid their use or shift them away from the center to use more UL spectrum, use the `--tune-offset ` command line switch, where `` is ideally half the bandwidth, or possibly less. diff --git a/doc/tutorial_resources/docker-compose-basic-nrf.yaml b/doc/tutorial_resources/docker-compose-basic-nrf.yaml index dd441010c0..7c2287a3c4 100644 --- a/doc/tutorial_resources/docker-compose-basic-nrf.yaml +++ b/doc/tutorial_resources/docker-compose-basic-nrf.yaml @@ -89,8 +89,8 @@ services: - AUSF_NAME=OAI_AUSF - SBI_IF_NAME=eth0 - SBI_PORT=80 - - USE_HTTP2 - - SBI_HTTP2_PORT + - USE_HTTP2=no + - SBI_HTTP2_PORT=8080 - USE_FQDN_DNS=yes - UDM_IP_ADDRESS=192.168.70.137 - UDM_PORT=80 @@ -127,23 +127,27 @@ services: - TZ=Europe/paris - INSTANCE=0 - PID_DIRECTORY=/var/run - - MCC=208 - - MNC=99 + - MCC=001 + - MNC=01 - REGION_ID=128 - AMF_SET_ID=1 - - SERVED_GUAMI_MCC_0=208 - - SERVED_GUAMI_MNC_0=99 + - SERVED_GUAMI_MCC_0=001 + - SERVED_GUAMI_MNC_0=01 - SERVED_GUAMI_REGION_ID_0=128 - SERVED_GUAMI_AMF_SET_ID_0=1 - SERVED_GUAMI_MCC_1=460 - SERVED_GUAMI_MNC_1=11 - SERVED_GUAMI_REGION_ID_1=10 - SERVED_GUAMI_AMF_SET_ID_1=1 - - PLMN_SUPPORT_MCC=208 - - PLMN_SUPPORT_MNC=99 + - PLMN_SUPPORT_MCC=001 + - PLMN_SUPPORT_MNC=01 - PLMN_SUPPORT_TAC=0x0001 - SST_0=1 - SD_0=0x1 + - SST_1=1 + - SD_1=0x2 + - SST_2=1 + - SD_2=0x3 - AMF_INTERFACE_NAME_FOR_NGAP=eth0 - AMF_INTERFACE_NAME_FOR_N11=eth0 - SMF_INSTANCE_ID_0=1 @@ -230,8 +234,25 @@ services: - DNN_RANGE0=12.1.1.2 - 12.1.1.253 - NSSAI_SST0=1 - NSSAI_SD0=0x1 - - SESSION_AMBR_UL0=1000Mbps - - SESSION_AMBR_DL0=1000Mbps + - SESSION_AMBR_UL0=10000Mbps + - SESSION_AMBR_DL0=10000Mbps + - DNN_NI1=oai2 + - TYPE1=IPv4 + - DNN_RANGE1=12.1.2.2 - 12.1.2.253 + - NSSAI_SST1=1 + - NSSAI_SD1=0x2 + - SESSION_AMBR_UL1=10000Mbps + - SESSION_AMBR_DL1=10000Mbps + - DNN_NI2=oai3 + - TYPE2=IPv4 + - DNN_RANGE2=12.1.3.2 - 12.1.3.253 + - NSSAI_SST2=1 + - NSSAI_SD2=0x3 + - SESSION_AMBR_UL2=10000Mbps + - SESSION_AMBR_DL2=10000Mbps + - DNN_NI3=ims + - TYPE3=IPv4v6 + - DNN_RANGE3=14.1.1.2 - 14.1.1.253 - DEFAULT_CSCF_IPV4_ADDRESS=127.0.0.1 # only needed when ims is being used - ENABLE_USAGE_REPORTING=no # Set yes if UE USAGE REPORTING is to be done at UPF depends_on: @@ -253,9 +274,9 @@ services: - NETWORK_UE_IP=12.1.1.0/24 - SPGWC0_IP_ADDRESS=192.168.70.133 - BYPASS_UL_PFCP_RULES=no - - MCC=208 - - MNC=99 - - MNC03=099 + - MCC=001 + - MNC=01 + - MNC03=001 - TAC=1 - GW_ID=1 - THREAD_S1U_PRIO=80 @@ -276,6 +297,12 @@ services: - NSSAI_SST_0=1 - NSSAI_SD_0=0x1 - DNN_0=oai + - NSSAI_SST_1=1 + - NSSAI_SD_1=0x2 + - DNN_1=oai2 + - NSSAI_SST_2=1 + - NSSAI_SD_2=0x3 + - DNN_2=oai3 depends_on: - oai-nrf - oai-smf diff --git a/doc/tutorial_resources/oai_db.sql b/doc/tutorial_resources/oai_db.sql index fb8f4b20ed..0f6d5ae01c 100644 --- a/doc/tutorial_resources/oai_db.sql +++ b/doc/tutorial_resources/oai_db.sql @@ -151,13 +151,11 @@ CREATE TABLE `AuthenticationSubscription` ( -- INSERT INTO `AuthenticationSubscription` (`ueid`, `authenticationMethod`, `encPermanentKey`, `protectionParameterId`, `sequenceNumber`, `authenticationManagementField`, `algorithmId`, `encOpcKey`, `encTopcKey`, `vectorGenerationInHss`, `n5gcAuthMethod`, `rgAuthenticationInd`, `supi`) VALUES - ('2089900007487', '5G_AKA', 'fec86ba6eb707ed08905757b1bb44b8f', 'fec86ba6eb707ed08905757b1bb44b8f', '{\"sqn\": \"000000000000\", \"sqnScheme\": \"NON_TIME_BASED\", \"lastIndexes\": {\"ausf\": 0}}', '8000', 'milenage', 'C42449363BBAD02B66D16BC975D77CC1', NULL, NULL, NULL, NULL, '2089900007487'); + ('001010000000001', '5G_AKA', 'fec86ba6eb707ed08905757b1bb44b8f', 'fec86ba6eb707ed08905757b1bb44b8f', '{\"sqn\": \"000000000000\", \"sqnScheme\": \"NON_TIME_BASED\", \"lastIndexes\": {\"ausf\": 0}}', '8000', 'milenage', 'C42449363BBAD02B66D16BC975D77CC1', NULL, NULL, NULL, NULL, '001010000000001'); INSERT INTO `AuthenticationSubscription` (`ueid`, `authenticationMethod`, `encPermanentKey`, `protectionParameterId`, `sequenceNumber`, `authenticationManagementField`, `algorithmId`, `encOpcKey`, `encTopcKey`, `vectorGenerationInHss`, `n5gcAuthMethod`, `rgAuthenticationInd`, `supi`) VALUES - ('208990000000001', '5G_AKA', 'fec86ba6eb707ed08905757b1bb44b8f', 'fec86ba6eb707ed08905757b1bb44b8f', '{\"sqn\": \"000000000000\", \"sqnScheme\": \"NON_TIME_BASED\", \"lastIndexes\": {\"ausf\": 0}}', '8000', 'milenage', 'C42449363BBAD02B66D16BC975D77CC1', NULL, NULL, NULL, NULL, '208990000000001'); + ('001010000000002', '5G_AKA', 'fec86ba6eb707ed08905757b1bb44b8f', 'fec86ba6eb707ed08905757b1bb44b8f', '{\"sqn\": \"000000000000\", \"sqnScheme\": \"NON_TIME_BASED\", \"lastIndexes\": {\"ausf\": 0}}', '8000', 'milenage', 'C42449363BBAD02B66D16BC975D77CC1', NULL, NULL, NULL, NULL, '001010000000002'); INSERT INTO `AuthenticationSubscription` (`ueid`, `authenticationMethod`, `encPermanentKey`, `protectionParameterId`, `sequenceNumber`, `authenticationManagementField`, `algorithmId`, `encOpcKey`, `encTopcKey`, `vectorGenerationInHss`, `n5gcAuthMethod`, `rgAuthenticationInd`, `supi`) VALUES - ('208990000000002', '5G_AKA', 'fec86ba6eb707ed08905757b1bb44b8f', 'fec86ba6eb707ed08905757b1bb44b8f', '{\"sqn\": \"000000000000\", \"sqnScheme\": \"NON_TIME_BASED\", \"lastIndexes\": {\"ausf\": 0}}', '8000', 'milenage', 'C42449363BBAD02B66D16BC975D77CC1', NULL, NULL, NULL, NULL, '208990000000002'); -INSERT INTO `AuthenticationSubscription` (`ueid`, `authenticationMethod`, `encPermanentKey`, `protectionParameterId`, `sequenceNumber`, `authenticationManagementField`, `algorithmId`, `encOpcKey`, `encTopcKey`, `vectorGenerationInHss`, `n5gcAuthMethod`, `rgAuthenticationInd`, `supi`) VALUES - ('208990000000003', '5G_AKA', 'fec86ba6eb707ed08905757b1bb44b8f', 'fec86ba6eb707ed08905757b1bb44b8f', '{\"sqn\": \"000000000000\", \"sqnScheme\": \"NON_TIME_BASED\", \"lastIndexes\": {\"ausf\": 0}}', '8000', 'milenage', 'C42449363BBAD02B66D16BC975D77CC1', NULL, NULL, NULL, NULL, '208990000000003'); + ('001010000000003', '5G_AKA', 'fec86ba6eb707ed08905757b1bb44b8f', 'fec86ba6eb707ed08905757b1bb44b8f', '{\"sqn\": \"000000000000\", \"sqnScheme\": \"NON_TIME_BASED\", \"lastIndexes\": {\"ausf\": 0}}', '8000', 'milenage', 'C42449363BBAD02B66D16BC975D77CC1', NULL, NULL, NULL, NULL, '001010000000003'); -- -------------------------------------------------------- @@ -211,13 +209,11 @@ CREATE TABLE `SessionManagementSubscriptionData` ( -- INSERT INTO `SessionManagementSubscriptionData` (`ueid`, `servingPlmnid`, `singleNssai`, `dnnConfigurations`) VALUES - ('2089900007487', '20899', '{\"sst\": 1, \"sd\": \"1\"}','{\"oai\":{\"pduSessionTypes\":{ \"defaultSessionType\": \"IPV4\"},\"sscModes\": {\"defaultSscMode\": \"SSC_MODE_1\"},\"5gQosProfile\": {\"5qi\": 6,\"arp\":{\"priorityLevel\": 1,\"preemptCap\": \"NOT_PREEMPT\",\"preemptVuln\":\"NOT_PREEMPTABLE\"},\"priorityLevel\":1},\"sessionAmbr\":{\"uplink\":\"1000Mbps\", \"downlink\":\"1000Mbps\"},\"staticIpAddress\":[{\"ipv4Addr\": \"12.1.1.2\"}]}}'); + ('001010000000001', '00101', '{\"sst\": 1, \"sd\": \"1\"}','{\"oai\":{\"pduSessionTypes\":{ \"defaultSessionType\": \"IPV4\"},\"sscModes\": {\"defaultSscMode\": \"SSC_MODE_1\"},\"5gQosProfile\": {\"5qi\": 6,\"arp\":{\"priorityLevel\": 1,\"preemptCap\": \"NOT_PREEMPT\",\"preemptVuln\":\"NOT_PREEMPTABLE\"},\"priorityLevel\":1},\"sessionAmbr\":{\"uplink\":\"10000Mbps\", \"downlink\":\"10000Mbps\"},\"staticIpAddress\":[{\"ipv4Addr\": \"12.1.1.2\"}]}}'); INSERT INTO `SessionManagementSubscriptionData` (`ueid`, `servingPlmnid`, `singleNssai`, `dnnConfigurations`) VALUES - ('208990000000001', '20899', '{\"sst\": 1, \"sd\": \"1\"}','{\"oai\":{\"pduSessionTypes\":{ \"defaultSessionType\": \"IPV4\"},\"sscModes\": {\"defaultSscMode\": \"SSC_MODE_1\"},\"5gQosProfile\": {\"5qi\": 6,\"arp\":{\"priorityLevel\": 1,\"preemptCap\": \"NOT_PREEMPT\",\"preemptVuln\":\"NOT_PREEMPTABLE\"},\"priorityLevel\":1},\"sessionAmbr\":{\"uplink\":\"1000Mbps\", \"downlink\":\"1000Mbps\"},\"staticIpAddress\":[{\"ipv4Addr\": \"12.1.1.2\"}]}}'); + ('001010000000002', '00101', '{\"sst\": 1, \"sd\": \"1\"}','{\"oai\":{\"pduSessionTypes\":{ \"defaultSessionType\": \"IPV4\"},\"sscModes\": {\"defaultSscMode\": \"SSC_MODE_1\"},\"5gQosProfile\": {\"5qi\": 6,\"arp\":{\"priorityLevel\": 1,\"preemptCap\": \"NOT_PREEMPT\",\"preemptVuln\":\"NOT_PREEMPTABLE\"},\"priorityLevel\":1},\"sessionAmbr\":{\"uplink\":\"10000Mbps\", \"downlink\":\"10000Mbps\"},\"staticIpAddress\":[{\"ipv4Addr\": \"12.1.1.3\"}]}}'); INSERT INTO `SessionManagementSubscriptionData` (`ueid`, `servingPlmnid`, `singleNssai`, `dnnConfigurations`) VALUES - ('208990000000002', '20899', '{\"sst\": 1, \"sd\": \"1\"}','{\"oai\":{\"pduSessionTypes\":{ \"defaultSessionType\": \"IPV4\"},\"sscModes\": {\"defaultSscMode\": \"SSC_MODE_1\"},\"5gQosProfile\": {\"5qi\": 6,\"arp\":{\"priorityLevel\": 1,\"preemptCap\": \"NOT_PREEMPT\",\"preemptVuln\":\"NOT_PREEMPTABLE\"},\"priorityLevel\":1},\"sessionAmbr\":{\"uplink\":\"1000Mbps\", \"downlink\":\"1000Mbps\"},\"staticIpAddress\":[{\"ipv4Addr\": \"12.1.1.3\"}]}}'); -INSERT INTO `SessionManagementSubscriptionData` (`ueid`, `servingPlmnid`, `singleNssai`, `dnnConfigurations`) VALUES - ('208990000000003', '20899', '{\"sst\": 1, \"sd\": \"1\"}','{\"oai\":{\"pduSessionTypes\":{ \"defaultSessionType\": \"IPV4\"},\"sscModes\": {\"defaultSscMode\": \"SSC_MODE_1\"},\"5gQosProfile\": {\"5qi\": 6,\"arp\":{\"priorityLevel\": 1,\"preemptCap\": \"NOT_PREEMPT\",\"preemptVuln\":\"NOT_PREEMPTABLE\"},\"priorityLevel\":1},\"sessionAmbr\":{\"uplink\":\"1000Mbps\", \"downlink\":\"1000Mbps\"},\"staticIpAddress\":[{\"ipv4Addr\": \"12.1.1.4\"}]}}'); + ('001010000000003', '00101', '{\"sst\": 1, \"sd\": \"1\"}','{\"oai\":{\"pduSessionTypes\":{ \"defaultSessionType\": \"IPV4\"},\"sscModes\": {\"defaultSscMode\": \"SSC_MODE_1\"},\"5gQosProfile\": {\"5qi\": 6,\"arp\":{\"priorityLevel\": 1,\"preemptCap\": \"NOT_PREEMPT\",\"preemptVuln\":\"NOT_PREEMPTABLE\"},\"priorityLevel\":1},\"sessionAmbr\":{\"uplink\":\"10000Mbps\", \"downlink\":\"10000Mbps\"},\"staticIpAddress\":[{\"ipv4Addr\": \"12.1.1.4\"}]}}'); -- -------------------------------------------------------- diff --git a/docker/README.md b/docker/README.md index ace75161df..c591ee3d75 100644 --- a/docker/README.md +++ b/docker/README.md @@ -30,52 +30,54 @@ For all platforms, the strategy for building docker/podman images is the same: * all packages, compilers, ... * especially UHD is installed * Then, from the `ran-base` shared image, we create a shared image `ran-build` - in which all targets are compiled: + into which all targets are compiled. +* Then from the `ran-build` shared image, we can build target images for: - eNB - - gNB + - gNB (with UHD) + - gNB (with AW2S), only on RHEL8 - lte-UE - nr-UE -* Then from the `ran-build` shared image we can build target images for: - - eNB - - gNB - - lte-UE - - nr-UE -* These target images will only contain: + + These target images will only contain: - the generated executable (for example `lte-softmodem`) - the generated shared libraries (for example `liboai_usrpdevif.so`) - the needed libraries and packages to run these generated binaries - Some configuration file templates - Some tools (such as `ping`, `ifconfig`) -TO DO: - -- Proper entrypoints -- Proper port exposure -- ... +Note that on every push to develop (i.e., typically after integrating merge +requests), we build all images and push them to [Docker +Hub](https://hub.docker.com/u/oaisoftwarealliance). To pull them, do +``` +docker pull oaisoftwarealliance/oai-gnb:develop +docker pull oaisoftwarealliance/oai-nr-ue:develop +docker pull oaisoftwarealliance/oai-enb:develop +docker pull oaisoftwarealliance/oai-lte-ue:develop +``` +Have a look at [this +README](../ci-scripts/yaml_files/5g_rfsimulator/README.md) to get some +information on how to use the images. # 2. File organization # -Dockerfiles are named with the following naming convention: `Dockerfile.${target}.${OS-version}.${cluster-version}` +Dockerfiles are named with the following naming convention: `Dockerfile.${target}.${OS-version}` Targets can be: - `base` for an image named `ran-base` (shared image) -- `ran` for an image named `ran-build` (shared image) +- `build` for an image named `ran-build` (shared image) - `eNB` for an image named `oai-enb` - `gNB` for an image named `oai-gnb` +- `gNB.aw2s` for an image named `oai-gnb-aw2s` - `lteUE` for an image named `oai-lte-ue` - `nrUE` for an image named `oai-nr-ue` The currently-supported OS are: -- `rhel8.2` for Red Hat Entreprise Linux +- `rhel8.2` for Red Hat Entreprise Linux (including images for an OpenShift cluster) - `ubuntu18` for Ubuntu 18.04 LTS -The currently-supported cluster version is: - -- `rhel8.2.oc4-9` - -For more details in build within a Openshift Cluster, see [OpenShift README](../openshift/README.md) for more details. +For more details regarding the build on an Openshift Cluster, see [OpenShift README](../openshift/README.md). # 3. Building using `docker` under Ubuntu 18.04 # @@ -87,26 +89,12 @@ For more details in build within a Openshift Cluster, see [OpenShift README](../ ## 3.2. Building the shared images ## -Note: This can be done starting `2020.XX` tag on the `develop` branch, or any branch that includes that tag. - There are two shared images: one that has all dependencies, and a second that compiles all targets (eNB, gNB, [nr]UE). ```bash git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git cd openairinterface5g git checkout develop -``` - -In our Eurecom/OSA environment we need to pass a GIT proxy. - -```bash -docker build --target ran-base --tag ran-base:latest --file docker/Dockerfile.base.ubuntu18 --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . -docker build --target ran-build --tag ran-build:latest --file docker/Dockerfile.build.ubuntu18 --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . -``` - -if you don't need it, do NOT pass any value: - -```bash docker build --target ran-base --tag ran-base:latest --file docker/Dockerfile.base.ubuntu18 . docker build --target ran-build --tag ran-build:latest --file docker/Dockerfile.build.ubuntu18 . ``` @@ -149,11 +137,77 @@ docker image prune --force # 4. Building using `podman` under Red Hat Entreprise Linux 8.2 # -TODO. +Analogous to the above steps: +``` +sudo podman build --target ran-base --tag ran-base:latest --file docker/Dockerfile.base.rhel8.2 . +sudo podman build --target ran-build --tag ran-build:latest --file docker/Dockerfile.build.rhel8.2 . +sudo podman build --target oai-enb --tag oai-enb:latest --file docker/Dockerfile.eNB.rhel8.2 . +``` # 5. Running modems using `docker` under Ubuntu 18.04 # -TODO. +The easiest is to run them from a `docker-compose` file, which is used by the +CI to test OAI. Some folders under `ci-scripts/yaml_files` have a README that +you can follow. For 5G, the easiest is to start with the RFsimulator, as +described in [this README](../ci-scripts/yaml_files/5g_rfsimulator/README.md) +(you would of course use your own images instead of downloading them from +Docker hub). + +For an example using a B210, please refer to [this `docker-compose` +file](../ci-scripts/yaml_files/sa_b200_gnb/docker-compose.yml). + +It is also possible to mount your own configuration file. The following +docker-compose file can be used to start a gNB using a B210 and your own +config, located at `/tmp/gnb.conf`: +``` +version: '3.8' + +services: + gnb_mono_tdd: + image: oai-gnb:latest + privileged: true + container_name: sa-b200-gnb + environment: + USE_VOLUMED_CONF: 'yes' + USE_B2XX: 'yes' + USE_ADDITIONAL_OPTIONS: --sa -E --continuous-tx + volumes: + - /dev:/dev + - /tmp/gnb.conf:/opt/oai-gnb/etc/mounted.conf + networks: + public_net: + ipv4_address: 192.168.68.194 + healthcheck: + # pgrep does NOT work + test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem" + interval: 10s + timeout: 5s + retries: 5 + +networks: + public_net: + name: sa-b200-gnb-net + ipam: + config: + - subnet: 192.168.68.192/26 + driver_opts: + com.docker.network.bridge.name: "sa-gnb-net" +``` + +You should also change the `image` to the right image name and tag of the gNB +you are using. Start like this: +``` +docker-compose up # gNB in foreground +docker-compose up -d # gNB in background +``` +Stop it like this (in both cases): +``` +docker-compose down +``` + +Note that in the above case, ALL devices are passed into the container (by +mounting `/dev`), which allows the container to access all devices connected to +the host! # 6. Running modems using `podman` under Red Hat Entreprise Linux 8.2 # diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 5c41ebf43b..b3de5d751a 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -608,6 +608,7 @@ void processSlotTX(void *arg) { nr_rxtx_thread_data_t *rxtxD = (nr_rxtx_thread_data_t *) arg; UE_nr_rxtx_proc_t *proc = &rxtxD->proc; PHY_VARS_NR_UE *UE = rxtxD->UE; + nr_phy_data_tx_t phy_data = {0}; LOG_D(PHY,"%d.%d => slot type %d\n", proc->frame_tx, proc->nr_slot_tx, proc->tx_slot_type); if (proc->tx_slot_type == NR_UPLINK_SLOT || proc->tx_slot_type == NR_MIXED_SLOT){ @@ -627,12 +628,13 @@ void processSlotTX(void *arg) { ul_indication.frame_tx = proc->frame_tx; ul_indication.slot_tx = proc->nr_slot_tx; ul_indication.ue_sched_mode = rxtxD->ue_sched_mode; + ul_indication.phy_data = &phy_data; UE->if_inst->ul_indication(&ul_indication); stop_meas(&UE->ue_ul_indication_stats); } - phy_procedures_nrUE_TX(UE,proc,proc->gNB_id); + phy_procedures_nrUE_TX(UE, proc, proc->gNB_id, &phy_data); } } @@ -686,7 +688,7 @@ void UE_processing(nr_rxtx_thread_data_t *rxtxD) { } if (proc->tx_slot_type == NR_UPLINK_SLOT || proc->tx_slot_type == NR_MIXED_SLOT) { - nr_phy_data_t phy_data = {0}; + nr_phy_data_tx_t phy_data = {0}; if (UE->if_inst != NULL && UE->if_inst->ul_indication != NULL) { nr_uplink_indication_t ul_indication; memset((void*)&ul_indication, 0, sizeof(ul_indication)); diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index a27a4abe17..1c3aaf432e 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -648,19 +648,42 @@ void free_nr_ue_dl_harq(NR_DL_UE_HARQ_t* harq_list, int number_of_processes, int } } -void term_nr_ue_transport(PHY_VARS_NR_UE *ue) -{ - const int N_RB_DL = ue->frame_parms.N_RB_DL; - int num_cw = NR_MAX_NB_LAYERS > 4? 2:1; - for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) { - for (int j = 0; j < num_cw; j++) { - free_nr_ue_dl_harq(ue->dl_harq_processes[j], NR_MAX_DLSCH_HARQ_PROCESSES, N_RB_DL); - free_nr_ue_ulsch(&ue->ulsch[i], N_RB_DL, &ue->frame_parms); +void free_nr_ue_ul_harq(NR_UL_UE_HARQ_t *harq_list, int number_of_processes, int num_rb, int num_ant_tx) { + + int max_layers = (num_ant_tx < NR_MAX_NB_LAYERS) ? num_ant_tx : NR_MAX_NB_LAYERS; + uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*max_layers; //number of segments to be allocated + + if (num_rb != 273) { + a_segments = a_segments*num_rb; + a_segments = a_segments/273 +1; + } + + for (int i = 0; i < number_of_processes; i++) { + free_and_zero(harq_list[i].a); + free_and_zero(harq_list[i].b); + for (int r = 0; r < a_segments; r++) { + free_and_zero(harq_list[i].c[r]); + free_and_zero(harq_list[i].d[r]); } + free_and_zero(harq_list[i].c); + free_and_zero(harq_list[i].d); + free_and_zero(harq_list[i].e); + free_and_zero(harq_list[i].f); } } -void nr_init_harq_processes(NR_DL_UE_HARQ_t* harq_list, int number_of_processes, int num_rb) { +void term_nr_ue_transport(PHY_VARS_NR_UE *ue) +{ + const int N_RB_DL = ue->frame_parms.N_RB_DL; + const int N_RB_UL = ue->frame_parms.N_RB_UL; + int num_cw = NR_MAX_NB_LAYERS > 4? 2:1; + for (int j = 0; j < num_cw; j++) { + free_nr_ue_dl_harq(ue->dl_harq_processes[j], NR_MAX_DLSCH_HARQ_PROCESSES, N_RB_DL); + } + free_nr_ue_ul_harq(ue->ul_harq_processes, NR_MAX_ULSCH_HARQ_PROCESSES, N_RB_UL, ue->frame_parms.nb_antennas_tx); +} + +void nr_init_dl_harq_processes(NR_DL_UE_HARQ_t* harq_list, int number_of_processes, int num_rb) { int a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS; //number of segments to be allocated if (num_rb != 273) { @@ -698,19 +721,63 @@ void nr_init_harq_processes(NR_DL_UE_HARQ_t* harq_list, int number_of_processes, } } +void nr_init_ul_harq_processes(NR_UL_UE_HARQ_t *harq_list, int number_of_processes, int num_rb, int num_ant_tx) { + + int max_layers = (num_ant_tx < NR_MAX_NB_LAYERS) ? num_ant_tx : NR_MAX_NB_LAYERS; + uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*max_layers; //number of segments to be allocated + + if (num_rb != 273) { + a_segments = a_segments*num_rb; + a_segments = a_segments/273 +1; + } + + uint32_t ulsch_bytes = a_segments*1056; // allocated bytes per segment + + for (int i = 0; i < number_of_processes; i++) { + + memset(harq_list + i, 0, sizeof(NR_UL_UE_HARQ_t)); + + harq_list[i].a = malloc16(ulsch_bytes); + DevAssert(harq_list[i].a); + bzero(harq_list[i].a, ulsch_bytes); + + harq_list[i].b = malloc16(ulsch_bytes); + DevAssert(harq_list[i].b); + bzero(harq_list[i].b, ulsch_bytes); + + harq_list[i].c = malloc16(a_segments*sizeof(uint8_t *)); + harq_list[i].d = malloc16(a_segments*sizeof(uint16_t *)); + for (int r = 0; r < a_segments; r++) { + harq_list[i].c[r] = malloc16(8448); + DevAssert(harq_list[i].c[r]); + bzero(harq_list[i].c[r],8448); + + harq_list[i].d[r] = malloc16(68*384); //max size for coded output + DevAssert(harq_list[i].d[r]); + bzero(harq_list[i].d[r],(68*384)); + } + + harq_list[i].e = malloc16(14*num_rb*12*8); + DevAssert(harq_list[i].e); + bzero(harq_list[i].e,14*num_rb*12*8); + + harq_list[i].f = malloc16(14*num_rb*12*8); + DevAssert(harq_list[i].f); + bzero(harq_list[i].f,14*num_rb*12*8); + + harq_list[i].first_tx = 1; + harq_list[i].round = 0; + } +} + void init_nr_ue_transport(PHY_VARS_NR_UE *ue) { int num_codeword = NR_MAX_NB_LAYERS > 4? 2:1; - for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) { - for (int j=0; jdl_harq_processes[j], NR_MAX_DLSCH_HARQ_PROCESSES, ue->frame_parms.N_RB_DL); - if (j==0) { - AssertFatal((ue->ulsch[i] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES,&ue->frame_parms))!=NULL,"Can't get ue ulsch structures\n"); - LOG_D(PHY,"ulsch[%d] => %p\n",i,ue->ulsch[i]); - } - } + for (int j=0; jdl_harq_processes[j], NR_MAX_DLSCH_HARQ_PROCESSES, ue->frame_parms.N_RB_DL); } + nr_init_ul_harq_processes(ue->ul_harq_processes, NR_MAX_ULSCH_HARQ_PROCESSES, ue->frame_parms.N_RB_UL, ue->frame_parms.nb_antennas_tx); for(int i=0; i<5; i++) ue->dl_stats[i] = 0; diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index 40d9d12d3c..22f41ba492 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -418,8 +418,10 @@ void reset_DLSCH_struct(const PHY_VARS_gNB *gNB, processingData_L1tx_t *msg); void RCconfig_nrUE_prs(void *cfg); void init_nr_prs_ue_vars(PHY_VARS_NR_UE *ue); -void nr_init_harq_processes(NR_DL_UE_HARQ_t* harq_list, int number_of_processes, int num_rb); +void nr_init_dl_harq_processes(NR_DL_UE_HARQ_t* harq_list, int number_of_processes, int num_rb); +void nr_init_ul_harq_processes(NR_UL_UE_HARQ_t *harq_list, int number_of_processes, int num_rb, int num_ant_tx); void free_nr_ue_dl_harq(NR_DL_UE_HARQ_t* harq_list, int number_of_processes, int num_rb); +void free_nr_ue_ul_harq(NR_UL_UE_HARQ_t *harq_list, int number_of_processes, int num_rb, int num_ant_tx); /** @} */ #endif diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h index 8e9bfd6201..efdcd51e64 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -52,13 +52,6 @@ */ void nr_ue_dlsch_init(NR_UE_DLSCH_t *dlsch_list, int num_dlsch, uint8_t max_ldpc_iterations); -void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr, - uint16_t N_RB_UL, - NR_DL_FRAME_PARMS* frame_parms); - - -NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids, NR_DL_FRAME_PARMS* frame_parms); - /** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream QPSK/QPSK reception. @param stream0_in Input from channel compensated (MR combined) stream 0 @param stream1_in Input from channel compensated (MR combined) stream 1 @@ -735,7 +728,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, unsigned char harq_pid, uint32_t frame, uint8_t slot, - int gNB_id); + int gNB_id, + nr_phy_data_tx_t *phy_data); /** \brief This function does IFFT for PUSCH diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h index b91ad2b9cd..5c8506e4f7 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h @@ -57,8 +57,6 @@ typedef enum { } harq_result_t; typedef struct { - /// NDAPI struct for UE - nfapi_nr_ue_pusch_pdu_t pusch_pdu; /// Indicator of first transmission uint8_t first_tx; /// HARQ tx status @@ -120,11 +118,10 @@ typedef struct { } NR_UL_UE_HARQ_t; typedef struct { + /// NDAPI struct for UE + nfapi_nr_ue_pusch_pdu_t pusch_pdu; /// SRS active flag uint8_t srs_active; - // Pointers to HARQ processes for the ULSCH - NR_UL_UE_HARQ_t *harq_processes[NR_MAX_ULSCH_HARQ_PROCESSES]; - int harq_process_id[NR_MAX_SLOTS_PER_FRAME]; // UL number of harq processes uint8_t number_harq_processes_for_pusch; /// Minimum number of CQI bits for PUSCH (36-212 r8.6, Sec 5.2.4.1 p. 37) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index 0ff5d0a2eb..1973d617f7 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -43,137 +43,6 @@ //#define DEBUG_ULSCH_CODING -void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr, - uint16_t N_RB_UL, - NR_DL_FRAME_PARMS* frame_parms) { - - NR_UE_ULSCH_t *ulsch = *ulschptr; - - if (ulsch) { -#ifdef DEBUG_ULSCH_FREE - printf("Freeing ulsch %p\n",ulsch); -#endif - - int max_layers = (frame_parms->nb_antennas_txnb_antennas_tx : NR_MAX_NB_LAYERS; - uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*max_layers; //number of segments to be allocated - - if (N_RB_UL != 273) { - a_segments = a_segments*N_RB_UL; - a_segments = a_segments/273 +1; - } - - for (int i=0; iharq_processes[i]) { - - if (ulsch->harq_processes[i]->a) { - free16(ulsch->harq_processes[i]->a,a_segments*1056); - ulsch->harq_processes[i]->a = NULL; - } - if (ulsch->harq_processes[i]->b) { - free16(ulsch->harq_processes[i]->b,a_segments*1056); - ulsch->harq_processes[i]->b = NULL; - } - if (ulsch->harq_processes[i]->e) { - free16(ulsch->harq_processes[i]->e,14*N_RB_UL*12*8); - ulsch->harq_processes[i]->e = NULL; - } - if (ulsch->harq_processes[i]->f) { - free16(ulsch->harq_processes[i]->f,14*N_RB_UL*12*8); - ulsch->harq_processes[i]->f = NULL; - } - for (int r=0; rharq_processes[i]->c[r]) { - free16(ulsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+768); - ulsch->harq_processes[i]->c[r] = NULL; - } - - if (ulsch->harq_processes[i]->d[r]) { - free16(ulsch->harq_processes[i]->d[r],68*384); - ulsch->harq_processes[i]->d[r] = NULL; - } - - } - - if (ulsch->harq_processes[i]->c) { - free16(ulsch->harq_processes[i]->c,a_segments); - ulsch->harq_processes[i]->c = NULL; - } - if (ulsch->harq_processes[i]->d) { - free16(ulsch->harq_processes[i]->d,a_segments); - ulsch->harq_processes[i]->d = NULL; - } - - free16(ulsch->harq_processes[i],sizeof(NR_UL_UE_HARQ_t)); - ulsch->harq_processes[i] = NULL; - } - } - free16(ulsch,sizeof(NR_UE_ULSCH_t)); - *ulschptr = NULL; - } -} - - -NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids, NR_DL_FRAME_PARMS* frame_parms) { - - int max_layers = (frame_parms->nb_antennas_txnb_antennas_tx : NR_MAX_NB_LAYERS; - uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*max_layers; //number of segments to be allocated - - if (N_RB_UL != 273) { - a_segments = a_segments*N_RB_UL; - a_segments = a_segments/273 +1; - } - - uint32_t ulsch_bytes = a_segments*1056; // allocated bytes per segment - - NR_UE_ULSCH_t *ulsch = malloc16(sizeof(NR_UE_ULSCH_t)); - DevAssert(ulsch); - memset(ulsch, 0, sizeof(*ulsch)); - - ulsch->number_harq_processes_for_pusch = NR_MAX_ULSCH_HARQ_PROCESSES; - - for (int i = 0; i < number_of_harq_pids; i++) { - - ulsch->harq_processes[i] = malloc16(sizeof(NR_UL_UE_HARQ_t)); - DevAssert(ulsch->harq_processes[i]); - memset(ulsch->harq_processes[i], 0, sizeof(NR_UL_UE_HARQ_t)); - - ulsch->harq_processes[i]->a = malloc16(ulsch_bytes); - DevAssert(ulsch->harq_processes[i]->a); - bzero(ulsch->harq_processes[i]->a,ulsch_bytes); - - ulsch->harq_processes[i]->b = malloc16(ulsch_bytes); - DevAssert(ulsch->harq_processes[i]->b); - bzero(ulsch->harq_processes[i]->b,ulsch_bytes); - - ulsch->harq_processes[i]->c = malloc16(a_segments*sizeof(uint8_t *)); - ulsch->harq_processes[i]->d = malloc16(a_segments*sizeof(uint16_t *)); - for (int r = 0; r < a_segments; r++) { - // account for filler in first segment and CRCs for multiple segment case - ulsch->harq_processes[i]->c[r] = malloc16(8448); - DevAssert(ulsch->harq_processes[i]->c[r]); - bzero(ulsch->harq_processes[i]->c[r],8448); - - ulsch->harq_processes[i]->d[r] = malloc16(68*384); //max size for coded output - DevAssert(ulsch->harq_processes[i]->d[r]); - bzero(ulsch->harq_processes[i]->d[r],(68*384)); - } - - ulsch->harq_processes[i]->e = malloc16(14*N_RB_UL*12*8); - DevAssert(ulsch->harq_processes[i]->e); - bzero(ulsch->harq_processes[i]->e,14*N_RB_UL*12*8); - - ulsch->harq_processes[i]->f = malloc16(14*N_RB_UL*12*8); - DevAssert(ulsch->harq_processes[i]->f); - bzero(ulsch->harq_processes[i]->f,14*N_RB_UL*12*8); - - ulsch->harq_processes[i]->subframe_scheduling_flag = 0; - ulsch->harq_processes[i]->first_tx = 1; - } - - return(ulsch); -} - - int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, NR_UE_ULSCH_t *ulsch, NR_DL_FRAME_PARMS* frame_parms, @@ -186,29 +55,29 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, /////////// unsigned int crc = 1; - NR_UL_UE_HARQ_t *harq_process = ulsch->harq_processes[harq_pid]; - uint16_t nb_rb = harq_process->pusch_pdu.rb_size; - uint32_t A = harq_process->pusch_pdu.pusch_data.tb_size<<3; + NR_UL_UE_HARQ_t *harq_process = &ue->ul_harq_processes[harq_pid]; + uint16_t nb_rb = ulsch->pusch_pdu.rb_size; + uint32_t A = ulsch->pusch_pdu.pusch_data.tb_size<<3; uint32_t *pz = &harq_process->Z; - uint8_t mod_order = harq_process->pusch_pdu.qam_mod_order; + uint8_t mod_order = ulsch->pusch_pdu.qam_mod_order; uint16_t Kr=0; uint32_t r_offset=0; uint32_t F=0; // target_code_rate is in 0.1 units - float Coderate = (float) harq_process->pusch_pdu.target_code_rate / 10240.0f; + float Coderate = (float) ulsch->pusch_pdu.target_code_rate / 10240.0f; /////////// ///////////////////////////////////////////////////////////////////////////////////////// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_UE_ULSCH_ENCODING, VCD_FUNCTION_IN); - LOG_D(NR_PHY, "ulsch coding nb_rb %d, Nl = %d\n", nb_rb, harq_process->pusch_pdu.nrOfLayers); + LOG_D(NR_PHY, "ulsch coding nb_rb %d, Nl = %d\n", nb_rb, ulsch->pusch_pdu.nrOfLayers); LOG_D(NR_PHY, "ulsch coding A %d G %d mod_order %d Coderate %f\n", A, G, mod_order, Coderate); LOG_D(NR_PHY, "harq_pid %d harq_process->ndi %d, pusch_data.new_data_indicator %d\n", - harq_pid,harq_process->ndi,harq_process->pusch_pdu.pusch_data.new_data_indicator); + harq_pid,harq_process->ndi,ulsch->pusch_pdu.pusch_data.new_data_indicator); if (harq_process->first_tx == 1 || - harq_process->ndi != harq_process->pusch_pdu.pusch_data.new_data_indicator) { // this is a new packet + harq_process->ndi != ulsch->pusch_pdu.pusch_data.new_data_indicator) { // this is a new packet #ifdef DEBUG_ULSCH_CODING printf("encoding thinks this is a new packet \n"); #endif @@ -223,7 +92,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, printf("\n"); */ - int max_payload_bytes = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*harq_process->pusch_pdu.nrOfLayers*1056; + int max_payload_bytes = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*ulsch->pusch_pdu.nrOfLayers*1056; if (A > 3824) { // Add 24-bit crc (polynomial A) to payload @@ -278,7 +147,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, &harq_process->F, harq_process->BG); - if (harq_process->C>MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*harq_process->pusch_pdu.nrOfLayers) { + if (harq_process->C>MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*ulsch->pusch_pdu.nrOfLayers) { LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d\n",harq_process->C,harq_process->B); return(-1); } @@ -350,8 +219,8 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, /////////// /////////////////////////////////////////////////////////////////////////////// - LOG_D(PHY,"setting ndi to %d from pusch_data\n", harq_process->pusch_pdu.pusch_data.new_data_indicator); - harq_process->ndi = harq_process->pusch_pdu.pusch_data.new_data_indicator; + LOG_D(PHY,"setting ndi to %d from pusch_data\n", ulsch->pusch_pdu.pusch_data.new_data_indicator); + harq_process->ndi = ulsch->pusch_pdu.pusch_data.new_data_indicator; } F = harq_process->F; Kr = harq_process->K; @@ -371,17 +240,17 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, G, Kr*3, mod_order,nb_rb, - harq_process->pusch_pdu.pusch_data.rv_index); + ulsch->pusch_pdu.pusch_data.rv_index); //start_meas(rm_stats); ///////////////////////// d---->| Rate matching bit selection |---->e ///////////////////////// /////////// - uint32_t E = nr_get_E(G, harq_process->C, mod_order, harq_process->pusch_pdu.nrOfLayers, r); + uint32_t E = nr_get_E(G, harq_process->C, mod_order, ulsch->pusch_pdu.nrOfLayers, r); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_IN); start_meas(&ue->ulsch_rate_matching_stats); - if (nr_rate_matching_ldpc(harq_process->pusch_pdu.tbslbrm, + if (nr_rate_matching_ldpc(ulsch->pusch_pdu.tbslbrm, harq_process->BG, *pz, harq_process->d[r], @@ -389,7 +258,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, harq_process->C, F, Kr-F-2*(*pz), - harq_process->pusch_pdu.pusch_data.rv_index, + ulsch->pusch_pdu.pusch_data.rv_index, E) == -1) return -1; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index ae4ac7046e..6b62fe4f84 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -110,7 +110,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, unsigned char harq_pid, uint32_t frame, uint8_t slot, - int gNB_id) { + int gNB_id, + nr_phy_data_tx_t *phy_data) { LOG_D(PHY,"nr_ue_ulsch_procedures hard_id %d %d.%d\n",harq_pid,frame,slot); @@ -126,9 +127,9 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, int N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig uint16_t number_dmrs_symbols = 0; - NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[gNB_id]; - NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid]; - nfapi_nr_ue_pusch_pdu_t *pusch_pdu = &harq_process_ul_ue->pusch_pdu; + NR_UE_ULSCH_t *ulsch_ue = &phy_data->ulsch; + NR_UL_UE_HARQ_t *harq_process_ul_ue = &UE->ul_harq_processes[harq_pid]; + nfapi_nr_ue_pusch_pdu_t *pusch_pdu = &ulsch_ue->pusch_pdu; int start_symbol = pusch_pdu->start_symbol_index; uint16_t ul_dmrs_symb_pos = pusch_pdu->ul_dmrs_symb_pos; @@ -169,7 +170,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, trace_NRpdu(DIRECTION_UPLINK, harq_process_ul_ue->a, - harq_process_ul_ue->pusch_pdu.pusch_data.tb_size, + pusch_pdu->pusch_data.tb_size, WS_C_RNTI, rnti, frame, slot, 0, 0); if (nr_ulsch_encoding(UE, ulsch_ue, frame_parms, harq_pid, G) == -1) @@ -236,8 +237,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, if (pusch_pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { - K_ptrs = harq_process_ul_ue->pusch_pdu.pusch_ptrs.ptrs_freq_density; - L_ptrs = 1<pusch_pdu.pusch_ptrs.ptrs_time_density; + K_ptrs = pusch_pdu->pusch_ptrs.ptrs_freq_density; + L_ptrs = 1<pusch_ptrs.ptrs_time_density; beta_ptrs = 1; // temp value until power control is implemented @@ -572,7 +573,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, }// port loop NR_UL_UE_HARQ_t *harq_process_ulsch=NULL; - harq_process_ulsch = UE->ulsch[gNB_id]->harq_processes[harq_pid]; + harq_process_ulsch = &UE->ul_harq_processes[harq_pid]; harq_process_ulsch->status = SCH_IDLE; for (int nl = 0; nl < Nl; nl++) { diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 1d37d0e85c..9c2e20a6e5 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -538,10 +538,10 @@ typedef struct { NR_UE_CSI_IM *csiim_vars[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_CSI_RS *csirs_vars[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_SRS *srs_vars[NUMBER_OF_CONNECTED_gNB_MAX]; - NR_UE_ULSCH_t *ulsch[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_PRS *prs_vars[NR_MAX_PRS_COMB_SIZE]; uint8_t prs_active_gNBs; NR_DL_UE_HARQ_t dl_harq_processes[NR_MAX_NB_LAYERS>4 ? 2:1][NR_MAX_DLSCH_HARQ_PROCESSES]; + NR_UL_UE_HARQ_t ul_harq_processes[NR_MAX_ULSCH_HARQ_PROCESSES]; //Paging parameters uint32_t IMSImod1024; @@ -752,8 +752,12 @@ typedef struct { void* scopeData; } PHY_VARS_NR_UE; -typedef struct nr_phy_data_s { +typedef struct nr_phy_data_tx_s { + NR_UE_ULSCH_t ulsch; NR_UE_PUCCH pucch_vars; +} nr_phy_data_tx_t; + +typedef struct nr_phy_data_s { NR_UE_PDCCH_CONFIG phy_pdcch_config; NR_UE_DLSCH_t dlsch[NR_MAX_NB_LAYERS>4 ? 2:1]; } nr_phy_data_t; diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index 51749889c9..4e65074c43 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -96,7 +96,7 @@ typedef struct { @param proc Pointer to RXn-TXnp4 proc information @param eNB_id Local id of eNB on which to act */ -void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id); +void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id, nr_phy_data_tx_t *phy_data); /*! \brief Scheduling for UE RX procedures in normal subframes. @param ue Pointer to UE variables on which to act diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 5b81753128..9c9e7a249b 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -329,8 +329,8 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ // Note: we have to handle the thread IDs for this. To be revisited completely. NR_UE_DLSCH_t *dlsch0 = &((nr_phy_data_t *)scheduled_response->phy_data)->dlsch[0]; - NR_UE_ULSCH_t *ulsch = PHY_vars_UE_g[module_id][cc_id]->ulsch[0]; - NR_UE_PUCCH *pucch_vars = &((nr_phy_data_t *)scheduled_response->phy_data)->pucch_vars; + NR_UE_ULSCH_t *ulsch = &((nr_phy_data_tx_t *)scheduled_response->phy_data)->ulsch; + NR_UE_PUCCH *pucch_vars = &((nr_phy_data_tx_t *)scheduled_response->phy_data)->pucch_vars; NR_UE_CSI_IM *csiim_vars = PHY_vars_UE_g[module_id][cc_id]->csiim_vars[0]; NR_UE_CSI_RS *csirs_vars = PHY_vars_UE_g[module_id][cc_id]->csirs_vars[0]; NR_UE_PDCCH_CONFIG *phy_pdcch_config = NULL; @@ -426,26 +426,21 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ // pusch config pdu pusch_config_pdu = &ul_config->ul_config_list[i].pusch_config_pdu; current_harq_pid = pusch_config_pdu->pusch_data.harq_process_id; - NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch->harq_processes[current_harq_pid]; + NR_UL_UE_HARQ_t *harq_process_ul_ue = &PHY_vars_UE_g[module_id][cc_id]->ul_harq_processes[current_harq_pid]; - if (harq_process_ul_ue){ + nfapi_nr_ue_pusch_pdu_t *pusch_pdu = &ulsch->pusch_pdu; - nfapi_nr_ue_pusch_pdu_t *pusch_pdu = &harq_process_ul_ue->pusch_pdu; - - LOG_D(PHY, "In %s i %d: copy pusch_config_pdu nrOfLayers:%d, num_dmrs_cdm_grps_no_data:%d \n", __FUNCTION__, i, pusch_config_pdu->nrOfLayers,pusch_config_pdu->num_dmrs_cdm_grps_no_data); + LOG_D(PHY, "In %s i %d: copy pusch_config_pdu nrOfLayers:%d, num_dmrs_cdm_grps_no_data:%d \n", __FUNCTION__, i, pusch_config_pdu->nrOfLayers,pusch_config_pdu->num_dmrs_cdm_grps_no_data); - memcpy(pusch_pdu, pusch_config_pdu, sizeof(nfapi_nr_ue_pusch_pdu_t)); + memcpy(pusch_pdu, pusch_config_pdu, sizeof(nfapi_nr_ue_pusch_pdu_t)); - ulsch->f_pusch = pusch_config_pdu->absolute_delta_PUSCH; - - if (scheduled_response->tx_request) { - for (int j=0; jtx_request->number_of_pdus; j++) { - fapi_nr_tx_request_body_t *tx_req_body = &scheduled_response->tx_request->tx_request_body[j]; - if ((tx_req_body->pdu_index == i) && (tx_req_body->pdu_length > 0)) { - LOG_D(PHY,"%d.%d Copying %d bytes to harq_process_ul_ue->a (harq_pid %d)\n",scheduled_response->frame,slot,tx_req_body->pdu_length,current_harq_pid); - memcpy(harq_process_ul_ue->a, tx_req_body->pdu, tx_req_body->pdu_length); - break; - } + if (scheduled_response->tx_request) { + for (int j=0; jtx_request->number_of_pdus; j++) { + fapi_nr_tx_request_body_t *tx_req_body = &scheduled_response->tx_request->tx_request_body[j]; + if ((tx_req_body->pdu_index == i) && (tx_req_body->pdu_length > 0)) { + LOG_D(PHY,"%d.%d Copying %d bytes to harq_process_ul_ue->a (harq_pid %d)\n",scheduled_response->frame,slot,tx_req_body->pdu_length,current_harq_pid); + memcpy(harq_process_ul_ue->a, tx_req_body->pdu, tx_req_body->pdu_length); + break; } } diff --git a/openair1/SCHED_NR_UE/harq_nr.c b/openair1/SCHED_NR_UE/harq_nr.c index 25e23551e0..2cffd3f484 100644 --- a/openair1/SCHED_NR_UE/harq_nr.c +++ b/openair1/SCHED_NR_UE/harq_nr.c @@ -98,128 +98,6 @@ #define DL_DCI (1) #define UL_DCI (0) - -/******************************************************************* -* -* NAME : config_uplink_harq_process -* -* PARAMETERS : pointer to ue context -* id of current gNB -* number of uplink processes -* maximum number of uplink retransmissions -* RETURN : none -* -* DESCRIPTION : configuration of uplink HARQ entity -* -*********************************************************************/ - -void config_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int code_word_idx, uint8_t number_harq_processes_pusch) -{ - NR_UE_ULSCH_t *ulsch; - - ulsch = (NR_UE_ULSCH_t *)malloc16(sizeof(NR_UE_ULSCH_t)); - - if (ulsch != NULL) { - - memset(ulsch,0,sizeof(NR_UE_ULSCH_t)); - - ue->ulsch[gNB_id] = ulsch; - } - else { - LOG_E(PHY, "Fatal memory allocation problem at line %d in function %s of file %s \n", __LINE__ , __func__, __FILE__); - assert(0); - } - - ulsch->number_harq_processes_for_pusch = number_harq_processes_pusch; - - /* allocation of HARQ process context */ - for (int harq_pid = 0; harq_pid < number_harq_processes_pusch; harq_pid++) { - - ulsch->harq_processes[harq_pid] = (NR_UL_UE_HARQ_t *)malloc16(sizeof(NR_UL_UE_HARQ_t)); - - if (ulsch->harq_processes[harq_pid] == NULL) { - LOG_E(PHY, "Fatal memory allocation problem at line %d in function %s of file %s \n", __LINE__ , __func__, __FILE__); - assert(0); - } - - ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 0; - ulsch->harq_processes[harq_pid]->first_tx = 1; - ulsch->harq_processes[harq_pid]->round = 0; - } - - for (int slot_tx = 0; slot_tx < NR_MAX_SLOTS_PER_FRAME; slot_tx++) { - ue->ulsch[gNB_id]->harq_process_id[slot_tx] = NR_MAX_HARQ_PROCESSES; - } -} - -/******************************************************************* -* -* NAME : release_uplink_harq_process -* -* PARAMETERS : pointer to ue context -* id of current gNB -* -* RETURN : none -* -* DESCRIPTION : release of HARQ uplink entity -* -*********************************************************************/ - -void release_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int code_word_idx) -{ - NR_UE_ULSCH_t *ulsch = ue->ulsch[gNB_id]; - - for (int process_id = 0; process_id < ulsch->number_harq_processes_for_pusch; process_id++) { - - free16(ulsch->harq_processes[process_id],sizeof(NR_UL_UE_HARQ_t)); - - ulsch->harq_processes[process_id] = NULL; - } - - free16(ulsch, sizeof(NR_UE_ULSCH_t)); - - ue->ulsch[gNB_id] = NULL; -} - -/******************************************************************* -* -* NAME : set_tx_harq_id -* -* PARAMETERS : ue context -* slot_tx slot for transmission -* gNB_id identifier -* -* RETURN : none -* -* DESCRIPTION : store tx harq process identifier for given transmission slot -* -*********************************************************************/ - -void set_tx_harq_id(NR_UE_ULSCH_t *ulsch, int harq_pid, int slot_tx) -{ - ulsch->harq_process_id[slot_tx] = harq_pid; -} - -/******************************************************************* -* -* NAME : get_tx_harq_id -* -* PARAMETERS : ue context -* slot_tx slot for transmission -* gNB_id identifier -* -* RETURN : harq process identifier -* -* DESCRIPTION : return tx harq process identifier for given slot transmission -* -*********************************************************************/ - -int get_tx_harq_id(NR_UE_ULSCH_t *ulsch, int slot_tx) -{ - - return (ulsch->harq_process_id[slot_tx]); -} - /******************************************************************* * * NAME : uplink_harq_process @@ -239,7 +117,7 @@ int get_tx_harq_id(NR_UE_ULSCH_t *ulsch, int slot_tx) * *********************************************************************/ -harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, int ndi, uint8_t rnti_type) +harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, NR_UL_UE_HARQ_t harq_processes[NR_MAX_ULSCH_HARQ_PROCESSES], int ndi, uint8_t rnti_type) { harq_result_t result_harq = RETRANSMISSION_HARQ; @@ -257,11 +135,10 @@ harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, int ndi, u } /* 38.321 5.4.2.1 2> if the uplink grant was received on PDCCH for the C-RNTI and the HARQ buffer of the identified process is empty */ - if ((ulsch->harq_processes[harq_pid]->first_tx == 1) && (rnti_type == _C_RNTI_)) { /* no transmission yet on this process so consider its harq buffer as empty */ - ulsch->harq_processes[harq_pid]->first_tx = 0; - ulsch->harq_processes[harq_pid]->pusch_pdu.pusch_data.new_data_indicator = ndi; /* store first value of ndi */ - ulsch->harq_processes[harq_pid]->round = 0; - ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1; + if ((harq_processes[harq_pid].first_tx == 1) && (rnti_type == _C_RNTI_)) { /* no transmission yet on this process so consider its harq buffer as empty */ + harq_processes[harq_pid].first_tx = 0; + harq_processes[harq_pid].ndi = ndi; /* store first value of ndi */ + harq_processes[harq_pid].round = 0; result_harq = NEW_TRANSMISSION_HARQ; @@ -269,10 +146,9 @@ harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, int ndi, u } /* 38.321 5.4.2.1 2> if the received grant was not addressed to a Temporary C-RNTI on PDCCH, and the NDI provided in the associated HARQ */ /* information has been toggled compared to the value in the previous transmission of this TB of this HARQ process */ - else if ((ulsch->harq_processes[harq_pid]->pusch_pdu.pusch_data.new_data_indicator != ndi) && (rnti_type != _TC_RNTI_)) { /* is ndi toogled so this is a new grant ? */ - ulsch->harq_processes[harq_pid]->pusch_pdu.pusch_data.new_data_indicator = ndi; /* store first value of ndi */ - ulsch->harq_processes[harq_pid]->round = 0; - ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1; + else if ((harq_processes[harq_pid].ndi != ndi) && (rnti_type != _TC_RNTI_)) { /* is ndi toogled so this is a new grant ? */ + harq_processes[harq_pid].ndi = ndi; /* store first value of ndi */ + harq_processes[harq_pid].round = 0; result_harq = NEW_TRANSMISSION_HARQ; @@ -280,8 +156,8 @@ harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, int ndi, u } /* 38.321 5.4.2.1 2> else (i.e. retransmission): */ else { - ulsch->harq_processes[harq_pid]->pusch_pdu.pusch_data.new_data_indicator = ndi; /* ndi has not toggled si this is a retransmission */ - ulsch->harq_processes[harq_pid]->round++; /* increment number of retransmission */ + harq_processes[harq_pid].ndi = ndi; /* ndi has not toggled si this is a retransmission */ + harq_processes[harq_pid].round++; /* increment number of retransmission */ result_harq = RETRANSMISSION_HARQ; diff --git a/openair1/SCHED_NR_UE/harq_nr.h b/openair1/SCHED_NR_UE/harq_nr.h index b707e2d983..e511e6f1c6 100644 --- a/openair1/SCHED_NR_UE/harq_nr.h +++ b/openair1/SCHED_NR_UE/harq_nr.h @@ -65,45 +65,7 @@ /*************** FUNCTIONS ****************************************/ - -/** \brief This function configures uplink HARQ context - @param PHY_VARS_NR_UE ue context - @param gNB_id gNodeB identifier - @param code_word_idx code word index - @param number_harq_processes_pusch maximum number of uplink HARQ processes - @returns none */ - -void config_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int code_word_idx, uint8_t number_harq_processes_pusch); - -/** \brief This function releases uplink HARQ context - @param PHY_VARS_NR_UE ue context - @param gNB_id gNodeB identifier - @param code_word_idx code word index - @returns none */ - -void release_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int code_word_idx); - -/** \brief This function stores slot for transmission in HARQ context - @param ulsch uplink context - @param harq process identifier harq_pid - @param slot_tx slot for transmission related to current downlink PDCCH - @returns 0 none */ - -void set_tx_harq_id(NR_UE_ULSCH_t *ulsch, int harq_pid, int slot_tx); - -/** \brief This function initialises context of an uplink HARQ process - @param ulsch uplink context - @param harq process identifier harq_pid - @returns harq number for tx slot */ - -int get_tx_harq_id(NR_UE_ULSCH_t *ulsch, int slot_tx); - -/** \brief This function update uplink harq context and return transmission type (new transmission or retransmission) - @param ulsch uplink harq context - @param harq process identifier harq_pid - @returns retransmission or new transmission */ - -harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, int ndi, uint8_t rnti_type); +harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, NR_UL_UE_HARQ_t harq_processes[NR_MAX_ULSCH_HARQ_PROCESSES], int ndi, uint8_t rnti_type); /** \brief This function initialises downlink HARQ status @param pointer to downlink harq status diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 31be395df8..af44860664 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -269,7 +269,8 @@ void ue_ta_procedures(PHY_VARS_NR_UE *ue, int slot_tx, int frame_tx){ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, - uint8_t gNB_id) { + uint8_t gNB_id, + nr_phy_data_tx_t *phy_data) { int slot_tx = proc->nr_slot_tx; int frame_tx = proc->frame_tx; @@ -287,9 +288,9 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, if (ue->UE_mode[gNB_id] <= PUSCH){ - for (uint8_t harq_pid = 0; harq_pid < ue->ulsch[gNB_id]->number_harq_processes_for_pusch; harq_pid++) { - if (ue->ulsch[gNB_id]->harq_processes[harq_pid]->status == ACTIVE) - nr_ue_ulsch_procedures(ue, harq_pid, frame_tx, slot_tx, gNB_id); + for (uint8_t harq_pid = 0; harq_pid < NR_MAX_ULSCH_HARQ_PROCESSES; harq_pid++) { + if (ue->ul_harq_processes[harq_pid].status == ACTIVE) + nr_ue_ulsch_procedures(ue, harq_pid, frame_tx, slot_tx, gNB_id, phy_data); } } @@ -492,7 +493,7 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id, int frame_rx = proc->frame_rx; int nr_slot_rx = proc->nr_slot_rx; unsigned int dci_cnt=0; - fapi_nr_dci_indication_t *dci_ind = calloc(1, sizeof(*dci_ind)); + fapi_nr_dci_indication_t dci_ind = {0}; nr_downlink_indication_t dl_indication; NR_UE_PDCCH_CONFIG *phy_pdcch_config = &phy_data->phy_pdcch_config; @@ -516,7 +517,7 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id, n_ss); #endif - dci_cnt = nr_dci_decoding_procedure(ue, proc, pdcch_e_rx, dci_ind, rel15); + dci_cnt = nr_dci_decoding_procedure(ue, proc, pdcch_e_rx, &dci_ind, rel15); #ifdef NR_PDCCH_SCHED_DEBUG LOG_I(PHY,"<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%u\n",dci_cnt); @@ -530,14 +531,14 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id, ue->Mod_id,frame_rx%1024,nr_slot_rx,nr_mode_string[ue->UE_mode[gNB_id]], i + 1, dci_cnt, - dci_ind->dci_list[i].rnti, - dci_ind->dci_list[i].dci_format); + dci_ind.dci_list[i].rnti, + dci_ind.dci_list[i].dci_format); } - dci_ind->number_of_dcis = dci_cnt; + dci_ind.number_of_dcis = dci_cnt; // fill dl_indication message - nr_fill_dl_indication(&dl_indication, dci_ind, NULL, proc, ue, gNB_id, phy_data); + nr_fill_dl_indication(&dl_indication, &dci_ind, NULL, proc, ue, gNB_id, phy_data); // send to mac ue->if_inst->dl_indication(&dl_indication, NULL); diff --git a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c index 4f45250016..a10e6a29b4 100644 --- a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c +++ b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c @@ -201,7 +201,7 @@ void nr_generate_pucch3_4(int32_t **txdataF, void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t *proc, - nr_phy_data_t *phy_data) { + nr_phy_data_tx_t *phy_data) { int nr_slot_tx = proc->nr_slot_tx; fapi_nr_ul_config_pucch_pdu *pucch_pdu; diff --git a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h index 1ff1b7cc5c..7f8bf13da3 100644 --- a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h +++ b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h @@ -62,7 +62,7 @@ void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t *proc, - nr_phy_data_t *phy_data); + nr_phy_data_tx_t *phy_data); void set_csi_nr(int csi_status, uint32_t csi_payload); diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 706e64bfd1..04c203b594 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -406,7 +406,7 @@ int main(int argc, char **argv) nr_ue_dlsch_init(dlsch_ue, num_codeword, 5); for (int i=0; i < num_codeword; i++) dlsch_ue[0].rnti = n_rnti; - nr_init_harq_processes(UE->dl_harq_processes[0], 8, nb_rb); + nr_init_dl_harq_processes(UE->dl_harq_processes[0], 8, nb_rb); unsigned char harq_pid = 0; //dlsch->harq_ids[subframe]; processingData_L1tx_t msgDataTx; diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 7d9b465d37..ac7b9b5c48 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -432,11 +432,7 @@ int main(int argc, char **argv) exit(-1); } - UE->ulsch[0] = new_nr_ue_ulsch(N_RB_UL, 8, frame_parms); - if (!UE->ulsch[0]) { - printf("Can't get ue ulsch structures.\n"); - exit(-1); - } + nr_init_ul_harq_processes(UE->ul_harq_processes, NR_MAX_ULSCH_HARQ_PROCESSES, UE->frame_parms.N_RB_UL, UE->frame_parms.nb_antennas_tx); unsigned char harq_pid = 0; unsigned int TBS = 8424; @@ -453,7 +449,8 @@ int main(int argc, char **argv) NR_UL_gNB_HARQ_t *harq_process_gNB = ulsch_gNB->harq_processes[harq_pid]; nfapi_nr_pusch_pdu_t *rel15_ul = &harq_process_gNB->ulsch_pdu; - NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[0]; + nr_phy_data_tx_t phy_data = {0}; + NR_UE_ULSCH_t *ulsch_ue = &phy_data.ulsch; if ((Nl==4)||(Nl==3)) nb_re_dmrs = nb_re_dmrs*2; @@ -488,22 +485,22 @@ int main(int argc, char **argv) /////////////////////////[adk] preparing UL harq_process parameters///////////////////////// /////////// - NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid]; + NR_UL_UE_HARQ_t *harq_process_ul_ue = &UE->ul_harq_processes[harq_pid]; DevAssert(harq_process_ul_ue); N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig N_RE_prime = NR_NB_SC_PER_RB*nb_symb_sch - nb_re_dmrs - N_PRB_oh; - harq_process_ul_ue->pusch_pdu.rnti = n_rnti; - harq_process_ul_ue->pusch_pdu.mcs_index = Imcs; - harq_process_ul_ue->pusch_pdu.nrOfLayers = Nl; - harq_process_ul_ue->pusch_pdu.rb_size = nb_rb; - harq_process_ul_ue->pusch_pdu.nr_of_symbols = nb_symb_sch; + ulsch_ue->pusch_pdu.rnti = n_rnti; + ulsch_ue->pusch_pdu.mcs_index = Imcs; + ulsch_ue->pusch_pdu.nrOfLayers = Nl; + ulsch_ue->pusch_pdu.rb_size = nb_rb; + ulsch_ue->pusch_pdu.nr_of_symbols = nb_symb_sch; harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*nb_codewords; - harq_process_ul_ue->pusch_pdu.pusch_data.rv_index = rvidx; - harq_process_ul_ue->pusch_pdu.pusch_data.tb_size = TBS>>3; - harq_process_ul_ue->pusch_pdu.target_code_rate = code_rate; - harq_process_ul_ue->pusch_pdu.qam_mod_order = mod_order; + ulsch_ue->pusch_pdu.pusch_data.rv_index = rvidx; + ulsch_ue->pusch_pdu.pusch_data.tb_size = TBS>>3; + ulsch_ue->pusch_pdu.target_code_rate = code_rate; + ulsch_ue->pusch_pdu.qam_mod_order = mod_order; unsigned char *test_input = harq_process_ul_ue->a; /////////// @@ -549,7 +546,7 @@ int main(int argc, char **argv) } */ - if (ulsch_ue->harq_processes[harq_pid]->f[i] == 0) + if (harq_process_ul_ue->f[i] == 0) modulated_input[i] = 1.0; ///sqrt(2); //QPSK else modulated_input[i] = -1.0; ///sqrt(2); @@ -573,7 +570,7 @@ int main(int argc, char **argv) else channel_output_uncoded[i] = 0; - if (channel_output_uncoded[i] != ulsch_ue->harq_processes[harq_pid]->f[i]) + if (channel_output_uncoded[i] != harq_process_ul_ue->f[i]) errors_bit_uncoded = errors_bit_uncoded + 1; } /* @@ -638,7 +635,7 @@ int main(int argc, char **argv) printf("\n"); } - free_nr_ue_ulsch(&UE->ulsch[0], N_RB_UL, frame_parms); + free_nr_ue_ul_harq(UE->ul_harq_processes, NR_MAX_ULSCH_HARQ_PROCESSES, UE->frame_parms.N_RB_UL, UE->frame_parms.nb_antennas_tx); term_nr_ue_signal(UE, 1); free(UE); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 52b17fa92b..5355f34d65 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -868,7 +868,7 @@ int main(int argc, char **argv) nfapi_nr_pusch_pdu_t *pusch_pdu = &UL_tti_req->pdus_list[0].pusch_pdu; - NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[0]; + nr_phy_data_tx_t phy_data = {0}; unsigned char *estimated_output_bit; unsigned char *test_input_bit; @@ -1093,7 +1093,7 @@ int main(int argc, char **argv) errors_decoding = 0; while (round < max_rounds && crc_status) { round_trials[round]++; - ulsch_ue->harq_processes[harq_pid]->round = round; + UE->ul_harq_processes[harq_pid].round = round; rv_index = nr_rv_round_map[round % 4]; UE_proc.nr_slot_tx = slot; @@ -1178,6 +1178,7 @@ int main(int argc, char **argv) scheduled_response.dl_config = NULL; scheduled_response.ul_config = &ul_config; scheduled_response.tx_request = &tx_req; + scheduled_response.phy_data = (void *)&phy_data; // Config UL TX PDU tx_req.slot = slot; @@ -1232,7 +1233,7 @@ int main(int argc, char **argv) // nr_fill_ulsch(gNB,frame,slot,pusch_pdu); // Not needed as its its already filled as apart of "nr_schedule_response(Sched_INFO);" for (int i = 0; i < (TBS / 8); i++) - ulsch_ue->harq_processes[harq_pid]->a[i] = i & 0xff; + UE->ul_harq_processes[harq_pid].a[i] = i & 0xff; if (input_fd == NULL) { // set FAPI parameters for UE, put them in the scheduled response and call nr_ue_scheduled_response(&scheduled_response); @@ -1240,7 +1241,7 @@ int main(int argc, char **argv) /////////////////////////phy_procedures_nr_ue_TX/////////////////////// /////////// - phy_procedures_nrUE_TX(UE, &UE_proc, gNB_id); + phy_procedures_nrUE_TX(UE, &UE_proc, gNB_id, &phy_data); /* We need to call common sending function to send signal */ LOG_D(PHY, "Sending Uplink data \n"); @@ -1507,8 +1508,8 @@ int main(int argc, char **argv) } for (i = 0; i < available_bits; i++) { - if (((ulsch_ue->harq_processes[harq_pid]->f[i] == 0) && (gNB->pusch_vars[UE_id]->llr[i] <= 0)) - || ((ulsch_ue->harq_processes[harq_pid]->f[i] == 1) && (gNB->pusch_vars[UE_id]->llr[i] >= 0))) { + if (((UE->ul_harq_processes[harq_pid].f[i] == 0) && (gNB->pusch_vars[UE_id]->llr[i] <= 0)) + || ((UE->ul_harq_processes[harq_pid].f[i] == 1) && (gNB->pusch_vars[UE_id]->llr[i] >= 0))) { /*if(errors_scrambling == 0) printf("\x1B[34m" "[frame %d][trial %d]\t1st bit in error in unscrambling = %d\n" "\x1B[0m", frame, trial, i);*/ errors_scrambling[round]++; @@ -1524,7 +1525,7 @@ int main(int argc, char **argv) for (i = 0; i < TBS; i++) { estimated_output_bit[i] = (ulsch_gNB->harq_processes[harq_pid]->b[i / 8] & (1 << (i & 7))) >> (i & 7); - test_input_bit[i] = (ulsch_ue->harq_processes[harq_pid]->b[i / 8] & (1 << (i & 7))) >> (i & 7); + test_input_bit[i] = (UE->ul_harq_processes[harq_pid].b[i / 8] & (1 << (i & 7))) >> (i & 7); if (estimated_output_bit[i] != test_input_bit[i]) { /*if(errors_decoding == 0) @@ -1533,14 +1534,14 @@ int main(int argc, char **argv) } } if (n_trials == 1) { - for (int r = 0; r < ulsch_ue->harq_processes[harq_pid]->C; r++) - for (int i = 0; i < ulsch_ue->harq_processes[harq_pid]->K >> 3; i++) { - if ((ulsch_ue->harq_processes[harq_pid]->c[r][i] ^ ulsch_gNB->harq_processes[harq_pid]->c[r][i]) != 0) + for (int r = 0; r < UE->ul_harq_processes[harq_pid].C; r++) + for (int i = 0; i < UE->ul_harq_processes[harq_pid].K >> 3; i++) { + if ((UE->ul_harq_processes[harq_pid].c[r][i] ^ ulsch_gNB->harq_processes[harq_pid]->c[r][i]) != 0) printf("************"); /*printf("r %d: in[%d] %x, out[%d] %x (%x)\n",r, - i,ulsch_ue->harq_processes[harq_pid]->c[r][i], + i,UE->ul_harq_processes[harq_pid].c[r][i], i,ulsch_gNB->harq_processes[harq_pid]->c[r][i], - ulsch_ue->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]);*/ + UE->ul_harq_processes[harq_pid].c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]);*/ } } if (errors_decoding > 0 && error_flag == 0) { 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/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 903b20b037..a51ebfa868 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -1251,7 +1251,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in } pthread_mutex_unlock(&ul_config->mutex_ul_config); // avoid double lock - fill_scheduled_response(&scheduled_response, NULL, ul_config, &tx_req, mod_id, cc_id, frame_tx, slot_tx, NULL); + fill_scheduled_response(&scheduled_response, NULL, ul_config, &tx_req, mod_id, cc_id, frame_tx, slot_tx, ul_info->phy_data); if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL){ LOG_D(NR_MAC,"3# scheduled_response transmitted,%d, %d\n", frame_tx, slot_tx); mac->if_module->scheduled_response(&scheduled_response); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index d61adf5d3d..277632528f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1401,14 +1401,10 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra uint16_t mac_sdu_length = 0; - rnti_t tc_rnti = ra->rnti; // If UE is known by the network, C-RNTI to be used instead of TC-RNTI + rnti_t tc_rnti = ra->rnti; if (ra->msg3_dcch_dtch) { ra->rnti = ra->crnti; - } else { - mac_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, CCCH, ra->rnti, 1, NULL); - if (mac_sdu_length <= 0) - return; // need to wait until RRCSetup is encoded } NR_UE_info_t * UE = find_nr_UE(&nr_mac->UE_info, ra->rnti); @@ -1417,6 +1413,16 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra return; } + NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; + /* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */ + int current_harq_pid = sched_ctrl->retrans_dl_harq.head; + + if (ra->msg3_dcch_dtch == false && current_harq_pid < 0) { + mac_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, CCCH, ra->rnti, 1, NULL); + if (mac_sdu_length <= 0) + return; // need to wait until RRCSetup is encoded + } + long BWPStart = 0; long BWPSize = 0; NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config = NULL; @@ -1464,9 +1470,17 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra int rbSize = 0; uint8_t tb_scaling = 0; uint32_t tb_size = 0; - uint8_t subheader_len = (mac_sdu_length < 256) ? sizeof(NR_MAC_SUBHEADER_SHORT) : sizeof(NR_MAC_SUBHEADER_LONG); - uint16_t pdu_length = mac_sdu_length + subheader_len + 7; //7 is contetion resolution length - uint16_t *vrb_map = cc[CC_id].vrb_map; + uint16_t pdu_length; + if(current_harq_pid >= 0) { // in case of retransmission + NR_UE_harq_t *harq = &sched_ctrl->harq_processes[current_harq_pid]; + DevAssert(!harq->is_waiting); + pdu_length = harq->tb_size; + } + else { + uint8_t subheader_len = (mac_sdu_length < 256) ? sizeof(NR_MAC_SUBHEADER_SHORT) : sizeof(NR_MAC_SUBHEADER_LONG); + pdu_length = mac_sdu_length + subheader_len + 7; //7 is contetion resolution length + } + // increase PRBs until we get to BWPSize or TBS is bigger than MAC PDU size do { if(rbSize < BWPSize) @@ -1482,6 +1496,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra AssertFatal(tb_size >= pdu_length,"Cannot allocate Msg4\n"); int i = 0; + uint16_t *vrb_map = cc[CC_id].vrb_map; while ((i < rbSize) && (rbStart + rbSize <= BWPSize)) { if (vrb_map[BWPStart + rbStart + i]&SL_to_bitmap(msg4_tda.startSymbolIndex, msg4_tda.nrOfSymbols)) { rbStart += i+1; @@ -1509,9 +1524,6 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra LOG_I(NR_MAC,"Generate msg4, rnti: %04x\n", ra->rnti); - NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; - /* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */ - int current_harq_pid = sched_ctrl->retrans_dl_harq.head; // HARQ management if (current_harq_pid < 0) { AssertFatal(sched_ctrl->available_dl_harq.head >= 0, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index d85d8d85a1..c55aeec49e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2298,9 +2298,13 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac, // Schedule BWP switching to the first active BWP (previous active BWP before RA with Msg3 carrying DCCH or DTCH message) if (servingCellConfig->firstActiveDownlinkBWP_Id) { sched_ctrl->next_dl_bwp_id = *servingCellConfig->firstActiveDownlinkBWP_Id; + } else { + sched_ctrl->next_dl_bwp_id = 0; } if (servingCellConfig->uplinkConfig->firstActiveUplinkBWP_Id) { sched_ctrl->next_ul_bwp_id = *servingCellConfig->uplinkConfig->firstActiveUplinkBWP_Id; + } else { + sched_ctrl->next_ul_bwp_id = 0; } } else { @@ -3059,26 +3063,17 @@ void schedule_nr_bwp_switch(module_id_t module_id, NR_UE_DL_BWP_t *dl_bwp = &UE->current_DL_BWP; NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP; if (sched_ctrl->rrc_processing_timer == 0 && UE->Msg4_ACKed && sched_ctrl->next_dl_bwp_id >= 0) { + LOG_W(NR_MAC, + "%4d.%2d UE %04x Scheduling BWP switch from DL_BWP %ld to %ld and from UL_BWP %ld to %ld\n", + frame, + slot, + UE->rnti, + dl_bwp->bwp_id, + sched_ctrl->next_dl_bwp_id, + ul_bwp->bwp_id, + sched_ctrl->next_ul_bwp_id); - int schedule_bwp_switching = false; - if (dl_bwp->bwp_id == 0) { - // Switching from Initial BWP to Dedicated BWP - if (sched_ctrl->next_dl_bwp_id > 0 && sched_ctrl->next_ul_bwp_id > 0) { - schedule_bwp_switching = true; - LOG_W(NR_MAC,"%4d.%2d UE %04x Schedule BWP switch from Initial DL BWP to %ld and from Initial UL BWP to %ld\n", - frame, slot, UE->rnti, sched_ctrl->next_dl_bwp_id, sched_ctrl->next_ul_bwp_id); - } - } else if (dl_bwp->bwp_id != sched_ctrl->next_dl_bwp_id && ul_bwp->bwp_id != sched_ctrl->next_ul_bwp_id) { - // Switching between Dedicated BWPs - schedule_bwp_switching = true; - LOG_W(NR_MAC,"%4d.%2d UE %04x Schedule BWP switch from dl_bwp_id %ld to %ld and from ul_bwp_id %ld to %ld\n", - frame, slot, UE->rnti, dl_bwp->bwp_id, sched_ctrl->next_dl_bwp_id, ul_bwp->bwp_id, sched_ctrl->next_ul_bwp_id); - } - - if (schedule_bwp_switching) { - AssertFatal(sched_ctrl->next_dl_bwp_id > 0 && sched_ctrl->next_ul_bwp_id > 0, "BWP switching from a Dedicated BWP to the Initial BWP not handled yet!"); - nr_mac_rrc_bwp_switch_req(module_id, frame, slot, UE->rnti, sched_ctrl->next_dl_bwp_id, sched_ctrl->next_ul_bwp_id); - } + nr_mac_rrc_bwp_switch_req(module_id, frame, slot, UE->rnti, sched_ctrl->next_dl_bwp_id, sched_ctrl->next_ul_bwp_id); } } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 38da157a28..f3e1c3d85c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1712,13 +1712,12 @@ void pf_ul(module_id_t module_id, while (rbStart + max_rbSize < bwpSize && (rballoc_mask[rbStart + max_rbSize] & slbitmap) == slbitmap) max_rbSize++; - if (rbStart + min_rb >= bwpSize) { - LOG_W(NR_MAC, "cannot allocate UL data for RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d)\n", - iterator->UE->rnti,rbStart,min_rb,bwpSize); + if (rbStart + min_rb >= bwpSize || max_rbSize < min_rb) { + LOG_D(NR_MAC, "cannot allocate UL data for RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d)\n", iterator->UE->rnti, rbStart, min_rb, bwpSize); + iterator++; continue; - } - else - LOG_D(NR_MAC,"allocating UL data for RNTI %04x (rbStsart %d, min_rb %d, bwpSize %d)\n", iterator->UE->rnti,rbStart,min_rb,bwpSize); + } else + LOG_D(NR_MAC, "allocating UL data for RNTI %04x (rbStart %d, min_rb %d, max_rbSize %d, bwpSize %d)\n", iterator->UE->rnti, rbStart, min_rb, max_rbSize, bwpSize); /* Calculate the current scheduling bytes */ const int B = cmax(sched_ctrl->estimated_ul_buffer - sched_ctrl->sched_ul_bytes, 0); diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 96a436ebc0..e606c409b4 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1214,7 +1214,6 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ } memset(def_dci_pdu_rel15, 0, sizeof(*def_dci_pdu_rel15)); } - free(dl_info->dci_ind); dl_info->dci_ind = NULL; } diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index af12637ae9..114b0f7610 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -477,7 +477,7 @@ void config_srs(NR_SetupRelease_SRS_Config_t *setup_release_srs_Config, srs_res0->resourceType.present = NR_SRS_Resource__resourceType_PR_periodic; srs_res0->resourceType.choice.periodic = calloc(1,sizeof(*srs_res0->resourceType.choice.periodic)); srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl160; - srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl160 = 17 + (uid>1)*10; // 17/17/.../147/157 are mixed slots + srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl160 = 17 + (uid >> 1) * 10; // 17/17/.../147/157 are mixed slots } else { srs_res0->resourceType.present = NR_SRS_Resource__resourceType_PR_aperiodic; srs_res0->resourceType.choice.aperiodic = calloc(1,sizeof(*srs_res0->resourceType.choice.aperiodic)); diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index bf84cf0c2e..edd8cd36a8 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -672,7 +672,9 @@ rrc_gNB_generate_defaultRRCReconfiguration( AssertFatal(size > 0, "cannot encode RRCReconfiguration in %s()\n", __func__); LOG_W(RRC, "do_RRCReconfiguration(): size %d\n", size); - xer_fprint(stdout,&asn_DEF_NR_CellGroupConfig, ue_p->masterCellGroup); + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { + xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, ue_p->masterCellGroup); + } free(ue_context_pP->ue_context.nas_pdu.buffer); @@ -1788,11 +1790,11 @@ int nr_rrc_reconfiguration_req(rrc_gNB_ue_context_t *const ue_context_pP uint8_t xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id); NR_CellGroupConfig_t *masterCellGroup = ue_context_pP->ue_context.masterCellGroup; - if (dl_bwp_id >= 0) { + if (dl_bwp_id > 0) { *masterCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id = dl_bwp_id; *masterCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id = dl_bwp_id; } - if (ul_bwp_id >= 0) { + if (ul_bwp_id > 0) { *masterCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id = ul_bwp_id; } @@ -3567,7 +3569,9 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, const ch sizeof(*cellGroupConfig->rlc_BearerToAddModList)); } } - xer_fprint(stdout,&asn_DEF_NR_CellGroupConfig, ue_context_p->ue_context.masterCellGroup); + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { + xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, ue_context_p->ue_context.masterCellGroup); + } if (ue_context_p->ue_context.established_pdu_sessions_flag == 1) { rrc_gNB_generate_dedicatedRRCReconfiguration(&ctxt, ue_context_p, cellGroupConfig); @@ -3629,7 +3633,9 @@ static void rrc_CU_process_ue_context_modification_response(MessageDef *msg_p, c } } LOG_I(NR_RRC, "Updated master cell group configuration stored at the UE context of the CU:\n"); - xer_fprint(stdout,&asn_DEF_NR_CellGroupConfig, ue_context_p->ue_context.masterCellGroup); + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { + xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, ue_context_p->ue_context.masterCellGroup); + } rrc_gNB_generate_dedicatedRRCReconfiguration(&ctxt, ue_context_p, cellGroupConfig); 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])