From: xuegao Date: Mon, 14 Nov 2022 10:28:08 +0000 (+0100) Subject: Add simulator helm charts X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=it%2Fdep.git;a=commitdiff_plain;h=a54a96ba117b4b30c8f88e88f973ea18ddd8687c Add simulator helm charts Add simulator helm charts for Network Slicing use case. Issue-ID: INT-147 Signed-off-by: xuegao Change-Id: I6472ed9aacff942ebfcd4f4b2c914961471ef762 Signed-off-by: xuegao --- diff --git a/smo-install/scripts/layer-2/2-install-onap-only.sh b/smo-install/scripts/layer-2/2-install-onap-only.sh new file mode 100755 index 00000000..35061bc4 --- /dev/null +++ b/smo-install/scripts/layer-2/2-install-onap-only.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +### +# ============LICENSE_START======================================================= +# ORAN SMO Package +# ================================================================================ +# Copyright (C) 2022 AT&T Intellectual Property. 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============================================ +# =================================================================== +# +### + +SCRIPT=$(readlink -f "$0") +SCRIPT_PATH=$(dirname "$SCRIPT") +cd $SCRIPT_PATH + +FLAVOUR=$1 +if [ -z "$1" ] + then + echo "No helm override flavour supplied, going to default" + FLAVOUR="default" +fi + +timestamp=$(date +%s) + +echo "Starting ONAP namespaces ..." +../sub-scripts/install-onap.sh ../../helm-override/$FLAVOUR/onap-override.yaml $timestamp + +kubectl get pods -n onap +kubectl get namespaces diff --git a/smo-install/test/pythonsdk/src/orantests/configuration/settings.py b/smo-install/test/pythonsdk/src/orantests/configuration/settings.py index 78077b18..d1ab7a5c 100644 --- a/smo-install/test/pythonsdk/src/orantests/configuration/settings.py +++ b/smo-install/test/pythonsdk/src/orantests/configuration/settings.py @@ -81,6 +81,7 @@ POLICY_PAP_URL = "https://"+subprocess.run("kubectl get services policy-pap -n o POLICY_API_URL = "https://"+subprocess.run("kubectl get services policy-api -n onap |grep policy-api | awk '{print $3}'", shell=True, check=True, stdout=subprocess.PIPE).stdout.decode('utf-8').strip()+":6969" SDNC_URL = "http://"+subprocess.run("kubectl get services sdnc-oam -n onap |grep sdnc-oam | awk '{print $3}'", shell=True, check=True, stdout=subprocess.PIPE).stdout.decode('utf-8').strip()+":8282" CLAMP_URL = "https://"+subprocess.run("kubectl get services policy-clamp-be -n onap |grep policy-clamp-be | awk '{print $3}'", shell=True, check=True, stdout=subprocess.PIPE).stdout.decode('utf-8').strip()+":8443" +OOF_URL = "https://"+subprocess.run("kubectl get services oof-has-api -n onap |grep oof-has-api | awk '{print $3}'", shell=True, check=True, stdout=subprocess.PIPE).stdout.decode('utf-8').strip()+":8091" ### Network simulators topology NETWORK_SIMULATORS_RU_LIST = ["o-ru-11211","o-ru-11221","o-ru-11222","o-ru-11223"] @@ -109,3 +110,5 @@ CLAMP_CHECK_RETRY = 30 CLAMP_CHECK_TIMEOUT = 900 NETWORK_SIMULATOR_CHECK_RETRY = 30 NETWORK_SIMULATOR_CHECK_TIMEOUT = 900 +DEFAULT_CHECK_RETRY = 30 +DEFAULT_CHECK_TIMEOUT = 900 diff --git a/smo-install/test/pythonsdk/src/orantests/network_slicing/conftest.py b/smo-install/test/pythonsdk/src/orantests/network_slicing/conftest.py new file mode 100644 index 00000000..c580f56e --- /dev/null +++ b/smo-install/test/pythonsdk/src/orantests/network_slicing/conftest.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 +### +# ============LICENSE_START======================================================= +# ORAN SMO PACKAGE - PYTHONSDK TESTS +# ================================================================================ +# Copyright (C) 2022 AT&T Intellectual Property. 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============================================ +# =================================================================== +# +### +"""Module called by pytest.""" +import logging +import logging.config +from onapsdk.configuration import settings +from waiting import wait +from preparation.ns_simulators import NsSimulators +from oransdk.utils.healthcheck import HealthCheck + +logging.config.dictConfig(settings.LOG_CONFIG) +logger = logging.getLogger("Test Session setup") + +ns_sims = NsSimulators() + +###### Entry points of PYTEST Session +def pytest_sessionstart(): + """Pytest calls it when starting a test session.""" + logger.info("Check and wait for SMO to be running") + wait(lambda: HealthCheck.is_onap_up(18), sleep_seconds=settings.DEFAULT_CHECK_RETRY, timeout_seconds=settings.DEFAULT_CHECK_TIMEOUT, waiting_for="SMO to be ready") + logger.info("Check and wait for for Policy to be running") + wait(lambda: HealthCheck.policy_component_ready(), sleep_seconds=settings.DEFAULT_CHECK_RETRY, timeout_seconds=settings.DEFAULT_CHECK_TIMEOUT, waiting_for="Policy to be ready") + logger.info("Check and wait for for SDNC to be running") + wait(lambda: HealthCheck.sdnc_component_ready(), sleep_seconds=settings.DEFAULT_CHECK_RETRY, timeout_seconds=settings.DEFAULT_CHECK_TIMEOUT, waiting_for="SDNC to be ready") + logger.info("Check and wait for for SDC to be running") + wait(lambda: HealthCheck.sdc_component_ready(), sleep_seconds=settings.DEFAULT_CHECK_RETRY, timeout_seconds=settings.DEFAULT_CHECK_TIMEOUT, waiting_for="SDC to be ready") + logger.info("Check and wait for for AAI to be running") + wait(lambda: HealthCheck.aai_component_ready(), sleep_seconds=settings.DEFAULT_CHECK_RETRY, timeout_seconds=settings.DEFAULT_CHECK_TIMEOUT, waiting_for="AAI to be ready") + logger.info("Check and wait for for SO to be running") + wait(lambda: HealthCheck.so_component_ready(), sleep_seconds=settings.DEFAULT_CHECK_RETRY, timeout_seconds=settings.DEFAULT_CHECK_TIMEOUT, waiting_for="SO to be ready") + logger.info("Check and wait for for MSB to be running") + wait(lambda: HealthCheck.msb_component_ready(), sleep_seconds=settings.DEFAULT_CHECK_RETRY, timeout_seconds=settings.DEFAULT_CHECK_TIMEOUT, waiting_for="MSB to be ready") + logger.info("Check and wait for for OOF to be running") + wait(lambda: HealthCheck.oof_component_ready(), sleep_seconds=settings.DEFAULT_CHECK_RETRY, timeout_seconds=settings.DEFAULT_CHECK_TIMEOUT, waiting_for="OOF to be ready") + + ## Just kill any simulators that could already be running + ns_sims.stop_and_wait_ns_simulators() + + ###### END of FIRST start, now we can start the sims for the real tests. + logger.info("Tests session setup is ready") diff --git a/smo-install/test/pythonsdk/src/orantests/network_slicing/preparation/ns_simulators.py b/smo-install/test/pythonsdk/src/orantests/network_slicing/preparation/ns_simulators.py new file mode 100644 index 00000000..61e97428 --- /dev/null +++ b/smo-install/test/pythonsdk/src/orantests/network_slicing/preparation/ns_simulators.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 +### +# ============LICENSE_START======================================================= +# ORAN SMO PACKAGE - PYTHONSDK TESTS +# ================================================================================ +# Copyright (C) 2022 AT&T Intellectual Property. 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============================================ +# =================================================================== +# +### + +"""Network Slicing Simulators module.""" +import logging +import logging.config +from subprocess import check_output, run +from onapsdk.configuration import settings +from waiting import wait + +logging.config.dictConfig(settings.LOG_CONFIG) +logger = logging.getLogger("Network Slicing Simulators k8s") + +class NsSimulators(): + """Network Slicing simulators controls the simulators k8s deployment.""" + + @staticmethod + def start_ns_simulators(): + """Start all simulators.""" + logger.info("Start the network slicing simulators") + cmd = "kubectl create namespace nssimulators" + check_output(cmd, shell=True).decode('utf-8') + cmd = f"helm install --debug ns-simulators local/ns-simulators --namespace nssimulators" + check_output(cmd, shell=True).decode('utf-8') + + def start_and_wait_ns_simulators(self): + """Start and wait for all simulators.""" + logger.info("Start the network slicing simulators") + self.start_ns_simulators() + NsSimulators.wait_for_ns_simulators_to_be_running() + + def stop_and_wait_ns_simulators(self): + """Stop and wait for all simulators.""" + logger.info("Stop the network slicing simulators") + self.stop_ns_simulators() + NsSimulators.wait_for_ns_simulators_to_be_stopped() + + @staticmethod + def stop_ns_simulators(): + """Stop the simulators.""" + logger.info("Clean up any network slicing simulators") + cmd = "kubectl delete namespace nssimulators" + run(cmd, shell=True, check=False) + + @staticmethod + def is_ns_simulators_up() -> bool: + """Check if the network slicing simulators are up.""" + cmd = "kubectl get pods --field-selector status.phase!=Running -n nssimulators" + result = check_output(cmd, shell=True).decode('utf-8') + logger.info("Checking if network slicing simulators is UP: %s", result) + if result == '': + logger.info("Network slicing sims is Up") + return True + logger.info("Network slicing sims is Down") + return False + + + @staticmethod + def wait_for_ns_simulators_to_be_running(): + """Check and wait for the network slicing sims to be running.""" + wait(lambda: NsSimulators.is_ns_simulators_up(), sleep_seconds=settings.NETWORK_SIMULATOR_CHECK_RETRY, timeout_seconds=settings.NETWORK_SIMULATOR_CHECK_TIMEOUT, waiting_for="Network slicing simulators to be ready") + + @staticmethod + def is_ns_simulators_stopped() -> bool: + """Check if the network slicing simulators are stopped.""" + cmd = "kubectl get ns | grep nssimulators | wc -l" + result = check_output(cmd, shell=True).decode('utf-8') + logger.info("Checking if network slicing simulators is stopped: %s", result) + if int(result) == 0: + logger.info("Network slicing sims are Down") + return True + logger.info("Network slicing sims is still Up") + return False + + @staticmethod + def wait_for_ns_simulators_to_be_stopped(): + """Check and wait for the network slicing sims to be stopped.""" + wait(lambda: NsSimulators.is_ns_simulators_stopped(), sleep_seconds=settings.NETWORK_SIMULATOR_CHECK_RETRY, timeout_seconds=settings.NETWORK_SIMULATOR_CHECK_TIMEOUT, waiting_for="Network slicing simulators to be ready") diff --git a/smo-install/test/pythonsdk/src/orantests/network_slicing/test_network_slicing.py b/smo-install/test/pythonsdk/src/orantests/network_slicing/test_network_slicing.py index 54fb7352..b792311a 100644 --- a/smo-install/test/pythonsdk/src/orantests/network_slicing/test_network_slicing.py +++ b/smo-install/test/pythonsdk/src/orantests/network_slicing/test_network_slicing.py @@ -29,6 +29,7 @@ import logging.config import pytest from onapsdk.configuration import settings from preparation.aai_preparation import AaiPreparation +from preparation.ns_simulators import NsSimulators from preparation.oof_preparation import OofPreparation from preparation.sdc_preparation import SdcPreparation from preparation.so_preparation import SoPreparation @@ -44,12 +45,16 @@ aaiPreparation = AaiPreparation() oofPreparation = OofPreparation() msbPreparation = MsbPreparation() uuiPreparation = UuiPreparation() +ns_sims = NsSimulators() @pytest.fixture(scope="module", autouse=True) def pre_config(): """Set the onap components before executing the tests.""" logger.info("Test class setup for Network Slicing usecase Option2") + logger.info("Start needed simulators") + ns_sims.start_and_wait_ns_simulators() + logger.info("PreConfig Step1: Create SDC Templates") res = sdcPreparation.prepare_sdc() cst_id = res[0] @@ -83,6 +88,7 @@ def pre_config(): ### Cleanup code yield logger.info("Start to cleanup user case specific configurations") + ns_sims.stop_and_wait_ns_simulators() #aaiPreparation.cleanup_aai() #soPreparation.cleanup_so() #oofPreparation.cleanup_oof() diff --git a/smo-install/test/pythonsdk/src/orantests/oran_tests/conftest.py b/smo-install/test/pythonsdk/src/orantests/oran_tests/conftest.py index 9723a6d3..48314d5d 100644 --- a/smo-install/test/pythonsdk/src/orantests/oran_tests/conftest.py +++ b/smo-install/test/pythonsdk/src/orantests/oran_tests/conftest.py @@ -25,18 +25,13 @@ import logging import logging.config import os -from requests import RequestException from onapsdk.configuration import settings -from onapsdk.exceptions import ConnectionFailed, APIError from waiting import wait -from urllib3.exceptions import NewConnectionError -from oransdk.dmaap.dmaap import OranDmaap -from oransdk.policy.clamp import ClampToscaTemplate -from oransdk.policy.policy import OranPolicy -from oransdk.sdnc.sdnc import OranSdnc +from oransdk.utils.healthcheck import HealthCheck from smo.smo import Smo from smo.network_simulators import NetworkSimulators + # Set working dir as python script location abspath = os.path.abspath(__file__) dname = os.path.dirname(abspath) @@ -47,62 +42,19 @@ logger = logging.getLogger("Test Session setup") network_sims = NetworkSimulators("./resources") smo = Smo() -clamp = ClampToscaTemplate(settings.CLAMP_BASICAUTH) -dmaap = OranDmaap() -sdnc = OranSdnc() -policy = OranPolicy() - -def policy_component_ready(): - """Check if components are ready.""" - logger.info("Verify policy components are ready") - try: - policy_ready = {"api_ready": False, "pap_ready": False, "apex_ready": False} - except (RequestException, NewConnectionError, ConnectionFailed, APIError) as e: - logger.error(e) - return False - policy_status = policy.get_components_status(settings.POLICY_BASICAUTH) - if (policy_status["api"]["healthy"] and not policy_ready["api_ready"]): - logger.info("Policy Api is ready") - policy_ready["api_ready"] = True - if (policy_status["pap"]["healthy"] and not policy_ready["pap_ready"]): - logger.info("Policy Pap is ready") - policy_ready["pap_ready"] = True - if (len(policy_status["pdps"]["apex"]) > 0 and policy_status["pdps"]["apex"][0]["healthy"] == "HEALTHY" and not policy_ready["apex_ready"]): - logger.info("Policy Apex is ready") - policy_ready["apex_ready"] = True - return policy_ready["api_ready"] and policy_ready["pap_ready"] and policy_ready["apex_ready"] - -def sdnc_component_ready(): - """Check if SDNC component is ready.""" - logger.info("Verify sdnc component is ready") - - try: - response = OranSdnc.get_events(settings.SDNC_BASICAUTH, "test") - except (RequestException, NewConnectionError, ConnectionFailed, APIError) as e: - logger.error(e) - return False - return response.status_code == 200 - -def clamp_component_ready(): - """Check if Clamp component is ready.""" - logger.info("Verify Clamp component is ready") - try: - response = clamp.get_template_instance() - except (RequestException, NewConnectionError, ConnectionFailed, APIError) as e: - logger.error(e) - return False - return response["automationCompositionList"] is not None ###### Entry points of PYTEST Session def pytest_sessionstart(): """Pytest calls it when starting a test session.""" logger.info("Check and wait for SMO to be running") smo.wait_for_smo_to_be_running() - logger.info("Check and for for SDNC to be running") - wait(lambda: policy_component_ready(), sleep_seconds=settings.POLICY_CHECK_RETRY, timeout_seconds=settings.POLICY_CHECK_TIMEOUT, waiting_for="Policy to be ready") - wait(lambda: sdnc_component_ready(), sleep_seconds=settings.SDNC_CHECK_RETRY, timeout_seconds=settings.SDNC_CHECK_TIMEOUT, waiting_for="SDNC to be ready") - # disable for now, until policy/clamp issue has been fixed - wait(lambda: clamp_component_ready(), sleep_seconds=settings.CLAMP_CHECK_RETRY, timeout_seconds=settings.CLAMP_CHECK_TIMEOUT, waiting_for="Clamp to be ready") + + logger.info("Check and wait for for Policy to be running") + wait(lambda: HealthCheck.policy_component_ready(), sleep_seconds=settings.POLICY_CHECK_RETRY, timeout_seconds=settings.POLICY_CHECK_TIMEOUT, waiting_for="Policy to be ready") + logger.info("Check and wait for for SDNC to be running") + wait(lambda: HealthCheck.sdnc_component_ready(), sleep_seconds=settings.SDNC_CHECK_RETRY, timeout_seconds=settings.SDNC_CHECK_TIMEOUT, waiting_for="SDNC to be ready") + logger.info("Check and wait for for Clamp to be running") + wait(lambda: HealthCheck.clamp_component_ready(), sleep_seconds=settings.CLAMP_CHECK_RETRY, timeout_seconds=settings.CLAMP_CHECK_TIMEOUT, waiting_for="Clamp to be ready") ## Just kill any simulators that could already be runnin network_sims.stop_network_simulators() diff --git a/smo-install/test/pythonsdk/src/orantests/resources/cl-test-helm-chart/odu-app-1.0.0.tgz b/smo-install/test/pythonsdk/src/orantests/resources/cl-test-helm-chart/odu-app-1.0.0.tgz deleted file mode 100755 index b82abf21..00000000 Binary files a/smo-install/test/pythonsdk/src/orantests/resources/cl-test-helm-chart/odu-app-1.0.0.tgz and /dev/null differ diff --git a/smo-install/test/pythonsdk/src/orantests/resources/cl-test-helm-chart/odu-app-ics-version-1.0.0.tgz b/smo-install/test/pythonsdk/src/orantests/resources/cl-test-helm-chart/odu-app-ics-version-1.0.0.tgz deleted file mode 100755 index b78e502a..00000000 Binary files a/smo-install/test/pythonsdk/src/orantests/resources/cl-test-helm-chart/odu-app-ics-version-1.0.0.tgz and /dev/null differ diff --git a/smo-install/test/pythonsdk/src/orantests/resources/cl-test-helm-chart/oru-app-1.0.0.tgz b/smo-install/test/pythonsdk/src/orantests/resources/cl-test-helm-chart/oru-app-1.0.0.tgz deleted file mode 100755 index 387a7a26..00000000 Binary files a/smo-install/test/pythonsdk/src/orantests/resources/cl-test-helm-chart/oru-app-1.0.0.tgz and /dev/null differ diff --git a/smo-install/tests_oom/Makefile b/smo-install/tests_oom/Makefile index 3db2e129..4ca6a117 100644 --- a/smo-install/tests_oom/Makefile +++ b/smo-install/tests_oom/Makefile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -PARENT_CHART := oran-tests-suite ru-du-simulators +PARENT_CHART := oran-tests-suite ru-du-simulators ns-simulators COMMON_CHARTS_DIR := nonrtric-common aux-common ric-common # FIXME OOM-765 ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) diff --git a/smo-install/tests_oom/actn-simulator/Chart.yaml b/smo-install/tests_oom/actn-simulator/Chart.yaml new file mode 100644 index 00000000..35a7b8fe --- /dev/null +++ b/smo-install/tests_oom/actn-simulator/Chart.yaml @@ -0,0 +1,21 @@ +# ============LICENSE_START======================================================= +# Copyright © 2022 AT&T Intellectual Property +# +# 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. +# Static Defaults +# ============LICENSE_END========================================================= +apiVersion: v1 +appVersion: "1.0.0" +description: A Helm chart for core nssmf simulator +name: actn-simulator +version: 1.0.0 diff --git a/smo-install/tests_oom/actn-simulator/templates/deployment.yaml b/smo-install/tests_oom/actn-simulator/templates/deployment.yaml new file mode 100644 index 00000000..2f74ee40 --- /dev/null +++ b/smo-install/tests_oom/actn-simulator/templates/deployment.yaml @@ -0,0 +1,49 @@ +# ============LICENSE_START======================================================= +# Copyright © 2022 AT&T Intellectual Property +# +# 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. +# Static Defaults +# ============LICENSE_END========================================================= +{{- range $nodePort := .Values.service.nodePorts }} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ $.Values.config.name }}-{{ $nodePort }}" + labels: + sim-name: "{{ $.Values.config.name }}-{{ $nodePort }}" + release: {{ $.Release.Name }} + chart: {{ $.Chart.Name }} +spec: + replicas: 1 + selector: + matchLabels: + sim-name: "{{ $.Values.config.name }}-{{ $nodePort }}" + template: + metadata: + labels: + sim-name: "{{ $.Values.config.name }}-{{ $nodePort }}" + release: {{ $.Release.Name }} + chart: {{ $.Chart.Name }} + annotations: + checksum/config: {{ print "$.Values.config.name-$port" | sha256sum }} + spec: + hostname: "{{ $.Values.config.name }}-{{ $nodePort }}" + containers: + - name: {{ $.Chart.Name }} + image: "{{ $.Values.image.repository }}/{{ $.Values.image.name}}:{{ $.Values.image.tag }}" + imagePullPolicy: {{ $.Values.image.pullPolicy }} + tty: true + stdin: true + + {{- end }} \ No newline at end of file diff --git a/smo-install/tests_oom/actn-simulator/templates/service.yaml b/smo-install/tests_oom/actn-simulator/templates/service.yaml new file mode 100644 index 00000000..99405e87 --- /dev/null +++ b/smo-install/tests_oom/actn-simulator/templates/service.yaml @@ -0,0 +1,37 @@ +# ============LICENSE_START======================================================= +# Copyright © 2022 AT&T Intellectual Property +# +# 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. +# Static Defaults +# ============LICENSE_END========================================================= +{{ range $nodePort := .Values.service.nodePorts }} +--- +apiVersion: v1 +kind: Service +metadata: + name: "{{ $.Values.config.name }}-{{ $nodePort }}" + labels: + sim-name: "{{ $.Values.config.name }}-{{ $nodePort }}" + release: {{ $.Release.Name }} + chart: {{ $.Chart.Name }} +spec: + type: {{ $.Values.service.type }} + ports: + - port: {{ $.Values.service.port }} + nodePort: {{ $nodePort }} + selector: + sim-name: "{{ $.Values.config.name }}-{{ $nodePort }}" + release: {{ $.Release.Name }} + chart: {{ $.Chart.Name }} + + {{ end }} diff --git a/smo-install/tests_oom/actn-simulator/values.yaml b/smo-install/tests_oom/actn-simulator/values.yaml new file mode 100644 index 00000000..fa5a8358 --- /dev/null +++ b/smo-install/tests_oom/actn-simulator/values.yaml @@ -0,0 +1,33 @@ +# ============LICENSE_START======================================================= +# Copyright © 2022 AT&T Intellectual Property +# +# 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. +# Static Defaults +# ============LICENSE_END========================================================= +image: + repository: registry.hub.docker.com + name: dzhanghuawei/pncsimulator + tag: 1.1.0 + pullPolicy: IfNotPresent + +service: + port: 8181 + type: NodePort + nodePorts: + - 30181 + - 30182 + + +config: + name: pncsimu + diff --git a/smo-install/tests_oom/core-nssmf-simulator/Chart.yaml b/smo-install/tests_oom/core-nssmf-simulator/Chart.yaml new file mode 100644 index 00000000..b71b5a68 --- /dev/null +++ b/smo-install/tests_oom/core-nssmf-simulator/Chart.yaml @@ -0,0 +1,22 @@ +# ============LICENSE_START======================================================= +# Copyright © 2022 AT&T Intellectual Property +# +# 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. +# Static Defaults +# ============LICENSE_END========================================================= + +apiVersion: v1 +appVersion: "1.0.0" +description: A Helm chart for core nssmf simulator +name: core-nssmf-simulator +version: 1.0.0 diff --git a/smo-install/tests_oom/core-nssmf-simulator/resources/config/application.properties b/smo-install/tests_oom/core-nssmf-simulator/resources/config/application.properties new file mode 100644 index 00000000..66d486b1 --- /dev/null +++ b/smo-install/tests_oom/core-nssmf-simulator/resources/config/application.properties @@ -0,0 +1,18 @@ +server.port={{ .Values.service.ports.port }} +notifyurl=http://192.168.235.25:30472/v1/pm/notification +ftppath=sftp://root:oom@192.168.235.25:22/home/ubuntu/dcae/PM.tar.gz +fixeddelay=900000 +filepath=/app/dcae +amffilepath=/app/dcae/AMF.xml.gz +upffilepath=/app/dcae/UPF.xml.gz + +logging.file=/root/luk/simulator/log + +spring.jackson.default-property-inclusion=NON_NULL +#logging.path=/home/ubuntu/dcae/ +#logging.file=simulator.log + +server.ssl.key-store=/home/onap/app/luk.keystore +server.ssl.key-store-password=tomcat +server.ssl.keyStoreType=JKS +server.ssl.keyAlias:luk \ No newline at end of file diff --git a/smo-install/tests_oom/core-nssmf-simulator/resources/config/luk.keystore b/smo-install/tests_oom/core-nssmf-simulator/resources/config/luk.keystore new file mode 100644 index 00000000..54a6455a Binary files /dev/null and b/smo-install/tests_oom/core-nssmf-simulator/resources/config/luk.keystore differ diff --git a/smo-install/tests_oom/core-nssmf-simulator/templates/configmap.yaml b/smo-install/tests_oom/core-nssmf-simulator/templates/configmap.yaml new file mode 100644 index 00000000..e7a4b12b --- /dev/null +++ b/smo-install/tests_oom/core-nssmf-simulator/templates/configmap.yaml @@ -0,0 +1,38 @@ +# ============LICENSE_START======================================================= +# Copyright © 2022 AT&T Intellectual Property +# +# 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. +# Static Defaults +# ============LICENSE_END========================================================= +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ $.Values.config.name }}-configmap + labels: + sim-name: {{ $.Values.config.name }} + release: {{ $.Release.Name }} + chart: {{ $.Chart.Name }} +data: +{{ tpl ($.Files.Glob "resources/config/application.properties").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ $.Values.config.name }}-keystore + labels: + sim-name: {{ $.Values.config.name }} + release: {{ $.Release.Name }} + chart: {{ $.Chart.Name }} +type: Opaque +data: + {{ tpl ($.Files.Glob "resources/config/luk.keystore").AsSecrets . | indent 2 }} diff --git a/smo-install/tests_oom/core-nssmf-simulator/templates/deployment.yaml b/smo-install/tests_oom/core-nssmf-simulator/templates/deployment.yaml new file mode 100644 index 00000000..2598c619 --- /dev/null +++ b/smo-install/tests_oom/core-nssmf-simulator/templates/deployment.yaml @@ -0,0 +1,69 @@ +# ============LICENSE_START======================================================= +# Copyright © 2022 AT&T Intellectual Property +# +# 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. +# Static Defaults +# ============LICENSE_END========================================================= + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ $.Values.config.name }} + labels: + sim-name: {{ $.Values.config.name }} + release: {{ $.Release.Name }} + chart: {{ $.Chart.Name }} +spec: + replicas: {{ $.Values.replicaCount }} + selector: + matchLabels: + sim-name: {{ $.Values.config.name }} + template: + metadata: + labels: + sim-name: {{ $.Values.config.name }} + release: {{ $.Release.Name }} + chart: {{ $.Chart.Name }} + annotations: + checksum/config: {{ print .Values | sha256sum }} + spec: + hostname: "{{ $.Values.config.name }}" + containers: + - name: {{ $.Chart.Name }} + image: "{{ $.Values.image.repository }}/{{ $.Values.image.name}}:{{ $.Values.image.tag }}" + imagePullPolicy: {{ $.Values.image.pullPolicy }} + command: + - /home/onap/startup.sh + ports: + - containerPort: {{ $.Values.service.ports.port }} + protocol: TCP + volumeMounts: + - name: {{ $.Values.config.name }}-config-volume + subPath: application.properties + mountPath: /app/application.properties + - name: {{ $.Values.config.name }}-keystore + subPath: luk.keystore + mountPath: /app/luk.keystore + volumes: + - name: {{ $.Values.config.name }}-config-volume + configMap: + name: {{ $.Values.config.name }}-configmap + items: + - key: application.properties + path: application.properties + - name: {{ $.Values.config.name }}-keystore + secret: + secretName: {{ $.Values.config.name }}-keystore + items: + - key: luk.keystore + path: luk.keystore diff --git a/smo-install/tests_oom/core-nssmf-simulator/templates/service.yaml b/smo-install/tests_oom/core-nssmf-simulator/templates/service.yaml new file mode 100644 index 00000000..fcf2ba56 --- /dev/null +++ b/smo-install/tests_oom/core-nssmf-simulator/templates/service.yaml @@ -0,0 +1,34 @@ +# ============LICENSE_START======================================================= +# Copyright © 2022 AT&T Intellectual Property +# +# 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. +# Static Defaults +# ============LICENSE_END========================================================= + +apiVersion: v1 +kind: Service +metadata: + name: "{{ $.Values.config.name }}" + labels: + sim-name: {{ $.Values.config.name }} + release: {{ $.Release.Name }} + chart: {{ $.Chart.Name }} +spec: + type: {{ $.Values.service.type }} + ports: + - port: {{ $.Values.service.ports.port }} + nodePort: {{ $.Values.service.ports.port }} + selector: + tests-name: {{ $.Values.config.name }} + release: {{ $.Release.Name }} + chart: {{ $.Chart.Name }} \ No newline at end of file diff --git a/smo-install/tests_oom/core-nssmf-simulator/values.yaml b/smo-install/tests_oom/core-nssmf-simulator/values.yaml new file mode 100644 index 00000000..aad709ce --- /dev/null +++ b/smo-install/tests_oom/core-nssmf-simulator/values.yaml @@ -0,0 +1,30 @@ +# ============LICENSE_START======================================================= +# Copyright © 2022 AT&T Intellectual Property +# +# 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. +# Static Defaults +# ============LICENSE_END========================================================= +image: + repository: 'nexus3.onap.org:10001' + name: core-nssmf-simulator + tag: 1.0.0 + pullPolicy: IfNotPresent + +service: + type: NodePort + ports: + port: 31111 + +config: + name: core-nssmf-simulator + diff --git a/smo-install/tests_oom/ns-simulators/Chart.yaml b/smo-install/tests_oom/ns-simulators/Chart.yaml new file mode 100644 index 00000000..8b85da99 --- /dev/null +++ b/smo-install/tests_oom/ns-simulators/Chart.yaml @@ -0,0 +1,24 @@ +# Copyright © 2022 AT&T Intellectual Property +# +# 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. + +apiVersion: v1 +name: ns-simulators +version: 1.0.0 +appVersion: test +description: Network Slicing simulators +home: https://www.onap.org +sources: +- https://gerrit.onap.org/r/#/admin/projects/ +icon: https://wiki.onap.org/download/thumbnails/1015829/onap_704x271%20copy.png?version=1&modificationDate=1488326334000&api=v2 +kubeVersion: ">=1.11.5-0" diff --git a/smo-install/tests_oom/ns-simulators/requirements.yaml b/smo-install/tests_oom/ns-simulators/requirements.yaml new file mode 100644 index 00000000..f37e8bca --- /dev/null +++ b/smo-install/tests_oom/ns-simulators/requirements.yaml @@ -0,0 +1,29 @@ +# Copyright © 2022 AT&T Intellectual Property +# +# 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. + +dependencies: + - name: actn-simulator + version: ~1.0.0 + repository: "@local" + condition: ns-simulators.actn-simulator + + - name: core-nssmf-simulator + version: ~1.0.0 + repository: "@local" + condition: ns-simulators.core-nssmf-simulator + + - name: ran-nssmf-simulator + version: ~1.0.0 + repository: "@local" + condition: ns-simulators.ran-nssmf-simulator diff --git a/smo-install/tests_oom/ns-simulators/values.yaml b/smo-install/tests_oom/ns-simulators/values.yaml new file mode 100644 index 00000000..f9f91edf --- /dev/null +++ b/smo-install/tests_oom/ns-simulators/values.yaml @@ -0,0 +1,18 @@ +# Copyright © 2022 AT&T Intellectual Property +# +# 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. + +ns-simulators: + actn-simulator: true + core-nssmf-simulator: true + ran-nssmf-simulator: true diff --git a/smo-install/tests_oom/ran-nssmf-simulator/Chart.yaml b/smo-install/tests_oom/ran-nssmf-simulator/Chart.yaml new file mode 100644 index 00000000..c93ba71e --- /dev/null +++ b/smo-install/tests_oom/ran-nssmf-simulator/Chart.yaml @@ -0,0 +1,22 @@ +# ============LICENSE_START======================================================= +# Copyright © 2022 AT&T Intellectual Property +# +# 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. +# Static Defaults +# ============LICENSE_END========================================================= + +apiVersion: v1 +appVersion: "1.0.0" +description: A Helm chart for ran nssmf simulator +name: ran-nssmf-simulator +version: 1.0.0 diff --git a/smo-install/tests_oom/ran-nssmf-simulator/templates/deployment.yaml b/smo-install/tests_oom/ran-nssmf-simulator/templates/deployment.yaml new file mode 100644 index 00000000..7ee7f384 --- /dev/null +++ b/smo-install/tests_oom/ran-nssmf-simulator/templates/deployment.yaml @@ -0,0 +1,45 @@ +# ============LICENSE_START======================================================= +# Copyright © 2022 AT&T Intellectual Property +# +# 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. +# Static Defaults +# ============LICENSE_END========================================================= +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ $.Values.config.name }}" + labels: + sim-name: "{{ $.Values.config.name }}" + release: {{ $.Release.Name }} + chart: {{ $.Chart.Name }} +spec: + replicas: 1 + selector: + matchLabels: + sim-name: "{{ $.Values.config.name }}" + template: + metadata: + labels: + sim-name: "{{ $.Values.config.name }}" + release: {{ $.Release.Name }} + chart: {{ $.Chart.Name }} + annotations: + checksum/config: {{ print .Values | sha256sum }} + spec: + hostname: "{{ $.Values.config.name }}" + containers: + - name: {{ $.Chart.Name }} + image: "{{ $.Values.image.repository }}/{{ $.Values.image.name}}:{{ $.Values.image.tag }}" + imagePullPolicy: {{ $.Values.image.pullPolicy }} + tty: true + stdin: true diff --git a/smo-install/tests_oom/ran-nssmf-simulator/templates/service.yaml b/smo-install/tests_oom/ran-nssmf-simulator/templates/service.yaml new file mode 100644 index 00000000..8438d29f --- /dev/null +++ b/smo-install/tests_oom/ran-nssmf-simulator/templates/service.yaml @@ -0,0 +1,33 @@ +# ============LICENSE_START======================================================= +# Copyright © 2022 AT&T Intellectual Property +# +# 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. +# Static Defaults +# ============LICENSE_END========================================================= +apiVersion: v1 +kind: Service +metadata: + name: "{{ $.Values.config.name }}" + labels: + sim-name: {{ $.Values.config.name }} + release: {{ $.Release.Name }} + chart: {{ $.Chart.Name }} +spec: + type: {{ $.Values.service.type }} + ports: + - port: 8443 + nodePort: {{ $.Values.service.nodePorts }} + selector: + tests-name: {{ $.Values.config.name }} + release: {{ $.Release.Name }} + chart: {{ $.Chart.Name }} \ No newline at end of file diff --git a/smo-install/tests_oom/ran-nssmf-simulator/values.yaml b/smo-install/tests_oom/ran-nssmf-simulator/values.yaml new file mode 100644 index 00000000..894a2c6f --- /dev/null +++ b/smo-install/tests_oom/ran-nssmf-simulator/values.yaml @@ -0,0 +1,29 @@ +# ============LICENSE_START======================================================= +# Copyright © 2022 AT&T Intellectual Property +# +# 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. +# Static Defaults +# ============LICENSE_END========================================================= +image: + repository: 'nexus3.onap.org:10001' + name: onap/ran-nssmf-simulator + tag: 1.0.0 + pullPolicy: IfNotPresent + +service: + type: NodePort + nodePort: 18443 + +config: + name: ran-nssmf-simulator +