String based replacement added to add the proper chartmuseum urls in the configuration.
Issue-ID: NONRTRIC-985
Change-Id: I0b533b0a99cb329fabe6821fa4c3d8187f673da3
Signed-off-by: aravind.est <aravindhan.a@est.tech>
public String getInstantiationPayload(Rapp rapp, RappACMInstance rappACMInstance, UUID compositionId) {
return getPayload(rapp,
getResourceUri(RappCsarPathProvider.ACM_INSTANCES_LOCATION, rappACMInstance.getInstance())).replaceAll(
- "COMPOSITIONID", String.valueOf(compositionId));
+ "DO_NOT_CHANGE_THIS_COMPOSITION_ID", String.valueOf(compositionId));
}
public ByteArrayResource getArtifactPayload(Rapp rapp, String location) {
descriptor_version: 1.0\r
schema_version: 2.0\r
function_description: rApp description\r
- provider: EST\r
+ provider: Ericsson Software Technology (O-RAN SC NONRTRIC team)\r
application_name: rapp-all\r
application_version: 1.0\r
artifacts:\r
properties:\r
artifact_type: "helm_chart"\r
target_server: "chartmuseum"\r
- target_server_uri: "http://10.101.0.106:8879/charts/api/charts"\r
+ target_server_uri: "UPDATE_THIS_CHART_MUSEUM_POST_CHARTS_URI"\r
item_id: 1\r
oru-app:\r
type: tosca.artifacts.asd.deploymentItem\r
properties:\r
artifact_type: "helm_chart"\r
target_server: "chartmuseum"\r
- target_server_uri: "http://10.101.0.106:8879/charts/api/charts"\r
+ target_server_uri: "UPDATE_THIS_CHART_MUSEUM_POST_CHARTS_URI"\r
item_id: 2
\ No newline at end of file
{
"name": "A1PMSInstance0",
"version": "1.0.1",
- "compositionId": "COMPOSITIONID",
+ "compositionId": "DO_NOT_CHANGE_THIS_COMPOSITION_ID",
"description": "Demo automation composition instance 0",
"elements": {
"709c62b3-8918-41b9-a747-d21eb79c6c12": {
{
"name": "AllInstance0",
"version": "1.0.1",
- "compositionId": "COMPOSITIONID",
+ "compositionId": "DO_NOT_CHANGE_THIS_COMPOSITION_ID",
"description": "Demo automation composition instance",
"elements": {
"709c62b3-8918-41b9-a747-d21eb79c6c12": {
"podName": "ransliceassurance",
"repository": {
"repoName": "local",
- "address": "http://10.101.2.41:8879/charts"
+ "address": "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI"
}
}
}
{
"name": "DemoInstance0",
"version": "1.0.1",
- "compositionId": "COMPOSITIONID",
+ "compositionId": "DO_NOT_CHANGE_THIS_COMPOSITION_ID",
"description": "Demo automation composition instance 0",
"elements": {
"709c62b3-8918-41b9-a747-d21eb79c6c21": {
"podName": "ransliceassurance",
"repository": {
"repoName": "local",
- "address": "http://10.101.2.41:8879/charts"
+ "address": "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI"
}
}
}
{
"name": "KserveInstance0",
"version": "1.0.1",
- "compositionId": "COMPOSITIONID",
+ "compositionId": "DO_NOT_CHANGE_THIS_COMPOSITION_ID",
"description": "Demo automation composition instance 0",
"elements": {
"709c62b3-8918-41b9-a747-d21eb79c6c20": {
TOSCA-Meta-File-Version: 1.0\r
CSAR-Version: 1.0\r
-Created-By: EST\r
+Created-By: Ericsson Software Technology (O-RAN SC NONRTRIC team)\r
Entry-Definitions: Definitions/asd.yaml\r
ETSI-Entry-Manifest: asd.mf
\ No newline at end of file
file: "Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz"\r
properties:\r
artifact_type: "helm_chart"\r
- itemId: 1\r
+ target_server: "chartmuseum"\r
+ target_server_uri: "UPDATE_THIS_CHART_MUSEUM_POST_CHARTS_URI"\r
+ item_id: 1\r
type: string\r
constraints:\r
- valid_values: ["helm_chart"]\r
+ target_server:\r
+ description: >\r
+ Specify target server for artifact.\r
+ required: true\r
+ type: string\r
+ constraints:\r
+ - valid_values: [ "chartmuseum" ]\r
+ target_server_uri:\r
+ description: "URI of the target server"\r
+ required: true\r
+ type: string
\ No newline at end of file
{\r
"name": "K8DemoInstance0",\r
"version": "1.0.1",\r
- "compositionId": "COMPOSITIONID",\r
+ "compositionId": "DO_NOT_CHANGE_THIS_COMPOSITION_ID",\r
"description": "Demo automation composition instance 0",\r
"elements": {\r
"d7be552e-bcc5-4478-b64d-797dbaec8f55": {\r
"podName": "hello-world-chart",\r
"repository": {\r
"repoName": "local",\r
- "address": "http://10.101.1.90:8879/charts"\r
+ "address": "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI"\r
}\r
}\r
}\r
type: string\r
constraints:\r
- valid_values: ["helm_chart"]\r
+ target_server:\r
+ description: >\r
+ Specify target server for artifact.\r
+ required: true\r
+ type: string\r
+ constraints:\r
+ - valid_values: [ "chartmuseum" ]\r
+ target_server_uri:\r
+ description: "URI of the target server"\r
+ required: true\r
+ type: string
\ No newline at end of file
{\r
"name": "DemoKserveInstance0",\r
"version": "1.0.1",\r
- "compositionId": "COMPOSITIONID",\r
+ "compositionId": "DO_NOT_CHANGE_THIS_COMPOSITION_ID",\r
"description": "Demo automation composition instance 0",\r
"elements": {\r
"709c62b3-8918-41b9-a747-d21eb79c6c20": {\r
echo "Patching Kserve..."
./patch-kserve.sh
+echo "Patching Sample rApps..."
+./patch-sample-rapps.sh
+
echo "Rapp Manager installation completed."
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+# ============LICENSE_START===============================================
+# 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.
+# ============LICENSE_END=================================================
+#
+
+echo "######### Patching Sample rApps #########"
+
+CWD=$(pwd)
+export WORKSPACE="$CWD/../../sample-rapp-generator"
+
+IP_ADDRESS=$(hostname -I | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 | awk '{print $1}')
+echo "IP Address : $IP_ADDRESS"
+
+CHART_REPO_GET_URI=${CHART_REPO_GET_URI:-'http://'$IP_ADDRESS':8879/charts'}
+CHART_REPO_POST_URI=${CHART_REPO_POST_URI:-'http://'$IP_ADDRESS':8879/charts/api/charts'}
+
+echo "Replacing charts repo post url in yaml files....."
+echo "Chart repository post URI : $CHART_REPO_POST_URI"
+for file in $(find $WORKSPACE -type f -name "*.yaml"); do
+ sed -i "s|UPDATE_THIS_CHART_MUSEUM_POST_CHARTS_URI|${CHART_REPO_POST_URI}|g" "$file"
+ if grep -q "$CHART_REPO_POST_URI" "$file"; then
+ echo "$file is updated."
+ fi
+done
+
+echo "Replacing charts repo get url in json files....."
+echo "Chart repository get URI : $CHART_REPO_GET_URI"
+for file in $(find $WORKSPACE -type f -name "*.json"); do
+ sed -i "s|UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI|${CHART_REPO_GET_URI}|g" "$file"
+ if grep -q "$CHART_REPO_GET_URI" "$file"; then
+ echo "$file is updated."
+ fi
+done
+
+echo "Patching Sample rApps completed."