From 046b8fa550f0f79e578ebaf5ded3e3d107ab2f19 Mon Sep 17 00:00:00 2001 From: ambrishest Date: Thu, 8 Feb 2024 10:41:11 +0000 Subject: [PATCH] K8s participant and SME producer service for Hello World rApp Issue-ID: NONRTRIC-965 Change-Id: Ibd37256e1b15d735a760c2a1e1956cebb9707eb7 Signed-off-by: ambrishest --- .../Deployment/HELM/hello-world-chart-0.1.0.tgz | Bin 0 -> 2039 bytes .../rapp-hello-world/Definitions/asd.yaml | 46 +++++ .../rapp-hello-world/Definitions/asd_types.yaml | 79 +++++++++ .../Files/Acm/definition/compositions.json | 189 +++++++++++++++++++++ .../Files/Acm/instances/k8s-instance.json | 31 ++++ .../Files/Sme/providers/provider-function-1.json | 20 +++ .../Files/Sme/serviceapis/api-set-1.json | 32 ++++ .../Files/Sme/serviceapis/api-set-2.json | 32 ++++ .../rapp-hello-world/TOSCA-Metadata/TOSCA.meta | 5 + sample-rapp-generator/rapp-hello-world/asd.mf | 16 ++ 10 files changed, 450 insertions(+) create mode 100644 sample-rapp-generator/rapp-hello-world/Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz create mode 100644 sample-rapp-generator/rapp-hello-world/Definitions/asd.yaml create mode 100644 sample-rapp-generator/rapp-hello-world/Definitions/asd_types.yaml create mode 100644 sample-rapp-generator/rapp-hello-world/Files/Acm/definition/compositions.json create mode 100644 sample-rapp-generator/rapp-hello-world/Files/Acm/instances/k8s-instance.json create mode 100644 sample-rapp-generator/rapp-hello-world/Files/Sme/providers/provider-function-1.json create mode 100644 sample-rapp-generator/rapp-hello-world/Files/Sme/serviceapis/api-set-1.json create mode 100644 sample-rapp-generator/rapp-hello-world/Files/Sme/serviceapis/api-set-2.json create mode 100644 sample-rapp-generator/rapp-hello-world/TOSCA-Metadata/TOSCA.meta create mode 100644 sample-rapp-generator/rapp-hello-world/asd.mf diff --git a/sample-rapp-generator/rapp-hello-world/Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz b/sample-rapp-generator/rapp-hello-world/Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..141ad8a9c0ba7ea7e37eeee9f4c28cc2c61258fd GIT binary patch literal 2039 zcmVDc zVQyr3R8em|NM&qo0PI>{Z`(K$@3TI|oO;E!xmuPTJ1KnF2cMHgjScJ|&bC+_4h1cZ zWo{@^B`G_;H22vLBxOgo^T)ZQ**&c0L6*qja5x;!Z$|PI856a+kSwl6QzCV}XRg75 zr0mr*Q5c5dL91nd!!X?Z4V#Vjt46DR&^&1GA2ge zn~VEDA(GKgC>0gF1GA<_vTXGj28|%}VpNf&nYK+`_=qe8>nJc05(dM;+4)(&XWE&7 z&&H2DPEzc^mS=f-kzof&mN6O;BhZ_z&-Hs7<4;K2=YK|6j_NrBzys&Maj<{5asJz; zyE^|bK(C?Zy#|0E@1T=@?|3je{xUl6o}J&tv?42NSUc+uYNMWgc=N{o^hCChG?{96 z+j|Giu({uXVTQcVCz8NVBImJ<2ymQBkzsl035}2|j3MVSO3+h;ZbqUhE_>cX5wf5e zgz(ld_(hlh?(bH{LgbK=1#qDuR|tAa6-+2Yz{?0T4U|J9(u`5UBZN8CQ#(;1Ca^+& zErf`%CX@q#NMs8TlQJg|?Y*|#mZn-~oqByfp9jS190-}znd4RU!nn0&5Ei3;;S7}m ziC=RnF^2JC8862Sfsr`~2_%t-F=%1bo=d7JPu_zP6Fn!=*)FC^OFGW=n%$O4Qnkh) zI1mngcLe>B5C7(gWhm()IaYJ2O}8%1l_@} z@N<7~^d6AvDN4Z0Oqw+a3Dj5=V`sh*;+hf$KFqVqFrpJ00V6!gNrI4w8A?uh0vXDb zDzmo=2#>8CMpLS-v#9N*1v@$O@!;q|S2oVtCkGGL$ON*^{8)f%w1Q-fwQi|HDR=|Gf-dUDfxzetua)m05*oKTM7Z~07MM)^>?;UhWI5V%reU_=I=Tv}l`hclFt#t7d)%bZ7Wuy1c^ zI?5*#dI^5bhe8(e*xY(n&z?l05y)zWNzT{;zUG9{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u=-Q|Nn3x_*4Ki007qR_6`65 literal 0 HcmV?d00001 diff --git a/sample-rapp-generator/rapp-hello-world/Definitions/asd.yaml b/sample-rapp-generator/rapp-hello-world/Definitions/asd.yaml new file mode 100644 index 0000000..2968ce8 --- /dev/null +++ b/sample-rapp-generator/rapp-hello-world/Definitions/asd.yaml @@ -0,0 +1,46 @@ +# ============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 Hello World + +imports: + - asd_types.yaml + +topology_template: + node_templates: + applicationServiceDescriptor: + type: tosca.nodes.asd + description: "rapp-hello-world" + properties: + descriptor_id: 2cd6a567-2e33-4960-8ef7-1cc519c998c4 + descriptor_invariant_id: 3f8a5e1b-68f1-42e5-89d0-47090dd0ef5a + descriptor_version: 1.0 + schema_version: 2.0 + function_description: rApp description + provider: Ericsson Software Technology (O-RAN SC NONRTRIC team) + application_name: rapp-hello-world + application_version: 1.0 + artifacts: + helloworld: + type: tosca.artifacts.asd.deploymentItem + file: "Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz" + properties: + artifact_type: "helm_chart" + itemId: 1 diff --git a/sample-rapp-generator/rapp-hello-world/Definitions/asd_types.yaml b/sample-rapp-generator/rapp-hello-world/Definitions/asd_types.yaml new file mode 100644 index 0000000..237ccfd --- /dev/null +++ b/sample-rapp-generator/rapp-hello-world/Definitions/asd_types.yaml @@ -0,0 +1,79 @@ +# ============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"] diff --git a/sample-rapp-generator/rapp-hello-world/Files/Acm/definition/compositions.json b/sample-rapp-generator/rapp-hello-world/Files/Acm/definition/compositions.json new file mode 100644 index 0000000..f7b0401 --- /dev/null +++ b/sample-rapp-generator/rapp-hello-world/Files/Acm/definition/compositions.json @@ -0,0 +1,189 @@ +{ + "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 + } + } + } + }, + "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 + } + } + } + }, + "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" + } + }, + "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": 300, + "podStatusCheckInterval": 30 + } + }, + "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" + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/sample-rapp-generator/rapp-hello-world/Files/Acm/instances/k8s-instance.json b/sample-rapp-generator/rapp-hello-world/Files/Acm/instances/k8s-instance.json new file mode 100644 index 0000000..734f0d1 --- /dev/null +++ b/sample-rapp-generator/rapp-hello-world/Files/Acm/instances/k8s-instance.json @@ -0,0 +1,31 @@ +{ + "name": "K8DemoInstance0", + "version": "1.0.1", + "compositionId": "COMPOSITIONID", + "description": "Demo automation composition instance 0", + "elements": { + "d7be552e-bcc5-4478-b64d-797dbaec8f55": { + "id": "d7be552e-bcc5-4478-b64d-797dbaec8f55", + "definition": { + "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement", + "version": "1.2.3" + }, + "description": "Starter Automation Composition Element for the Hello World", + "properties": { + "chart": { + "chartId": { + "name": "hello-world-chart", + "version": "0.1.0" + }, + "namespace": "nonrtric", + "releaseName": "hello-world-chart", + "podName": "hello-world-chart", + "repository": { + "repoName": "local", + "address": "http://10.101.1.90:8879/charts" + } + } + } + } + } +} \ No newline at end of file diff --git a/sample-rapp-generator/rapp-hello-world/Files/Sme/providers/provider-function-1.json b/sample-rapp-generator/rapp-hello-world/Files/Sme/providers/provider-function-1.json new file mode 100644 index 0000000..f647cdc --- /dev/null +++ b/sample-rapp-generator/rapp-hello-world/Files/Sme/providers/provider-function-1.json @@ -0,0 +1,20 @@ +{ + "apiProvDomInfo": "Provider domain", + "apiProvFuncs": [ + { + "apiProvFuncInfo": "Hello World as APF", + "apiProvFuncRole": "APF", + "regInfo": { + "apiProvPubKey": "NOT USED here" + } + }, + { + "apiProvFuncInfo": "Hello World as AEF", + "apiProvFuncRole": "AEF", + "regInfo": { + "apiProvPubKey": "NOT USED here" + } + } + ], + "regSec": "plain" +} \ No newline at end of file diff --git a/sample-rapp-generator/rapp-hello-world/Files/Sme/serviceapis/api-set-1.json b/sample-rapp-generator/rapp-hello-world/Files/Sme/serviceapis/api-set-1.json new file mode 100644 index 0000000..cd8b414 --- /dev/null +++ b/sample-rapp-generator/rapp-hello-world/Files/Sme/serviceapis/api-set-1.json @@ -0,0 +1,32 @@ +{ + "apiName": "Hello World API Set 1", + "description": "Simple Hello World API", + "aefProfiles": [ + { + "aefId": "Hello World as AEF", + "description": "Simple Hello World API", + "versions": [ + { + "apiVersion": "v1", + "resources": [ + { + "resourceName": "helloworld", + "commType": "REQUEST_RESPONSE", + "uri": "/helloworld/v1", + "operations": [ + "GET" + ] + } + ] + } + ], + "protocol": "HTTP_1_1", + "interfaceDescriptions": [ + { + "ipv4Addr": "hello-world-chart.nonrtric.svc.cluster.local", + "port": 8080 + } + ] + } + ] +} \ No newline at end of file diff --git a/sample-rapp-generator/rapp-hello-world/Files/Sme/serviceapis/api-set-2.json b/sample-rapp-generator/rapp-hello-world/Files/Sme/serviceapis/api-set-2.json new file mode 100644 index 0000000..11694c9 --- /dev/null +++ b/sample-rapp-generator/rapp-hello-world/Files/Sme/serviceapis/api-set-2.json @@ -0,0 +1,32 @@ +{ + "apiName": "Hello World API Set 2", + "description": "Simple Hello World API for Subpath", + "aefProfiles": [ + { + "aefId": "Hello World as AEF", + "description": "Simple Hello World API for Subpath", + "versions": [ + { + "apiVersion": "v1", + "resources": [ + { + "resourceName": "helloworld", + "commType": "REQUEST_RESPONSE", + "uri": "/helloworld/v1/subpath1", + "operations": [ + "GET" + ] + } + ] + } + ], + "protocol": "HTTP_1_1", + "interfaceDescriptions": [ + { + "ipv4Addr": "hello-world-chart.nonrtric.svc.cluster.local", + "port": 8080 + } + ] + } + ] +} \ No newline at end of file diff --git a/sample-rapp-generator/rapp-hello-world/TOSCA-Metadata/TOSCA.meta b/sample-rapp-generator/rapp-hello-world/TOSCA-Metadata/TOSCA.meta new file mode 100644 index 0000000..3da5f0d --- /dev/null +++ b/sample-rapp-generator/rapp-hello-world/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-hello-world/asd.mf b/sample-rapp-generator/rapp-hello-world/asd.mf new file mode 100644 index 0000000..a26c676 --- /dev/null +++ b/sample-rapp-generator/rapp-hello-world/asd.mf @@ -0,0 +1,16 @@ +metadata: + application_name: rapp-hello-world + application_provider: Ericsson Software Technology (O-RAN SC NONRTRIC team) + release_date_time: 2024-02-12T11:30:00+00:00 + entry_definition_type: asd + +Source: asd.mf +Source: Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz +Source: Definitions/asd.yaml +Source: Definitions/asd_types.yaml +Source: TOSCA-Metadata/TOSCA.meta +Source: Files/Acm/definition/compositions.json +Source: Files/Acm/instances/k8s-instance.json +Source: Files/Sme/provider/provider-function-1.json +Source: Files/Sme/serviceapis/api-set-1.json +Source: Files/Sme/serviceapis/api-set-2.json -- 2.16.6