NONRTRIC-1005: ServiceManager preload 63/13263/5
authorDenisGNoonan <denis.noonan@est.tech>
Wed, 14 Aug 2024 11:38:47 +0000 (12:38 +0100)
committerDenisGNoonan <denis.noonan@est.tech>
Mon, 19 Aug 2024 08:10:31 +0000 (09:10 +0100)
Issue-ID: NONRTRIC-1005
Change-Id: I03d991ced630a89a05bf4176edcd322ff8f7cd0f
Signed-off-by: DenisGNoonan <denis.noonan@est.tech>
23 files changed:
.gitignore
bin/deploy-nonrtric
nonrtric/RECIPE_EXAMPLE/example_recipe.yaml
nonrtric/helm/a1simulator/values.yaml
nonrtric/helm/capifcore/values.yaml
nonrtric/helm/dmaapadapterservice/values.yaml
nonrtric/helm/dmeparticipant/values.yaml
nonrtric/helm/policymanagementservice/values.yaml
nonrtric/helm/rappcatalogueenhancedservice/values.yaml
nonrtric/helm/rappmanager/values.yaml
nonrtric/helm/servicemanager/values.yaml
servicemanager-preload/README.md [new file with mode: 0644]
servicemanager-preload/config-nonrtric.yaml [new file with mode: 0644]
servicemanager-preload/config-smo.yaml [new file with mode: 0644]
servicemanager-preload/servicemanager-preload.sh [new file with mode: 0755]
smo-install/oran_oom/a1simulator/values.yaml
smo-install/oran_oom/capifcore/values.yaml
smo-install/oran_oom/dmaapadapterservice/values.yaml
smo-install/oran_oom/policy-clamp-ac-dme-ppnt/values.yaml
smo-install/oran_oom/policymanagementservice/values.yaml
smo-install/oran_oom/rappmanager/values.yaml
smo-install/oran_oom/servicemanager/values.yaml
smo-install/scripts/sub-scripts/install-nonrtric.sh

index ad46484..6d47f3f 100644 (file)
@@ -7,4 +7,4 @@
 .tox
 .DS_Store
 docs/_build/
-index-cache.yaml
\ No newline at end of file
+index-cache.yaml
index 2b88363..cb40cd3 100755 (executable)
@@ -243,3 +243,10 @@ fi
 
 echo "helm install -f $OVERRIDEYAML --namespace ${NONRTRIC_NAMESPACE:-nonrtric} ${HELM_NAME_OPT} ${RELEASE_PREFIX} $ROOT_DIR/../nonrtric/helm/nonrtric"
 helm install -f $OVERRIDEYAML -n "${NONRTRIC_NAMESPACE:-nonrtric}" ${HELM_NAME_OPT} "${RELEASE_PREFIX}" "$ROOT_DIR/../nonrtric/helm/nonrtric"
+
+if [ "$INSTALL_SERVICEMANAGER" == "true" ]; then
+    pushd dep/servicemanager-preload
+    # Send stderr to null to turn off chatty logging
+    ./servicemanager-preload.sh config-nonrtric.yaml 2>/dev/null
+    popd
+fi
index 2ccbb75..46b7320 100644 (file)
@@ -100,7 +100,7 @@ policymanagementservice:
     image:
       registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc'
       name: nonrtric-plt-a1policymanagementservice
-      tag: 2.7.0
+      tag: 2.8.0
     service:
       allowHttp: true
       httpName: http
@@ -158,7 +158,7 @@ a1simulator:
     image:
       registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc'
       name: a1-simulator
-      tag: 2.6.1
+      tag: 2.7.0
     service:
       allowHttp: true
       httpName: http
@@ -238,7 +238,7 @@ rappcatalogueenhancedservice:
     image:
       registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc'
       name: nonrtric-plt-rappcatalogue-enhanced
-      tag: 1.1.0
+      tag: 1.2.0
     service:
       allowHttp: true
       httpName: http
@@ -276,7 +276,7 @@ dmaapadapterservice:
     image:
       registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc'
       name: 'nonrtric-plt-dmaapadapter'
-      tag: 1.3.0
+      tag: 1.4.0
     service:
       allowHttp: true
       httpName: http
@@ -380,7 +380,7 @@ capifcore:
     image:
       registry: "nexus3.o-ran-sc.org:10004/o-ran-sc"
       name: nonrtric-plt-capifcore
-      tag: 1.3.1
+      tag: 1.4.0
     env:
       chart_museum_url: "http://chartmuseum:8080"
       repo_name: "capifcore"
@@ -391,7 +391,7 @@ servicemanager:
     image:
       registry: "nexus3.o-ran-sc.org:10004/o-ran-sc"
       name: nonrtric-plt-servicemanager
-      tag: 0.1.2
+      tag: 0.1.3
 
 rappmanager:
   rappmanager:
@@ -399,7 +399,7 @@ rappmanager:
     image:
       registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
       name: nonrtric-plt-rappmanager
-      tag: 0.0.1
+      tag: 0.1.0
     service:
       httpName: http
       internalPort1: 8080
@@ -422,7 +422,7 @@ dmeparticipant:
     image:
       registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
       name: nonrtric-plt-participant-impl-dme
-      tag: 0.0.1
+      tag: 0.1.0
     service:
       httpName: http
       internalPort1: 8080
index dc44113..22e0096 100644 (file)
@@ -1,7 +1,7 @@
-#  ============LICENSE_START===============================================
+#  ============LICENSE_START================================================
 #  Copyright (C) 2020-2023 Nordix Foundation. All rights reserved.
-#  Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
-#  ========================================================================
+#  Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved.
+#  =========================================================================
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
 #  You may obtain a copy of the License at
@@ -13,7 +13,7 @@
 #  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.
-#  ============LICENSE_END=================================================
+#  ============LICENSE_END==================================================
 
 # Default values for a1-simulator.
 # This is a YAML-formatted file.
@@ -25,7 +25,7 @@ a1simulator:
   image:
     registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc'
     name: a1-simulator
-    tag: 2.6.1
+    tag: 2.7.0
   service:
     allowHttp: true
     httpName: http
index e7ca92f..2dd263a 100644 (file)
@@ -24,7 +24,7 @@ capifcore:
   image:
     registry: 'nexus3.o-ran-sc.org:10004/o-ran-sc'
     name: nonrtric-plt-capifcore
-    tag: 1.3.1
+    tag: 1.4.0
   service:
     httpName: http
     allowHttp: true
index 38e5e0b..0a53d14 100644 (file)
@@ -1,5 +1,6 @@
 ################################################################################
-#   Copyright (c) 2021 Nordix Foundation.                                      #
+#  Copyright (c) 2021 Nordix Foundation. All rights reserved.                  #
+#  Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved.   #
 #                                                                              #
 #   Licensed under the Apache License, Version 2.0 (the "License");            #
 #   you may not use this file except in compliance with the License.           #
@@ -23,7 +24,7 @@ dmaapadapterservice:
   image:
     registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
     name: "nonrtric-plt-dmaapadapter"
-    tag: 1.3.0
+    tag: 1.4.0
   service:
     allowHttp: true
     httpName: http
index 92f21cf..e451871 100644 (file)
@@ -1,6 +1,6 @@
-#  ============LICENSE_START===============================================
-#  Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
-#  ========================================================================
+#  ============LICENSE_START================================================
+#  Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved.
+#  =========================================================================
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
 #  You may obtain a copy of the License at
@@ -12,7 +12,7 @@
 #  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.
-#  ============LICENSE_END=================================================
+#  ============LICENSE_END==================================================
 #
 
 # Default values for DME Participant.
@@ -24,7 +24,7 @@ dmeparticipant:
   image:
     registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
     name: nonrtric-plt-participant-impl-dme
-    tag: 1.0.0
+    tag: 0.1.0
   service:
     httpName: http
     internalPort1: 8080
index 7191f1d..8103bfb 100644 (file)
@@ -1,7 +1,7 @@
-#  ============LICENSE_START===============================================
+#  ============LICENSE_START================================================
 #  Copyright (C) 2020-2023 Nordix Foundation. All rights reserved.
 #  Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved.
-#  ========================================================================
+#  =========================================================================
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
 #  You may obtain a copy of the License at
@@ -13,7 +13,7 @@
 #  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.
-#  ============LICENSE_END=================================================
+#  ============LICENSE_END==================================================
 
 # Default values for Policy Management Service.
 # This is a YAML-formatted file.
@@ -24,7 +24,7 @@ policymanagementservice:
   image:
     registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
     name: nonrtric-plt-a1policymanagementservice
-    tag: 2.7.0
+    tag: 2.8.0
   service:
     allowHttp: true
     httpName: http
index 2628dc4..bddf679 100644 (file)
@@ -1,7 +1,7 @@
-#  ============LICENSE_START===============================================
+#  ============LICENSE_START================================================
 #  Copyright (C) 2022-2023 Nordix Foundation. All rights reserved.
-#  Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
-#  ========================================================================
+#  Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved.
+#  =========================================================================
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
 #  You may obtain a copy of the License at
@@ -13,7 +13,7 @@
 #  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.
-#  ============LICENSE_END=================================================
+#  ============LICENSE_END==================================================
 
 # Default values for rAPP Catalogue Enhanced Service.
 # This is a YAML-formatted file.
@@ -24,7 +24,7 @@ rappcatalogueenhancedservice:
   image:
     registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc'
     name: nonrtric-plt-rappcatalogue-enhanced
-    tag: 1.1.0
+    tag: 1.2.0
   service:
     allowHttp: true
     httpName: http
index cf6aab7..75c54cc 100644 (file)
@@ -1,6 +1,6 @@
-#  ============LICENSE_START===============================================
+#  ============LICENSE_START================================================
 #  Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved.
-#  ========================================================================
+#  =========================================================================
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
 #  You may obtain a copy of the License at
@@ -12,7 +12,7 @@
 #  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.
-#  ============LICENSE_END=================================================
+#  ============LICENSE_END==================================================
 #
 
 # Default values for rApp Manager.
@@ -25,7 +25,7 @@ rappmanager:
   image:
     registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
     name: nonrtric-plt-rappmanager
-    tag: 0.0.1
+    tag: 0.1.0
   service:
     httpName: http
     internalPort1: 8080
index 0cfaa05..1463130 100644 (file)
@@ -21,7 +21,7 @@ servicemanager:
   image:
     registry: 'nexus3.o-ran-sc.org:10004/o-ran-sc'
     name: nonrtric-plt-servicemanager
-    tag: 0.1.2
+    tag: 0.1.3
   apiVersion: v1
   kind: ConfigMap
   metadataName: servicemanager-configmap
diff --git a/servicemanager-preload/README.md b/servicemanager-preload/README.md
new file mode 100644 (file)
index 0000000..b7b10a4
--- /dev/null
@@ -0,0 +1,103 @@
+<!---
+
+Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.
+
+Licensed under the Creative Commons License, Attribution 4.0 Intl.
+(the"Documentation License"); you may not use this documentation
+except incompliance with the Documentation License. You may obtain
+a copy of the Documentation License at
+
+    https://creativecommons.org/licenses/by/4.0/
+
+Unless required by applicable law or agreed to in writing,
+documentation distributed under the Documentation License is
+distributed on an "AS IS"BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, either express or implied. See the Documentation
+License for the specific language governing permissions and
+limitations under the Documentation License.
+
+-->
+
+# Service Manager Preload
+
+## Config format
+The config file follows a format that is similar to the format required by the Service Manager/CAPIFcore Publisher.
+
+## Running
+
+At the end of the Kubernetes deployment, following script runs automatically.
+
+```sh
+servicemanager-preload.sh [config.yaml]
+```
+where [config.yaml] is a config file. If this arguement is not specified, the default is config.yaml. The input file is expected to be in the same directory as the `servicemanager-preload.sh` script. You can call the command without arguements as below.
+
+In our installation we provide 2 config files, `config-nonrtric.yaml` and `config-smo.yaml`. The file `config-nonrtric.yaml` is used by both the NONRTRIC install and SMO installs. For the SMO install we concatate both files into a file called `config-nonrtric-smo.yaml` and use that. This file is deleted after use in the installation script. We do it this way to avoid duplicating the information in `config-nonrtric.yaml`.
+
+## Script Action
+
+1. The script runs through the provided config.yaml file and selects the root entries in the YAML as Kubernetes service names.
+1. For each service, we check if the service exists, using `kubectl get service` for both the nonrtric and onap namespaces.
+1. If the service is exists, we add it to a list, `running_services_list`.
+1. Next, we run through all entries in the supplied YAML file.
+1. If the service is on the `running_services_list`, we build a payload from the entries for that YAML item.
+1. We use the payload to call the Service Manager. This in turn calls Kong and Capif to set up the service.
+
+## Interface Descriptions
+
+To distinguish between multiple interface descriptions, Service Manager prepends the port number and a hash code to the URL path.
+
+## Static and Dynamic Routes
+
+We can specify either static or dynamic routes. Static routing defines a route when there is a single route for traffic to reach a destination. Dynamic routing allows us to specify path parameters. In this config file, we specify path parameters using regular expressions.
+
+Kong uses the regex definition from the [Rust programming language](https://docs.rs/regex/latest/regex/) to specify the regular expression (regex) that describes the path parameters, [Kong regex](https://docs.konghq.com/gateway/latest/key-concepts/routes/#regular-expressions).
+
+An example of a static path is as follows. This is the straightforward case.
+
+```http
+   /rapps
+```
+
+An example of a dynamic path is
+
+```http
+   ~/rapps/(?<rappId>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)
+```
+
+Our dynamic path starts with a ~ character. In this example, we have a path parameter that is described by a regex capture group called rappId. The regex describes a word made of mixed-case alphanumeric characters optionally followed by one or more sets of a dash or underscore together with another word.
+
+When the Service Manager client calls a dynamic API, it must strip the ~ and substitute the path parameter according to the rules specified in the regex. Therefore, we can call the above example by using
+
+```http
+   /rapps/my-rApp-id
+```
+
+as the URL where my-rApp-id is the rApp id of in the rApp Manager. The name my-rApp-id has to match the regex shown above.
+
+It is required to name the capture group in this YAML config file. The capture group name is used by Service Manager when creating a Kong Request Transformerplugin. We can specify multiple capture groups in a URL if there are multiple path parameters in the API path.
+
+We create a Kong Request Transformer plugin with the following .data[].config.replace, as in the following example curl and abridged response.
+
+```sh
+curl -X GET http://oran-nonrtric-kong-admin.nonrtric.svc.cluster.local:8001/plugins
+```
+
+```json
+{
+  "body": [],
+  "uri": "/rapps/$(uri_captures[\"rappId\"])",
+  "headers": [],
+  "querystring": []
+}
+```
+
+In our example, this allows Kong to match /rapps/my-rApp-id. 
+
+The Service Manager uses the following regex to search and replace the YAML file regexes.
+
+```regex
+/\(\?<([^>]+)>([^\/]+)/
+```
+
+Please note that the example path, /rapps/my-rApp-id, is not terminated by a '/'. Service Manager adds a '/' for internal matching. This made the regex easier to develop. Service Manager will match on /rapps/my-rApp-id/ for this case.
diff --git a/servicemanager-preload/config-nonrtric.yaml b/servicemanager-preload/config-nonrtric.yaml
new file mode 100644 (file)
index 0000000..8546b86
--- /dev/null
@@ -0,0 +1,392 @@
+################################################################################
+#   Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.       #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   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.                                             #
+################################################################################
+
+---
+
+# Preload services for nonrtric install
+
+# https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-plt-sme/en/latest/overview.html#
+
+servicemanager:
+  AefProfiles:
+  - interfaceDescriptions:
+    - ipv4Addr: "servicemanager.nonrtric.svc.cluster.local"
+      port: 8095
+      securityMethods:
+      - PKI
+    Versions:
+      - ApiVersion: "v1"
+        Resources:
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: healthcheck
+          Uri: "/"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - POST
+          ResourceName: registrations
+          Uri: "/api-provider-management/registrations"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - PUT
+          - PATCH
+          - DELETE
+          ResourceName: registrations-domain_id
+          Uri: "~/api-provider-management/registrations/(?<registrationId>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          - POST
+          ResourceName: publisher
+          Uri: "~/published-apis/(?<apfId>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)/service-apis"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          - PUT
+          - PATCH
+          - DELETE
+          ResourceName: publisher-api_id
+          Uri: "~/published-apis/(?<apfId>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)/service-apis/(?<serviceApiId>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - POST
+          ResourceName: invoker
+          Uri: "/api-invoker-management/onboardedInvokers"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - PUT
+          - PATCH
+          - DELETE
+          ResourceName: invoker-invoker_id
+          Uri: "~/api-invoker-management/onboardedInvokers/(?<onboardingId>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: discovery
+          Uri: "/service-apis/allServiceAPIs"
+  ApiName: servicemanager-http
+
+# https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-plt-rappmanager/en/latest/rappmanager-api.html
+
+rappmanager:
+  AefProfiles:
+  - interfaceDescriptions:
+    - ipv4Addr: "rappmanager.nonrtric.svc.cluster.local"
+      port: 8080
+      securityMethods:
+      - PKI
+    - ipv4Addr: "rappmanager.nonrtric.svc.cluster.local"
+      port: 8433
+      securityMethods:
+      - PSK
+    Versions:
+      - ApiVersion: ""
+        Resources:
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          - POST
+          - PUT
+          - DELETE
+          ResourceName: "rapps-rappId"
+          Uri: "~/rapps/(?<rappId>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "rapps"
+          Uri: "/rapps"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          - PUT
+          - DELETE
+          ResourceName: "rapps-instance"
+          Uri: "~/rapps/(?<rappId>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)/instance/(?<rappInstanceId>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          - POST
+          ResourceName: "rapps-all-instances"
+          Uri: "~/rapps/(?<rappId>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)/instance"
+  ApiName: rapp-http
+
+# https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-plt-a1policymanagementservice/en/latest/pms-api.html
+
+policymanagementservice:
+  AefProfiles:
+  - interfaceDescriptions:
+    - ipv4Addr: "policymanagementservice.nonrtric.svc.cluster.local"
+      port: 8081
+      securityMethods:
+      - PKI
+    - ipv4Addr: "policymanagementservice.nonrtric.svc.cluster.local"
+      port: 8433
+      securityMethods:
+      - PSK
+    Versions:
+      - ApiVersion: ""
+        Resources:
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - PUT
+          ResourceName: "putPolicy"
+          Uri: "/a1-policy/v2/policies"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          - DELETE
+          ResourceName: "Policy"
+          Uri: "~/a1-policy/v2/policies/(?<policy_id>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "getPolicyIds"
+          Uri: "/a1-policy/v2/policies"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "getPolicyInstances"
+          Uri: "/a1-policy/v2/policy-instances"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "getPolicyStatus"
+          Uri: "~/a1-policy/v2/policies/(?<policy_id>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)/status"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "getPolicyTypeDefinition"
+          Uri: "~/a1-policy/v2/policy-types/(?<policytype_id>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "getPolicyTypes"
+          Uri: "/a1-policy/v2/policy-types"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "health"
+          Uri: "/actuator/health"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "healthPath"
+          Uri: "/actuator/health/**"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "heapdump"
+          Uri: "/actuator/heapdump"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "info"
+          Uri: "/actuator/info"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "ActuatorRootWebEndpoint"
+          Uri: "/actuator"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "logfile"
+          Uri: "/actuator/logfile"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "loggers"
+          Uri: "/actuator/loggers"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          - POST
+          ResourceName: "loggersName"
+          Uri: "~/actuator/loggers/(?<name>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "metrics"
+          Uri: "/actuator/metrics"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "metricsRequiredMetricName"
+          Uri: "~/actuator/metrics/(?<requiredMetricName>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - POST
+          ResourceName: "shutdown"
+          Uri: "/actuator/shutdown"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "threaddump"
+          Uri: "/actuator/threaddump"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          - PUT
+          ResourceName: "Configuration"
+          Uri: "/a1-policy/v2/configuration"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "getStatus"
+          Uri: "/a1-policy/v2/status"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "getStatusV1"
+          Uri: "/status"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "getRic"
+          Uri: "/a1-policy/v2/rics/ric"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "getRics"
+          Uri: "/a1-policy/v2/rics"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - DELETE
+          ResourceName: "deleteService"
+          Uri: "~/a1-policy/v2/services/(?<service_id>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - PUT
+          ResourceName: "keepAliveService"
+          Uri: "~/a1-policy/v2/services/(?<service_id>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)/keepalive"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - DELETE
+          ResourceName: "putService"
+          Uri: "/a1-policy/v2/services"
+  ApiName: a1-policy-http
+
+# https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-plt-informationcoordinatorservice/en/h-release/ics-api.html
+
+informationservice:
+  AefProfiles:
+  - interfaceDescriptions:
+    - ipv4Addr: "informationservice.nonrtric.svc.cluster.local"
+      port: 9082
+      securityMethods:
+      - PKI
+    - ipv4Addr: "informationservice.nonrtric.svc.cluster.local"
+      port: 9083
+      securityMethods:
+      - PSK
+    Versions:
+      - ApiVersion: "v1"
+        Resources:
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "IndividualEIType"
+          Uri: "~/A1-EI/eitypes/(?<eiTypeId>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "EIJobStatus"
+          Uri: "~/A1-EI/v1/eijobs/(?<eiJobId>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)/status"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "EITypeIdentifiers"
+          Uri: "/A1-EI/eitypes"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          - DELETE
+          - PUT
+          ResourceName: "IndividualEIJob"
+          Uri: "~/A1-EI/v1/eijobs/(?<eiJobId>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "EIJobIdentifiers"
+          Uri: "/A1-EI/v1/eijobs"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "ServiceStatus"
+          Uri: "/status"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "threaddump"
+          Uri: "/actuator/threaddump"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "loggers"
+          Uri: "/actuator/loggers"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "health"
+          Uri: "/actuator/health"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "healthPath"
+          Uri: "/actuator/health/**"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - POST
+          ResourceName: "shutdown"
+          Uri: "/actuator/shutdown"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "metrics"
+          Uri: "/actuator/metrics"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "metricsRequiredMetricName"
+          Uri: "~/actuator/metrics/(?<requiredMetricName>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "ActuatorRootWebEndpoint"
+          Uri: "/actuator"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "info"
+          Uri: "/actuator/info"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "logfile"
+          Uri: "/actuator/logfile"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          - POST
+          ResourceName: "loggersName"
+          Uri: "~/actuator/loggers/(?<name>[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*)"
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - GET
+          ResourceName: "heapdump"
+          Uri: "/actuator/heapdump"
+  ApiName: informationservice-http
diff --git a/servicemanager-preload/config-smo.yaml b/servicemanager-preload/config-smo.yaml
new file mode 100644 (file)
index 0000000..51f365c
--- /dev/null
@@ -0,0 +1,132 @@
+################################################################################
+#   Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.       #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   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.                                             #
+################################################################################
+
+---
+
+# Preload services for smo install
+
+policy-apex-pdp:
+  AefProfiles:
+  - interfaceDescriptions:
+    - ipv4Addr: "policy-apex-pdp.nonrtric.svc.cluster.local"
+      port: 6969
+      securityMethods:
+      - PKI
+    Versions:
+      - ApiVersion: ""
+        Resources:
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - DELETE
+          - GET
+          - PATCH
+          - POST
+          - PUT
+          ResourceName: root
+          Uri: "/"
+  ApiName: policy-apex-pdp-http
+
+policy-api:
+  AefProfiles:
+  - interfaceDescriptions:
+    - ipv4Addr: "policy-api.nonrtric.svc.cluster.local"
+      port: 6969
+      securityMethods:
+      - PKI
+    Versions:
+      - ApiVersion: ""
+        Resources:
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - DELETE
+          - GET
+          - PATCH
+          - POST
+          - PUT
+          ResourceName: root
+          Uri: "/"
+  ApiName: policy-api-http
+
+policy-pap:
+  AefProfiles:
+  - interfaceDescriptions:
+    - ipv4Addr: "policy-pap.nonrtric.svc.cluster.local"
+      port: 6969
+      securityMethods:
+      - PKI
+    - ipv4Addr: "policy-pap.nonrtric.svc.cluster.local"
+      port: 5005
+      securityMethods:
+      - PSK
+    Versions:
+      - ApiVersion: ""
+        Resources:
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - DELETE
+          - GET
+          - PATCH
+          - POST
+          - PUT
+          ResourceName: root
+          Uri: "/"
+  ApiName: policy-pap-http
+
+sdnc-oam:
+  AefProfiles:
+  - interfaceDescriptions:
+    - ipv4Addr: "sdnc-oam.nonrtric.svc.cluster.local"
+      port: 8282
+      securityMethods:
+      - PKI
+    - ipv4Addr: "sdnc-oam.nonrtric.svc.cluster.local"
+      port: 8202
+      securityMethods:
+      - PSK
+    Versions:
+      - ApiVersion: ""
+        Resources:
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - DELETE
+          - GET
+          - PATCH
+          - POST
+          - PUT
+          ResourceName: root
+          Uri: "/"
+  ApiName: sdnc-oam-http
+
+sdnc-web:
+  AefProfiles:
+  - interfaceDescriptions:
+    - ipv4Addr: "sdnc-web.nonrtric.svc.cluster.local"
+      port: 8080
+      securityMethods:
+      - PKI
+    Versions:
+      - ApiVersion: ""
+        Resources:
+        - CommType: REQUEST_RESPONSE
+          Operations:
+          - DELETE
+          - GET
+          - PATCH
+          - POST
+          - PUT
+          ResourceName: root
+          Uri: "/"
+  ApiName: sdnc-web-http
diff --git a/servicemanager-preload/servicemanager-preload.sh b/servicemanager-preload/servicemanager-preload.sh
new file mode 100755 (executable)
index 0000000..fcf4a82
--- /dev/null
@@ -0,0 +1,382 @@
+#!/bin/bash
+
+################################################################################
+#   Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.       #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   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.                                             #
+################################################################################
+
+function get_published_apis_payload() {
+
+    IFS=$'\n' read -d '' -r -a ipv4Ar <<< ${interfaceDescIpv4Addr}
+    IFS=$'\n' read -d '' -r -a portAr <<< ${interfaceDescPort}
+    IFS=$'\n' read -d '' -r -a securityMethodsAr <<< ${interfaceDescSecurityMethods}
+
+    interfaceDescArLen=${#ipv4Ar[@]}
+    >&2 echo "interfaceDescArLen: ${interfaceDescArLen}"
+
+    # Iterate over the array using array indexing
+    interfaceDescBlock=""
+    for (( i=0; i<interfaceDescArLen; i++ )); do
+        >&2 echo "ipv4Ar[$i]: ${ipv4Ar[$i]}"
+
+        interfaceDescItem="
+        {
+            \"ipv4Addr\": \"${ipv4Ar[$i]}\",
+            \"port\":  ${portAr[$i]},
+            \"securityMethods\":  ${securityMethodsAr[$i]}
+        }"
+        interfaceDescBlock="${interfaceDescBlock}${interfaceDescItem}, "
+        >&2 echo "interfaceDescItem: ${interfaceDescItem}"
+    done
+
+    # Trim the trailing space and comma
+    interfaceDescBlock="${interfaceDescBlock%??}"
+
+    >&2 echo "interfaceDescBlock: ${interfaceDescBlock}"
+
+
+    declare -a commType_array
+    read -r -a commType_array <<< "${resourcesAr["CommType"]}"
+
+    declare -a resourceName_array
+    read -r -a resourceName_array <<< "${resourcesAr["ResourceName"]}"
+
+    declare -a uri_array
+    read -r -a uri_array <<< "${resourcesAr["Uri"]}"
+
+    declare -a ops_array
+
+    ops_array=$(echo ${resourcesAr["Operations"]} | tr ' ' '*')
+
+    declare -a operations_array
+
+    IFS=',' read -r -a operations_array <<< "${ops_array}"
+
+    for operation in ${operations_array[@]}; do
+        >&2 echo "Operations Element: ${operation}"
+    done
+
+    ops_ar_length=${#operations_array[@]}
+
+    >&2 echo "ops_ar_length operations_array ${ops_ar_length}"
+
+    # Iterate over the array using array indexing
+    resourceBlock=""
+    for (( i=0; i<ops_ar_length; i++ )); do
+        IFS='*' read -r -a ops_per_resource <<< "${operations_array[$i]}"
+
+        resourceStart="
+        {
+            \"CommType\": \"${commType_array[$i]}\",
+            \"Operations\": [
+                "
+
+        # Print the array elements
+        resourceMid=""
+        for element in "${ops_per_resource[@]}"; do
+            resourceMid="${resourceMid}\"${element}\", "
+        done
+
+        resourceMid=$(sed 's/..$//' <<< "$resourceMid")
+        resourceMid="${resourceMid}
+            ],"
+
+
+        resourceEnd="
+            \"ResourceName\": \"${resourceName_array[$i]}\",
+            \"Uri\": \"${uri_array[$i]}\"
+        }"
+
+
+        resourceItem="${resourceStart}${resourceMid}${resourceEnd}"
+
+        resourceBlock="${resourceBlock}${resourceItem}, "
+    done
+
+    resourceBlock=${resourceBlock::-2}
+
+    payload="{
+    \"AefProfiles\": [
+        {
+            \"AefId\": \"${aefId}\",
+            \"interfaceDescriptions\": [
+                ${interfaceDescBlock}
+            ],
+            \"DomainName\": \"${domainName}\",
+            \"Protocol\": \"HTTP_1_1\",
+            \"Versions\": [
+                {
+                    \"ApiVersion\": ${ApiVersion},
+                    \"Resources\": [
+                    ${resourceBlock}
+                    ]
+                }
+            ]
+        }
+    ],
+    \"ApiName\": ${api_name},
+    \"Description\": \"Description,namespace,repoName,chartName,releaseName\"
+}"
+    >&2 echo "payload ${payload}"
+
+    echo $payload | jq .
+}
+
+function publish_service() {
+    echo "Publish  service  for $service_name"
+
+    aef_profiles=$(echo "$service" | jq -c '.value.AefProfiles')
+    api_name=$(echo "$service" | jq -c '.value.ApiName')
+
+    echo "$aef_profiles" | jq -c '.[]' | while read -r aef_profile; do
+
+        interfaceDescriptions=$(echo "$aef_profile" | jq -c '.interfaceDescriptions')
+
+        >&2 echo "interfaceDescriptions: ${interfaceDescriptions}";
+
+        interfaceDescIpv4Addr=$(echo $interfaceDescriptions | jq -r .[]."ipv4Addr")
+        interfaceDescPort=$(echo $interfaceDescriptions | jq .[]."port")
+        interfaceDescSecurityMethods=$(echo $interfaceDescriptions | jq -c .[]."securityMethods")
+
+        >&2 echo "interfaceDescIpv4Addr: ${interfaceDescIpv4Addr}";
+        >&2 echo "interfaceDescPort: ${interfaceDescPort}";
+        >&2 echo "interfaceDescSecurityMethods: ${interfaceDescSecurityMethods}";
+
+        versions=$(echo "$aef_profile" | jq -c '.Versions[]')
+
+        ApiVersion=$(echo "$versions" | jq -c '.ApiVersion')
+        >&2 echo "ApiVersion: $ApiVersion"
+
+        Resources=$(echo "$versions" | jq -c '.Resources[]')
+
+        # Parse Resources
+        declare -A resourcesAr
+
+        commTypeCsv=""
+
+        for row in $(echo "$Resources" | jq -c '.CommType'); do
+            commType=$(echo "$row" | jq -r '.');
+            >&2 echo "commType: $commType";
+            commTypeCsv="${commTypeCsv}${commType} "
+            >&2 echo "Building commTypeCsv ${commTypeCsv}"
+        done
+
+        commTypeCsv=$(echo "$commTypeCsv" | xargs)
+        resourcesAr["CommType"]=${commTypeCsv}
+
+        resourceNameCsv=""
+        for row in $(echo "$Resources" | jq -c '.ResourceName'); do
+            resourceName=$(echo "$row" | jq -r '.');
+            >&2 echo "resourceName: $resourceName";
+            resourceNameCsv="${resourceNameCsv}${resourceName} "
+            >&2 echo "Building resourceNameCsv ${resourceNameCsv}"
+        done
+        resourceNameCsv=$(echo "$resourceNameCsv" | xargs)
+        resourcesAr["ResourceName"]=$resourceNameCsv
+
+        uriCsv=""
+        for row in $(echo "$Resources" | jq -c '.Uri'); do
+            uri=$(echo "$row" | jq -r '.');
+            >&2 echo "uri: $uri";
+            uriCsv="${uriCsv}${uri} "
+            >&2 echo "Building uriCsv ${uriCsv}"
+        done
+        uriCsv=$(echo "$uriCsv" | xargs)
+        resourcesAr["Uri"]=$uriCsv
+
+        operationsCsv=""
+        for row in $(echo "$Resources" | jq -c '.Operations'); do
+            operations=$(echo "$row" | jq -r '.[]')
+            >&2 echo "operations: $operations";
+            operationsCsv="${operationsCsv}${operations},"
+            >&2 echo "Building operationsCsv ${operationsCsv}"
+        done
+        resourcesAr["Operations"]=$operationsCsv
+
+        payload=$(get_published_apis_payload)
+
+        # Make the REST call
+        url="http://${first_node_ip}:${servicemanager_node_port}/published-apis/v1/${apfId}/service-apis"
+        >&2 echo "published-apis url: ${url}"
+        response=$(curl -s -X POST -H "Content-Type: application/json" -d "$payload" "$url")
+
+        ret=$?
+        if [ $ret -ne 0 ]; then
+            echo "REST call to Service Manager/published-apis failed, error code $ret"
+            return $ret
+        fi
+
+        resp_code=$(echo $response | jq -r '.status')
+        if [ "$resp_code" != "null" ] && [ "$resp_code" != "201" ]; then
+            echo "Failed to publish service $service_name with response code $resp_code"
+        fi
+
+        response=$(echo "${response}" | jq .)
+        >&2 echo "Response for published service $service_name: $response"
+    done
+    return 0
+}
+
+function register_provider() {
+    # Make the REST call
+    url="http://${first_node_ip}:${servicemanager_node_port}/api-provider-management/v1/registrations"
+    response=$(curl -s -X POST -H "Content-Type: application/json" -d "$payload" "$url")
+
+    ret=$?
+    if [ $ret -ne 0 ]; then
+        echo "REST call to Service Manager/api-provider-management failed, error code $ret"
+        status="$ret"
+    else
+        check_resp=$(jq --argjson resp "$response" -n '$resp.apiProvDomId')
+        if [ $check_resp != "null" ]; then
+            status=201
+        else
+            status=$(jq --argjson resp "$response" -n '$resp.status')
+        fi
+    fi
+    echo $status
+}
+
+function get_registrations_payload() {
+    payload="{
+    \"apiProvDomInfo\": \"${domainName}\",
+    \"apiProvFuncs\": [
+        {
+            \"apiProvFuncInfo\": \"${apf_info}\",
+            \"apiProvFuncRole\": \"APF\",
+            \"regInfo\": {
+                \"apiProvPubKey\": \"APF-PublicKey\"
+            }
+        },
+        {
+            \"apiProvFuncInfo\": \"${aef_info}\",
+            \"apiProvFuncRole\": \"AEF\",
+            \"regInfo\": {
+                \"apiProvPubKey\": \"AEF-PublicKey\"
+            }
+        }
+    ],
+    \"regSec\": \"${service_name}-regsec\"
+}"
+    echo $payload
+}
+
+function register_apf() {
+    echo "Register provider for ${service_name}"
+    # Prepare the JSON payload for the REST calls
+    apf_info="${service_name} as APF"
+    aef_info="${service_name} as AEF"
+    aefId="AEF_id_${service_name}_as_AEF"
+    apfId="APF_id_${service_name}_as_APF"
+
+    payload=$(get_registrations_payload)
+    >&2 echo "Registration payload: $payload"
+    resp=$(register_provider)
+
+    if [ $resp != 201 ]; then
+        >&2 echo "Failed to register provider with error code ${resp}"
+        return $resp
+    fi
+    return 0
+}
+
+function find_running_services_from_config() {
+    result=""
+
+    # Extract service names from YAML using yq and strip leading/trailing whitespace
+    SERVICE_NAMES=$(yq eval '. | keys[]' "$yaml_file")
+
+    # Check each service using kubectl
+    for service in $SERVICE_NAMES; do
+        >&2 echo "Checking service: $service in nonrtric"
+        # Use kubectl get to check if the service exists and capture the output
+        SERVICE_STATUS=$(kubectl get service "$service" -n nonrtric)
+
+        if [ $? = 0 ]; then
+            >&2 echo "Service $service is found in nonrtric"
+            result+="$service "
+        else
+            >&2 echo "Service $service is not running in nonrtric"
+            SERVICE_STATUS=$(kubectl get service "$service" -n onap)
+            if [ $? = 0 ]; then
+                >&2 echo "Service $service is found in onap"
+                result+="$service "
+            else
+                >&2 echo "Service $service is not found in onap"
+            fi
+        fi
+    done
+
+    # Trim trailing whitespace
+    result=$(echo "$result" | xargs)
+    echo $result
+}
+
+function publish_services_from_config() {
+    echo "Find running services"
+    domainName="kong"
+    running_services_list=$(find_running_services_from_config)
+
+    # Iterate through the configured services
+    echo "$json_config" | jq -c 'to_entries[]' | while read -r service; do
+        service_name=$(echo "$service" | jq -r '.key')
+        if echo "$running_services_list" | grep -q "$service_name"; then
+            register_apf
+            ret=$?
+            if [ $ret -ne 0 ]; then
+                break
+            fi
+
+            publish_service
+            ret=$?
+            if [ $ret -ne 0 ]; then
+                break
+            fi
+        fi
+    done
+}
+
+# Ensure yq and jq are installed
+if ! command -v yq &> /dev/null; then
+    >&2 echo "yq is not installed. Installing yq..."
+    sudo snap install yq --channel=v4/stable
+fi
+
+if ! command -v jq &> /dev/null; then
+    >&2 echo "jq is not installed. Installing jq..."
+    sudo snap install jq
+fi
+
+# Read and parse the YAML file
+yaml_file="${1:-config.yaml}"
+json_config=$(yq eval "$yaml_file" -o=json)
+
+echo "Preloading Service Manager from ${yaml_file}"
+
+# Get our Node IP and nodePort
+first_node_ip=$(kubectl get nodes -o jsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}')
+servicemanager_node_port=$(kubectl get service servicemanager -n nonrtric -o jsonpath='{.spec.ports[0].nodePort}')
+
+echo "Waiting for capifcore deployment"
+kubectl wait --for=condition=Available -n nonrtric --timeout=300s deploy/capifcore
+
+echo "Waiting for servicemanager deployment"
+kubectl wait --for=condition=Available -n nonrtric --timeout=300s deploy/servicemanager
+
+echo "Waiting for kong deployment"
+kubectl wait --for=condition=Available -n nonrtric --timeout=300s deploy/oran-nonrtric-kong
+
+publish_services_from_config
+
+echo "Service Manager preload completed for ${yaml_file}"
index a2145ae..b2459ae 100644 (file)
@@ -1,7 +1,7 @@
-#  ============LICENSE_START===============================================
+#  ============LICENSE_START================================================
 #  Copyright (C) 2020-2023 Nordix Foundation. All rights reserved.
-#  Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
-#  ========================================================================
+#  Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved.
+#  =========================================================================
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
 #  You may obtain a copy of the License at
 #  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.
-#  ============LICENSE_END=================================================
+#  ============LICENSE_END==================================================
 
 image:
   repository: 'nexus3.o-ran-sc.org:10002/o-ran-sc'
   name: a1-simulator
-  tag: 2.6.1
+  tag: 2.7.0
   pullPolicy: IfNotPresent
 service:
   type: ClusterIP
index 8d9cf80..fb4e1cd 100644 (file)
@@ -20,9 +20,9 @@
 
 imagePullPolicy: IfNotPresent
 image:
-  registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc'
+  registry: 'nexus3.o-ran-sc.org:10004/o-ran-sc'
   name: nonrtric-plt-capifcore
-  tag: 1.2.0
+  tag: 1.4.0
 service:
   type: ClusterIP
   ports:
index 40665dc..62cc766 100644 (file)
@@ -1,5 +1,6 @@
 ################################################################################
-#   Copyright (c) 2021 Nordix Foundation.                                      #
+#  Copyright (c) 2021-22 Nordix Foundation. All rights reserved.               #
+#  Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved.   #
 #                                                                              #
 #   Licensed under the Apache License, Version 2.0 (the "License");            #
 #   you may not use this file except in compliance with the License.           #
@@ -22,7 +23,7 @@ imagePullPolicy: IfNotPresent
 image:
   registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
   name: "nonrtric-plt-dmaapadapter"
-  tag: 1.3.0
+  tag: 1.4.0
 service:
   type: ClusterIP
   ports:
index f75f811..c7027e5 100644 (file)
@@ -42,7 +42,7 @@ secrets:
 # Application configuration defaults.
 #################################################################
 # application image
-image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-participant-impl-dme:0.0.1
+image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-participant-impl-dme:0.1.0
 pullPolicy: Always
 
 componentName: &componentName policy-clamp-ac-dme-ppnt
index e34f886..cac8329 100644 (file)
@@ -1,7 +1,7 @@
-#  ============LICENSE_START===============================================
+#  ============LICENSE_START================================================
 #  Copyright (C) 2020-2023 Nordix Foundation. All rights reserved.
-#  Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
-#  ========================================================================
+#  Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved.
+#  =========================================================================
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
 #  You may obtain a copy of the License at
@@ -13,7 +13,7 @@
 #  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.
-#  ============LICENSE_END=================================================
+#  ============LICENSE_END==================================================
 
 # Default values for Policy Management Service.
 # This is a YAML-formatted file.
@@ -23,7 +23,7 @@ imagePullPolicy: IfNotPresent
 image:
   registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
   name: nonrtric-plt-a1policymanagementservice
-  tag: 2.7.0
+  tag: 2.8.0
 service:
   type: NodePort
   ports:
index dd7a2c7..1429b07 100644 (file)
@@ -24,7 +24,7 @@ imagePullPolicy: IfNotPresent
 image:
   registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
   name: nonrtric-plt-rappmanager
-  tag: 0.0.1
+  tag: 0.1.0
 service:
   type: ClusterIP
   ports:
index fb53671..28a4974 100644 (file)
@@ -20,7 +20,7 @@ imagePullPolicy: IfNotPresent
 image:
   registry: 'nexus3.o-ran-sc.org:10004/o-ran-sc'
   name: nonrtric-plt-servicemanager
-  tag: 0.1.2
+  tag: 0.1.3
 service:
   httpName: http
   ports:
index d91243d..4f58600 100755 (executable)
@@ -63,3 +63,11 @@ if [ "$INSTALL_SERVICEMANAGER" == "true" ]; then
 fi
 
 helm install --debug oran-nonrtric local/nonrtric --namespace nonrtric -f $OVERRIDEYAML --set nonrtric.persistence.mountPath="/dockerdata-nfs/deployment-$2"
+
+if [ "$INSTALL_SERVICEMANAGER" == "true" ]; then
+    pushd ../../../servicemanager-preload
+    # Send stderr to /dev/null to turn off chatty logging
+    ./servicemanager-preload.sh config-nonrtric.yaml 2>/dev/null
+    ./servicemanager-preload.sh config-smo.yaml 2>/dev/null
+    popd
+fi