From: ecaiyanlinux Date: Tue, 22 Dec 2020 08:25:03 +0000 (+0100) Subject: Add A1 STD V2 simulators X-Git-Tag: f-release~65^2 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=it%2Fdep.git;a=commitdiff_plain;h=ee640dc47d881672e230b849ffabcaab0ac39ddc Add A1 STD V2 simulators Change-Id: I314fd976378badd6349dc5f2d17ea5d6143616ef Issue-ID: NONRTRIC-368 Signed-off-by: elinuxhenrik Signed-off-by: ecaiyanlinux --- diff --git a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml index 08c84079..51adbd6f 100644 --- a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml +++ b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml @@ -78,6 +78,9 @@ a1simulator: stdVersion: name: a1-sim-std replicaCount: 2 + stdVersion2: + name: a1-sim-std2 + replicaCount: 2 # image registry and tag to be changed after first release of controlpanel # Need to check the external port Availability @@ -167,6 +170,24 @@ policymanagementservice: "kista_1", "kista_2" ] + }, + { + "name":"ric5", + "baseUrl":"https://a1-sim-std2-0.a1-sim:8185", + "controller": "controller1", + "managedElementIds":[ + "kista_1", + "kista_2" + ] + }, + { + "name":"ric6", + "baseUrl":"https://a1-sim-std2-1.a1-sim:8185", + "controller": "controller1", + "managedElementIds":[ + "kista_1", + "kista_2" + ] } ] streams_publishes: | @@ -239,4 +260,4 @@ rappcatalogueservice: periodSeconds: 10 readiness: initialDelaySeconds: 20 - periodSeconds: 10 \ No newline at end of file + periodSeconds: 10 diff --git a/nonrtric/data/run_in_k8s/populate_data.sh b/nonrtric/data/run_in_k8s/populate_data.sh index 69cd28c0..d3e3f8b4 100755 --- a/nonrtric/data/run_in_k8s/populate_data.sh +++ b/nonrtric/data/run_in_k8s/populate_data.sh @@ -23,6 +23,8 @@ # one service in policy agent # five policies in a1-sim-OSC_0 # one policy in a1-sim-STD_0 +# one policy type in a1-sim-STD2_0 +# one policy in a1-sim-STD2_0 policy_agent_host="policymanagementservice" policy_agent_port="9080" @@ -34,6 +36,10 @@ a1_sim_std_0_host="a1-sim-std-0.a1-sim" a1_sim_std_0_port="8085" a1_sim_std_1_host="a1-sim-std-1.a1-sim" a1_sim_std_1_port="8085" +a1_sim_std2_0_host="a1-sim-std2-0.a1-sim" +a1_sim_std2_0_port="8085" +a1_sim_std2_1_host="a1-sim-std2-1.a1-sim" +a1_sim_std2_1_port="8085" httpx=http echo "policy agent status:" @@ -56,6 +62,14 @@ echo "ric4 version:" curl -skw " %{http_code}" $httpx://$a1_sim_std_1_host:$a1_sim_std_1_port/counter/interface echo -e "\n" +echo "ric5 version:" +curl -skw " %{http_code}" $httpx://$a1_sim_std2_0_host:$a1_sim_std_0_port/counter/interface +echo -e "\n" + +echo "ric6 version:" +curl -skw " %{http_code}" $httpx://$a1_sim_std2_1_host:$a1_sim_std_1_port/counter/interface +echo -e "\n" + echo "create policy type 1 to ric1:" curl -X PUT -skw " %{http_code}" $httpx://$a1_sim_osc_0_host:$a1_sim_osc_0_port/policytype?id=1 -H Content-Type:application/json --data-binary @testdata/OSC/policy_type.json echo -e "\n" @@ -64,12 +78,20 @@ echo "create policy type 1 to ric2:" curl -X PUT -skw " %{http_code}" $httpx://$a1_sim_osc_1_host:$a1_sim_osc_1_port/policytype?id=1 -H Content-Type:application/json --data-binary @testdata/OSC/policy_type.json echo -e "\n" +echo "create policy type 2 to STD2 ric5:" +curl -X PUT -skw " %{http_code}" $httpx://$a1_sim_std2_0_host:$a1_sim_std2_0_port/policytype?id=2 -H Content-Type:application/json --data-binary @testdata/STD/policy_type.json +echo -e "\n" + +echo "create policy type 2 to STD2 ric6:" +curl -X PUT -skw " %{http_code}" $httpx://$a1_sim_std2_1_host:$a1_sim_std2_1_port/policytype?id=2 -H Content-Type:application/json --data-binary @testdata/STD/policy_type.json +echo -e "\n" + for i in {1..12}; do echo "policy types from policy agent:" curlString="curl -skw %{http_code} $httpx://$policy_agent_host:$policy_agent_port/policy_types" res=$($curlString) echo "$res" - expect="[\"\",\"1\"]200" + expect="[\"\",\"1\",\"2\"]200" if [ "$res" == "$expect" ]; then echo -e "\n" break; @@ -102,6 +124,10 @@ echo "create policy 2004 to ric1 with type1 and service1 via policy agent:" curl -k -X PUT -sw " %{http_code}" -H accept:application/json -H Content-Type:application/json "$httpx://$policy_agent_host:$policy_agent_port/policy?id=2004&ric=ric1&service=service1&type=1" --data '{"scope": {"ueId": "ue3100","qosId": "qos3100"},"qosObjective": {"priorityLevel": 3104}}' echo -e "\n" +echo "create policy 2200 to ric5 with type1 and service1 via policy agent:" +curl -k -X PUT -sw " %{http_code}" -H accept:application/json -H Content-Type:application/json "$httpx://$policy_agent_host:$policy_agent_port/v2/policies" --data-binary @testdata/STD/policy.json +echo -e "\n" + echo "policy numbers from ric1:" curl -skw " %{http_code}" $httpx://$a1_sim_osc_0_host:$a1_sim_osc_0_port/counter/num_instances echo -e "\n" @@ -120,4 +146,4 @@ echo -e "\n" echo "policy id 2100 from policy agent:" curl -k -X GET -sw " %{http_code}" $httpx://$policy_agent_host:$policy_agent_port/policy?id=2100 -echo -e "\n" \ No newline at end of file +echo -e "\n" diff --git a/nonrtric/data/run_in_k8s/testdata/STD/policy.json b/nonrtric/data/run_in_k8s/testdata/STD/policy.json new file mode 100644 index 00000000..de158bda --- /dev/null +++ b/nonrtric/data/run_in_k8s/testdata/STD/policy.json @@ -0,0 +1,15 @@ +{ + "ric_id": "ric5", + "policy_id": "2100", + "service_id": "service1", + "policy_data": { + "scope": { + "ueId": "ue3100", + "qosId": "qos3100" + }, + "qosObjective": { + "priorityLevel": 3100 + } + }, + "policytype_id": "2" +} diff --git a/nonrtric/data/run_in_k8s/testdata/STD/policy_type.json b/nonrtric/data/run_in_k8s/testdata/STD/policy_type.json new file mode 100644 index 00000000..931498c4 --- /dev/null +++ b/nonrtric/data/run_in_k8s/testdata/STD/policy_type.json @@ -0,0 +1,56 @@ +{ + "policySchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "STD_QOS_0_2_0", + "description": "STD QOS policy type", + "type": "object", + "properties": { + "scope": { + "type": "object", + "properties": { + "ueId": { + "type": "string" + }, + "qosId": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "ueId", + "qosId" + ] + }, + "qosObjectives": { + "type": "object", + "properties": { + "priorityLevel": { + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "priorityLevel" + ] + } + } + }, + "statusSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "STD_QOS_0.2.0", + "description": "STD QOS policy type status", + "type": "object", + "properties": { + "enforceStatus": { + "type": "string" + }, + "enforceReason": { + "type": "string" + }, + "additionalProperties": false, + "required": [ + "enforceStatus" + ] + } + } + } \ No newline at end of file diff --git a/nonrtric/helm/a1simulator/templates/statefulset.yaml b/nonrtric/helm/a1simulator/templates/statefulset.yaml index 63019cd5..939f3a3c 100644 --- a/nonrtric/helm/a1simulator/templates/statefulset.yaml +++ b/nonrtric/helm/a1simulator/templates/statefulset.yaml @@ -117,4 +117,56 @@ spec: - name: A1_VERSION value: STD_1.1.3 - name: ALLOW_HTTP - value: {{ .Values.a1simulator.service.allowHttp | quote}} \ No newline at end of file + value: {{ .Values.a1simulator.service.allowHttp | quote}} +--- +kind: StatefulSet +apiVersion: apps/v1 +metadata: + name: {{ .Values.a1simulator.stdVersion2.name }} + namespace: {{ include "common.namespace.nonrtric" . }} + generation: 1 + labels: + app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.a1simulator" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: + deployment.kubernetes.io/revision: '1' +spec: + replicas: {{ .Values.a1simulator.stdVersion2.replicaCount }} + selector: + matchLabels: + app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.a1simulator" . }} + release: {{ .Release.Name }} + serviceName: {{ .Values.a1simulator.name }} + template: + metadata: + labels: + app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.a1simulator" . }} + release: {{ .Release.Name }} + spec: + hostname: {{ include "common.name.a1simulator" . }} + containers: + - name: {{ include "common.containername.a1simulator" . }} + image: {{ .Values.a1simulator.image.registry }}/{{ .Values.a1simulator.image.name }}:{{ .Values.a1simulator.image.tag }} + imagePullPolicy: {{ .Values.a1simulator.imagePullPolicy }} + ports: + - containerPort: {{ .Values.a1simulator.service.targetPort1 }} + protocol: TCP + - containerPort: {{ .Values.a1simulator.service.targetPort2 }} + protocol: TCP + readinessProbe: + tcpSocket: + port: {{ .Values.a1simulator.service.targetPort1 }} + initialDelaySeconds: {{ .Values.a1simulator.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.a1simulator.readiness.periodSeconds }} + livenessProbe: + tcpSocket: + port: {{ .Values.a1simulator.service.targetPort1 }} + initialDelaySeconds: {{ .Values.a1simulator.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.a1simulator.liveness.periodSeconds }} + env: + - name: A1_VERSION + value: STD_2.0.0 + - name: ALLOW_HTTP + value: {{ .Values.a1simulator.service.allowHttp | quote}} diff --git a/nonrtric/helm/a1simulator/values.yaml b/nonrtric/helm/a1simulator/values.yaml index 85468742..9836bf22 100644 --- a/nonrtric/helm/a1simulator/values.yaml +++ b/nonrtric/helm/a1simulator/values.yaml @@ -45,3 +45,7 @@ a1simulator: stdVersion: name: a1-sim-std replicaCount: 2 + stdVersion2: + name: a1-sim-std2 + replicaCount: 2 + diff --git a/nonrtric/helm/controlpanel/resources/application.properties b/nonrtric/helm/controlpanel/resources/application.properties index 3c1699e7..07fd88e4 100644 --- a/nonrtric/helm/controlpanel/resources/application.properties +++ b/nonrtric/helm/controlpanel/resources/application.properties @@ -32,8 +32,8 @@ portalapi.username = Default portalapi.password = password # URL for enrichment coordinator service -# enrichmentcontroller.url.prefix = https://enrichment-service-container:8434 -enrichmentcontroller.url.prefix = http://enrichment-service-container:8083/ei-producer/v1 +# enrichmentcontroller.url.prefix = https://enrichmentservice:9083/ei-producer/v1 +enrichmentcontroller.url.prefix = http://enrichmentservice:9082/ei-producer/v1 # Mimic slow endpoints by defining sleep period, in milliseconds mock.config.delay = 0 diff --git a/nonrtric/helm/policymanagementservice/resources/config/application.yaml b/nonrtric/helm/policymanagementservice/resources/config/application.yaml index cff6abf8..dae3fcea 100644 --- a/nonrtric/helm/policymanagementservice/resources/config/application.yaml +++ b/nonrtric/helm/policymanagementservice/resources/config/application.yaml @@ -35,7 +35,7 @@ logging: org.springframework: ERROR org.springframework.data: ERROR org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR - org.oransc.policyagent: INFO + org.onap.ccsdk.oran.a1policymanagementservice: INFO file: /var/log/policy-agent/application.log server: