From 5dc884314efafc74fc50ea51b5a77a0f0c78bbe5 Mon Sep 17 00:00:00 2001 From: lapentafd Date: Mon, 30 Sep 2024 14:01:20 +0100 Subject: [PATCH] Adding new Simple consumer producer rapp packages Issue-ID: NONRTRIC-1009 Change-Id: I7d7268ead6b236a476e39622916133544c9f0187 Signed-off-by: lapentafd --- .../Deployment/HELM/ics-consumer/.helmignore | 23 ++ .../Deployment/HELM/ics-consumer/Chart.yaml | 6 + .../templates/consumer-deployment.yaml | 41 +++ .../ics-consumer/templates/consumer-service.yaml | 31 ++ .../Deployment/HELM/ics-consumer/values.yaml | 32 +++ .../rapp-simple-ics-consumer/Definitions/asd.yaml | 48 ++++ .../Definitions/asd_types.yaml | 90 ++++++ .../Files/Acm/definition/compositions.json | 311 +++++++++++++++++++++ .../Files/Acm/instances/k8s-instance.json | 68 +++++ .../Files/Dme/consumerinfotypes/type1.json | 9 + .../Dme/infoconsumers/ics-simple-consumer.json | 12 + .../TOSCA-Metadata/TOSCA.meta | 5 + .../rapp-simple-ics-consumer/asd.mf | 15 + .../Deployment/HELM/ics-producer/.helmignore | 23 ++ .../Deployment/HELM/ics-producer/Chart.yaml | 6 + .../templates/producer-deployment.yaml | 41 +++ .../ics-producer/templates/producer-service.yaml | 31 ++ .../Deployment/HELM/ics-producer/values.yaml | 32 +++ .../rapp-simple-ics-producer/Definitions/asd.yaml | 48 ++++ .../Definitions/asd_types.yaml | 90 ++++++ .../Files/Acm/definition/compositions.json | 311 +++++++++++++++++++++ .../Files/Acm/instances/k8s-instance.json | 68 +++++ .../Dme/infoproducers/ics-simple-producer.json | 7 + .../Files/Dme/producerinfotypes/type1.json | 9 + .../TOSCA-Metadata/TOSCA.meta | 5 + .../rapp-simple-ics-producer/asd.mf | 13 + scripts/install/patch-sample-rapps.sh | 16 +- 27 files changed, 1388 insertions(+), 3 deletions(-) create mode 100644 sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/.helmignore create mode 100644 sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/Chart.yaml create mode 100644 sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/templates/consumer-deployment.yaml create mode 100644 sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/templates/consumer-service.yaml create mode 100644 sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/values.yaml create mode 100644 sample-rapp-generator/rapp-simple-ics-consumer/Definitions/asd.yaml create mode 100644 sample-rapp-generator/rapp-simple-ics-consumer/Definitions/asd_types.yaml create mode 100644 sample-rapp-generator/rapp-simple-ics-consumer/Files/Acm/definition/compositions.json create mode 100644 sample-rapp-generator/rapp-simple-ics-consumer/Files/Acm/instances/k8s-instance.json create mode 100644 sample-rapp-generator/rapp-simple-ics-consumer/Files/Dme/consumerinfotypes/type1.json create mode 100644 sample-rapp-generator/rapp-simple-ics-consumer/Files/Dme/infoconsumers/ics-simple-consumer.json create mode 100644 sample-rapp-generator/rapp-simple-ics-consumer/TOSCA-Metadata/TOSCA.meta create mode 100644 sample-rapp-generator/rapp-simple-ics-consumer/asd.mf create mode 100644 sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/.helmignore create mode 100644 sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/Chart.yaml create mode 100644 sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/templates/producer-deployment.yaml create mode 100644 sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/templates/producer-service.yaml create mode 100644 sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/values.yaml create mode 100644 sample-rapp-generator/rapp-simple-ics-producer/Definitions/asd.yaml create mode 100644 sample-rapp-generator/rapp-simple-ics-producer/Definitions/asd_types.yaml create mode 100644 sample-rapp-generator/rapp-simple-ics-producer/Files/Acm/definition/compositions.json create mode 100644 sample-rapp-generator/rapp-simple-ics-producer/Files/Acm/instances/k8s-instance.json create mode 100644 sample-rapp-generator/rapp-simple-ics-producer/Files/Dme/infoproducers/ics-simple-producer.json create mode 100644 sample-rapp-generator/rapp-simple-ics-producer/Files/Dme/producerinfotypes/type1.json create mode 100644 sample-rapp-generator/rapp-simple-ics-producer/TOSCA-Metadata/TOSCA.meta create mode 100644 sample-rapp-generator/rapp-simple-ics-producer/asd.mf diff --git a/sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/.helmignore b/sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/.helmignore @@ -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/sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/Chart.yaml b/sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/Chart.yaml new file mode 100644 index 0000000..8b972e8 --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: ics-consumer +description: A Helm chart for Kubernetes +type: application +version: 0.1.0 +appVersion: "1.16.0" diff --git a/sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/templates/consumer-deployment.yaml b/sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/templates/consumer-deployment.yaml new file mode 100644 index 0000000..640607e --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/templates/consumer-deployment.yaml @@ -0,0 +1,41 @@ +# +# ========================LICENSE_START================================= +# O-RAN-SC +# +# Copyright (C) 2024: OpenInfra Foundation Europe +# +# 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=================================== +# +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.consumer.name }} +spec: + replicas: {{ .Values.consumer.replicaCount }} + selector: + matchLabels: + app: {{ .Values.consumer.name }} + template: + metadata: + labels: + app: {{ .Values.consumer.name }} + spec: + containers: + - name: {{ .Values.consumer.name }} + image: "{{ .Values.consumer.image.repository }}:{{ .Values.consumer.image.tag }}" + ports: + - containerPort: {{ .Values.consumer.service.port }} + env: + - name: SPRING_KAFKA_SERVER + value: "{{ .Values.kafka.host }}:{{ .Values.kafka.port }}" diff --git a/sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/templates/consumer-service.yaml b/sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/templates/consumer-service.yaml new file mode 100644 index 0000000..6b33838 --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/templates/consumer-service.yaml @@ -0,0 +1,31 @@ +# +# ========================LICENSE_START================================= +# O-RAN-SC +# +# Copyright (C) 2024: OpenInfra Foundation Europe +# +# 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=================================== +# +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.consumer.name }} +spec: + type: NodePort + ports: + - port: {{ .Values.consumer.service.port }} + targetPort: {{ .Values.consumer.service.port }} + nodePort: {{ .Values.consumer.service.nodePort }} + selector: + app: {{ .Values.consumer.name }} diff --git a/sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/values.yaml b/sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/values.yaml new file mode 100644 index 0000000..cb661e7 --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-consumer/Artifacts/Deployment/HELM/ics-consumer/values.yaml @@ -0,0 +1,32 @@ +# +# ========================LICENSE_START================================= +# O-RAN-SC +# +# Copyright (C) 2024: OpenInfra Foundation Europe +# +# 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=================================== +# +consumer: + name: kafka-consumer + replicaCount: 1 + image: + repository: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-sample-simple-icsconsumer + tag: 0.0.1 + service: + port: 9090 + nodePort: 31112 + +kafka: + host: kafka.default.svc.cluster.local + port: 9092 diff --git a/sample-rapp-generator/rapp-simple-ics-consumer/Definitions/asd.yaml b/sample-rapp-generator/rapp-simple-ics-consumer/Definitions/asd.yaml new file mode 100644 index 0000000..824deda --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-consumer/Definitions/asd.yaml @@ -0,0 +1,48 @@ +# ============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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +tosca_definitions_version: tosca_simple_yaml_1_2 + +description: rApp ICS Consumer + +imports: + - asd_types.yaml + +topology_template: + node_templates: + applicationServiceDescriptor: + type: tosca.nodes.asd + description: "rapp-ics-consumer" + properties: + descriptor_id: 9be3038d-d0ed-4d8a-b3f8-13c5329aae17 + descriptor_invariant_id: 9be3038d-d0ed-4d8a-b3f8-13c5329aae18 + descriptor_version: 1.0 + schema_version: 2.0 + function_description: rApp description + provider: Ericsson Software Technology (O-RAN SC NONRTRIC team) + application_name: rapp-ics-consumer + application_version: 1.0 + artifacts: + consumer: + type: tosca.artifacts.asd.deploymentItem + file: "Artifacts/Deployment/HELM/ics-consumer-0.1.0.tgz" + properties: + artifact_type: "helm_chart" + target_server: "chartmuseum" + target_server_uri: "UPDATE_THIS_CHART_MUSEUM_POST_CHARTS_URI" + item_id: 1 diff --git a/sample-rapp-generator/rapp-simple-ics-consumer/Definitions/asd_types.yaml b/sample-rapp-generator/rapp-simple-ics-consumer/Definitions/asd_types.yaml new file mode 100644 index 0000000..c4de6ad --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-consumer/Definitions/asd_types.yaml @@ -0,0 +1,90 @@ +# ============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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +tosca_definitions_version: tosca_simple_yaml_1_2 +description: ASD types definitions version 0.1 +node_types: + tosca.nodes.asd: + derived_from: tosca.nodes.Root + description: "The ASD node type" + version: 0.1 + properties: + descriptor_id: + type: string # UUID + required: true + description: Identifier of this ASD. It is in UUID format as specified in RFC 4122 + descriptor_invariant_id: + type: string # UUID + required: true + description: > + Identifier of this descriptor in a version independent manner. This attribute + is invariant across versions of ASD. It is in UUID format as specified in RFC 4122 + descriptor_version: + type: string + required: true + description: Identifies the version of the ASD. + schema_version: + type: string + required: true + description: Identifies the Identifies the version of this ASD’s schema. + function_description: + type: string + required: false + description: Description of the application service described by this ASD. + provider: + type: string + required: true + description: Identifies the provider of the ASD. + application_name: + type: string + required: true + description: Name to identify the application service described by this ASD + application_version: + type: string + required: true + description: Identifies the version of the application service described by this ASD. + +artifact_types: +tosca.artifacts.asd.deploymentItem: + version: 0.1 + derived_from: tosca.artifacts.Root + description: "Describes the artifact type of asd deployment item" + file: "Relative path of the artifact in the package" + properties: + item_id: + description: "The identifier of this asd deployment item" + required: true + type: string + artifact_type: + description: > + Specify artifact type. + required: true + type: string + constraints: + - valid_values: ["helm_chart"] + target_server: + description: > + Specify target server for artifact. + required: true + type: string + constraints: + - valid_values: [ "chartmuseum" ] + target_server_uri: + description: "URI of the target server" + required: true + type: string \ No newline at end of file diff --git a/sample-rapp-generator/rapp-simple-ics-consumer/Files/Acm/definition/compositions.json b/sample-rapp-generator/rapp-simple-ics-consumer/Files/Acm/definition/compositions.json new file mode 100644 index 0000000..cf4cb65 --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-consumer/Files/Acm/definition/compositions.json @@ -0,0 +1,311 @@ +{ + "tosca_definitions_version": "tosca_simple_yaml_1_3", + "data_types": { + "onap.datatypes.ToscaConceptIdentifier": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "name": { + "type": "string", + "required": true + }, + "version": { + "type": "string", + "required": true + } + } + }, + "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest": { + "version": "1.0.0", + "derived_from": "tosca.datatypes.Root", + "properties": { + "restRequestId": { + "type": "onap.datatypes.ToscaConceptIdentifier", + "type_version": "0.0.0", + "required": true, + "description": "The name and version of a REST request to be sent to a REST endpoint" + }, + "httpMethod": { + "type": "string", + "required": true, + "constraints": [ + { + "valid_values": [ + "POST", + "PUT", + "GET", + "DELETE" + ] + } + ], + "description": "The REST method to use" + }, + "path": { + "type": "string", + "required": true, + "description": "The path of the REST request relative to the base URL" + }, + "body": { + "type": "string", + "required": false, + "description": "The body of the REST request for PUT and POST requests" + }, + "expectedResponse": { + "type": "integer", + "required": true, + "constraints": [ + { + "in_range": [ + 100, + 599 + ] + } + ], + "description": "THe expected HTTP status code for the REST request" + } + } + }, + "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity": { + "version": "1.0.0", + "derived_from": "tosca.datatypes.Root", + "properties": { + "configurationEntityId": { + "type": "onap.datatypes.ToscaConceptIdentifier", + "type_version": "0.0.0", + "required": true, + "description": "The name and version of a Configuration Entity to be handled by the HTTP Automation Composition Element" + }, + "restSequence": { + "type": "list", + "entry_schema": { + "type": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest", + "type_version": "1.0.0" + }, + "description": "A sequence of REST commands to send to the REST endpoint" + } + } + } + }, + "node_types": { + "org.onap.policy.clamp.acm.Participant": { + "version": "1.0.1", + "derived_from": "tosca.nodetypes.Root", + "properties": { + "provider": { + "type": "string", + "required": false + } + } + }, + "org.onap.policy.clamp.acm.AutomationCompositionElement": { + "version": "1.0.1", + "derived_from": "tosca.nodetypes.Root", + "properties": { + "provider": { + "type": "string", + "required": false + }, + "participantType": { + "type": "onap.datatypes.ToscaConceptIdentifier", + "required": true + }, + "startPhase": { + "type": "integer", + "required": false, + "constraints": [ + { + "greater-or-equal": 0 + } + ], + "metadata": { + "common": true + }, + "description": "A value indicating the start phase in which this automation composition element will be started, the first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped in reverse start phase order. Automation Composition Elements with the same start phase are started and stopped simultaneously" + }, + "passiveToRunningTimeout": { + "type": "integer", + "required": false, + "constraints": [ + { + "greater_or_equal": 0 + } + ], + "default": 60, + "metadata": { + "common": true + }, + "description": "The maximum time in seconds to wait for a state chage from passive to running" + }, + "runningToPassiveTimeout": { + "type": "integer", + "required": false, + "constraints": [ + { + "greater_or_equal": 0 + } + ], + "default": 60, + "metadata": { + "common": true + }, + "description": "The maximum time in seconds to wait for a state chage from running to passive" + }, + "passiveToUninitializedTimeout": { + "type": "integer", + "required": false, + "constraints": [ + { + "greater_or_equal": 0 + } + ], + "default": 60, + "metadata": { + "common": true + }, + "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized" + } + } + }, + "org.onap.policy.clamp.acm.AutomationComposition": { + "version": "1.0.1", + "derived_from": "tosca.nodetypes.Root", + "properties": { + "provider": { + "type": "string", + "required": false, + "metadata": { + "common": true + } + }, + "elements": { + "type": "list", + "required": true, + "metadata": { + "common": true + }, + "entry_schema": { + "type": "onap.datatypes.ToscaConceptIdentifier" + } + } + } + }, + "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement": { + "version": "1.0.0", + "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement", + "properties": { + "chart": { + "type": "string", + "required": true + }, + "configs": { + "type": "list", + "required": false + }, + "requirements": { + "type": "string", + "required": false + }, + "templates": { + "type": "list", + "required": false, + "entry_schema": null + }, + "values": { + "type": "string", + "required": true + } + } + }, + "org.onap.policy.clamp.acm.HttpAutomationCompositionElement": { + "version": "1.0.0", + "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement", + "properties": { + "baseUrl": { + "type": "string", + "required": true, + "description": "The base URL to be prepended to each path, identifies the host for the REST endpoints." + }, + "httpHeaders": { + "type": "map", + "required": false, + "entry_schema": { + "type": "string" + }, + "description": "HTTP headers to send on REST requests" + }, + "configurationEntities": { + "type": "map", + "required": true, + "entry_schema": { + "type": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity", + "type_version": "1.0.0" + }, + "description": "The connfiguration entities the Automation Composition Element is managing and their associated REST requests" + } + } + } + }, + "topology_template": { + "node_templates": { + "org.onap.k8s.acm.K8SAutomationCompositionParticipant": { + "version": "2.3.4", + "type": "org.onap.policy.clamp.acm.Participant", + "type_version": "1.0.1", + "description": "Participant for K8S", + "properties": { + "provider": "ONAP" + } + }, + "org.onap.k8s.acm.HttpAutomationCompositionParticipant": { + "version": "1.2.3", + "type": "org.onap.policy.clamp.acm.Participant", + "type_version": "1.0.1", + "description": "Participant for Http requests", + "properties": { + "provider": "ONAP" + } + }, + "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement": { + "version": "1.2.3", + "type": "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement", + "type_version": "1.0.0", + "description": "Automation composition element for the K8S microservice for AC Element Starter", + "properties": { + "provider": "ONAP", + "startPhase": 0, + "uninitializedToPassiveTimeout": 500, + "podStatusCheckInterval": 30 + } + }, + "onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement": { + "version": "1.2.3", + "type": "org.onap.policy.clamp.acm.HttpAutomationCompositionElement", + "type_version": "1.0.0", + "description": "Automation composition element for the http requests of AC Element Starter microservice", + "properties": { + "provider": "ONAP", + "uninitializedToPassiveTimeout": 300, + "startPhase": 1 + } + }, + "onap.policy.clamp.ac.element.AutomationCompositionDefinition": { + "version": "1.2.3", + "type": "org.onap.policy.clamp.acm.AutomationComposition", + "type_version": "1.0.1", + "description": "Automation composition for rapp deployment", + "properties": { + "provider": "ONAP", + "elements": [ + { + "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement", + "version": "1.2.3" + }, + { + "name": "onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement", + "version": "1.2.3" + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/sample-rapp-generator/rapp-simple-ics-consumer/Files/Acm/instances/k8s-instance.json b/sample-rapp-generator/rapp-simple-ics-consumer/Files/Acm/instances/k8s-instance.json new file mode 100644 index 0000000..300a6f7 --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-consumer/Files/Acm/instances/k8s-instance.json @@ -0,0 +1,68 @@ +{ + "name": "icsConsumerInstance", + "version": "1.0.1", + "compositionId": "DO_NOT_CHANGE_THIS_COMPOSITION_ID", + "description": "Demo automation composition instance consumer", + "elements": { + "d425fb6d-ebe3-432d-ba30-1d5ed9df58f0": { + "id": "d425fb6d-ebe3-432d-ba30-1d5ed9df58f0", + "definition": { + "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement", + "version": "1.2.3" + }, + "description": "Starter Automation Composition Element for ICS Consumer", + "properties": { + "startPhase": 0, + "chart": { + "chartId": { + "name": "ics-consumer", + "version": "0.1.0" + }, + "namespace": "nonrtric", + "releaseName": "ics-consumer", + "podName": "kafka-consumer", + "repository": { + "repoName": "local", + "address": "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI" + } + } + } + }, + "94f1af01-c759-48ca-91f2-f0b48c12fcee": { + "id": "94f1af01-c759-48ca-91f2-f0b48c12fcee", + "definition": { + "name": "onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement", + "version": "1.2.3" + }, + "description": "Starter Automation Composition Element for the Demo ICS-Consumer", + "properties": { + "provider": "ONAP", + "uninitializedToPassiveTimeout": 180, + "startPhase": 1, + "baseUrl": "http://UPDATE_THIS_MACHINE_IP:31112", + "httpHeaders": { + "Content-Type": "application/json" + }, + "configurationEntities": [ + { + "configurationEntityId": { + "name": "oran.demo.ics.consumer", + "version": "1.0.0" + }, + "restSequence": [ + { + "restRequestId": { + "name": "request1", + "version": "1.0.1" + }, + "httpMethod": "GET", + "path": "/start", + "expectedResponse": 200 + } + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/sample-rapp-generator/rapp-simple-ics-consumer/Files/Dme/consumerinfotypes/type1.json b/sample-rapp-generator/rapp-simple-ics-consumer/Files/Dme/consumerinfotypes/type1.json new file mode 100644 index 0000000..7869860 --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-consumer/Files/Dme/consumerinfotypes/type1.json @@ -0,0 +1,9 @@ +{ + "info_job_data_schema": { + "$schema":"http://json-schema.org/draft-07/schema#", + "title":"STD_Type1_1.0.0", + "description":"Type 1", + "topic": "mytopic", + "bootStrapServers": "kafka.default.svc.cluster.local:9092" + } +} \ No newline at end of file diff --git a/sample-rapp-generator/rapp-simple-ics-consumer/Files/Dme/infoconsumers/ics-simple-consumer.json b/sample-rapp-generator/rapp-simple-ics-consumer/Files/Dme/infoconsumers/ics-simple-consumer.json new file mode 100644 index 0000000..1094c01 --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-consumer/Files/Dme/infoconsumers/ics-simple-consumer.json @@ -0,0 +1,12 @@ +{ + "info_type_id": "type1", + "job_owner": "demo", + "job_definition": { + "deliveryInfo": { + "topic": "mytopic", + "bootStrapServers": "kafka.default.svc.cluster.local:9092" + } + }, + "job_result_uri": "http://kafka-producer:8080/info-job", + "status_notification_uri": "http://kafka-producer:9090/info-type-status" +} \ No newline at end of file diff --git a/sample-rapp-generator/rapp-simple-ics-consumer/TOSCA-Metadata/TOSCA.meta b/sample-rapp-generator/rapp-simple-ics-consumer/TOSCA-Metadata/TOSCA.meta new file mode 100644 index 0000000..3da5f0d --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-consumer/TOSCA-Metadata/TOSCA.meta @@ -0,0 +1,5 @@ +TOSCA-Meta-File-Version: 1.0 +CSAR-Version: 1.0 +Created-By: Ericsson Software Technology (O-RAN SC NONRTRIC team) +Entry-Definitions: Definitions/asd.yaml +ETSI-Entry-Manifest: asd.mf \ No newline at end of file diff --git a/sample-rapp-generator/rapp-simple-ics-consumer/asd.mf b/sample-rapp-generator/rapp-simple-ics-consumer/asd.mf new file mode 100644 index 0000000..1e68d7e --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-consumer/asd.mf @@ -0,0 +1,15 @@ +metadata: + application_name: rapp-simple-ics-consumer + application_provider: Ericsson Software Technology (O-RAN SC NONRTRIC team) + release_date_time: 2024-05-23T12:00:00+00:00 + entry_definition_type: asd + +Source: asd.mf +Source: Artifacts/Deployment/HELM/ics-consumer-0.1.0.tgz +Source: Definitions/asd.yaml +Source: Definitions/asd_types.yaml +Source: TOSCA-Metadata/TOSCA.meta +Source: Files/Dme/infoconsumers/ics-simple-consumer.json +Source: Files/Dme/consumerinfotypes/type1.json +Source: Files/Acm/definition/compositions.json +Source: Files/Acm/instances/k8s-instance.json \ No newline at end of file diff --git a/sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/.helmignore b/sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/.helmignore @@ -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/sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/Chart.yaml b/sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/Chart.yaml new file mode 100644 index 0000000..e26165b --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: ics-producer +description: A Helm chart for Kubernetes +type: application +version: 0.1.0 +appVersion: "1.16.0" diff --git a/sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/templates/producer-deployment.yaml b/sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/templates/producer-deployment.yaml new file mode 100644 index 0000000..e6eb95d --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/templates/producer-deployment.yaml @@ -0,0 +1,41 @@ +# +# ========================LICENSE_START================================= +# O-RAN-SC +# +# Copyright (C) 2024: OpenInfra Foundation Europe +# +# 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=================================== +# +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.producer.name }} +spec: + replicas: {{ .Values.producer.replicaCount }} + selector: + matchLabels: + app: {{ .Values.producer.name }} + template: + metadata: + labels: + app: {{ .Values.producer.name }} + spec: + containers: + - name: {{ .Values.producer.name }} + image: "{{ .Values.producer.image.repository }}:{{ .Values.producer.image.tag }}" + ports: + - containerPort: {{ .Values.producer.service.port }} + env: + - name: SPRING_KAFKA_SERVER + value: "{{ .Values.kafka.host }}:{{ .Values.kafka.port }}" diff --git a/sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/templates/producer-service.yaml b/sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/templates/producer-service.yaml new file mode 100644 index 0000000..8e17906 --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/templates/producer-service.yaml @@ -0,0 +1,31 @@ +# +# ========================LICENSE_START================================= +# O-RAN-SC +# +# Copyright (C) 2024: OpenInfra Foundation Europe +# +# 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=================================== +# +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.producer.name }} +spec: + type: NodePort + ports: + - port: {{ .Values.producer.service.port }} + targetPort: {{ .Values.producer.service.port }} + nodePort: {{ .Values.producer.service.nodePort }} + selector: + app: {{ .Values.producer.name }} diff --git a/sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/values.yaml b/sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/values.yaml new file mode 100644 index 0000000..eb05e88 --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-producer/Artifacts/Deployment/HELM/ics-producer/values.yaml @@ -0,0 +1,32 @@ +# +# ========================LICENSE_START================================= +# O-RAN-SC +# +# Copyright (C) 2024: OpenInfra Foundation Europe +# +# 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=================================== +# +producer: + name: kafka-producer + replicaCount: 1 + image: + repository: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-sample-simple-icsproducer + tag: 0.0.1 + service: + port: 8080 + nodePort: 31111 + +kafka: + host: kafka.default.svc.cluster.local + port: 9092 diff --git a/sample-rapp-generator/rapp-simple-ics-producer/Definitions/asd.yaml b/sample-rapp-generator/rapp-simple-ics-producer/Definitions/asd.yaml new file mode 100644 index 0000000..a2ace96 --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-producer/Definitions/asd.yaml @@ -0,0 +1,48 @@ +# ============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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +tosca_definitions_version: tosca_simple_yaml_1_2 + +description: rApp ICS Producer + +imports: + - asd_types.yaml + +topology_template: + node_templates: + applicationServiceDescriptor: + type: tosca.nodes.asd + description: "rapp-ics-producer" + properties: + descriptor_id: 2cd6a567-2e33-4960-8ef7-1cc519c998c5 + descriptor_invariant_id: 3f8a5e1b-68f1-42e5-89d0-47090dd0ef5b + descriptor_version: 1.0 + schema_version: 2.0 + function_description: rApp description + provider: Ericsson Software Technology (O-RAN SC NONRTRIC team) + application_name: rapp-ics-producer + application_version: 1.0 + artifacts: + producer: + type: tosca.artifacts.asd.deploymentItem + file: "Artifacts/Deployment/HELM/ics-producer-0.1.0.tgz" + properties: + artifact_type: "helm_chart" + target_server: "chartmuseum" + target_server_uri: "UPDATE_THIS_CHART_MUSEUM_POST_CHARTS_URI" + item_id: 1 diff --git a/sample-rapp-generator/rapp-simple-ics-producer/Definitions/asd_types.yaml b/sample-rapp-generator/rapp-simple-ics-producer/Definitions/asd_types.yaml new file mode 100644 index 0000000..c4de6ad --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-producer/Definitions/asd_types.yaml @@ -0,0 +1,90 @@ +# ============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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +tosca_definitions_version: tosca_simple_yaml_1_2 +description: ASD types definitions version 0.1 +node_types: + tosca.nodes.asd: + derived_from: tosca.nodes.Root + description: "The ASD node type" + version: 0.1 + properties: + descriptor_id: + type: string # UUID + required: true + description: Identifier of this ASD. It is in UUID format as specified in RFC 4122 + descriptor_invariant_id: + type: string # UUID + required: true + description: > + Identifier of this descriptor in a version independent manner. This attribute + is invariant across versions of ASD. It is in UUID format as specified in RFC 4122 + descriptor_version: + type: string + required: true + description: Identifies the version of the ASD. + schema_version: + type: string + required: true + description: Identifies the Identifies the version of this ASD’s schema. + function_description: + type: string + required: false + description: Description of the application service described by this ASD. + provider: + type: string + required: true + description: Identifies the provider of the ASD. + application_name: + type: string + required: true + description: Name to identify the application service described by this ASD + application_version: + type: string + required: true + description: Identifies the version of the application service described by this ASD. + +artifact_types: +tosca.artifacts.asd.deploymentItem: + version: 0.1 + derived_from: tosca.artifacts.Root + description: "Describes the artifact type of asd deployment item" + file: "Relative path of the artifact in the package" + properties: + item_id: + description: "The identifier of this asd deployment item" + required: true + type: string + artifact_type: + description: > + Specify artifact type. + required: true + type: string + constraints: + - valid_values: ["helm_chart"] + target_server: + description: > + Specify target server for artifact. + required: true + type: string + constraints: + - valid_values: [ "chartmuseum" ] + target_server_uri: + description: "URI of the target server" + required: true + type: string \ No newline at end of file diff --git a/sample-rapp-generator/rapp-simple-ics-producer/Files/Acm/definition/compositions.json b/sample-rapp-generator/rapp-simple-ics-producer/Files/Acm/definition/compositions.json new file mode 100644 index 0000000..cf4cb65 --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-producer/Files/Acm/definition/compositions.json @@ -0,0 +1,311 @@ +{ + "tosca_definitions_version": "tosca_simple_yaml_1_3", + "data_types": { + "onap.datatypes.ToscaConceptIdentifier": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "name": { + "type": "string", + "required": true + }, + "version": { + "type": "string", + "required": true + } + } + }, + "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest": { + "version": "1.0.0", + "derived_from": "tosca.datatypes.Root", + "properties": { + "restRequestId": { + "type": "onap.datatypes.ToscaConceptIdentifier", + "type_version": "0.0.0", + "required": true, + "description": "The name and version of a REST request to be sent to a REST endpoint" + }, + "httpMethod": { + "type": "string", + "required": true, + "constraints": [ + { + "valid_values": [ + "POST", + "PUT", + "GET", + "DELETE" + ] + } + ], + "description": "The REST method to use" + }, + "path": { + "type": "string", + "required": true, + "description": "The path of the REST request relative to the base URL" + }, + "body": { + "type": "string", + "required": false, + "description": "The body of the REST request for PUT and POST requests" + }, + "expectedResponse": { + "type": "integer", + "required": true, + "constraints": [ + { + "in_range": [ + 100, + 599 + ] + } + ], + "description": "THe expected HTTP status code for the REST request" + } + } + }, + "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity": { + "version": "1.0.0", + "derived_from": "tosca.datatypes.Root", + "properties": { + "configurationEntityId": { + "type": "onap.datatypes.ToscaConceptIdentifier", + "type_version": "0.0.0", + "required": true, + "description": "The name and version of a Configuration Entity to be handled by the HTTP Automation Composition Element" + }, + "restSequence": { + "type": "list", + "entry_schema": { + "type": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest", + "type_version": "1.0.0" + }, + "description": "A sequence of REST commands to send to the REST endpoint" + } + } + } + }, + "node_types": { + "org.onap.policy.clamp.acm.Participant": { + "version": "1.0.1", + "derived_from": "tosca.nodetypes.Root", + "properties": { + "provider": { + "type": "string", + "required": false + } + } + }, + "org.onap.policy.clamp.acm.AutomationCompositionElement": { + "version": "1.0.1", + "derived_from": "tosca.nodetypes.Root", + "properties": { + "provider": { + "type": "string", + "required": false + }, + "participantType": { + "type": "onap.datatypes.ToscaConceptIdentifier", + "required": true + }, + "startPhase": { + "type": "integer", + "required": false, + "constraints": [ + { + "greater-or-equal": 0 + } + ], + "metadata": { + "common": true + }, + "description": "A value indicating the start phase in which this automation composition element will be started, the first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped in reverse start phase order. Automation Composition Elements with the same start phase are started and stopped simultaneously" + }, + "passiveToRunningTimeout": { + "type": "integer", + "required": false, + "constraints": [ + { + "greater_or_equal": 0 + } + ], + "default": 60, + "metadata": { + "common": true + }, + "description": "The maximum time in seconds to wait for a state chage from passive to running" + }, + "runningToPassiveTimeout": { + "type": "integer", + "required": false, + "constraints": [ + { + "greater_or_equal": 0 + } + ], + "default": 60, + "metadata": { + "common": true + }, + "description": "The maximum time in seconds to wait for a state chage from running to passive" + }, + "passiveToUninitializedTimeout": { + "type": "integer", + "required": false, + "constraints": [ + { + "greater_or_equal": 0 + } + ], + "default": 60, + "metadata": { + "common": true + }, + "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized" + } + } + }, + "org.onap.policy.clamp.acm.AutomationComposition": { + "version": "1.0.1", + "derived_from": "tosca.nodetypes.Root", + "properties": { + "provider": { + "type": "string", + "required": false, + "metadata": { + "common": true + } + }, + "elements": { + "type": "list", + "required": true, + "metadata": { + "common": true + }, + "entry_schema": { + "type": "onap.datatypes.ToscaConceptIdentifier" + } + } + } + }, + "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement": { + "version": "1.0.0", + "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement", + "properties": { + "chart": { + "type": "string", + "required": true + }, + "configs": { + "type": "list", + "required": false + }, + "requirements": { + "type": "string", + "required": false + }, + "templates": { + "type": "list", + "required": false, + "entry_schema": null + }, + "values": { + "type": "string", + "required": true + } + } + }, + "org.onap.policy.clamp.acm.HttpAutomationCompositionElement": { + "version": "1.0.0", + "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement", + "properties": { + "baseUrl": { + "type": "string", + "required": true, + "description": "The base URL to be prepended to each path, identifies the host for the REST endpoints." + }, + "httpHeaders": { + "type": "map", + "required": false, + "entry_schema": { + "type": "string" + }, + "description": "HTTP headers to send on REST requests" + }, + "configurationEntities": { + "type": "map", + "required": true, + "entry_schema": { + "type": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity", + "type_version": "1.0.0" + }, + "description": "The connfiguration entities the Automation Composition Element is managing and their associated REST requests" + } + } + } + }, + "topology_template": { + "node_templates": { + "org.onap.k8s.acm.K8SAutomationCompositionParticipant": { + "version": "2.3.4", + "type": "org.onap.policy.clamp.acm.Participant", + "type_version": "1.0.1", + "description": "Participant for K8S", + "properties": { + "provider": "ONAP" + } + }, + "org.onap.k8s.acm.HttpAutomationCompositionParticipant": { + "version": "1.2.3", + "type": "org.onap.policy.clamp.acm.Participant", + "type_version": "1.0.1", + "description": "Participant for Http requests", + "properties": { + "provider": "ONAP" + } + }, + "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement": { + "version": "1.2.3", + "type": "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement", + "type_version": "1.0.0", + "description": "Automation composition element for the K8S microservice for AC Element Starter", + "properties": { + "provider": "ONAP", + "startPhase": 0, + "uninitializedToPassiveTimeout": 500, + "podStatusCheckInterval": 30 + } + }, + "onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement": { + "version": "1.2.3", + "type": "org.onap.policy.clamp.acm.HttpAutomationCompositionElement", + "type_version": "1.0.0", + "description": "Automation composition element for the http requests of AC Element Starter microservice", + "properties": { + "provider": "ONAP", + "uninitializedToPassiveTimeout": 300, + "startPhase": 1 + } + }, + "onap.policy.clamp.ac.element.AutomationCompositionDefinition": { + "version": "1.2.3", + "type": "org.onap.policy.clamp.acm.AutomationComposition", + "type_version": "1.0.1", + "description": "Automation composition for rapp deployment", + "properties": { + "provider": "ONAP", + "elements": [ + { + "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement", + "version": "1.2.3" + }, + { + "name": "onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement", + "version": "1.2.3" + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/sample-rapp-generator/rapp-simple-ics-producer/Files/Acm/instances/k8s-instance.json b/sample-rapp-generator/rapp-simple-ics-producer/Files/Acm/instances/k8s-instance.json new file mode 100644 index 0000000..d02772a --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-producer/Files/Acm/instances/k8s-instance.json @@ -0,0 +1,68 @@ +{ + "name": "icsProducerInstance", + "version": "1.0.1", + "compositionId": "DO_NOT_CHANGE_THIS_COMPOSITION_ID", + "description": "Demo automation composition instance 0", + "elements": { + "ea40d074-17c6-4f34-a6ea-6e464ac4cc38": { + "id": "ea40d074-17c6-4f34-a6ea-6e464ac4cc38", + "definition": { + "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement", + "version": "1.2.3" + }, + "description": "Starter Automation Composition Element for ICS Producer", + "properties": { + "startPhase": 0, + "chart": { + "chartId": { + "name": "ics-producer", + "version": "0.1.0" + }, + "namespace": "nonrtric", + "releaseName": "ics-producer", + "podName": "kafka-producer", + "repository": { + "repoName": "local", + "address": "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI" + } + } + } + }, + "709c62b3-8918-41b9-a747-d21eb79c6c24": { + "id": "709c62b3-8918-41b9-a747-d21eb79c6c24", + "definition": { + "name": "onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement", + "version": "1.2.3" + }, + "description": "Starter Automation Composition Element for the Demo ICS-Producer", + "properties": { + "provider": "ONAP", + "uninitializedToPassiveTimeout": 180, + "startPhase": 1, + "baseUrl": "http://UPDATE_THIS_MACHINE_IP:31111", + "httpHeaders": { + "Content-Type": "application/json" + }, + "configurationEntities": [ + { + "configurationEntityId": { + "name": "oran.demo.ics.producer", + "version": "1.0.0" + }, + "restSequence": [ + { + "restRequestId": { + "name": "request1", + "version": "1.0.1" + }, + "httpMethod": "GET", + "path": "/publish/A", + "expectedResponse": 200 + } + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/sample-rapp-generator/rapp-simple-ics-producer/Files/Dme/infoproducers/ics-simple-producer.json b/sample-rapp-generator/rapp-simple-ics-producer/Files/Dme/infoproducers/ics-simple-producer.json new file mode 100644 index 0000000..5bcaba2 --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-producer/Files/Dme/infoproducers/ics-simple-producer.json @@ -0,0 +1,7 @@ +{ + "info_producer_supervision_callback_url": "http://kafka-producer:8080/health-check", + "supported_info_types": [ + "type1" + ], + "info_job_callback_url": "http://kafka-producer:8080/info-job" +} \ No newline at end of file diff --git a/sample-rapp-generator/rapp-simple-ics-producer/Files/Dme/producerinfotypes/type1.json b/sample-rapp-generator/rapp-simple-ics-producer/Files/Dme/producerinfotypes/type1.json new file mode 100644 index 0000000..7869860 --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-producer/Files/Dme/producerinfotypes/type1.json @@ -0,0 +1,9 @@ +{ + "info_job_data_schema": { + "$schema":"http://json-schema.org/draft-07/schema#", + "title":"STD_Type1_1.0.0", + "description":"Type 1", + "topic": "mytopic", + "bootStrapServers": "kafka.default.svc.cluster.local:9092" + } +} \ No newline at end of file diff --git a/sample-rapp-generator/rapp-simple-ics-producer/TOSCA-Metadata/TOSCA.meta b/sample-rapp-generator/rapp-simple-ics-producer/TOSCA-Metadata/TOSCA.meta new file mode 100644 index 0000000..3da5f0d --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-producer/TOSCA-Metadata/TOSCA.meta @@ -0,0 +1,5 @@ +TOSCA-Meta-File-Version: 1.0 +CSAR-Version: 1.0 +Created-By: Ericsson Software Technology (O-RAN SC NONRTRIC team) +Entry-Definitions: Definitions/asd.yaml +ETSI-Entry-Manifest: asd.mf \ No newline at end of file diff --git a/sample-rapp-generator/rapp-simple-ics-producer/asd.mf b/sample-rapp-generator/rapp-simple-ics-producer/asd.mf new file mode 100644 index 0000000..0e03e87 --- /dev/null +++ b/sample-rapp-generator/rapp-simple-ics-producer/asd.mf @@ -0,0 +1,13 @@ +metadata: + application_name: rapp-simple-ics-producer + application_provider: Ericsson Software Technology (O-RAN SC NONRTRIC team) + release_date_time: 2024-05-03T12:00:00+00:00 + entry_definition_type: asd + +Source: asd.mf +Source: Artifacts/Deployment/HELM/ics-producer-0.1.0.tgz +Source: Definitions/asd.yaml +Source: Definitions/asd_types.yaml +Source: TOSCA-Metadata/TOSCA.meta +Source: Files/Dme/infoproducers/ics-simple-producer.json +Source: Files/Dme/producerinfotypes/type1.json \ No newline at end of file diff --git a/scripts/install/patch-sample-rapps.sh b/scripts/install/patch-sample-rapps.sh index 0dfa922..5ad1c10 100755 --- a/scripts/install/patch-sample-rapps.sh +++ b/scripts/install/patch-sample-rapps.sh @@ -17,7 +17,10 @@ # echo "######### Patching Sample rApps #########" - +echo "Replacing hardcoded variables inside sample-rapp-generator:" +echo "UPDATE_THIS_MACHINE_IP" +echo "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI" +echo "UPDATE_THIS_CHART_MUSEUM_POST_CHARTS_URI" CWD=$(pwd) export WORKSPACE="$CWD/../../sample-rapp-generator" @@ -36,13 +39,20 @@ for file in $(find $WORKSPACE -type f -name "*.yaml"); do fi done -echo "Replacing charts repo get url in json files....." +echo "Replacing charts repo get url and machine ip 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 + sed -i "s/UPDATE_THIS_MACHINE_IP/$IP_ADDRESS/g" "$file" + if grep -q "$IP_ADDRESS" "$file"; then + echo "UPDATE_THIS_MACHINE_IP updated in file: $file" + fi +done +echo "UPDATE_THIS_MACHINE_IP=$IP_ADDRESS" +echo "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI=$CHART_REPO_GET_URI" +echo "UPDATE_THIS_CHART_MUSEUM_POST_CHARTS_URI=$CHART_REPO_POST_URI" echo "Patching Sample rApps completed." -- 2.16.6