[Epic-Id: ODUHIGH-611][Task-Id: ODUHIGH-626] | Containerization of DU, CU stub &... 84/13284/3
authorpborla <pborla@radisys.com>
Wed, 28 Aug 2024 09:37:45 +0000 (15:07 +0530)
committerpborla <pborla@radisys.com>
Wed, 4 Sep 2024 12:59:21 +0000 (18:29 +0530)
Change-Id: I896a89df47f7f54fe04124f271c0cf2e619df2d6
Signed-off-by: pborla <pborla@radisys.com>
43 files changed:
Dockerfile.cu [new file with mode: 0644]
Dockerfile.du [new file with mode: 0644]
Dockerfile.ric [new file with mode: 0644]
build/odu/makefile
container/cu_helm/cu/.helmignore [new file with mode: 0644]
container/cu_helm/cu/Chart.yaml [new file with mode: 0644]
container/cu_helm/cu/templates/NOTES.txt [new file with mode: 0644]
container/cu_helm/cu/templates/_helpers.tpl [new file with mode: 0644]
container/cu_helm/cu/templates/deployment.yaml [new file with mode: 0644]
container/cu_helm/cu/templates/hpa.yaml [new file with mode: 0644]
container/cu_helm/cu/templates/ingress.yaml [new file with mode: 0644]
container/cu_helm/cu/templates/service.yaml [new file with mode: 0644]
container/cu_helm/cu/templates/serviceaccount.yaml [new file with mode: 0644]
container/cu_helm/cu/templates/tests/test-connection.yaml [new file with mode: 0644]
container/cu_helm/cu/values.yaml [new file with mode: 0644]
container/du_helm/du/.helmignore [new file with mode: 0644]
container/du_helm/du/Chart.yaml [new file with mode: 0644]
container/du_helm/du/templates/NOTES.txt [new file with mode: 0644]
container/du_helm/du/templates/_helpers.tpl [new file with mode: 0644]
container/du_helm/du/templates/deployment.yaml [new file with mode: 0644]
container/du_helm/du/templates/hpa.yaml [new file with mode: 0644]
container/du_helm/du/templates/ingress.yaml [new file with mode: 0644]
container/du_helm/du/templates/service.yaml [new file with mode: 0644]
container/du_helm/du/templates/serviceaccount.yaml [new file with mode: 0644]
container/du_helm/du/templates/tests/test-connection.yaml [new file with mode: 0644]
container/du_helm/du/values.yaml [new file with mode: 0644]
container/ric_helm/ric/.helmignore [new file with mode: 0644]
container/ric_helm/ric/Chart.yaml [new file with mode: 0644]
container/ric_helm/ric/templates/NOTES.txt [new file with mode: 0644]
container/ric_helm/ric/templates/_helpers.tpl [new file with mode: 0644]
container/ric_helm/ric/templates/deployment.yaml [new file with mode: 0644]
container/ric_helm/ric/templates/hpa.yaml [new file with mode: 0644]
container/ric_helm/ric/templates/ingress.yaml [new file with mode: 0644]
container/ric_helm/ric/templates/service.yaml [new file with mode: 0644]
container/ric_helm/ric/templates/serviceaccount.yaml [new file with mode: 0644]
container/ric_helm/ric/templates/tests/test-connection.yaml [new file with mode: 0644]
container/ric_helm/ric/values.yaml [new file with mode: 0644]
cu-docker-entrypoint.sh [new file with mode: 0755]
du-docker-entrypoint.sh [new file with mode: 0755]
ric-docker-entrypoint.sh [new file with mode: 0755]
src/cu_stub/cu_stub_sctp.c
src/du_app/du_cfg.c
src/ric_stub/ric_stub_sctp.c

diff --git a/Dockerfile.cu b/Dockerfile.cu
new file mode 100644 (file)
index 0000000..770b067
--- /dev/null
@@ -0,0 +1,60 @@
+FROM ubuntu:22.04
+
+LABEL description="This docker file isused to build CU Image"
+
+
+WORKDIR /root
+
+# Update package lists and install required packages
+RUN apt-get update  \
+    && DEBIAN_FRONTEND=noninteractive apt-get install -y \
+        git \
+       libsctp-dev \
+        libpcap-dev \
+        libxml2-dev \
+         vim \
+  libxml2-utils \
+  zip \
+  unzip \
+  lksctp-tools \
+  python3-dev \
+  python3-setuptools \
+  libreadline-dev \
+  python3-pip \
+  build-essential \
+  libffi6* \
+  libssl-dev \
+  python3-paramiko \
+  apt-utils \
+  openssh-client \
+  iproute2 \
+  libglib* \
+  autoconf automake autotools-dev libtool \
+  libhugetlbfs-dev* \
+  numactl \
+  libnuma-dev \
+  python3 \
+  iproute2 \
+  net-tools \
+  libnuma-dev \
+  dnsutils \
+  python3-pip \
+  python3-paramiko \
+  pciutils \
+  libcurl4 \
+  vim \
+  net-tools \
+  gdb \
+  libjansson-dev \
+  && rm -rf /var/lib/apt/lists/*
+
+
+COPY . /root/l2
+
+COPY cu-docker-entrypoint.sh /root/
+
+RUN cd /root/ && chmod +x cu-docker-entrypoint.sh
+
+ENTRYPOINT ["/root/cu-docker-entrypoint.sh"]
+
+
diff --git a/Dockerfile.du b/Dockerfile.du
new file mode 100644 (file)
index 0000000..4fad686
--- /dev/null
@@ -0,0 +1,61 @@
+FROM ubuntu:22.04
+
+LABEL description="This docker file isused to build CU Image"
+
+
+WORKDIR /root
+
+# Update package lists and install required packages
+RUN apt-get update  \
+    && DEBIAN_FRONTEND=noninteractive apt-get install -y \
+        git \
+       libsctp-dev \
+        libpcap-dev \
+        libxml2-dev \
+         vim \
+  libxml2-utils \
+  zip \
+  unzip \
+  lksctp-tools \
+  python3-dev \
+  python3-setuptools \
+  libreadline-dev \
+  python3-pip \
+  build-essential \
+  libffi6* \
+  libssl-dev \
+  python3-paramiko \
+  apt-utils \
+  openssh-client \
+  iproute2 \
+  libglib* \
+  autoconf automake autotools-dev libtool \
+  libhugetlbfs-dev* \
+  numactl \
+  libnuma-dev \
+  python3 \
+  iproute2 \
+  net-tools \
+  libnuma-dev \
+  dnsutils \
+  python3-pip \
+  python3-paramiko \
+  pciutils \
+  libcurl4 \
+  vim \
+  net-tools \
+  gdb \
+  libjansson-dev \
+  && rm -rf /var/lib/apt/lists/*
+
+
+COPY .  /root/l2
+
+
+COPY du-docker-entrypoint.sh /root/
+
+RUN cd /root/ && chmod +x du-docker-entrypoint.sh
+
+ENTRYPOINT ["/root/du-docker-entrypoint.sh"]
+
+
diff --git a/Dockerfile.ric b/Dockerfile.ric
new file mode 100644 (file)
index 0000000..6b7fcb7
--- /dev/null
@@ -0,0 +1,60 @@
+FROM ubuntu:22.04
+
+LABEL description="This docker file isused to build CU Image"
+
+
+WORKDIR /root
+
+# Update package lists and install required packages
+RUN apt-get update  \
+    && DEBIAN_FRONTEND=noninteractive apt-get install -y \
+        git \
+       libsctp-dev \
+        libpcap-dev \
+        libxml2-dev \
+         vim \
+  libxml2-utils \
+  zip \
+  unzip \
+  lksctp-tools \
+  python3-dev \
+  python3-setuptools \
+  libreadline-dev \
+  python3-pip \
+  build-essential \
+  libffi6* \
+  libssl-dev \
+  python3-paramiko \
+  apt-utils \
+  openssh-client \
+  iproute2 \
+  libglib* \
+  autoconf automake autotools-dev libtool \
+  libhugetlbfs-dev* \
+  numactl \
+  libnuma-dev \
+  python3 \
+  iproute2 \
+  net-tools \
+  libnuma-dev \
+  dnsutils \
+  python3-pip \
+  python3-paramiko \
+  pciutils \
+  libcurl4 \
+  vim \
+  net-tools \
+  gdb \
+  libjansson-dev \
+  && rm -rf /var/lib/apt/lists/*
+
+
+COPY . /root/l2
+
+COPY ric-docker-entrypoint.sh /root/
+
+RUN cd /root/ && chmod +x ric-docker-entrypoint.sh
+
+ENTRYPOINT ["/root/ric-docker-entrypoint.sh"]
+
+
index a6f9061..2715660 100644 (file)
@@ -74,7 +74,7 @@ endif
 # macro for output file name and makefile name
 #
 
-PLTFRM_FLAGS=-UMSPD -DODU -DINTEL_FAPI -UODU_MEMORY_DEBUG_LOG -DDEBUG_ASN_PRINT -UDEBUG_PRINT -DERROR_PRINT -USTART_DL_UL_DATA -UNR_DRX -UCALL_FLOW_DEBUG_LOG -UODU_SLOT_IND_DEBUG_LOG -UNFAPI_ENABLED -UTHREAD_AFFINITY -UMEM_SIZE_CHECK -UFAPI_DECODER 
+PLTFRM_FLAGS=-UMSPD -DODU -DINTEL_FAPI -UODU_MEMORY_DEBUG_LOG -DDEBUG_ASN_PRINT -UDEBUG_PRINT -DERROR_PRINT -USTART_DL_UL_DATA -UNR_DRX -UCALL_FLOW_DEBUG_LOG -UODU_SLOT_IND_DEBUG_LOG -UNFAPI_ENABLED -UTHREAD_AFFINITY -UMEM_SIZE_CHECK -UFAPI_DECODER -UCONTAINERIZE 
 
 ifeq ($(MODE),TDD)
    PLTFRM_FLAGS += -DNR_TDD
diff --git a/container/cu_helm/cu/.helmignore b/container/cu_helm/cu/.helmignore
new file mode 100644 (file)
index 0000000..0e8a0eb
--- /dev/null
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/container/cu_helm/cu/Chart.yaml b/container/cu_helm/cu/Chart.yaml
new file mode 100644 (file)
index 0000000..0d8cc34
--- /dev/null
@@ -0,0 +1,24 @@
+apiVersion: v2
+name: cu
+description: A Helm chart for Kubernetes
+
+# A chart can be either an 'application' or a 'library' chart.
+#
+# Application charts are a collection of templates that can be packaged into versioned archives
+# to be deployed.
+#
+# Library charts provide useful utilities or functions for the chart developer. They're included as
+# a dependency of application charts to inject those utilities and functions into the rendering
+# pipeline. Library charts do not define any templates and therefore cannot be deployed.
+type: application
+
+# 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.
+# Versions are expected to follow Semantic Versioning (https://semver.org/)
+version: 0.1.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. Versions are not expected to
+# follow Semantic Versioning. They should reflect the version the application is using.
+# It is recommended to use it with quotes.
+appVersion: "1.16.0"
diff --git a/container/cu_helm/cu/templates/NOTES.txt b/container/cu_helm/cu/templates/NOTES.txt
new file mode 100644 (file)
index 0000000..3a8f95d
--- /dev/null
@@ -0,0 +1,22 @@
+1. Get the application URL by running these commands:
+{{- if .Values.ingress.enabled }}
+{{- range $host := .Values.ingress.hosts }}
+  {{- range .paths }}
+  http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
+  {{- end }}
+{{- end }}
+{{- else if contains "NodePort" .Values.service.type }}
+  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "cu.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 "cu.fullname" . }}'
+  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "cu.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 "cu.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
+  export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
+  echo "Visit http://127.0.0.1:8080 to use your application"
+  kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
+{{- end }}
diff --git a/container/cu_helm/cu/templates/_helpers.tpl b/container/cu_helm/cu/templates/_helpers.tpl
new file mode 100644 (file)
index 0000000..eb4e480
--- /dev/null
@@ -0,0 +1,62 @@
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "cu.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Create a default fully qualified app name.
+We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
+If release name contains chart name it will be used as a full name.
+*/}}
+{{- define "cu.fullname" -}}
+{{- if .Values.fullnameOverride }}
+{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- $name := default .Chart.Name .Values.nameOverride }}
+{{- if contains $name .Release.Name }}
+{{- .Release.Name | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
+{{- end }}
+{{- end }}
+{{- end }}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "cu.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "cu.labels" -}}
+helm.sh/chart: {{ include "cu.chart" . }}
+{{ include "cu.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end }}
+
+{{/*
+Selector labels
+*/}}
+{{- define "cu.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "cu.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}
+
+{{/*
+Create the name of the service account to use
+*/}}
+{{- define "cu.serviceAccountName" -}}
+{{- if .Values.serviceAccount.create }}
+{{- default (include "cu.fullname" .) .Values.serviceAccount.name }}
+{{- else }}
+{{- default "default" .Values.serviceAccount.name }}
+{{- end }}
+{{- end }}
diff --git a/container/cu_helm/cu/templates/deployment.yaml b/container/cu_helm/cu/templates/deployment.yaml
new file mode 100644 (file)
index 0000000..8b4aa09
--- /dev/null
@@ -0,0 +1,76 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ include "cu.fullname" . }}
+  labels:
+    {{- include "cu.labels" . | nindent 4 }}
+spec:
+  {{- if not .Values.autoscaling.enabled }}
+  replicas: {{ .Values.replicaCount }}
+  {{- end }}
+  selector:
+    matchLabels:
+      {{- include "cu.selectorLabels" . | nindent 6 }}
+  template:
+    metadata:
+      {{- with .Values.podAnnotations }}
+      annotations:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      labels:
+        {{- include "cu.labels" . | nindent 8 }}
+        {{- with .Values.podLabels }}
+        {{- toYaml . | nindent 8 }}
+        {{- end }}
+    spec:
+      {{- with .Values.imagePullSecrets }}
+      imagePullSecrets:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      serviceAccountName: {{ include "cu.serviceAccountName" . }}
+      securityContext:
+        {{- toYaml .Values.podSecurityContext | nindent 8 }}
+      containers:
+        - name: {{ .Chart.Name }}
+          securityContext:
+            {{- toYaml .Values.securityContext | nindent 12 }}
+          image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
+          imagePullPolicy: {{ .Values.image.pullPolicy }}
+          command: [ "/bin/bash", "-c", "--"]
+          #args: [ "sleep 60; /root/docker-entrypoint.sh" ]
+          args: [ "sleep 60000000000000000000;"]
+          ports:
+            - name: http
+              containerPort: {{ .Values.service.port }}
+              protocol: {{ .Values.service.protocol }}
+          env:
+            {{- range .Values.env }}
+            - name: {{ .name }}
+              value: {{ .value | quote }}
+            {{- end }}
+          livenessProbe:
+            {{- toYaml .Values.livenessProbe | nindent 12 }}
+          readinessProbe:
+            {{- toYaml .Values.readinessProbe | nindent 12 }}
+          resources:
+            {{- toYaml .Values.resources | nindent 12 }}
+          {{- with .Values.volumeMounts }}
+          volumeMounts:
+            {{- toYaml . | nindent 12 }}
+          {{- end }}
+      {{- with .Values.volumes }}
+      volumes:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- with .Values.nodeSelector }}
+      nodeSelector:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- with .Values.affinity }}
+      affinity:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- with .Values.tolerations }}
+      tolerations:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
diff --git a/container/cu_helm/cu/templates/hpa.yaml b/container/cu_helm/cu/templates/hpa.yaml
new file mode 100644 (file)
index 0000000..b3428c5
--- /dev/null
@@ -0,0 +1,32 @@
+{{- if .Values.autoscaling.enabled }}
+apiVersion: autoscaling/v2
+kind: HorizontalPodAutoscaler
+metadata:
+  name: {{ include "cu.fullname" . }}
+  labels:
+    {{- include "cu.labels" . | nindent 4 }}
+spec:
+  scaleTargetRef:
+    apiVersion: apps/v1
+    kind: Deployment
+    name: {{ include "cu.fullname" . }}
+  minReplicas: {{ .Values.autoscaling.minReplicas }}
+  maxReplicas: {{ .Values.autoscaling.maxReplicas }}
+  metrics:
+    {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
+    - type: Resource
+      resource:
+        name: cpu
+        target:
+          type: Utilization
+          averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
+    {{- end }}
+    {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
+    - type: Resource
+      resource:
+        name: memory
+        target:
+          type: Utilization
+          averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
+    {{- end }}
+{{- end }}
diff --git a/container/cu_helm/cu/templates/ingress.yaml b/container/cu_helm/cu/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..64e710f
--- /dev/null
@@ -0,0 +1,61 @@
+{{- if .Values.ingress.enabled -}}
+{{- $fullName := include "cu.fullname" . -}}
+{{- $svcPort := .Values.service.port -}}
+{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
+  {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
+  {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
+  {{- end }}
+{{- end }}
+{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
+apiVersion: networking.k8s.io/v1
+{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
+apiVersion: networking.k8s.io/v1beta1
+{{- else -}}
+apiVersion: extensions/v1beta1
+{{- end }}
+kind: Ingress
+metadata:
+  name: {{ $fullName }}
+  labels:
+    {{- include "cu.labels" . | nindent 4 }}
+  {{- with .Values.ingress.annotations }}
+  annotations:
+    {{- toYaml . | nindent 4 }}
+  {{- end }}
+spec:
+  {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
+  ingressClassName: {{ .Values.ingress.className }}
+  {{- end }}
+  {{- if .Values.ingress.tls }}
+  tls:
+    {{- range .Values.ingress.tls }}
+    - hosts:
+        {{- range .hosts }}
+        - {{ . | quote }}
+        {{- end }}
+      secretName: {{ .secretName }}
+    {{- end }}
+  {{- end }}
+  rules:
+    {{- range .Values.ingress.hosts }}
+    - host: {{ .host | quote }}
+      http:
+        paths:
+          {{- range .paths }}
+          - path: {{ .path }}
+            {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
+            pathType: {{ .pathType }}
+            {{- end }}
+            backend:
+              {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
+              service:
+                name: {{ $fullName }}
+                port:
+                  number: {{ $svcPort }}
+              {{- else }}
+              serviceName: {{ $fullName }}
+              servicePort: {{ $svcPort }}
+              {{- end }}
+          {{- end }}
+    {{- end }}
+{{- end }}
diff --git a/container/cu_helm/cu/templates/service.yaml b/container/cu_helm/cu/templates/service.yaml
new file mode 100644 (file)
index 0000000..f4dc11f
--- /dev/null
@@ -0,0 +1,15 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "cu.fullname" . }}
+  labels:
+    {{- include "cu.labels" . | nindent 4 }}
+spec:
+  type: {{ .Values.service.type }}
+  ports:
+    - port: {{ .Values.service.port }}
+      targetPort: {{ .Values.service.targetPort }}
+      protocol:  {{ .Values.service.protocol }}
+      name: f1ap
+  selector:
+    {{- include "cu.selectorLabels" . | nindent 4 }}
diff --git a/container/cu_helm/cu/templates/serviceaccount.yaml b/container/cu_helm/cu/templates/serviceaccount.yaml
new file mode 100644 (file)
index 0000000..8ff8fd0
--- /dev/null
@@ -0,0 +1,13 @@
+{{- if .Values.serviceAccount.create -}}
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: {{ include "cu.serviceAccountName" . }}
+  labels:
+    {{- include "cu.labels" . | nindent 4 }}
+  {{- with .Values.serviceAccount.annotations }}
+  annotations:
+    {{- toYaml . | nindent 4 }}
+  {{- end }}
+automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
+{{- end }}
diff --git a/container/cu_helm/cu/templates/tests/test-connection.yaml b/container/cu_helm/cu/templates/tests/test-connection.yaml
new file mode 100644 (file)
index 0000000..83e1eb5
--- /dev/null
@@ -0,0 +1,15 @@
+apiVersion: v1
+kind: Pod
+metadata:
+  name: "{{ include "cu.fullname" . }}-test-connection"
+  labels:
+    {{- include "cu.labels" . | nindent 4 }}
+  annotations:
+    "helm.sh/hook": test
+spec:
+  containers:
+    - name: wget
+      image: busybox
+      command: ['wget']
+      args: ['{{ include "cu.fullname" . }}:{{ .Values.service.port }}']
+  restartPolicy: Never
diff --git a/container/cu_helm/cu/values.yaml b/container/cu_helm/cu/values.yaml
new file mode 100644 (file)
index 0000000..3e9afbc
--- /dev/null
@@ -0,0 +1,110 @@
+# Default values for cu.
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.
+
+replicaCount: 1
+
+image:
+  repository: new-cu-container
+    #  pullPolicy: IfNotPresent
+  # Overrides the image tag whose default is the chart appVersion.
+  tag: v1
+
+    #imagePullSecrets:
+nameOverride: ""
+fullnameOverride: ""
+
+serviceAccount:
+  # Specifies whether a service account should be created
+  create: true
+  # Automatically mount a ServiceAccount's API credentials?
+  automount: true
+  # Annotations to add to the service account
+  annotations: {}
+  # The name of the service account to use.
+  # If not set and create is true, a name is generated using the fullname template
+  name: ""
+
+podAnnotations: {}
+podLabels: {}
+
+podSecurityContext: {}
+  # fsGroup: 2000
+
+securityContext:
+  privileged: true
+  # capabilities:
+  #   drop:
+  #   - ALL
+  # readOnlyRootFilesystem: true
+  # runAsNonRoot: true
+  # runAsUser: 1000
+
+service:
+  type: ClusterIP
+  port: 38472
+  protocol: SCTP
+  targetPort: 38472
+
+
+ingress:
+  enabled: false
+  className: ""
+  annotations: {}
+    # kubernetes.io/ingress.class: nginx
+    # kubernetes.io/tls-acme: "true"
+  hosts:
+    - host: chart-example.local
+      paths:
+        - path: /
+          pathType: ImplementationSpecific
+  tls: []
+  #  - secretName: chart-example-tls
+  #    hosts:
+  #      - chart-example.local
+
+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
+
+
+autoscaling:
+  enabled: false
+  minReplicas: 1
+  maxReplicas: 100
+  targetCPUUtilizationPercentage: 80
+  # targetMemoryUtilizationPercentage: 80
+
+# Additional volumes on the output Deployment definition.
+volumes: []
+# - name: foo
+#   secret:
+#     secretName: mysecret
+#     optional: false
+
+# Additional volumeMounts on the output Deployment definition.
+volumeMounts: []
+# - name: foo
+#   mountPath: "/etc/foo"
+#   readOnly: true
+
+nodeSelector: {}
+
+tolerations: []
+
+affinity: {}
+
+env:
+  - name: CU_ADDRESS
+    value: ocu
+  - name: DU_ADDRESS
+    value: odu
+
diff --git a/container/du_helm/du/.helmignore b/container/du_helm/du/.helmignore
new file mode 100644 (file)
index 0000000..0e8a0eb
--- /dev/null
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/container/du_helm/du/Chart.yaml b/container/du_helm/du/Chart.yaml
new file mode 100644 (file)
index 0000000..0362048
--- /dev/null
@@ -0,0 +1,24 @@
+apiVersion: v2
+name: du
+description: A Helm chart for Kubernetes
+
+# A chart can be either an 'application' or a 'library' chart.
+#
+# Application charts are a collection of templates that can be packaged into versioned archives
+# to be deployed.
+#
+# Library charts provide useful utilities or functions for the chart developer. They're included as
+# a dependency of application charts to inject those utilities and functions into the rendering
+# pipeline. Library charts do not define any templates and therefore cannot be deployed.
+type: application
+
+# 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.
+# Versions are expected to follow Semantic Versioning (https://semver.org/)
+version: 0.1.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. Versions are not expected to
+# follow Semantic Versioning. They should reflect the version the application is using.
+# It is recommended to use it with quotes.
+appVersion: "1.16.0"
diff --git a/container/du_helm/du/templates/NOTES.txt b/container/du_helm/du/templates/NOTES.txt
new file mode 100644 (file)
index 0000000..3203f35
--- /dev/null
@@ -0,0 +1,22 @@
+1. Get the application URL by running these commands:
+{{- if .Values.ingress.enabled }}
+{{- range $host := .Values.ingress.hosts }}
+  {{- range .paths }}
+  http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
+  {{- end }}
+{{- end }}
+{{- else if contains "NodePort" .Values.service.type }}
+  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "du.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 "du.fullname" . }}'
+  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "du.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 "du.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
+  export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
+  echo "Visit http://127.0.0.1:8080 to use your application"
+  kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
+{{- end }}
diff --git a/container/du_helm/du/templates/_helpers.tpl b/container/du_helm/du/templates/_helpers.tpl
new file mode 100644 (file)
index 0000000..99938f2
--- /dev/null
@@ -0,0 +1,62 @@
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "du.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Create a default fully qualified app name.
+We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
+If release name contains chart name it will be used as a full name.
+*/}}
+{{- define "du.fullname" -}}
+{{- if .Values.fullnameOverride }}
+{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- $name := default .Chart.Name .Values.nameOverride }}
+{{- if contains $name .Release.Name }}
+{{- .Release.Name | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
+{{- end }}
+{{- end }}
+{{- end }}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "du.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "du.labels" -}}
+helm.sh/chart: {{ include "du.chart" . }}
+{{ include "du.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end }}
+
+{{/*
+Selector labels
+*/}}
+{{- define "du.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "du.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}
+
+{{/*
+Create the name of the service account to use
+*/}}
+{{- define "du.serviceAccountName" -}}
+{{- if .Values.serviceAccount.create }}
+{{- default (include "du.fullname" .) .Values.serviceAccount.name }}
+{{- else }}
+{{- default "default" .Values.serviceAccount.name }}
+{{- end }}
+{{- end }}
diff --git a/container/du_helm/du/templates/deployment.yaml b/container/du_helm/du/templates/deployment.yaml
new file mode 100644 (file)
index 0000000..28e27bf
--- /dev/null
@@ -0,0 +1,76 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ include "du.fullname" . }}
+  labels:
+    {{- include "du.labels" . | nindent 4 }}
+spec:
+  {{- if not .Values.autoscaling.enabled }}
+  replicas: {{ .Values.replicaCount }}
+  {{- end }}
+  selector:
+    matchLabels:
+      {{- include "du.selectorLabels" . | nindent 6 }}
+  template:
+    metadata:
+      {{- with .Values.podAnnotations }}
+      annotations:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      labels:
+        {{- include "du.labels" . | nindent 8 }}
+        {{- with .Values.podLabels }}
+        {{- toYaml . | nindent 8 }}
+        {{- end }}
+    spec:
+      {{- with .Values.imagePullSecrets }}
+      imagePullSecrets:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      serviceAccountName: {{ include "du.serviceAccountName" . }}
+      securityContext:
+        {{- toYaml .Values.podSecurityContext | nindent 8 }}
+      containers:
+        - name: {{ .Chart.Name }}
+          securityContext:
+            {{- toYaml .Values.securityContext | nindent 12 }}
+          image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
+          imagePullPolicy: {{ .Values.image.pullPolicy }}
+          command: [ "/bin/bash", "-c", "--"]
+          #args: [ "sleep 60; /root/docker-entrypoint.sh" ]
+          args: [ "sleep 60000000000000000000;"]
+            #ports:
+            #- name: http
+            #  containerPort: {{ .Values.service.port }}
+            #  protocol: {{ .Values.service.protocol }}
+          env:
+            {{- range .Values.env }}
+            - name: {{ .name }}
+              value: {{ .value | quote }}
+            {{- end }}
+          livenessProbe:
+            {{- toYaml .Values.livenessProbe | nindent 12 }}
+          readinessProbe:
+            {{- toYaml .Values.readinessProbe | nindent 12 }}
+          resources:
+            {{- toYaml .Values.resources | nindent 12 }}
+          {{- with .Values.volumeMounts }}
+          volumeMounts:
+            {{- toYaml . | nindent 12 }}
+          {{- end }}
+      {{- with .Values.volumes }}
+      volumes:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- with .Values.nodeSelector }}
+      nodeSelector:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- with .Values.affinity }}
+      affinity:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- with .Values.tolerations }}
+      tolerations:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
diff --git a/container/du_helm/du/templates/hpa.yaml b/container/du_helm/du/templates/hpa.yaml
new file mode 100644 (file)
index 0000000..68b06c6
--- /dev/null
@@ -0,0 +1,32 @@
+{{- if .Values.autoscaling.enabled }}
+apiVersion: autoscaling/v2
+kind: HorizontalPodAutoscaler
+metadata:
+  name: {{ include "du.fullname" . }}
+  labels:
+    {{- include "du.labels" . | nindent 4 }}
+spec:
+  scaleTargetRef:
+    apiVersion: apps/v1
+    kind: Deployment
+    name: {{ include "du.fullname" . }}
+  minReplicas: {{ .Values.autoscaling.minReplicas }}
+  maxReplicas: {{ .Values.autoscaling.maxReplicas }}
+  metrics:
+    {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
+    - type: Resource
+      resource:
+        name: cpu
+        target:
+          type: Utilization
+          averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
+    {{- end }}
+    {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
+    - type: Resource
+      resource:
+        name: memory
+        target:
+          type: Utilization
+          averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
+    {{- end }}
+{{- end }}
diff --git a/container/du_helm/du/templates/ingress.yaml b/container/du_helm/du/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..3e13613
--- /dev/null
@@ -0,0 +1,61 @@
+{{- if .Values.ingress.enabled -}}
+{{- $fullName := include "du.fullname" . -}}
+{{- $svcPort := .Values.service.port -}}
+{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
+  {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
+  {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
+  {{- end }}
+{{- end }}
+{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
+apiVersion: networking.k8s.io/v1
+{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
+apiVersion: networking.k8s.io/v1beta1
+{{- else -}}
+apiVersion: extensions/v1beta1
+{{- end }}
+kind: Ingress
+metadata:
+  name: {{ $fullName }}
+  labels:
+    {{- include "du.labels" . | nindent 4 }}
+  {{- with .Values.ingress.annotations }}
+  annotations:
+    {{- toYaml . | nindent 4 }}
+  {{- end }}
+spec:
+  {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
+  ingressClassName: {{ .Values.ingress.className }}
+  {{- end }}
+  {{- if .Values.ingress.tls }}
+  tls:
+    {{- range .Values.ingress.tls }}
+    - hosts:
+        {{- range .hosts }}
+        - {{ . | quote }}
+        {{- end }}
+      secretName: {{ .secretName }}
+    {{- end }}
+  {{- end }}
+  rules:
+    {{- range .Values.ingress.hosts }}
+    - host: {{ .host | quote }}
+      http:
+        paths:
+          {{- range .paths }}
+          - path: {{ .path }}
+            {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
+            pathType: {{ .pathType }}
+            {{- end }}
+            backend:
+              {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
+              service:
+                name: {{ $fullName }}
+                port:
+                  number: {{ $svcPort }}
+              {{- else }}
+              serviceName: {{ $fullName }}
+              servicePort: {{ $svcPort }}
+              {{- end }}
+          {{- end }}
+    {{- end }}
+{{- end }}
diff --git a/container/du_helm/du/templates/service.yaml b/container/du_helm/du/templates/service.yaml
new file mode 100644 (file)
index 0000000..77b7132
--- /dev/null
@@ -0,0 +1,19 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "du.fullname" . }}
+  labels:
+    {{- include "du.labels" . | nindent 4 }}
+spec:
+  type: {{ .Values.service.type }}
+  ports:
+    - port: {{ .Values.service.f1port }}
+      targetPort: {{ .Values.service.f1targetPort }}
+      protocol:  {{ .Values.service.f1protocol }}
+      name: f1ap
+    - port: {{ .Values.service.e2port }}
+      targetPort: {{ .Values.service.e2targetPort }}
+      protocol:  {{ .Values.service.e2protocol }}
+      name: e2ap
+  selector:
+    {{- include "du.selectorLabels" . | nindent 4 }}
diff --git a/container/du_helm/du/templates/serviceaccount.yaml b/container/du_helm/du/templates/serviceaccount.yaml
new file mode 100644 (file)
index 0000000..edb18b3
--- /dev/null
@@ -0,0 +1,13 @@
+{{- if .Values.serviceAccount.create -}}
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: {{ include "du.serviceAccountName" . }}
+  labels:
+    {{- include "du.labels" . | nindent 4 }}
+  {{- with .Values.serviceAccount.annotations }}
+  annotations:
+    {{- toYaml . | nindent 4 }}
+  {{- end }}
+automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
+{{- end }}
diff --git a/container/du_helm/du/templates/tests/test-connection.yaml b/container/du_helm/du/templates/tests/test-connection.yaml
new file mode 100644 (file)
index 0000000..7725638
--- /dev/null
@@ -0,0 +1,15 @@
+apiVersion: v1
+kind: Pod
+metadata:
+  name: "{{ include "du.fullname" . }}-test-connection"
+  labels:
+    {{- include "du.labels" . | nindent 4 }}
+  annotations:
+    "helm.sh/hook": test
+spec:
+  containers:
+    - name: wget
+      image: busybox
+      command: ['wget']
+      args: ['{{ include "du.fullname" . }}:{{ .Values.service.port }}']
+  restartPolicy: Never
diff --git a/container/du_helm/du/values.yaml b/container/du_helm/du/values.yaml
new file mode 100644 (file)
index 0000000..8b0a019
--- /dev/null
@@ -0,0 +1,115 @@
+# Default values for du.
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.
+
+replicaCount: 1
+
+image:
+  repository: new-du-container
+    # pullPolicy: IfNotPresent
+  # Overrides the image tag whose default is the chart appVersion.
+  tag: v1
+
+    #imagePullSecrets:
+    #- name: local-registry
+nameOverride: ""
+fullnameOverride: ""
+
+serviceAccount:
+  # Specifies whether a service account should be created
+  create: true
+  # Automatically mount a ServiceAccount's API credentials?
+  automount: true
+  # Annotations to add to the service account
+  annotations: {}
+  # The name of the service account to use.
+  # If not set and create is true, a name is generated using the fullname template
+  name: ""
+
+podAnnotations: {}
+podLabels: {}
+
+podSecurityContext: {}
+  # fsGroup: 2000
+
+securityContext:
+  privileged: true
+  # capabilities:
+  #   drop:
+  #   - ALL
+  # readOnlyRootFilesystem: true
+  # runAsNonRoot: true
+  # runAsUser: 1000
+
+service:
+  type: ClusterIP
+  f1port: 38472
+  f1protocol: SCTP
+  f1targetPort: 38472
+  e2port: 36421
+  e2protocol: SCTP
+  e2targetPort: 36421
+
+
+ingress:
+  enabled: false
+  className: ""
+  annotations: {}
+    # kubernetes.io/ingress.class: nginx
+    # kubernetes.io/tls-acme: "true"
+  hosts:
+    - host: chart-example.local
+      paths:
+        - path: /
+          pathType: ImplementationSpecific
+  tls: []
+  #  - secretName: chart-example-tls
+  #    hosts:
+  #      - chart-example.local
+
+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
+
+
+autoscaling:
+  enabled: false
+  minReplicas: 1
+  maxReplicas: 100
+  targetCPUUtilizationPercentage: 80
+  # targetMemoryUtilizationPercentage: 80
+
+# Additional volumes on the output Deployment definition.
+volumes: []
+# - name: foo
+#   secret:
+#     secretName: mysecret
+#     optional: false
+
+# Additional volumeMounts on the output Deployment definition.
+volumeMounts: []
+# - name: foo
+#   mountPath: "/etc/foo"
+#   readOnly: true
+
+nodeSelector: {}
+
+tolerations: []
+
+affinity: {}
+
+env:
+  - name: CU_ADDRESS
+    value: ocu
+  - name: DU_ADDRESS
+    value: odu
+  - name: RIC_ADDRESS
+    value: ric
diff --git a/container/ric_helm/ric/.helmignore b/container/ric_helm/ric/.helmignore
new file mode 100644 (file)
index 0000000..0e8a0eb
--- /dev/null
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/container/ric_helm/ric/Chart.yaml b/container/ric_helm/ric/Chart.yaml
new file mode 100644 (file)
index 0000000..a474c7c
--- /dev/null
@@ -0,0 +1,24 @@
+apiVersion: v2
+name: ric
+description: A Helm chart for Kubernetes
+
+# A chart can be either an 'application' or a 'library' chart.
+#
+# Application charts are a collection of templates that can be packaged into versioned archives
+# to be deployed.
+#
+# Library charts provide useful utilities or functions for the chart developer. They're included as
+# a dependency of application charts to inject those utilities and functions into the rendering
+# pipeline. Library charts do not define any templates and therefore cannot be deployed.
+type: application
+
+# 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.
+# Versions are expected to follow Semantic Versioning (https://semver.org/)
+version: 0.1.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. Versions are not expected to
+# follow Semantic Versioning. They should reflect the version the application is using.
+# It is recommended to use it with quotes.
+appVersion: "1.16.0"
diff --git a/container/ric_helm/ric/templates/NOTES.txt b/container/ric_helm/ric/templates/NOTES.txt
new file mode 100644 (file)
index 0000000..78d3616
--- /dev/null
@@ -0,0 +1,22 @@
+1. Get the application URL by running these commands:
+{{- if .Values.ingress.enabled }}
+{{- range $host := .Values.ingress.hosts }}
+  {{- range .paths }}
+  http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
+  {{- end }}
+{{- end }}
+{{- else if contains "NodePort" .Values.service.type }}
+  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "ric.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 "ric.fullname" . }}'
+  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "ric.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 "ric.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
+  export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
+  echo "Visit http://127.0.0.1:8080 to use your application"
+  kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
+{{- end }}
diff --git a/container/ric_helm/ric/templates/_helpers.tpl b/container/ric_helm/ric/templates/_helpers.tpl
new file mode 100644 (file)
index 0000000..759c709
--- /dev/null
@@ -0,0 +1,62 @@
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "ric.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Create a default fully qualified app name.
+We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
+If release name contains chart name it will be used as a full name.
+*/}}
+{{- define "ric.fullname" -}}
+{{- if .Values.fullnameOverride }}
+{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- $name := default .Chart.Name .Values.nameOverride }}
+{{- if contains $name .Release.Name }}
+{{- .Release.Name | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
+{{- end }}
+{{- end }}
+{{- end }}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "ric.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "ric.labels" -}}
+helm.sh/chart: {{ include "ric.chart" . }}
+{{ include "ric.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end }}
+
+{{/*
+Selector labels
+*/}}
+{{- define "ric.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "ric.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}
+
+{{/*
+Create the name of the service account to use
+*/}}
+{{- define "ric.serviceAccountName" -}}
+{{- if .Values.serviceAccount.create }}
+{{- default (include "ric.fullname" .) .Values.serviceAccount.name }}
+{{- else }}
+{{- default "default" .Values.serviceAccount.name }}
+{{- end }}
+{{- end }}
diff --git a/container/ric_helm/ric/templates/deployment.yaml b/container/ric_helm/ric/templates/deployment.yaml
new file mode 100644 (file)
index 0000000..8259473
--- /dev/null
@@ -0,0 +1,76 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ include "ric.fullname" . }}
+  labels:
+    {{- include "ric.labels" . | nindent 4 }}
+spec:
+  {{- if not .Values.autoscaling.enabled }}
+  replicas: {{ .Values.replicaCount }}
+  {{- end }}
+  selector:
+    matchLabels:
+      {{- include "ric.selectorLabels" . | nindent 6 }}
+  template:
+    metadata:
+      {{- with .Values.podAnnotations }}
+      annotations:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      labels:
+        {{- include "ric.labels" . | nindent 8 }}
+        {{- with .Values.podLabels }}
+        {{- toYaml . | nindent 8 }}
+        {{- end }}
+    spec:
+      {{- with .Values.imagePullSecrets }}
+      imagePullSecrets:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      serviceAccountName: {{ include "ric.serviceAccountName" . }}
+      securityContext:
+        {{- toYaml .Values.podSecurityContext | nindent 8 }}
+      containers:
+        - name: {{ .Chart.Name }}
+          securityContext:
+            {{- toYaml .Values.securityContext | nindent 12 }}
+          image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
+          imagePullPolicy: {{ .Values.image.pullPolicy }}
+          command: [ "/bin/bash", "-c", "--"]
+          #args: [ "sleep 60; /root/docker-entrypoint.sh" ]
+          args: [ "sleep 60000000000000000000;"]
+          ports:
+            - name: http
+              containerPort: {{ .Values.service.port }}
+              protocol: {{ .Values.service.protocol }}
+          env:
+            {{- range .Values.env }}
+            - name: {{ .name }}
+              value: {{ .value | quote }}
+            {{- end }}
+          livenessProbe:
+            {{- toYaml .Values.livenessProbe | nindent 12 }}
+          readinessProbe:
+            {{- toYaml .Values.readinessProbe | nindent 12 }}
+          resources:
+            {{- toYaml .Values.resources | nindent 12 }}
+          {{- with .Values.volumeMounts }}
+          volumeMounts:
+            {{- toYaml . | nindent 12 }}
+          {{- end }}
+      {{- with .Values.volumes }}
+      volumes:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- with .Values.nodeSelector }}
+      nodeSelector:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- with .Values.affinity }}
+      affinity:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- with .Values.tolerations }}
+      tolerations:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
diff --git a/container/ric_helm/ric/templates/hpa.yaml b/container/ric_helm/ric/templates/hpa.yaml
new file mode 100644 (file)
index 0000000..b0bab98
--- /dev/null
@@ -0,0 +1,32 @@
+{{- if .Values.autoscaling.enabled }}
+apiVersion: autoscaling/v2
+kind: HorizontalPodAutoscaler
+metadata:
+  name: {{ include "ric.fullname" . }}
+  labels:
+    {{- include "ric.labels" . | nindent 4 }}
+spec:
+  scaleTargetRef:
+    apiVersion: apps/v1
+    kind: Deployment
+    name: {{ include "ric.fullname" . }}
+  minReplicas: {{ .Values.autoscaling.minReplicas }}
+  maxReplicas: {{ .Values.autoscaling.maxReplicas }}
+  metrics:
+    {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
+    - type: Resource
+      resource:
+        name: cpu
+        target:
+          type: Utilization
+          averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
+    {{- end }}
+    {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
+    - type: Resource
+      resource:
+        name: memory
+        target:
+          type: Utilization
+          averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
+    {{- end }}
+{{- end }}
diff --git a/container/ric_helm/ric/templates/ingress.yaml b/container/ric_helm/ric/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..37d14df
--- /dev/null
@@ -0,0 +1,61 @@
+{{- if .Values.ingress.enabled -}}
+{{- $fullName := include "ric.fullname" . -}}
+{{- $svcPort := .Values.service.port -}}
+{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
+  {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
+  {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
+  {{- end }}
+{{- end }}
+{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
+apiVersion: networking.k8s.io/v1
+{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
+apiVersion: networking.k8s.io/v1beta1
+{{- else -}}
+apiVersion: extensions/v1beta1
+{{- end }}
+kind: Ingress
+metadata:
+  name: {{ $fullName }}
+  labels:
+    {{- include "ric.labels" . | nindent 4 }}
+  {{- with .Values.ingress.annotations }}
+  annotations:
+    {{- toYaml . | nindent 4 }}
+  {{- end }}
+spec:
+  {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
+  ingressClassName: {{ .Values.ingress.className }}
+  {{- end }}
+  {{- if .Values.ingress.tls }}
+  tls:
+    {{- range .Values.ingress.tls }}
+    - hosts:
+        {{- range .hosts }}
+        - {{ . | quote }}
+        {{- end }}
+      secretName: {{ .secretName }}
+    {{- end }}
+  {{- end }}
+  rules:
+    {{- range .Values.ingress.hosts }}
+    - host: {{ .host | quote }}
+      http:
+        paths:
+          {{- range .paths }}
+          - path: {{ .path }}
+            {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
+            pathType: {{ .pathType }}
+            {{- end }}
+            backend:
+              {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
+              service:
+                name: {{ $fullName }}
+                port:
+                  number: {{ $svcPort }}
+              {{- else }}
+              serviceName: {{ $fullName }}
+              servicePort: {{ $svcPort }}
+              {{- end }}
+          {{- end }}
+    {{- end }}
+{{- end }}
diff --git a/container/ric_helm/ric/templates/service.yaml b/container/ric_helm/ric/templates/service.yaml
new file mode 100644 (file)
index 0000000..f0b5ddf
--- /dev/null
@@ -0,0 +1,15 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "ric.fullname" . }}
+  labels:
+    {{- include "ric.labels" . | nindent 4 }}
+spec:
+  type: {{ .Values.service.type }}
+  ports:
+    - port: {{ .Values.service.port }}
+      targetPort: {{ .Values.service.targetPort }}
+      protocol:  {{ .Values.service.protocol }}
+      name: e2ap
+  selector:
+    {{- include "ric.selectorLabels" . | nindent 4 }}
diff --git a/container/ric_helm/ric/templates/serviceaccount.yaml b/container/ric_helm/ric/templates/serviceaccount.yaml
new file mode 100644 (file)
index 0000000..b3f7d08
--- /dev/null
@@ -0,0 +1,13 @@
+{{- if .Values.serviceAccount.create -}}
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: {{ include "ric.serviceAccountName" . }}
+  labels:
+    {{- include "ric.labels" . | nindent 4 }}
+  {{- with .Values.serviceAccount.annotations }}
+  annotations:
+    {{- toYaml . | nindent 4 }}
+  {{- end }}
+automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
+{{- end }}
diff --git a/container/ric_helm/ric/templates/tests/test-connection.yaml b/container/ric_helm/ric/templates/tests/test-connection.yaml
new file mode 100644 (file)
index 0000000..a6d9d16
--- /dev/null
@@ -0,0 +1,15 @@
+apiVersion: v1
+kind: Pod
+metadata:
+  name: "{{ include "ric.fullname" . }}-test-connection"
+  labels:
+    {{- include "ric.labels" . | nindent 4 }}
+  annotations:
+    "helm.sh/hook": test
+spec:
+  containers:
+    - name: wget
+      image: busybox
+      command: ['wget']
+      args: ['{{ include "ric.fullname" . }}:{{ .Values.service.port }}']
+  restartPolicy: Never
diff --git a/container/ric_helm/ric/values.yaml b/container/ric_helm/ric/values.yaml
new file mode 100644 (file)
index 0000000..bb22be2
--- /dev/null
@@ -0,0 +1,114 @@
+# Default values for ric.
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.
+
+replicaCount: 1
+
+image:
+  repository: new-ric-container
+    #  pullPolicy: IfNotPresent
+  # Overrides the image tag whose default is the chart appVersion.
+  tag: v1
+
+    #imagePullSecrets:
+nameOverride: ""
+fullnameOverride: ""
+
+serviceAccount:
+  # Specifies whether a service account should be created
+  create: true
+  # Automatically mount a ServiceAccount's API credentials?
+  automount: true
+  # Annotations to add to the service account
+  annotations: {}
+  # The name of the service account to use.
+  # If not set and create is true, a name is generated using the fullname template
+  name: ""
+
+podAnnotations: {}
+podLabels: {}
+
+podSecurityContext: {}
+  # fsGroup: 2000
+
+securityContext:
+  privileged: true
+  # capabilities:
+  #   drop:
+  #   - ALL
+  # readOnlyRootFilesystem: true
+  # runAsNonRoot: true
+  # runAsUser: 1000
+
+service:
+  type: ClusterIP
+  port: 36421 
+  protocol: SCTP
+  targetPort: 36421
+
+
+ingress:
+  enabled: false
+  className: ""
+  annotations: {}
+    # kubernetes.io/ingress.class: nginx
+    # kubernetes.io/tls-acme: "true"
+  hosts:
+    - host: chart-example.local
+      paths:
+        - path: /
+          pathType: ImplementationSpecific
+  tls: []
+  #  - secretName: chart-example-tls
+  #    hosts:
+  #      - chart-example.local
+
+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
+
+
+autoscaling:
+  enabled: false
+  minReplicas: 1
+  maxReplicas: 100
+  targetCPUUtilizationPercentage: 80
+  # targetMemoryUtilizationPercentage: 80
+
+# Additional volumes on the output Deployment definition.
+volumes: []
+# - name: foo
+#   secret:
+#     secretName: mysecret
+#     optional: false
+
+# Additional volumeMounts on the output Deployment definition.
+volumeMounts: []
+# - name: foo
+#   mountPath: "/etc/foo"
+#   readOnly: true
+
+nodeSelector: {}
+
+tolerations: []
+
+affinity: {}
+
+env:
+  - name: CU_ADDRESS
+    value: ocu
+  - name: DU_ADDRESS
+    value: odu
+  - name: RIC_PORT
+    value: "36421"
+  - name: RIC_ADDRESS
+    value: ric
+
diff --git a/cu-docker-entrypoint.sh b/cu-docker-entrypoint.sh
new file mode 100755 (executable)
index 0000000..82f90f4
--- /dev/null
@@ -0,0 +1,22 @@
+export CU_LOCAL=`ifconfig eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}'`
+echo CU_LOCAL IP address is "$CU_LOCAL"
+
+
+DU_IP=`nslookup ${DU_ADDRESS} | grep Address | awk 'NR==2' | cut -d: -f2 | awk '{print $1}'`
+if [ -z "$DU_IP" ]
+then
+        echo "CU not able to fetch DU Service IP address"
+        echo "CU Stopped......!"
+        exit
+else
+        echo DU Service IP address is "$DU_IP"
+fi
+DU_SVC_IP="$DU_IP"
+
+sed -i "s/192.168.130.82/$CU_LOCAL/g" l2/src/cu_stub/cu_stub.h 
+sed -i "s/192.168.130.81/$DU_IP/g" l2/src/cu_stub/cu_stub.h
+cd /root/l2/build/odu/
+sed -i "s/UCONTAINERIZE/DCONTAINERIZE/g" makefile
+make clean_cu cu_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
+
+
diff --git a/du-docker-entrypoint.sh b/du-docker-entrypoint.sh
new file mode 100755 (executable)
index 0000000..69b96a5
--- /dev/null
@@ -0,0 +1,33 @@
+export DU_LOCAL=`ifconfig eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}'`
+echo DU_F1C IP address is "$DU_LOCAL"
+
+CU_IP=`nslookup ${CU_ADDRESS} | grep Address | awk 'NR==2' | cut -d: -f2 | awk '{print $1}'`
+if [ -z "$CU_IP" ]
+then
+        echo "DU not able to fetch CU Service IP address"
+        echo "DU Stopped......!"
+        exit
+else
+        echo CU Service IP address is "$CU_IP"
+fi
+CU_SVC_IP="$CU_IP"
+
+RIC_IP=`nslookup ${RIC_ADDRESS} | grep Address | awk 'NR==2' | cut -d: -f2 | awk '{print $1}'`
+if [ -z "$RIC_IP" ]
+then
+        echo "DU not able to fetch RIC Service IP address"
+        echo "DU Stopped......!"
+        exit
+else
+        echo RIC Service IP address is "$RIC_IP"
+fi
+RIC_SVC_IP="$RIC_IP"
+
+sed -i "s/192.168.130.82/$CU_IP/g" l2/build/config/fdd_odu_config.xml l2/build/config/tdd_odu_config.xml 
+sed -i "s/192.168.130.80/$RIC_IP/g" l2/build/config/fdd_odu_config.xml l2/build/config/tdd_odu_config.xml 
+sed -i "s/192.168.130.81/$DU_LOCAL/g" l2/build/config/fdd_odu_config.xml l2/build/config/tdd_odu_config.xml 
+cd l2/build/odu
+sed -i "s/UCONTAINERIZE/DCONTAINERIZE/g" makefile
+make clean_odu odu MACHINE=BIT64 MODE=FDD
+
+
diff --git a/ric-docker-entrypoint.sh b/ric-docker-entrypoint.sh
new file mode 100755 (executable)
index 0000000..d77f632
--- /dev/null
@@ -0,0 +1,21 @@
+export RIC_LOCAL=`ifconfig eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}'`
+echo RIC_LOCAL IP address is "$RIC_LOCAL"
+
+DU_IP=`nslookup ${DU_ADDRESS} | grep Address | awk 'NR==2' | cut -d: -f2 | awk '{print $1}'`
+if [ -z "$DU_IP" ]
+then
+        echo "RIC not able to fetch DU Service IP address"
+        echo "RIC Stopped......!"
+        exit
+else
+        echo DU Service IP address is "$DU_IP"
+fi
+DU_SVC_IP="$DU_IP"
+
+sed -i "s/192.168.130.80/$RIC_LOCAL/g" l2/src/ric_stub/ric_stub.h 
+sed -i "s/192.168.130.81/$DU_IP/g" l2/src/ric_stub/ric_stub.h
+cd /root/l2/build/odu/
+sed -i "s/UCONTAINERIZE/DCONTAINERIZE/g" makefile
+make clean_ric ric_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
+
+
index 49ef03e..794881c 100644 (file)
@@ -178,12 +178,39 @@ uint8_t fillAddrLst(CmInetNetAddrLst *addrLstPtr, SctpIpAddr *ipAddr)
  *******************************************************************************/
 uint8_t fillDestNetAddr(CmInetNetAddr *destAddrPtr, SctpIpAddr *dstIpPtr)
 {
-   /* Filling destination address */
-   destAddrPtr->type = CM_INET_IPV4ADDR_TYPE;
-   destAddrPtr->u.ipv4NetAddr = CM_INET_NTOH_UINT32(dstIpPtr->ipV4Addr);
-   return ROK;
+       /* Filling destination address */
+       destAddrPtr->type = CM_INET_IPV4ADDR_TYPE;
+       destAddrPtr->u.ipv4NetAddr = CM_INET_NTOH_UINT32(dstIpPtr->ipV4Addr);
+       return ROK;
 }
 
+#ifdef CONTAINERIZE
+/******************************************************************************
+ *
+ * @brief in case of containerization the du ip recive only after completeing the
+ *  sctp connection that's why updating the duip after sctpAccept.
+ *
+ * @details
+ *
+ *    Function : updateDestAddrPtr
+ *
+ *    Functionality:
+ *       updating the destAddrPtr in database
+ *
+ * @params[in] DuSctpDestCb *paramPtr
+ *             CmInetAddr  *peerAddr
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ *******************************************************************************/
+
+void updateDestAddrPtr(CmInetNetAddr *destAddrPtr, CmInetAddr  *peerAddr)
+{
+       destAddrPtr->type = CM_INET_IPV4ADDR_TYPE;
+       destAddrPtr->u.ipv4NetAddr = peerAddr->address;
+}
+#endif
+
 /******************************************************************************
  *
  * @brief Eastablishes the Assoc Req for the received interface type
@@ -207,7 +234,40 @@ uint8_t sctpStartReq()
    uint8_t ret = ROK;
    CmInetFd sockFd;
 
+#ifdef CONTAINERIZE
    socket_type = CM_INET_STREAM;
+   if((ret = cmInetSocket(socket_type, &sctpCb.f1LstnSockFd, IPPROTO_SCTP) != ROK))
+   {
+          DU_LOG("\nERROR  -->  SCTP : Socket[%d] coudnt open for listening", sctpCb.f1LstnSockFd.fd);
+   }
+   else if((ret = cmInetSctpBindx(&sctpCb.f1LstnSockFd, &sctpCb.localAddrLst, sctpCb.sctpCfg.f1SctpInfo.port)) != ROK)
+   {
+          DU_LOG("\nERROR  -->  SCTP: Binding failed at CU");
+   }
+   else if(ret = cmInetListen(&sctpCb.f1LstnSockFd, 1) != ROK)
+   {
+          DU_LOG("\nERROR  -->  SCTP : Listening on socket failed");
+          cmInetClose(&sctpCb.f1LstnSockFd);
+          return RFAILED;
+   }
+   else
+   {
+          for(assocIdx=0; assocIdx < sctpCb.numAssoc; assocIdx++)
+          {
+                  if(sctpCb.assocCb[assocIdx].intf == F1_INTERFACE)
+                  {
+                          if((ret = sctpAccept(&sctpCb.f1LstnSockFd, &sctpCb.assocCb[assocIdx])) != ROK)
+                          {
+                                  DU_LOG("\nERROR  -->  SCTP: Unable to accept the connection at CU");
+                          }
+                          else
+                          {
+                                  updateDestAddrPtr(&sctpCb.assocCb[assocIdx].destIpNetAddr, &sctpCb.assocCb[assocIdx].peerAddr);
+                          }
+                  }
+          }
+   }
+#else
 
    /* Establish SCTP association at XN interface */
    if(sctpCb.sctpCfg.xnSctpInfo.numDestNode)
@@ -314,7 +374,7 @@ uint8_t sctpStartReq()
          }
       }
    }
-
+#endif
    if(ret == ROK)
    {
       if(sctpSockPoll() != ROK)
@@ -405,6 +465,7 @@ uint8_t sctpAccept(CmInetFd *lstnSockFd, CuSctpAssocCb *assocCb)
          break;
       }
    }
    DU_LOG("\nINFO  -->  SCTP : Connection established");
 
    return ROK;
index 239285a..deef4c5 100644 (file)
@@ -5559,8 +5559,8 @@ void printDuConfig()
 
    egtp = &duCfgParam.egtpParams;
    DU_LOG("\n ** EGTP PARAMETER ** \n");
-   DU_LOG("DU IP Address %d\n", egtp->localIp.ipV4Addr);
-   DU_LOG("CU IP Address %d\n", egtp->destIp.ipV4Addr);
+   DU_LOG("DU IP Address %u\n", egtp->localIp.ipV4Addr);
+   DU_LOG("CU IP Address %u\n", egtp->destIp.ipV4Addr);
    DU_LOG("EGTP Port at DU %d\n", egtp->localPort);
    DU_LOG("EGTP Port at CU %d\n", egtp->destPort);
    DU_LOG("Minimum Tunnel ID %d\n", egtp->minTunnelId);
index a0a455a..bb5face 100644 (file)
@@ -114,6 +114,33 @@ uint8_t fillDestNetAddr(CmInetNetAddr *destAddrPtr, SctpIpAddr *dstIpPtr)
    return ROK;
 }
 
+#ifdef CONTAINERIZE
+/******************************************************************************
+ *
+ * @brief in case of containerization the du ip recive only after completeing the 
+ *  sctp connection that's why updating the duip after sctpAccept.
+ *
+ * @details
+ *
+ *    Function : updateDestAddrPtr 
+ *
+ *    Functionality:
+ *       updating the destAddrPtr in database
+ *
+ * @params[in] DuSctpDestCb *paramPtr
+ *            CmInetAddr  *peerAddr
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ *******************************************************************************/
+
+void updateDestAddrPtr(CmInetNetAddr *destAddrPtr, CmInetAddr  *peerAddr)
+{
+        destAddrPtr->type = CM_INET_IPV4ADDR_TYPE;
+        destAddrPtr->u.ipv4NetAddr = peerAddr->address;
+}
+#endif
+
 /******************************************************************************
  *
  * @brief Eastablishes the Assoc Req for the received interface type
@@ -164,6 +191,12 @@ uint8_t sctpStartReq()
             {
                DU_LOG("\nERROR  -->  SCTP: Unable to accept the connection at RIC");
             }
+           else
+           {
+#ifdef CONTAINERIZE
+                 updateDestAddrPtr(&sctpCb.assocCb[assocIdx].destIpNetAddr, &sctpCb.assocCb[assocIdx].peerAddr);
+#endif
+           }
          }
       }
    }