From d1cdcb0bc12e4bd451a312ddd4a7d97b6a1e1cd7 Mon Sep 17 00:00:00 2001 From: softir Date: Wed, 16 Sep 2020 11:23:26 +0200 Subject: [PATCH 01/43] CT-147: modified linting stage for common package --- .gitlab-ci.yml | 1 + csp-lmc-common/.gitlab-ci.yml | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3a4366d..a89d2bf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,6 +36,7 @@ cache: # pages: create the badges stages: - build_common + - linting_common - test_common - publish_common - build diff --git a/csp-lmc-common/.gitlab-ci.yml b/csp-lmc-common/.gitlab-ci.yml index 0be7f45..faa5fd1 100644 --- a/csp-lmc-common/.gitlab-ci.yml +++ b/csp-lmc-common/.gitlab-ci.yml @@ -80,19 +80,18 @@ test:csp-lmc-common: - make test # # linting stage -.linting_common: + +linting:csp-lmc-common: extends: .test_common - stage: linting + stage: linting_common dependencies: [] script: - apt-get -y update - apt-get install -y python3-pip python3-setuptools python3-wheel --no-install-recommends - cd $COMMON_BUILD_PATH - make lint - -linting:csp-lmc-common: - extends: .linting_common - dependencies: [] + - pwd + - ls -alR # # Publish csp-lmc-common python package -- GitLab From 2ed0da781fd617f1374d2a3e99476994cb536328 Mon Sep 17 00:00:00 2001 From: softir Date: Wed, 16 Sep 2020 11:55:30 +0200 Subject: [PATCH 02/43] CT-147: try to run pylint without starting the devices. --- csp-lmc-common/.gitlab-ci.yml | 16 +++++++++++++--- csp-lmc-common/requirements.txt | 3 +++ 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 csp-lmc-common/requirements.txt diff --git a/csp-lmc-common/.gitlab-ci.yml b/csp-lmc-common/.gitlab-ci.yml index faa5fd1..04eca0f 100644 --- a/csp-lmc-common/.gitlab-ci.yml +++ b/csp-lmc-common/.gitlab-ci.yml @@ -82,16 +82,26 @@ test:csp-lmc-common: # linting stage linting:csp-lmc-common: - extends: .test_common + image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest stage: linting_common + tags: + - docker-executor + artifacts: + paths: + - ./$COMMON_BUILD_PATH/build/ dependencies: [] script: - apt-get -y update - apt-get install -y python3-pip python3-setuptools python3-wheel --no-install-recommends + - python3 -m pip install pylint2junit - cd $COMMON_BUILD_PATH - - make lint - - pwd + - python3 -m pip install --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple -r requirements.txt + - mkdir -p build/reports + - pylint --output-format=parseable csp_lmc_common | tee /build/csp_lmc_common-code-analysis.stdout + - pylint --output-format=pylint2junit.JunitReporter csp_lmc_common > /build/reports/csp-lmc-common-linting.xml - ls -alR + variables: + COMMON_BUILD_PATH: csp-lmc-common # # Publish csp-lmc-common python package diff --git a/csp-lmc-common/requirements.txt b/csp-lmc-common/requirements.txt new file mode 100644 index 0000000..0d09264 --- /dev/null +++ b/csp-lmc-common/requirements.txt @@ -0,0 +1,3 @@ +numpy == 1.17.2 +pytango >= 9.3.2 +lmcbaseclasses >= 0.6.4 -- GitLab From 777cdb0bfbae104e63b37faf2bce4d8183c591b4 Mon Sep 17 00:00:00 2001 From: softir Date: Wed, 16 Sep 2020 12:00:39 +0200 Subject: [PATCH 03/43] CT-147: fix issue in output directory to store results. --- csp-lmc-common/.gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csp-lmc-common/.gitlab-ci.yml b/csp-lmc-common/.gitlab-ci.yml index 04eca0f..d1a89d1 100644 --- a/csp-lmc-common/.gitlab-ci.yml +++ b/csp-lmc-common/.gitlab-ci.yml @@ -97,8 +97,8 @@ linting:csp-lmc-common: - cd $COMMON_BUILD_PATH - python3 -m pip install --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple -r requirements.txt - mkdir -p build/reports - - pylint --output-format=parseable csp_lmc_common | tee /build/csp_lmc_common-code-analysis.stdout - - pylint --output-format=pylint2junit.JunitReporter csp_lmc_common > /build/reports/csp-lmc-common-linting.xml + - pylint --output-format=parseable csp_lmc_common | tee ./build/csp_lmc_common-code-analysis.stdout + - pylint --output-format=pylint2junit.JunitReporter csp_lmc_common > ./build/reports/csp-lmc-common-linting.xml - ls -alR variables: COMMON_BUILD_PATH: csp-lmc-common -- GitLab From b69fcd4281924dafecc385c2f3faaa82450e2428 Mon Sep 17 00:00:00 2001 From: softir Date: Wed, 16 Sep 2020 12:25:00 +0200 Subject: [PATCH 04/43] CT-147: specified default image to use. Moved page stage before publish. --- .gitlab-ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a89d2bf..3014950 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ # GitLab CI in conjunction with GitLab Runner can use Docker Engine to test and build any application. # Docker, when used with GitLab CI, runs each job in a separate and isolated container using the predefined image that is set up in .gitlab-ci.yml. # In this case we use the latest python docker image to build and test this project. -#image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest +image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest variables: DOCKER_DRIVER: overlay2 @@ -32,8 +32,9 @@ cache: # build: build the docker images for csp-lmc-mid and csp-lmc-low # test: execute tests on csp-lmc-common, csp-lmc-mid, csp-lmc-low # package: create the python packages for common, mid and low -# publish: publish on nexus the mid and low images and the common python package -# pages: create the badges +# publish: publish on nexus the mid common python packages +# pages: move the metrics files to the right folder +# release release the images for csp-lmc-low and mid (only manual) stages: - build_common - linting_common @@ -42,8 +43,8 @@ stages: - build - test - linting - - publish - pages + - publish - release .install_pip: &install_pip |- @@ -72,7 +73,7 @@ pages: script: - pwd - python3 -m pip install junitparser - #update coverage o the last release + #update coverage to the last release - python3 -m pip install --upgrade coverage - ls -lR # copy the content of packages folders in public -- GitLab From 33436db6fa7eee3b74c2bf14c0bf7bbe403a9f4d Mon Sep 17 00:00:00 2001 From: softir Date: Wed, 16 Sep 2020 14:13:17 +0200 Subject: [PATCH 05/43] CT-147: no need to start docker containers to run tests. Commented connection to TANGO DB in CspMaster and CspSubarray. --- csp-lmc-common/.gitlab-ci.yml | 15 +- csp-lmc-common/conftest.py | 87 -------- csp-lmc-common/csp_lmc_common/CspMaster.py | 48 ++--- csp-lmc-common/csp_lmc_common/CspSubarray.py | 42 ++-- csp-lmc-common/csp_lmc_common/__init__.py | 8 + csp-lmc-common/requirements-tst.txt | 9 + csp-lmc-common/requirements.txt | 1 + csp-lmc-common/setup.py | 8 +- csp-lmc-common/tests/CspMaster_test.py | 188 ------------------ csp-lmc-common/tests/CspSubarray_test.py | 111 ----------- csp-lmc-common/tests/conftest.py | 166 ++++++++++++++++ csp-lmc-common/tests/unit/CspMaster_test.py | 130 ++++++++++++ csp-lmc-common/tests/unit/CspSubarray_test.py | 100 ++++++++++ csp-lmc-common/tests/unit/conftest.py | 75 +++++++ 14 files changed, 552 insertions(+), 436 deletions(-) delete mode 100644 csp-lmc-common/conftest.py create mode 100644 csp-lmc-common/requirements-tst.txt delete mode 100755 csp-lmc-common/tests/CspMaster_test.py delete mode 100755 csp-lmc-common/tests/CspSubarray_test.py create mode 100644 csp-lmc-common/tests/conftest.py create mode 100755 csp-lmc-common/tests/unit/CspMaster_test.py create mode 100755 csp-lmc-common/tests/unit/CspSubarray_test.py create mode 100644 csp-lmc-common/tests/unit/conftest.py diff --git a/csp-lmc-common/.gitlab-ci.yml b/csp-lmc-common/.gitlab-ci.yml index d1a89d1..81e2e6a 100644 --- a/csp-lmc-common/.gitlab-ci.yml +++ b/csp-lmc-common/.gitlab-ci.yml @@ -70,14 +70,23 @@ build:csp-lmc-common_image: paths: - ./$COMMON_BUILD_PATH/build/ variables: - COMMON_BUILD_PATH: csp-lmc-common/docker + COMMON_BUILD_PATH: csp-lmc-common test:csp-lmc-common: extends: .test_common stage: test_common script: - - cd $COMMON_BUILD_PATH - - make test + - cd $COMMON_BUILD_PATH + - pwd + - python3 -m pip install -r requirements-tst.txt + - python3 -m pip install --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple -r requirements.txt + - python3 setup.py test |tee setup_py_test.stdout + - pwd + - mkdir -p build/reports + - ls -alR + - mv setup_py_test.stdout build/csp-lmc-common-setup-test.stdout + - mv htmlcov build/csp-lmc-common_htmlcov + - mv coverage.xml build # # linting stage diff --git a/csp-lmc-common/conftest.py b/csp-lmc-common/conftest.py deleted file mode 100644 index 080583b..0000000 --- a/csp-lmc-common/conftest.py +++ /dev/null @@ -1,87 +0,0 @@ -""" -A module defining a list of fixture functions. -""" -import importlib -import pytest - -import tango -from unittest import mock -from tango import DeviceProxy -from tango.test_context import DeviceTestContext - -@pytest.fixture(scope="class") -def tango_context(request): - """Creates and returns a TANGO DeviceTestContext object. - - Parameters - ---------- - request: _pytest.fixtures.SubRequest - A request object gives access to the requesting test context. - """ - test_properties = { - 'CspMaster': {'SkaLevel': '2', - 'CspCbf': 'mid_csp_cbf/sub_elt/master', - 'CspPss': 'mid_csp_pss/sub_elt/master', - 'CspPst': 'mid_csp_pst/sub_elt/master', - }, - 'CspSubarray': {'CspMaster': 'common/elt/master', - 'CbfSubarray': 'mid_csp_cbf/sub_elt/subarray_01', - 'PssSubarray': 'mid_csp_pss/sub_elt/subarray_01', - 'SubID' : 1, - }, - } - # TODO: package_name and class_name can be used in future - # fq_test_class_name = request.cls.__module__ - # fq_test_class_name_details = fq_test_class_name.split(".") - # package_name = fq_test_class_name_details[1] - # class_name = module_name = fq_test_class_name_details[1] - test_class_name = request.cls.__name__ - class_name = test_class_name.split('Test', 1)[-1] - module = importlib.import_module("{}.{}".format("csp_lmc_common", class_name)) - klass = getattr(module, class_name) - tango_context = DeviceTestContext(klass, properties=test_properties.get(class_name)) - tango_context.start() - yield tango_context - tango_context.stop() - -# -# NOTE: if initialize_device is called, the tests crash with error because during the -# CspMaster and CspMaster access to the TANGO DB to get the memorized attributes. -# Need to mock the call to the TANGO DB get_device_attribute -@pytest.fixture(scope="function") -def initialize_device(tango_context): - """Re-initializes the device. - - Parameters - ---------- - tango_context: tango.test_context.DeviceTestContext - Context to run a device without a database. - """ - yield tango_context.device.Init() - -@pytest.fixture(scope="class") -def cbf_master(): - """Create DeviceProxy for the CbfMaster device - to test the device with the TANGO DB - """ - database = tango.Database() - instance_list = database.get_device_exported_for_class('CbfMaster') - for instance in instance_list.value_string: - try: - return tango.DeviceProxy(instance) - except tango.DevFailed: - continue - - -@pytest.fixture(scope="class") -def csp_master(): - """Create DeviceProxy for the CspMaster device - to test the device with the TANGO DB - """ - database = tango.Database() - instance_list = database.get_device_exported_for_class('CspMaster') - for instance in instance_list.value_string: - try: - return tango.DeviceProxy(instance) - except tango.DevFailed: - continue diff --git a/csp-lmc-common/csp_lmc_common/CspMaster.py b/csp-lmc-common/csp_lmc_common/CspMaster.py index 0199ba8..89d082d 100644 --- a/csp-lmc-common/csp_lmc_common/CspMaster.py +++ b/csp-lmc-common/csp_lmc_common/CspMaster.py @@ -1212,12 +1212,12 @@ class CspMaster(SKAMaster): self._build_state = '{}, {}, {}'.format(release.name, release.version, release.description) self._version_id = release.version # connect to TANGO DB - csp_tango_db = tango.Database() + #csp_tango_db = tango.Database() # read the CSP memorized attributes from the TANGO DB. # Note: a memorized attribute has defined the attribute # property '__value' - attribute_properties = csp_tango_db.get_device_attribute_property(self.get_name(), - {'adminMode': ['__value']}) + #attribute_properties = csp_tango_db.get_device_attribute_property(self.get_name(), + # {'adminMode': ['__value']}) # set init values for the CSP Element and Sub-element SCM states self.set_state(tango.DevState.INIT) self._health_state = HealthState.OK @@ -1233,16 +1233,16 @@ class CspMaster(SKAMaster): # build a dictionary with the (attr_name, value) of the memorized attributes # use memorized atrtibute if present, otherwise the default one - memorized_attr_dict = {attr_name : int(value[0]) for attr_name, db_key in attribute_properties.items() - for key, value in db_key.items() - if key == '__value'} - try: - self._admin_mode = memorized_attr_dict['adminMode'] - if self._admin_mode not in [AdminMode.ONLINE, AdminMode.MAINTENANCE]: - self._health_state = HealthState.UNKNOWN - self.set_state(tango.DevState.DISABLE) - except KeyError as key_err: - self.logger.info("Key {} not found".format(key_err)) + #memorized_attr_dict = {attr_name : int(value[0]) for attr_name, db_key in attribute_properties.items() + # for key, value in db_key.items() + # if key == '__value'} + #try: + # self._admin_mode = memorized_attr_dict['adminMode'] + # if self._admin_mode not in [AdminMode.ONLINE, AdminMode.MAINTENANCE]: + # self._health_state = HealthState.UNKNOWN + # self.set_state(tango.DevState.DISABLE) + #except KeyError as key_err: + # self.logger.info("Key {} not found".format(key_err)) # initialize list with CSP sub-element FQDNs self._se_fqdn = [] @@ -1260,17 +1260,17 @@ class CspMaster(SKAMaster): # read the sub-elements adminMode (memorized) attributes from # the TANGO DB. # Note: a memorized attribute has defined the attribute property '__value' - for fqdn in self._se_fqdn: - attribute_properties = csp_tango_db.get_device_attribute_property(fqdn, - {'adminMode': ['__value']}) - self.logger.info("fqdn: {} attribute_properties: {}".format(fqdn, attribute_properties)) - try: - admin_mode_memorized = attribute_properties['adminMode']['__value'] - self._se_admin_mode[fqdn] = int(admin_mode_memorized[0]) - except KeyError as key_err: - msg = ("No key {} found for sub-element {}" - " adminMode attribute".format(key_err, fqdn)) - self.logger.info(msg) + #for fqdn in self._se_fqdn: + # attribute_properties = csp_tango_db.get_device_attribute_property(fqdn, + # {'adminMode': ['__value']}) + # self.logger.info("fqdn: {} attribute_properties: {}".format(fqdn, attribute_properties)) + # try: + # admin_mode_memorized = attribute_properties['adminMode']['__value'] + # self._se_admin_mode[fqdn] = int(admin_mode_memorized[0]) + # except KeyError as key_err: + # msg = ("No key {} found for sub-element {}" + # " adminMode attribute".format(key_err, fqdn)) + # self.logger.info(msg) # _se_proxies: the sub-element proxies # implemented as dictionary: diff --git a/csp-lmc-common/csp_lmc_common/CspSubarray.py b/csp-lmc-common/csp_lmc_common/CspSubarray.py index d81b535..f52a859 100644 --- a/csp-lmc-common/csp_lmc_common/CspSubarray.py +++ b/csp-lmc-common/csp_lmc_common/CspSubarray.py @@ -156,25 +156,25 @@ class CspSubarray(SKASubarray): device._sc_subarray_obs_state = defaultdict(lambda: ObsState.IDLE) device._sc_subarray_obs_mode = defaultdict(lambda: ObsMode.IDLE) device._mutex_obs_state = threading.Lock() - device._csp_tango_db = tango.Database() + #device._csp_tango_db = tango.Database() # read the CSP memorized attributes from the TANGO DB. # Note: a memorized attribute has defined the attribute # property '__value' - attribute_properties = device._csp_tango_db.get_device_attribute_property(device.get_name(), - {'adminMode': ['__value']}) + #attribute_properties = device._csp_tango_db.get_device_attribute_property(device.get_name(), + # {'adminMode': ['__value']}) # build a dictionary with the (attr_name, value) of the memorized attributes # use memorized atrtibute if present, otherwise the default one - memorized_attr_dict = {attr_name : int(value[0]) for attr_name, db_key in attribute_properties.items() - for key, value in db_key.items() - if key == '__value'} - try: - device._admin_mode = memorized_attr_dict['adminMode'] - if device._admin_mode not in [AdminMode.ONLINE, AdminMode.MAINTENANCE]: - device._health_state = HealthState.UNKNOWN - device.set_state(tango.DevState.DISABLE) + #memorized_attr_dict = {attr_name : int(value[0]) for attr_name, db_key in attribute_properties.items() + # for key, value in db_key.items() + # if key == '__value'} + #try: + # device._admin_mode = memorized_attr_dict['adminMode'] + # if device._admin_mode not in [AdminMode.ONLINE, AdminMode.MAINTENANCE]: + # device._health_state = HealthState.UNKNOWN + # device.set_state(tango.DevState.DISABLE) - except KeyError as key_err: - device.logger.info("Key {} not found".format(key_err)) + #except KeyError as key_err: + # device.logger.info("Key {} not found".format(key_err)) # list of sub-array sub-component FQDNs device._sc_subarray_fqdn = [] @@ -1653,14 +1653,14 @@ class CspSubarray(SKASubarray): return # read the sub-componet adminMode (memorized) attribute from # the CSP.LMC TANGO DB. - attribute_properties = self._csp_tango_db.get_device_attribute_property(fqdn, - {'adminMode': ['__value']}) - self.logger.debug("fqdn: {} attribute_properties: {}".format(fqdn, attribute_properties)) - try: - admin_mode_memorized = attribute_properties['adminMode']['__value'] - self._sc_subarray_admin_mode[fqdn] = int(admin_mode_memorized[0]) - except KeyError as key_error: - self.logger.warning("No key {} found".format(str(key_error))) + #attribute_properties = self._csp_tango_db.get_device_attribute_property(fqdn, + # {'adminMode': ['__value']}) + #self.logger.debug("fqdn: {} attribute_properties: {}".format(fqdn, attribute_properties)) + #try: + # admin_mode_memorized = attribute_properties['adminMode']['__value'] + # self._sc_subarray_admin_mode[fqdn] = int(admin_mode_memorized[0]) + #except KeyError as key_error: + # self.logger.warning("No key {} found".format(str(key_error))) try: log_msg = "Trying connection to " + str(fqdn) + " device" self.logger.info(log_msg) diff --git a/csp-lmc-common/csp_lmc_common/__init__.py b/csp-lmc-common/csp_lmc_common/__init__.py index e69de29..6714272 100644 --- a/csp-lmc-common/csp_lmc_common/__init__.py +++ b/csp-lmc-common/csp_lmc_common/__init__.py @@ -0,0 +1,8 @@ +__all__ = [ + "CspMaster", + "CspSubarray", +] + +from .CspMaster import CspMaster +from .CspSubarray import CspSubarray + diff --git a/csp-lmc-common/requirements-tst.txt b/csp-lmc-common/requirements-tst.txt new file mode 100644 index 0000000..67c373b --- /dev/null +++ b/csp-lmc-common/requirements-tst.txt @@ -0,0 +1,9 @@ +pytest +pytest-bdd +pytest-cov +pytest-json-report +pytest-mock +#pytest-xdist == 1.34.0 +pycodestyle +coverage +mock diff --git a/csp-lmc-common/requirements.txt b/csp-lmc-common/requirements.txt index 0d09264..c1deb4d 100644 --- a/csp-lmc-common/requirements.txt +++ b/csp-lmc-common/requirements.txt @@ -1,3 +1,4 @@ numpy == 1.17.2 pytango >= 9.3.2 +jsonschema >= 3.2.0 lmcbaseclasses >= 0.6.4 diff --git a/csp-lmc-common/setup.py b/csp-lmc-common/setup.py index f0281d5..e61ff13 100644 --- a/csp-lmc-common/setup.py +++ b/csp-lmc-common/setup.py @@ -8,6 +8,7 @@ import os import sys +import setuptools from setuptools import setup, find_packages setup_dir = os.path.dirname(os.path.abspath(__file__)) @@ -38,7 +39,10 @@ setup( install_requires = [ 'pytango >9.3.1', 'future', - 'lmcbaseclasses==0.6.5+221be16f' + 'lmcbaseclasses==0.6.5' + ], + dependency_links=[ + 'https://nexus.engageska-portugal.pt/repository/pypi/simple' ], setup_requires=[ 'pytest-runner', @@ -47,7 +51,7 @@ setup( ], test_suite="test", entry_points={'console_scripts':[ - 'CspMaster = csp_lmc_common.CspMaster:main', + 'CspMaster=csp_lmc_common.CspMaster:main', 'CspSubarray=csp_lmc_common.CspSubarray:main']}, classifiers=[ "Development Status :: 3 - Alpha", diff --git a/csp-lmc-common/tests/CspMaster_test.py b/csp-lmc-common/tests/CspMaster_test.py deleted file mode 100755 index 20231c3..0000000 --- a/csp-lmc-common/tests/CspMaster_test.py +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# This file is part of the csp-lmc project -# -# -# -# Distributed under the terms of the BSD-3-Clause license. -# See LICENSE.txt for more info. -"""Contain the tests for the CspMaster.""" - -# Standard imports -import sys -import os -import time -import numpy as np -# Tango imports -import tango -from tango import DevState -from tango.test_context import DeviceTestContext -import pytest - -#Local imports -from csp_lmc_common.CspMaster import CspMaster -from ska.base.control_model import AdminMode, HealthState - -# Device test case -@pytest.mark.usefixtures("tango_context", "cbf_master") - -class TestCspMaster(object): - properties = {'SkaLevel': '2', - 'CspCbf': 'mid_csp_cbf/sub_elt/master', - 'CspPss': 'mid_csp_pss/sub_elt/master', - 'CspPst': 'mid_csp_pst/sub_elt/master', - } - - def test_State(self, cbf_master, tango_context): - """Test for State after initialization - NOTE: the CspMaster device state is ALARM because - this device relies on several forwarded attributes. - """ - # reinitalize Csp Master and CbfMaster devices - cbf_master.Init() - time.sleep(2) - csp_state = tango_context.device.state() - assert csp_state not in [DevState.FAULT, DevState.DISABLE] - - def test_adminMode_offline(self, tango_context): - """ Test the adminMode attribute w/r""" - tango_context.device.adminMode = AdminMode.OFFLINE - time.sleep(3) - assert tango_context.device.adminMode.value == AdminMode.OFFLINE - - def test_adminMode_online(self, tango_context): - """ Test the adminMode attribute w/r""" - tango_context.device.adminMode = AdminMode.ONLINE - time.sleep(3) - assert tango_context.device.adminMode.value == AdminMode.ONLINE - - def test_write_invalid_admin_mode(self, tango_context): - - with pytest.raises(tango.DevFailed) as df: - tango_context.device.adminMode = 7 - assert "Set value for attribute adminMode is negative or above the maximun authorized" in str(df.value.args[0].desc) - - def test_cspHealthState(self, tango_context): - """ Test the CSP initial healthState. - NOTE: to build the CSP healthState, the sub-elements - not ONLINE or MAINTENACE are not taken into account. - """ - assert tango_context.device.healthState == HealthState.OK - - def test_cbfAdminMode(self, tango_context): - """ Test the CBF adminMode attribute w/r""" - tango_context.device.cspCbfAdminMode = AdminMode.ONLINE - time.sleep(3) - assert tango_context.device.cspCbfAdminMode.value == AdminMode.ONLINE - - def test_cbfHealthState(self, tango_context): - """ Test the CBF initial healthState """ - tango_context.device.cspCbfHealthState == HealthState.OK - - def test_pssState(self, tango_context): - """ Test the PSS initial State """ - assert tango_context.device.cspPssState == DevState.DISABLE - - def test_pssHealthState(self, tango_context): - """ Test the PSS initial healthState """ - assert tango_context.device.cspPssHealthState == HealthState.UNKNOWN - - def test_pssAdminMode(self, tango_context): - """ Test the PSS initial adminMode """ - pss_admin = tango_context.device.cspPssAdminMode - assert pss_admin == AdminMode.NOT_FITTED - - def test_write_adminMode_of_not_running_device(self, tango_context): - assert tango_context.device.cspPssAdminMode == AdminMode.NOT_FITTED - tango_context.device.cspPssAdminMode == AdminMode.ONLINE - time.sleep(3) - assert tango_context.device.cspPssAdminMode == AdminMode.NOT_FITTED - - def test_pstState(self, tango_context): - """ Test the PST initial State """ - assert tango_context.device.cspPstState == DevState.DISABLE - - def test_pstHealthState(self, tango_context): - """ Test the PST initial healthState """ - assert tango_context.device.cspPstHealthState == HealthState.UNKNOWN - - def test_pstAdminMode(self, tango_context): - """ Test the PST initial adminMode """ - assert tango_context.device.cspPstAdminMode == AdminMode.NOT_FITTED - - def test_subelement_cbf_address(self, tango_context): - """Test the cbfMasterAdress value""" - cbf_addr = tango_context.device.cbfMasterAddress - cbf_addr_property = self.properties['CspCbf'] - assert cbf_addr == cbf_addr_property - - def test_subelement_pss_address(self, tango_context): - """Test the pssMasterAdress value""" - pss_addr = tango_context.device.pssMasterAddress - pss_addr_property = self.properties['CspPss'] - assert pss_addr == pss_addr_property - - def test_subelement_pst_address(self, tango_context): - """Test the pstMasterAdress value""" - pst_addr = tango_context.device.pstMasterAddress - pst_addr_property = self.properties['CspPst'] - assert pst_addr == pst_addr_property - - def test_configure_On_command_duration_time(self, tango_context): - tango_context.device.onCmdDurationExpected = 3 - assert tango_context.device.onCmdDurationExpected == 3 - - def test_configure_Off_command_duration_time(self, tango_context): - tango_context.device.offCmdDurationExpected = 3 - assert tango_context.device.offCmdDurationExpected == 3 - - def test_configure_Standby_command_duration_time(self, tango_context): - tango_context.device.standbyCmdDurationExpected = 3 - assert tango_context.device.standbyCmdDurationExpected == 3 - - def test_On_valid_state(self, tango_context, cbf_master): - """ - Test to execute the On command on the CbfMaster and to verify the - attributes related dto command execution: execution measured time, - timeout, command progress. - """ - #reinit CSP and CBFTest master devices - cbf_master.Init() - # sleep for a while to wait state transition - time.sleep(3) - # check CspMstar state - assert tango_context.device.cspCbfState == DevState.STANDBY - # issue the "On" command on CbfTestMaster device - argin = [tango_context.device.cbfMasterAddress,] - tango_context.device.On(argin) - time.sleep(4) - assert tango_context.device.cspCbfState == DevState.ON - time_measured = tango_context.device.onCmdDurationMeasured - assert time_measured >= 0 - # verify the command does not timeout - on_timeout = tango_context.device.onCmdTimeoutExpired - assert not on_timeout - # verify the command progress is 100 - assert tango_context.device.onCommandProgress == 100 - failure = tango_context.device.onCmdFailure - assert not failure - failure_message = tango_context.device.onFailureMessage - assert failure_message =='' - - def test_Standby_valid_state(self, tango_context, cbf_master): - assert tango_context.device.cspCbfState == DevState.ON - # issue the "On" command on CbfTestMaster device - argin = [tango_context.device.cbfMasterAddress,] - tango_context.device.Standby(argin) - time.sleep(4) - assert tango_context.device.cspCbfState == DevState.STANDBY - standby_timeout = tango_context.device.standbyCmdTimeoutExpired - assert not standby_timeout - assert tango_context.device.standbyCommandProgress == 100 - num_of_task = tango_context.device.numOfDevCompletedTask - assert num_of_task == 1 - list_of_task = tango_context.device.listOfDevCompletedTask - assert tango_context.device.cbfMasterAddress in list_of_task - time_measured = tango_context.device.standbyCmdDurationMeasured - assert time_measured >= 0 diff --git a/csp-lmc-common/tests/CspSubarray_test.py b/csp-lmc-common/tests/CspSubarray_test.py deleted file mode 100755 index 2847e71..0000000 --- a/csp-lmc-common/tests/CspSubarray_test.py +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# This file is part of the csp-lmc project -# -# -# -# Distributed under the terms of the BSD-3-Clause license. -# See LICENSE.txt for more info. -"""Contain the tests for the CspMaster.""" - -# Standard imports -import sys -import os -import time -import pytest -# Tango imports -import tango -from tango import DevState -from tango.test_context import DeviceTestContext -#Local imports -from csp_lmc_common.CspSubarray import CspSubarray -from ska.base.control_model import AdminMode, ObsState, HealthState - -# Device test case -@pytest.mark.usefixtures("tango_context", "csp_master") - -class TestCspSubarray(object): - properties = {'CspMaster': 'common/elt/master', - 'CbfSubarray': 'mid_csp_cbf/sub_elt/subarray_01', - 'PssSubarray': 'mid_csp_pss/sub_elt/subarray_01', - 'SubID': 1, - } - - @classmethod - def mocking(cls): - """Mock external libraries.""" - # Example : Mock numpy - # cls.numpy = SKASubarray.numpy = MagicMock() - # PROTECTED REGION ID(SKASubarray.test_mocking) ENABLED START # - # PROTECTED REGION END # // SKASubarray.test_mocking - - def test_init_State(self, tango_context): - """Test for State at initialization """ - state = tango_context.device.state() - assert state not in [DevState.FAULT] - - def test_cbfsubarray_state(self, tango_context): - assert tango_context.device.cbfSubarrayState == DevState.OFF - - def test_cbfsubarray_adminMode(self, tango_context): - assert tango_context.device.cbfSubarrayAdminMode == AdminMode.MAINTENANCE - - def test_cbfsubarray_healthState(self, tango_context): - assert tango_context.device.cbfSubarrayHealthState == HealthState.OK - - def test_psssubarray_state(self, tango_context): - assert tango_context.device.pssSubarrayState == DevState.DISABLE - - def test_psssubarray_adminMode(self, tango_context): - assert tango_context.device.pssSubarrayAdminMode == AdminMode.NOT_FITTED - - def test_psssubarray_healthState(self, tango_context): - assert tango_context.device.pssSubarrayHealthState == HealthState.UNKNOWN - - def test_psssubarray_obsState(self, tango_context): - assert tango_context.device.pssSubarrayObsState == ObsState.IDLE - - def test_init_obsState(self, tango_context): - """Test the obsState value at initialization """ - obs_state = tango_context.device.obsState - assert obs_state == ObsState.EMPTY - - def test_commands_progress(self, tango_context): - """Test xxCmdProgress attributes """ - assert tango_context.device.scanCmdProgress == 0 - assert tango_context.device.endScanCmdProgress == 0 - assert tango_context.device.goToIdleCmdProgress == 0 - ''' - def test_configure_invalid_state(self, tango_context): - """ Test Configure command execution when subarray - State is not ON - """ - with pytest.raises(tango.DevFailed) as df: - tango_context.device.Configure("") - assert "Command Configure not allowed" in df.value.args[0].desc - - def test_subarray_off(self, tango_context, csp_master): - """ Test subarray state after power-on - NOTE: this is a wrong behaviour of CbfSubarray that - starts in DISABLE state with adminMode = ONLINE and - it moves to OFF only after a power-on. - The CbfSubarray has to start in OFF State when it is - ONLINE and there is no need to power-on it. - This behavior has to be changed - """ - csp_master.On(["mid_csp_cbf/sub_elt/master",]) - time.sleep(4) - csp_state = csp_master.State() - state = tango_context.device.cbfSubarrayState - assert state == DevState.OFF - ''' - - #def test_remove_timing_beams_while_add_is_running_state(self, tango_context): - # """ Test the execution of the RemovingTimingBeams" while - # the AddTimingBeams is already running - # """ - # tango_context.device.AddTimingBeams([1,2,3]) - # with pytest.raises(tango.DevFailed) as df: - # tango_context.device.RemoveTimingBeams([1,2]) - # assert "Can't execute command" in df.value.args[0].desc diff --git a/csp-lmc-common/tests/conftest.py b/csp-lmc-common/tests/conftest.py new file mode 100644 index 0000000..4748ce8 --- /dev/null +++ b/csp-lmc-common/tests/conftest.py @@ -0,0 +1,166 @@ +""" +This module contains pytest fixtures and other test setups common to +all ska.low.mccs tests: unit, integration and functional (BDD) +""" +import json +import pytest + + +def pytest_addoption(parser): + """ + Pytest hook; implemented to add the `--true-context` option, used to + indicate that a true Tango subsystem is available, so there is no + need for a MultiDeviceTestContext + + :param parser: the command line options parser + :type parser: an argparse parser + """ + parser.addoption( + "--true-context", + action="store_true", + help=( + "Tell pytest that you have a true Tango context and don't " + "need to spin up a Tango test context" + ), + ) + + +def _load_data_from_json(path): + """ + Loads a dataset from a named json file. + + :param path: path to the JSON file from which the dataset is to be + loaded. + :type name: string + """ + with open(path, "r") as json_file: + return json.load(json_file) + + +def _load_devices(path, device_names): + """ + Loads device configuration data for specified devices from a + specified JSON configuration file. + + :param path: path to the JSON configuration file + :type path: string + :param device_names: names of the devices for which configuration + data should be loaded + :type device_names: list of string + """ + configuration = _load_data_from_json(path) + devices_by_class = {} + + servers = configuration["servers"] + for server in servers: + print("server:{}".format(server)) + for device_name in servers[server]: + if device_name in device_names: + for class_name, device_info in servers[server][device_name].items(): + if class_name not in devices_by_class: + devices_by_class[class_name] = [] + for fqdn, device_specs in device_info.items(): + devices_by_class[class_name].append( + {"name": fqdn, **device_specs} + ) + + devices_info = [] + for device_class in devices_by_class: + device_info = [] + for device in devices_by_class[device_class]: + device_info.append(device) + + devices_info.append({"class": device_class, "devices": device_info}) + + print("devices_info:{}".format(devices_info)) + return devices_info + + +@pytest.fixture(scope="module") +def devices_to_load(request): + """ + Fixture that returns the "devices_to_load" variable from the module + under test. This variable is a dictionary containing three entries: + + * "path": the path to a JSON file containing device configuration + information in dsconfig format + * "package": the package from which classes will be loaded; for + example, if the package is "ska.low.mccs", then if the JSON + configuration file refers to a class named "MccsMaster", then this + will be interpretated as the ska.low.mccs.MccsMaster class + * "devices": a list of names of the devices that are to be loaded. + + """ + return getattr(request.module, "devices_to_load") + + +@pytest.fixture(scope="module") +def device_to_load(request): + """ + Fixture that returns the "device_to_load" variable from the module + under test. This variable is a dictionary containing three entries: + + * "path": the path to a JSON file containing device configuration + information in dsconfig format + * "package": the package from which classes will be loaded; for + example, if the package is "ska.low.mccs", then if the JSON + configuration file refers to a class named "MccsMaster", then this + will be interpretated as the ska.low.mccs.MccsMaster class + * "device": the name of the devices that is to be loaded. + + """ + return getattr(request.module, "device_to_load", None) + + +@pytest.fixture(scope="module") +def device_info(device_to_load): + """ + Constructs a device_info dictionary in the form required by + tango.test_context.DeviceTestContext, with the device as specified + by the device_to_load fixture + + :param device_to_load: fixture that provides a specification of the + device that is to be included in the devices_info dictionary + :type device_to_load: specification of devices to be loaded + :type device_to_load: dictionary + """ + devices = _load_devices( + path=device_to_load["path"], device_names=[device_to_load["device"]] + ) + print("devices:{}".format(devices)) + print("devices[0]:{}".format(devices[0])) + print("devices[0] class:{}".format(devices[0]["class"])) + class_to_import = devices[0]["class"] + print("class to import:{}".format(class_to_import)) + package = __import__(device_to_load["package"], fromlist=class_to_import) + print("package:{}".format(package)) + + return { + "class": getattr(package, devices[0]["class"]), + "properties": devices[0]["devices"][0]["properties"], + } + + +@pytest.fixture(scope="module") +def devices_info(devices_to_load): + """ + Constructs a devices_info dictionary in the form required by + tango.test_context.MultiDeviceTestContext, with devices as specified + by the devices_to_load fixture + + :param devices_to_load: fixture that provides a specification of the + devices that are to be included in the devices_info dictionary + :type devices_to_load: specification of devices to be loaded + :type devices_to_load: dictionary + """ + devices = _load_devices( + path=devices_to_load["path"], device_names=devices_to_load["devices"] + ) + + classes_to_import = list(set(device["class"] for device in devices)) + package = __import__(devices_to_load["package"], fromlist=classes_to_import) + + for device in devices: + device["class"] = getattr(package, device["class"]) + + return devices diff --git a/csp-lmc-common/tests/unit/CspMaster_test.py b/csp-lmc-common/tests/unit/CspMaster_test.py new file mode 100755 index 0000000..b95bb65 --- /dev/null +++ b/csp-lmc-common/tests/unit/CspMaster_test.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# This file is part of the csp-lmc project +# +# +# +# Distributed under the terms of the BSD-3-Clause license. +# See LICENSE.txt for more info. +"""Contain the tests for the CspMaster.""" + +# Standard imports +import numpy as np +import pytest +import tango +from tango import DevState +from tango.test_context import DeviceTestContext + +#Local imports +from csp_lmc_common import CspMaster +from ska.base.control_model import AdminMode, HealthState + +device_to_load = { + "path": "docker/config/csplmc_dsconfig.json", + "package": "csp_lmc_common", + "device": "commaster", +} +# Device test case + +@pytest.mark.mock_device_proxy +class TestCspMaster: + + def test_State(self, device_under_test): + """Test for State after initialization + NOTE: the CspMaster device state is ALARM because + this device relies on several forwarded attributes. + """ + # reinitalize Csp Master and CbfMaster devices + csp_state = device_under_test.State() + print(csp_state) + assert csp_state not in [DevState.FAULT, DevState.DISABLE] + + def test_adminMode_offline(self, device_under_test): + """ Test the adminMode attribute w/r""" + device_under_test.adminMode = AdminMode.OFFLINE + assert device_under_test.adminMode.value == AdminMode.OFFLINE + + def test_adminMode_online(self, device_under_test): + """ Test the adminMode attribute w/r""" + device_under_test.adminMode = AdminMode.ONLINE + assert device_under_test.adminMode.value == AdminMode.ONLINE + + def test_write_invalid_admin_mode(self, device_under_test): + + with pytest.raises(tango.DevFailed) as df: + device_under_test.adminMode = 7 + assert "Set value for attribute adminMode is negative or above the maximun authorized" in str(df.value.args[0].desc) + + def test_cspHealthState(self, device_under_test): + """ Test the CSP initial healthState. + NOTE: to build the CSP healthState, the sub-elements + not ONLINE or MAINTENACE are not taken into account. + """ + assert device_under_test.healthState == HealthState.OK + + def test_cbfAdminMode(self, device_under_test): + """ Test the CBF adminMode attribute w/r""" + assert device_under_test.cspCbfAdminMode == AdminMode.NOT_FITTED + + def test_cbfHealthState(self, device_under_test): + """ Test the CBF initial healthState """ + device_under_test.cspCbfHealthState == HealthState.OK + + def test_pssState(self, device_under_test): + """ Test the PSS initial State """ + assert device_under_test.cspPssState == DevState.DISABLE + + def test_pssHealthState(self, device_under_test): + """ Test the PSS initial healthState """ + assert device_under_test.cspPssHealthState == HealthState.UNKNOWN + + def test_pssAdminMode(self, device_under_test): + """ Test the PSS initial adminMode """ + pss_admin = device_under_test.cspPssAdminMode + assert pss_admin == AdminMode.NOT_FITTED + + def test_pstState(self, device_under_test): + """ Test the PST initial State """ + assert device_under_test.cspPstState == DevState.DISABLE + + def test_pstHealthState(self, device_under_test): + """ Test the PST initial healthState """ + assert device_under_test.cspPstHealthState == HealthState.UNKNOWN + + def test_pstAdminMode(self, device_under_test): + """ Test the PST initial adminMode """ + assert device_under_test.cspPstAdminMode == AdminMode.NOT_FITTED + + def test_subelement_cbf_address(self, device_under_test, device_info): + """Test the cbfMasterAdress value""" + cbf_addr = device_under_test.cbfMasterAddress + master_property = device_info['properties'] + cbf_addr_from_property = master_property['CspCbf'] + assert cbf_addr == cbf_addr_from_property[0] + + def test_subelement_pss_address(self, device_under_test, device_info): + """Test the pssMasterAdress value""" + pss_addr = device_under_test.pssMasterAddress + master_property = device_info['properties'] + pss_addr_from_property = master_property['CspPss'] + assert pss_addr == pss_addr_from_property[0] + + def test_subelement_pst_address(self, device_under_test, device_info): + """Test the pstMasterAdress value""" + pst_addr = device_under_test.pstMasterAddress + master_property = device_info['properties'] + pst_addr_from_property = master_property['CspPst'] + assert pst_addr == pst_addr_from_property[0] + + def test_configure_On_command_duration_time(self, device_under_test): + device_under_test.onCmdDurationExpected = 3 + assert device_under_test.onCmdDurationExpected == 3 + + def test_configure_Off_command_duration_time(self, device_under_test): + device_under_test.offCmdDurationExpected = 3 + assert device_under_test.offCmdDurationExpected == 3 + + def test_configure_Standby_command_duration_time(self, device_under_test): + device_under_test.standbyCmdDurationExpected = 3 + assert device_under_test.standbyCmdDurationExpected == 3 diff --git a/csp-lmc-common/tests/unit/CspSubarray_test.py b/csp-lmc-common/tests/unit/CspSubarray_test.py new file mode 100755 index 0000000..1eb3950 --- /dev/null +++ b/csp-lmc-common/tests/unit/CspSubarray_test.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# This file is part of the csp-lmc project +# +# +# +# Distributed under the terms of the BSD-3-Clause license. +# See LICENSE.txt for more info. +"""Contain the tests for the CspMaster.""" + +# Standard imports +import pytest +# Tango imports +import tango +from tango import DevState +from tango.test_context import DeviceTestContext +#Local imports +from csp_lmc_common import CspSubarray +from ska.base.control_model import AdminMode, ObsState, HealthState + +# Device test case +device_to_load = { + "path": "docker/config/csplmc_dsconfig.json", + "package": "csp_lmc_common", + "device": "comsub1", +} + +@pytest.mark.mock_device_proxy +class TestCspSubarray: + def test_init_State(self, device_under_test): + """Test for State at initialization """ + state = device_under_test.State() + print("state:{}".format(state)) + assert state not in [DevState.FAULT] + + def test_cbfsubarray_state(self, device_under_test): + assert device_under_test.cbfSubarrayState == DevState.DISABLE + + def test_cbfsubarray_adminMode(self, device_under_test): + assert device_under_test.cbfSubarrayAdminMode == AdminMode.NOT_FITTED + + def test_cbfsubarray_healthState(self, device_under_test): + assert device_under_test.cbfSubarrayHealthState == HealthState.UNKNOWN + + def test_psssubarray_state(self, device_under_test): + assert device_under_test.pssSubarrayState == DevState.DISABLE + + def test_psssubarray_adminMode(self, device_under_test): + assert device_under_test.pssSubarrayAdminMode == AdminMode.NOT_FITTED + + def test_psssubarray_healthState(self, device_under_test): + assert device_under_test.pssSubarrayHealthState == HealthState.UNKNOWN + + def test_psssubarray_obsState(self, device_under_test): + assert device_under_test.pssSubarrayObsState == ObsState.IDLE + + def test_init_obsState(self, device_under_test): + """Test the obsState value at initialization """ + obs_state = device_under_test.obsState + assert obs_state == ObsState.EMPTY + + def test_commands_progress(self, device_under_test): + """Test xxCmdProgress attributes """ + assert device_under_test.scanCmdProgress == 0 + assert device_under_test.endScanCmdProgress == 0 + assert device_under_test.goToIdleCmdProgress == 0 + ''' + def test_configure_invalid_state(self, device_under_test): + """ Test Configure command execution when subarray + State is not ON + """ + with pytest.raises(tango.DevFailed) as df: + device_under_test.Configure("") + assert "Command Configure not allowed" in df.value.args[0].desc + + def test_subarray_off(self, device_under_test, csp_master): + """ Test subarray state after power-on + NOTE: this is a wrong behaviour of CbfSubarray that + starts in DISABLE state with adminMode = ONLINE and + it moves to OFF only after a power-on. + The CbfSubarray has to start in OFF State when it is + ONLINE and there is no need to power-on it. + This behavior has to be changed + """ + csp_master.On(["mid_csp_cbf/sub_elt/master",]) + time.sleep(4) + csp_state = csp_master.State() + state = device_under_test.cbfSubarrayState + assert state == DevState.OFF + ''' + + #def test_remove_timing_beams_while_add_is_running_state(self, device_under_test): + # """ Test the execution of the RemovingTimingBeams" while + # the AddTimingBeams is already running + # """ + # device_under_test.AddTimingBeams([1,2,3]) + # with pytest.raises(tango.DevFailed) as df: + # device_under_test.RemoveTimingBeams([1,2]) + # assert "Can't execute command" in df.value.args[0].desc diff --git a/csp-lmc-common/tests/unit/conftest.py b/csp-lmc-common/tests/unit/conftest.py new file mode 100644 index 0000000..3d0e2e9 --- /dev/null +++ b/csp-lmc-common/tests/unit/conftest.py @@ -0,0 +1,75 @@ +""" +This module contains pytest fixtures and other test setups for the +ska.low.mccs unit tests +""" +from collections import defaultdict +import pytest + +# import tango +from tango.test_context import DeviceTestContext + + +def pytest_itemcollected(item): + """ + pytest hook implementation; add the "forked" custom mark to all + tests that use the `device_context` fixture, causing them to be + sandboxed in their own process + + param item: the collected test for which this hook is called + type item: a collected test + """ + if "device_under_test" in item.fixturenames: + item.add_marker("forked") + + +def pytest_configure(config): + """ + pytest hook, used here to register custom marks to get rid of spurious + warnings + """ + config.addinivalue_line( + "markers", "mock_device_proxy: the test requires tango.DeviceProxy to be mocked" + ) + + +# @pytest.fixture(scope="module") +# def device_info(request): +# """ +# Pytest fixture that retrieves the `device_info` (note singular +# "device") attribute from the module under test. The `device_info` +# attribute contains information about the device under test, such as +# property values, necessary to stand up that device in a +# tango.DeviceTestContext for unit testing. + +# :param request: A pytest object giving access to the requesting test +# context. +# :type request: _pytest.fixtures.SubRequest +# """ +# yield getattr(request.module, "device_info") + + +@pytest.fixture(scope="function") +def device_under_test(request, device_info, mocker): + """ + Creates and returns a DeviceProxy under a DeviceTestContext. + + For tests that are marked with the custom "mock_device_proxy" marker + (i.e. `@pytest.mark.mock_device_proxy`), `tango.DeviceProxy` will be + mocked prior to initialisation of the device under test. + + :param device_info: Information about the device under test that is + needed to stand the device up in a DeviceTestContext, such as + the device class and properties + :type device_info: dict + """ + mock_device_proxy = request.node.get_closest_marker("mock_device_proxy") is not None + if mock_device_proxy: + mock_device_proxies = defaultdict(mocker.Mock) + mocker.patch( + "tango.DeviceProxy", side_effect=lambda fqdn: mock_device_proxies[fqdn] + ) + + with DeviceTestContext( + device_info["class"], properties=device_info["properties"] + ) as device_under_test: + yield device_under_test -- GitLab From fe79e4de760f10a6820e729cbae40580ee8ccf5e Mon Sep 17 00:00:00 2001 From: softir Date: Wed, 16 Sep 2020 14:24:18 +0200 Subject: [PATCH 06/43] CT-147: changed image to run tests. --- csp-lmc-common/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csp-lmc-common/.gitlab-ci.yml b/csp-lmc-common/.gitlab-ci.yml index 81e2e6a..17eb1a8 100644 --- a/csp-lmc-common/.gitlab-ci.yml +++ b/csp-lmc-common/.gitlab-ci.yml @@ -61,7 +61,7 @@ build:csp-lmc-common_image: # .test_common: - image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest + image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest before_script: - docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST tags: -- GitLab From 1f7b44304c9a4a2b88f7fb5bd62a422f4059dbb9 Mon Sep 17 00:00:00 2001 From: softir Date: Wed, 16 Sep 2020 14:31:25 +0200 Subject: [PATCH 07/43] CT-147: fix docker login error. --- csp-lmc-common/.gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/csp-lmc-common/.gitlab-ci.yml b/csp-lmc-common/.gitlab-ci.yml index 17eb1a8..bad97a8 100644 --- a/csp-lmc-common/.gitlab-ci.yml +++ b/csp-lmc-common/.gitlab-ci.yml @@ -62,8 +62,6 @@ build:csp-lmc-common_image: .test_common: image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest - before_script: - - docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST tags: - docker-executor artifacts: -- GitLab From 4511d614fd85e4cf11be2230c79b61fd8c78dc26 Mon Sep 17 00:00:00 2001 From: softir Date: Wed, 16 Sep 2020 14:47:47 +0200 Subject: [PATCH 08/43] CT-147: csp-lmc-common files used for metrics moved from docker/build to build. --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3014950..50dff4d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -68,7 +68,7 @@ pages: - docker-executor stage: pages variables: - COMMON_PATH: csp-lmc-common/docker + COMMON_PATH: csp-lmc-common/ MIDCSP_PATH: csp-lmc-mid/docker script: - pwd @@ -80,6 +80,7 @@ pages: # path to all files is relative to the repository # that has been cloned during the build - cp -R $COMMON_PATH/build/ public + - ls -l public - cp -R $MIDCSP_PATH/build/* public - ls -lR - junitparser merge public/reports/csp-lmc-common-unit-tests.xml public/reports/csp-lmc-mid-unit-tests.xml public/reports/unit-tests.xml -- GitLab From dbd0329109f04b40b59e9dd70e7803b7f19ac346 Mon Sep 17 00:00:00 2001 From: softir Date: Wed, 16 Sep 2020 15:08:09 +0200 Subject: [PATCH 09/43] CT-147: try to fix the problem of the csp-lmc-common-unit-tests.xml that is not found during pages pipeline stage --- csp-lmc-common/setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csp-lmc-common/setup.cfg b/csp-lmc-common/setup.cfg index 22862a6..935d6a4 100644 --- a/csp-lmc-common/setup.cfg +++ b/csp-lmc-common/setup.cfg @@ -25,7 +25,7 @@ addopts = --forked --cov-report=term --cov-report=html --cov-report=xml - --junitxml=/build/reports/csp-lmc-common-unit-tests.xml + --junitxml=build/reports/csp-lmc-common-unit-tests.xml console_output_style = progress junit_family=legacy filterwarnings = -- GitLab From f8496e4251ec7437c9fd69fea3554a562068d95d Mon Sep 17 00:00:00 2001 From: toor Date: Wed, 16 Sep 2020 21:09:21 +0200 Subject: [PATCH 10/43] CT-147: first step to move csp-lmc-mid project to k8s --- csp-lmc-mid/docker/.release | 22 ------- .../Makefile | 0 .../MidCspSubarrayConfiguration_test.py | 0 .../{ => integration}/MidCspSubarray_test.py | 0 .../{ => integration}/configScan_sub1.json | 0 .../{ => integration}/configScan_sub2.json | 0 .../test_ConfigureScan_ADR4.json | 0 .../test_ConfigureScan_basic.json | 0 .../test_ConfigureScan_invalid_cbf_json.json | 0 .../test_ConfigureScan_without_configID.json | 0 ...test_ConfigureScan_without_outputlink.json | 0 .../test_requirements.txt | 0 .../utils.py | 0 .../tests/test_ConfigureScan_basic.json | 63 ------------------- 14 files changed, 85 deletions(-) delete mode 100644 csp-lmc-mid/docker/.release rename csp-lmc-mid/tests/{acceptance_tests => integration}/Makefile (100%) rename csp-lmc-mid/tests/{acceptance_tests => integration}/MidCspSubarrayConfiguration_test.py (100%) rename csp-lmc-mid/tests/{ => integration}/MidCspSubarray_test.py (100%) rename csp-lmc-mid/tests/{ => integration}/configScan_sub1.json (100%) rename csp-lmc-mid/tests/{ => integration}/configScan_sub2.json (100%) rename csp-lmc-mid/tests/{acceptance_tests => integration}/test_ConfigureScan_ADR4.json (100%) rename csp-lmc-mid/tests/{acceptance_tests => integration}/test_ConfigureScan_basic.json (100%) rename csp-lmc-mid/tests/{acceptance_tests => integration}/test_ConfigureScan_invalid_cbf_json.json (100%) rename csp-lmc-mid/tests/{acceptance_tests => integration}/test_ConfigureScan_without_configID.json (100%) rename csp-lmc-mid/tests/{acceptance_tests => integration}/test_ConfigureScan_without_outputlink.json (100%) rename csp-lmc-mid/tests/{acceptance_tests => integration}/test_requirements.txt (100%) rename csp-lmc-mid/tests/{acceptance_tests => integration}/utils.py (100%) delete mode 100644 csp-lmc-mid/tests/test_ConfigureScan_basic.json diff --git a/csp-lmc-mid/docker/.release b/csp-lmc-mid/docker/.release deleted file mode 100644 index f5a4952..0000000 --- a/csp-lmc-mid/docker/.release +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of the CSP.LMC prototype project -# -# -# Distributed under the terms of the BSD-3-Clause license. -# See LICENSE.txt for more info. - -"""Release information for Python Package""" - -name = """MID CSP.LMC""" -version = "0.6.9" -version_info = version.split(".") -description = """SKA MID CSP.LMC Classes""" -author = "E.G" -author_email = "elisabetta.giani@inaf.it" -license = """BSD-3-Clause""" -url = """www.tango-controls.org""" -copyright = """""" - -release=0.6.9 -tag=mid-csp-lmc-0.6.9 diff --git a/csp-lmc-mid/tests/acceptance_tests/Makefile b/csp-lmc-mid/tests/integration/Makefile similarity index 100% rename from csp-lmc-mid/tests/acceptance_tests/Makefile rename to csp-lmc-mid/tests/integration/Makefile diff --git a/csp-lmc-mid/tests/acceptance_tests/MidCspSubarrayConfiguration_test.py b/csp-lmc-mid/tests/integration/MidCspSubarrayConfiguration_test.py similarity index 100% rename from csp-lmc-mid/tests/acceptance_tests/MidCspSubarrayConfiguration_test.py rename to csp-lmc-mid/tests/integration/MidCspSubarrayConfiguration_test.py diff --git a/csp-lmc-mid/tests/MidCspSubarray_test.py b/csp-lmc-mid/tests/integration/MidCspSubarray_test.py similarity index 100% rename from csp-lmc-mid/tests/MidCspSubarray_test.py rename to csp-lmc-mid/tests/integration/MidCspSubarray_test.py diff --git a/csp-lmc-mid/tests/configScan_sub1.json b/csp-lmc-mid/tests/integration/configScan_sub1.json similarity index 100% rename from csp-lmc-mid/tests/configScan_sub1.json rename to csp-lmc-mid/tests/integration/configScan_sub1.json diff --git a/csp-lmc-mid/tests/configScan_sub2.json b/csp-lmc-mid/tests/integration/configScan_sub2.json similarity index 100% rename from csp-lmc-mid/tests/configScan_sub2.json rename to csp-lmc-mid/tests/integration/configScan_sub2.json diff --git a/csp-lmc-mid/tests/acceptance_tests/test_ConfigureScan_ADR4.json b/csp-lmc-mid/tests/integration/test_ConfigureScan_ADR4.json similarity index 100% rename from csp-lmc-mid/tests/acceptance_tests/test_ConfigureScan_ADR4.json rename to csp-lmc-mid/tests/integration/test_ConfigureScan_ADR4.json diff --git a/csp-lmc-mid/tests/acceptance_tests/test_ConfigureScan_basic.json b/csp-lmc-mid/tests/integration/test_ConfigureScan_basic.json similarity index 100% rename from csp-lmc-mid/tests/acceptance_tests/test_ConfigureScan_basic.json rename to csp-lmc-mid/tests/integration/test_ConfigureScan_basic.json diff --git a/csp-lmc-mid/tests/acceptance_tests/test_ConfigureScan_invalid_cbf_json.json b/csp-lmc-mid/tests/integration/test_ConfigureScan_invalid_cbf_json.json similarity index 100% rename from csp-lmc-mid/tests/acceptance_tests/test_ConfigureScan_invalid_cbf_json.json rename to csp-lmc-mid/tests/integration/test_ConfigureScan_invalid_cbf_json.json diff --git a/csp-lmc-mid/tests/acceptance_tests/test_ConfigureScan_without_configID.json b/csp-lmc-mid/tests/integration/test_ConfigureScan_without_configID.json similarity index 100% rename from csp-lmc-mid/tests/acceptance_tests/test_ConfigureScan_without_configID.json rename to csp-lmc-mid/tests/integration/test_ConfigureScan_without_configID.json diff --git a/csp-lmc-mid/tests/acceptance_tests/test_ConfigureScan_without_outputlink.json b/csp-lmc-mid/tests/integration/test_ConfigureScan_without_outputlink.json similarity index 100% rename from csp-lmc-mid/tests/acceptance_tests/test_ConfigureScan_without_outputlink.json rename to csp-lmc-mid/tests/integration/test_ConfigureScan_without_outputlink.json diff --git a/csp-lmc-mid/tests/acceptance_tests/test_requirements.txt b/csp-lmc-mid/tests/integration/test_requirements.txt similarity index 100% rename from csp-lmc-mid/tests/acceptance_tests/test_requirements.txt rename to csp-lmc-mid/tests/integration/test_requirements.txt diff --git a/csp-lmc-mid/tests/acceptance_tests/utils.py b/csp-lmc-mid/tests/integration/utils.py similarity index 100% rename from csp-lmc-mid/tests/acceptance_tests/utils.py rename to csp-lmc-mid/tests/integration/utils.py diff --git a/csp-lmc-mid/tests/test_ConfigureScan_basic.json b/csp-lmc-mid/tests/test_ConfigureScan_basic.json deleted file mode 100644 index 51f2dd6..0000000 --- a/csp-lmc-mid/tests/test_ConfigureScan_basic.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "id": "sbi-mvp01-20200325-00001-science_A", - "frequencyBand": "1", - "delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/delayModel", - - "fsp": [ - { - "fspID": 1, - "functionMode": "CORR", - "frequencySliceID": 1, - "corrBandwidth": 0, - "integrationTime": 140, - "fspChannelOffset": 0, - "channelAveragingMap": [ - [0, 1], - [744, 1], - [1488, 1], - [2232, 1], - [2976, 1], - [3720, 1], - [4464, 1], - [5208, 1], - [5952, 1], - [6696, 1], - [7440, 1], - [8184, 1], - [8928, 1], - [9672, 1], - [10416, 1], - [11160, 1], - [11904, 1], - [12648, 1], - [13392, 1], - [14136, 1] - ], - "outputLinkMap": [ - [0, 4], - [744, 8], - [1480, 12], - [2234, 16], - [2978, 20], - [3722, 24], - [4466, 28], - [5208, 32], - [5952, 36], - [6696, 40], - [7440, 44], - [8184, 48], - [8928, 52], - [9672, 56], - [10416, 60], - [11160, 64], - [11904, 68], - [12648, 72], - [13392, 76], - [14136, 80] - ], - "outputHost": [[0, "192.168.0.1"], [8184, "192.168.0.2"]], - "outputMac": [[0, "06-00-00-00-00-01"]], - "outputPort": [[0, 9000, 1], [8184, 9000, 1]] - } - ] -} -- GitLab From e55ed87365b8ca558ed8de0d9abc0da63d99f71e Mon Sep 17 00:00:00 2001 From: toor Date: Wed, 16 Sep 2020 23:01:10 +0200 Subject: [PATCH 11/43] CT-147: first step in moving csp-lmc-mid from docker-compose to k8s --- .gitlab-ci.yml | 2 +- csp-lmc-mid/.gitlab-ci.yml | 78 +- csp-lmc-mid/.make/.make-release-support | 106 + csp-lmc-mid/.make/k8s.mk | 283 ++ csp-lmc-mid/.make/postdeploy.mk | 130 + csp-lmc-mid/.make/release.mk | 119 + csp-lmc-mid/.release | 22 + csp-lmc-mid/Dockerfile | 10 + csp-lmc-mid/Makefile | 91 + csp-lmc-mid/charts/csp-proto/Chart.yaml | 6 + .../charts/csp-proto/data/configuration.json | 1563 ++++++++++ .../charts/csp-proto/data/cspconfig.json | 838 ++++++ csp-lmc-mid/charts/csp-proto/secrets/.gitkeep | 0 csp-lmc-mid/charts/csp-proto/secrets/tls.crt | 20 + csp-lmc-mid/charts/csp-proto/secrets/tls.key | 28 + .../charts/csp-proto/templates/_helpers.tpl | 32 + .../charts/csp-proto/templates/csplmc.yaml | 147 + csp-lmc-mid/charts/csp-proto/values.yaml | 79 + csp-lmc-mid/charts/csp-proto/values.yaml.new | 59 + csp-lmc-mid/charts/mid-csp/Chart.lock | 9 + csp-lmc-mid/charts/mid-csp/Chart.yaml | 15 + .../mid-csp/charts/cbf-proto/Chart.yaml | 6 + .../charts/cbf-proto/data/midcbfconfig.json | 1719 +++++++++++ .../mid-csp/charts/cbf-proto/secrets/.gitkeep | 0 .../charts/cbf-proto/templates/_helpers.tpl | 32 + .../charts/cbf-proto/templates/midcbf.yaml | 146 + .../mid-csp/charts/cbf-proto/values.yaml | 154 + .../charts/mid-csp/charts/csp-proto-0.5.3.tgz | Bin 0 -> 10344 bytes .../mid-csp/charts/tango-base-0.1.1.tgz | Bin 0 -> 8849 bytes csp-lmc-mid/charts/mid-csp/requirements.lock | 9 + csp-lmc-mid/charts/mid-csp/secrets/.gitkeep | 0 csp-lmc-mid/charts/mid-csp/secrets/tls.crt | 20 + csp-lmc-mid/charts/mid-csp/secrets/tls.key | 28 + csp-lmc-mid/docker/.make/Makefile.mk | 4 +- csp-lmc-mid/docker/config/config_result.json | 2542 +++++++++++++++++ csp-lmc-mid/docker/mid-cbf-mcs.yml | 4 +- csp-lmc-mid/docker/mid-csp-lmc.yml | 4 +- csp-lmc-mid/requirements-tst.txt | 9 + csp-lmc-mid/requirements.txt | 5 + csp-lmc-mid/setup.cfg | 2 +- csp-lmc-mid/setup.py | 1 - csp-lmc-mid/test-harness/Makefile | 31 + csp-lmc-mid/test-harness/README.md | 3 + csp-lmc-mid/test-harness/requirements-tst.txt | 9 + csp-lmc-mid/test-harness/requirements.txt | 5 + .../{ => integration}/MidCspMaster_test.py | 4 +- .../MidCspSubarrayConfiguration_test.py | 381 --- .../tests/integration/MidCspSubarray_test.py | 156 +- .../integration/test_ConfigureScan_basic.json | 107 +- csp-lmc-mid/tests/integration/utils.py | 2 +- .../tests/test_data/configScan_sub1.json | 63 + .../tests/test_data/configScan_sub2.json | 63 + .../test_data/test_ConfigureScan_ADR4.json | 77 + .../test_data/test_ConfigureScan_basic.json | 63 + .../test_ConfigureScan_invalid_cbf_json.json | 63 + .../test_ConfigureScan_without_configID.json | 62 + ...test_ConfigureScan_without_outputlink.json | 41 + .../tests/unit/midcspsubarray_unit_test.py | 2 +- csp-lmc-mid/tests/unit/utils.py | 2 +- csp-lmc-mid/tools/adr8_cbf_plot.py | 138 + csp-lmc-mid/tools/adr8_plot.py | 119 + 61 files changed, 9143 insertions(+), 570 deletions(-) create mode 100644 csp-lmc-mid/.make/.make-release-support create mode 100644 csp-lmc-mid/.make/k8s.mk create mode 100644 csp-lmc-mid/.make/postdeploy.mk create mode 100644 csp-lmc-mid/.make/release.mk create mode 100644 csp-lmc-mid/.release create mode 100644 csp-lmc-mid/Dockerfile create mode 100644 csp-lmc-mid/Makefile create mode 100644 csp-lmc-mid/charts/csp-proto/Chart.yaml create mode 100644 csp-lmc-mid/charts/csp-proto/data/configuration.json create mode 100644 csp-lmc-mid/charts/csp-proto/data/cspconfig.json create mode 100644 csp-lmc-mid/charts/csp-proto/secrets/.gitkeep create mode 100644 csp-lmc-mid/charts/csp-proto/secrets/tls.crt create mode 100644 csp-lmc-mid/charts/csp-proto/secrets/tls.key create mode 100644 csp-lmc-mid/charts/csp-proto/templates/_helpers.tpl create mode 100644 csp-lmc-mid/charts/csp-proto/templates/csplmc.yaml create mode 100644 csp-lmc-mid/charts/csp-proto/values.yaml create mode 100644 csp-lmc-mid/charts/csp-proto/values.yaml.new create mode 100644 csp-lmc-mid/charts/mid-csp/Chart.lock create mode 100644 csp-lmc-mid/charts/mid-csp/Chart.yaml create mode 100644 csp-lmc-mid/charts/mid-csp/charts/cbf-proto/Chart.yaml create mode 100644 csp-lmc-mid/charts/mid-csp/charts/cbf-proto/data/midcbfconfig.json create mode 100644 csp-lmc-mid/charts/mid-csp/charts/cbf-proto/secrets/.gitkeep create mode 100644 csp-lmc-mid/charts/mid-csp/charts/cbf-proto/templates/_helpers.tpl create mode 100644 csp-lmc-mid/charts/mid-csp/charts/cbf-proto/templates/midcbf.yaml create mode 100644 csp-lmc-mid/charts/mid-csp/charts/cbf-proto/values.yaml create mode 100644 csp-lmc-mid/charts/mid-csp/charts/csp-proto-0.5.3.tgz create mode 100644 csp-lmc-mid/charts/mid-csp/charts/tango-base-0.1.1.tgz create mode 100644 csp-lmc-mid/charts/mid-csp/requirements.lock create mode 100644 csp-lmc-mid/charts/mid-csp/secrets/.gitkeep create mode 100644 csp-lmc-mid/charts/mid-csp/secrets/tls.crt create mode 100644 csp-lmc-mid/charts/mid-csp/secrets/tls.key create mode 100644 csp-lmc-mid/docker/config/config_result.json create mode 100644 csp-lmc-mid/requirements-tst.txt create mode 100644 csp-lmc-mid/requirements.txt create mode 100644 csp-lmc-mid/test-harness/Makefile create mode 100644 csp-lmc-mid/test-harness/README.md create mode 100644 csp-lmc-mid/test-harness/requirements-tst.txt create mode 100644 csp-lmc-mid/test-harness/requirements.txt rename csp-lmc-mid/tests/{ => integration}/MidCspMaster_test.py (99%) delete mode 100644 csp-lmc-mid/tests/integration/MidCspSubarrayConfiguration_test.py create mode 100644 csp-lmc-mid/tests/test_data/configScan_sub1.json create mode 100644 csp-lmc-mid/tests/test_data/configScan_sub2.json create mode 100644 csp-lmc-mid/tests/test_data/test_ConfigureScan_ADR4.json create mode 100644 csp-lmc-mid/tests/test_data/test_ConfigureScan_basic.json create mode 100644 csp-lmc-mid/tests/test_data/test_ConfigureScan_invalid_cbf_json.json create mode 100644 csp-lmc-mid/tests/test_data/test_ConfigureScan_without_configID.json create mode 100644 csp-lmc-mid/tests/test_data/test_ConfigureScan_without_outputlink.json create mode 100644 csp-lmc-mid/tools/adr8_cbf_plot.py create mode 100644 csp-lmc-mid/tools/adr8_plot.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 50dff4d..bebdd60 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,8 +41,8 @@ stages: - test_common - publish_common - build - - test - linting + - test - pages - publish - release diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index 1b8306a..28cfc4a 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -52,7 +52,7 @@ build:csp-lmc-mid_image: - cd $BUILD_PATH - make build variables: - BUILD_PATH: csp-lmc-mid/docker + BUILD_PATH: csp-lmc-mid # test:csp-lmc-mid: # stage: test @@ -76,38 +76,76 @@ build:csp-lmc-mid_image: # .test: - image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest - before_script: - - docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST - tags: - - docker-executor + stage: test artifacts: paths: - ./$BUILD_PATH/build/ variables: - BUILD_PATH: csp-lmc-mid/docker - -test:csp-lmc-mid: + BUILD_PATH: csp-lmc-mid + # +#unit:csp-lmc-mid: +# extends: .test +# stage: test +# script: +# - cd $BUILD_PATH +# - pwd +# - python3 -m pip install -r requirements-tst.txt +# - python3 -m pip install --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple -r requirements.txt +# - python3 setup.py test --addopts='-k-integration' |tee setup_py_test.stdout +# - pwd +# - mkdir -p build/reports +# - ls -alR +# - mv setup_py_test.stdout build/csp-lmc-mid-setup-test.stdout +# - mv htmlcov build/csp-lmc-mid_htmlcov +# - mv coverage.xml build + +integration:csp-lmc-mid: + tags: + - auto-k8sv2 extends: .test - stage: test + image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest script: + - curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.2/bin/linux/amd64/kubectl + - chmod +x ./kubectl + - sudo mv ./kubectl /usr/local/bin/kubectl + - curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 + - chmod 700 get_helm.sh + - ./get_helm.sh + - kubectl get pod --all-namespaces + - kubectl get namespaces - cd $BUILD_PATH - - make test + - export KUBE_NAMESPACE="ci-$CI_COMMIT_SHORT_SHA" + - make k8s_test + after_script: + - export KUBE_NAMESPACE="ci-$CI_COMMIT_SHORT_SHA" + - cd $BUILD_PATH + - pwd + - make delete + - make delete_namespace # linting stage -.linting: - extends: .test +# +linting:csp-lmc-mid: + image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest stage: linting + tags: + - docker-executor + artifacts: + paths: + - ./$BUILD_PATH/build/ dependencies: [] script: - apt-get -y update - apt-get install -y python3-pip python3-setuptools python3-wheel --no-install-recommends + - python3 -m pip install pylint2junit - cd $BUILD_PATH - - make lint - -linting:csp-lmc-mid: - extends: .linting - dependencies: [] + - python3 -m pip install --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple -r requirements.txt + - mkdir -p build/reports + - pylint --output-format=parseable csp_lmc_mid | tee ./build/csp_lmc_mid-code-analysis.stdout + - pylint --output-format=pylint2junit.JunitReporter csp_lmc_mid > ./build/reports/csp-lmc-mid-linting.xml + - ls -alR + variables: + BUILD_PATH: csp-lmc-mid # # Publish csp-lmc-mid python package @@ -122,7 +160,7 @@ linting:csp-lmc-mid: tags: - docker-executor before_script: - - python3 -m pip install twine + - pip install twine .publish_python_dev: extends: .publish_python @@ -171,4 +209,4 @@ release csp-lmc-mid image: refs: - master variables: - BUILD_PATH: csp-lmc-mid/docker + BUILD_PATH: csp-lmc-mid diff --git a/csp-lmc-mid/.make/.make-release-support b/csp-lmc-mid/.make/.make-release-support new file mode 100644 index 0000000..f1f3a2c --- /dev/null +++ b/csp-lmc-mid/.make/.make-release-support @@ -0,0 +1,106 @@ +#!/bin/bash +# +# Copyright 2015 Xebia Nederland B.V. +# Modifications copyright 2019 SKA Organisation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +function hasChanges() { + test -n "$(git status -s .)" +} + +function getRelease() { + awk -F= '/^release=/{print $2}' .release +} + +function getBaseTag() { + sed -n -e "s/^tag=\(.*\)$(getRelease)\$/\1/p" .release +} + +function getTag() { + if [ -z "$1" ] ; then + awk -F= '/^tag/{print $2}' .release + else + echo "$(getBaseTag)$1" + fi +} + +function setRelease() { + if [ -n "$1" ] ; then + sed -i.x -e "s/^tag=.*/tag=$(getTag $1)/" .release + sed -i.x -e "s/^release=.*/release=$1/g" .release + rm -f .release.x + runPreTagCommand "$1" + else + echo "ERROR: missing release version parameter " >&2 + return 1 + fi +} + +function runPreTagCommand() { + if [ -n "$1" ] ; then + COMMAND=$(sed -n -e "s/@@RELEASE@@/$1/g" -e 's/^pre_tag_command=\(.*\)/\1/p' .release) + if [ -n "$COMMAND" ] ; then + if ! OUTPUT=$(bash -c "$COMMAND" 2>&1) ; then echo $OUTPUT >&2 && exit 1 ; fi + fi + else + echo "ERROR: missing release version parameter " >&2 + return 1 + fi +} + +function tagExists() { + tag=${1:-$(getTag)} + test -n "$tag" && test -n "$(git tag | grep "^$tag\$")" +} + +function differsFromRelease() { + tag=$(getTag) + ! tagExists $tag || test -n "$(git diff --shortstat -r $tag .)" +} + +function getVersion() { + result=$(getRelease) + + if differsFromRelease; then + result="$result-$(git log -n 1 --format=%h .)" + fi + + if hasChanges ; then + result="$result-dirty" + fi + echo $result +} + +function nextPatchLevel() { + version=${1:-$(getRelease)} + major_and_minor=$(echo $version | cut -d. -f1,2) + patch=$(echo $version | cut -d. -f3) + version=$(printf "%s.%d" $major_and_minor $(($patch + 1))) + echo $version +} + +function nextMinorLevel() { + version=${1:-$(getRelease)} + major=$(echo $version | cut -d. -f1); + minor=$(echo $version | cut -d. -f2); + version=$(printf "%d.%d.0" $major $(($minor + 1))) ; + echo $version +} + +function nextMajorLevel() { + version=${1:-$(getRelease)} + major=$(echo $version | cut -d. -f1); + version=$(printf "%d.0.0" $(($major + 1))) + echo $version +} diff --git a/csp-lmc-mid/.make/k8s.mk b/csp-lmc-mid/.make/k8s.mk new file mode 100644 index 0000000..15673e2 --- /dev/null +++ b/csp-lmc-mid/.make/k8s.mk @@ -0,0 +1,283 @@ +IMAGE_TO_RUN_TEST ?= nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest +k8s: ## Which kubernetes are we connected to + @echo "Kubernetes cluster-info:" + @kubectl cluster-info + @echo "" + @echo "kubectl version:" + @kubectl version + @echo "" + @echo "Helm version:" + @helm version --client + +namespace: ## create the kubernetes namespace + kubectl describe namespace $(KUBE_NAMESPACE) || kubectl create namespace $(KUBE_NAMESPACE) + +delete_namespace: ## delete the kubernetes namespace + @if [ "default" == "$(KUBE_NAMESPACE)" ] || [ "kube-system" == "$(KUBE_NAMESPACE)" ]; then \ + echo "You cannot delete Namespace: $(KUBE_NAMESPACE)"; \ + exit 1; \ + else \ + kubectl describe namespace $(KUBE_NAMESPACE) && kubectl delete namespace $(KUBE_NAMESPACE); \ + fi + +deploy: namespace mkcerts depends ## deploy the helm chart + @helm install $(HELM_RELEASE) charts/$(HELM_CHART)/ \ + --namespace $(KUBE_NAMESPACE) \ + --set xauthority="$(XAUTHORITYx)" \ + --set display="$(DISPLAY)" \ + --set ingress.hostname=$(INGRESS_HOST) \ + --set helmTests=false + +delete: ## delete the helm chart release + @helm uninstall $(HELM_RELEASE) --namespace $(KUBE_NAMESPACE) + +install: namespace mkcerts ## install the helm chart + @helm install $(HELM_RELEASE) charts/$(HELM_CHART)/ \ + --namespace $(KUBE_NAMESPACE) \ + --set xauthority="$(XAUTHORITYx)" \ + --set display="$(DISPLAY)" \ + --set ingress.hostname=$(INGRESS_HOST) + +show: mkcerts ## show the helm chart + @helm template $(HELM_RELEASE) charts/$(HELM_CHART)/ \ + --namespace $(KUBE_NAMESPACE) \ + --set xauthority="$(XAUTHORITYx)" \ + --set display="$(DISPLAY)" \ + --set ingress.hostname=$(INGRESS_HOST) + +chart_lint: ## lint check the helm chart + @helm lint charts/$(HELM_CHART)/ \ + --namespace $(KUBE_NAMESPACE) \ + --set ingress.hostname=$(INGRESS_HOST) \ + --set xauthority="$(XAUTHORITYx)" \ + --set display="$(DISPLAY)" \ + +helm_delete: ## delete the helm chart release (with Tiller) + @helm delete $(HELM_RELEASE) --purge \ + + +traefik: ## install the helm chart for traefik (in the kube-system namespace). @param: EXTERNAL_IP (i.e. private ip of the master node). + @TMP=`mktemp -d`; \ + $(helm_add_stable_repo) && \ + helm fetch stable/traefik --untar --untardir $$TMP && \ + helm template $(helm_install_shim) $$TMP/traefik -n traefik0 --namespace kube-system \ + --set externalIP="$(EXTERNAL_IP)" \ + | kubectl apply -n kube-system -f - && \ + rm -rf $$TMP ; \ + + +delete_traefik: ## delete the helm chart for traefik. @param: EXTERNAL_IP + @TMP=`mktemp -d`; \ + $(helm_add_stable_repo) && \ + helm fetch stable/traefik --untar --untardir $$TMP && \ + helm template $(helm_install_shim) $$TMP/traefik -n traefik0 --namespace kube-system \ + --set externalIP="$(EXTERNAL_IP)" \ + | kubectl delete -n kube-system -f - && \ + rm -rf $$TMP + +describe: ## describe Pods executed from Helm chart + @for i in `kubectl -n $(KUBE_NAMESPACE) get pods -l app.kubernetes.io/instance=$(HELM_RELEASE) -o=name`; \ + do echo "---------------------------------------------------"; \ + echo "Describe for $${i}"; \ + echo kubectl -n $(KUBE_NAMESPACE) describe $${i}; \ + echo "---------------------------------------------------"; \ + kubectl -n $(KUBE_NAMESPACE) describe $${i}; \ + echo "---------------------------------------------------"; \ + echo ""; echo ""; echo ""; \ + done + +logs: ## show Helm chart POD logs + @for i in `kubectl -n $(KUBE_NAMESPACE) get pods -l app.kubernetes.io/instance=$(HELM_RELEASE) -o=name`; \ + do \ + echo "---------------------------------------------------"; \ + echo "Logs for $${i}"; \ + echo kubectl -n $(KUBE_NAMESPACE) logs $${i}; \ + echo kubectl -n $(KUBE_NAMESPACE) get $${i} -o jsonpath="{.spec.initContainers[*].name}"; \ + echo "---------------------------------------------------"; \ + for j in `kubectl -n $(KUBE_NAMESPACE) get $${i} -o jsonpath="{.spec.initContainers[*].name}"`; do \ + RES=`kubectl -n $(KUBE_NAMESPACE) logs $${i} -c $${j} 2>/dev/null`; \ + echo "initContainer: $${j}"; echo "$${RES}"; \ + echo "---------------------------------------------------";\ + done; \ + echo "Main Pod logs for $${i}"; \ + echo "---------------------------------------------------"; \ + for j in `kubectl -n $(KUBE_NAMESPACE) get $${i} -o jsonpath="{.spec.containers[*].name}"`; do \ + RES=`kubectl -n $(KUBE_NAMESPACE) logs $${i} -c $${j} 2>/dev/null`; \ + echo "Container: $${j}"; echo "$${RES}"; \ + echo "---------------------------------------------------";\ + done; \ + echo "---------------------------------------------------"; \ + echo ""; echo ""; echo ""; \ + done + +localip: ## set local Minikube IP in /etc/hosts file for Ingress $(INGRESS_HOST) + @new_ip=`minikube ip` && \ + existing_ip=`grep $(INGRESS_HOST) /etc/hosts || true` && \ + echo "New IP is: $${new_ip}" && \ + echo "Existing IP: $${existing_ip}" && \ + if [ -z "$${existing_ip}" ]; then echo "$${new_ip} $(INGRESS_HOST)" | sudo tee -a /etc/hosts; \ + else sudo perl -i -ne "s/\d+\.\d+.\d+\.\d+/$${new_ip}/ if /$(INGRESS_HOST)/; print" /etc/hosts; fi && \ + echo "/etc/hosts is now: " `grep $(INGRESS_HOST) /etc/hosts` + +mkcerts: ## Make dummy certificates for $(INGRESS_HOST) and Ingress + @if [ ! -f charts/$(HELM_CHART)/secrets/tls.key ]; then \ + openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 \ + -keyout charts/$(HELM_CHART)/secrets/tls.key \ + -out charts/$(HELM_CHART)/secrets/tls.crt \ + -subj "/CN=$(INGRESS_HOST)/O=Minikube"; \ + else \ + echo "SSL cert already exits in charts/$(HELM_CHART)/secrets ... skipping"; \ + fi + +# Utility target to install Helm dependencies +helm_dependencies: + @which helm ; rc=$$?; \ + if [[ $$rc != 0 ]]; then \ + curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3; \ + chmod 700 get_helm.sh; \ + ./get_helm.sh; \ + fi; \ + helm version --client + +# Utility target to install K8s dependencies +kubectl_dependencies: + @([ -n "$(KUBE_CONFIG_BASE64)" ] && [ -n "$(KUBECONFIG)" ]) || (echo "unset variables [KUBE_CONFIG_BASE64/KUBECONFIG] - abort!"; exit 1) + @which kubectl ; rc=$$?; \ + if [[ $$rc != 0 ]]; then \ + curl -L -o /usr/bin/kubectl "https://storage.googleapis.com/kubernetes-release/release/$(KUBERNETES_VERSION)/bin/linux/amd64/kubectl"; \ + chmod +x /usr/bin/kubectl; \ + mkdir -p /etc/deploy; \ + echo $(KUBE_CONFIG_BASE64) | base64 -d > $(KUBECONFIG); \ + fi + @echo -e "\nkubectl client version:" + @kubectl version --client + @echo -e "\nkubectl config view:" + @kubectl config view + @echo -e "\nkubectl config get-contexts:" + @kubectl config get-contexts + @echo -e "\nkubectl version:" + @kubectl version + +kubeconfig: ## export current KUBECONFIG as base64 ready for KUBE_CONFIG_BASE64 + @KUBE_CONFIG_BASE64=`kubectl config view --flatten | base64 -w 0`; \ + echo "KUBE_CONFIG_BASE64: $$(echo $${KUBE_CONFIG_BASE64} | cut -c 1-40)..."; \ + echo "appended to: PrivateRules.mak"; \ + echo -e "\n\n# base64 encoded from: kubectl config view --flatten\nKUBE_CONFIG_BASE64 = $${KUBE_CONFIG_BASE64}" >> PrivateRules.mak + +wait: + @echo "Waiting for device servers to be ready" + @date + @kubectl -n $(KUBE_NAMESPACE) get pods -l cspServer + @kubectl -n $(KUBE_NAMESPACE) wait --for=condition=ready --timeout=120s -l cspServer pods + @date + +# +# defines a function to copy the ./test-harness directory into the K8s TEST_RUNNER +# and then runs the requested make target in the container. +# capture the output of the test in a tar file +# stream the tar file base64 encoded to the Pod logs +# +k8s_test = tar -c . | \ + kubectl run $(TEST_RUNNER) \ + --namespace $(KUBE_NAMESPACE) -i --wait --restart=Never \ + --image-pull-policy=IfNotPresent \ + --image=$(IMAGE_TO_RUN_TEST) -- \ + /bin/bash -c "tar xv --strip-components 1 --warning=all && \ + python3 -m pip install --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple -r requirements.txt &&\ + python3 -m pip install . &&\ + cd test-harness &&\ + make TANGO_HOST=databaseds-tango-base-$(HELM_RELEASE):10000 $1 && \ + tar -czvf /tmp/build.tgz build && \ + echo '~~~~BOUNDARY~~~~' && \ + cat /tmp/build.tgz | base64 && \ + echo '~~~~BOUNDARY~~~~'" \ + 2>&1 + +# run the test function +# save the status +# clean out build dir +# print the logs minus the base64 encoded payload +# pull out the base64 payload and unpack build/ dir +# base64 payload is given a boundary "~~~~BOUNDARY~~~~" and extracted using perl +# clean up the run to completion container +# exit the saved status +k8s_test: deploy wait## test the application on K8s + @echo "KUBE_NAMESPACE: $(KUBE_NAMESPACE)" + $(call k8s_test,test); \ + status=$$?; \ + rm -fr build; \ + kubectl --namespace $(KUBE_NAMESPACE) logs $(TEST_RUNNER) | perl -ne 'BEGIN {$$on=1;}; if (index($$_, "~~~~BOUNDARY~~~~")!=-1){$$on+=1;next;}; print if $$on % 2;'; \ + kubectl --namespace $(KUBE_NAMESPACE) logs $(TEST_RUNNER) | \ + perl -ne 'BEGIN {$$on=0;}; if (index($$_, "~~~~BOUNDARY~~~~")!=-1){$$on+=1;next;}; print if $$on % 2;' | \ + base64 -d | tar -xzf -; \ + kubectl --namespace $(KUBE_NAMESPACE) delete pod $(TEST_RUNNER); \ + exit $$status + + +rlint: ## run lint check on Helm Chart using gitlab-runner + if [ -n "$(RDEBUG)" ]; then DEBUG_LEVEL=debug; else DEBUG_LEVEL=warn; fi && \ + gitlab-runner --log-level $${DEBUG_LEVEL} exec $(EXECUTOR) \ + --docker-privileged \ + --docker-disable-cache=false \ + --docker-host $(DOCKER_HOST) \ + --docker-volumes $(DOCKER_VOLUMES) \ + --docker-pull-policy always \ + --timeout $(TIMEOUT) \ + --env "DOCKER_HOST=$(DOCKER_HOST)" \ + --env "DOCKER_REGISTRY_USER_LOGIN=$(DOCKER_REGISTRY_USER_LOGIN)" \ + --env "CI_REGISTRY_PASS_LOGIN=$(CI_REGISTRY_PASS_LOGIN)" \ + --env "CI_REGISTRY=$(CI_REGISTRY)" \ + lint-check-chart || true + +# K8s testing with local gitlab-runner +# Run the powersupply tests in the TEST_RUNNER run to completion Pod: +# set namespace +# install dependencies for Helm and kubectl +# deploy into namespace +# run test in run to completion Pod +# extract Pod logs +# set test return code +# delete +# delete namespace +# return result +rk8s_test: ## run k8s_test on K8s using gitlab-runner + if [ -n "$(RDEBUG)" ]; then DEBUG_LEVEL=debug; else DEBUG_LEVEL=warn; fi && \ + KUBE_NAMESPACE=`git rev-parse --abbrev-ref HEAD | tr -dc 'A-Za-z0-9\-' | tr '[:upper:]' '[:lower:]'` && \ + gitlab-runner --log-level $${DEBUG_LEVEL} exec $(EXECUTOR) \ + --docker-privileged \ + --docker-disable-cache=false \ + --docker-host $(DOCKER_HOST) \ + --docker-volumes $(DOCKER_VOLUMES) \ + --docker-pull-policy always \ + --timeout $(TIMEOUT) \ + --env "DOCKER_HOST=$(DOCKER_HOST)" \ + --env "DOCKER_REGISTRY_USER_LOGIN=$(DOCKER_REGISTRY_USER_LOGIN)" \ + --env "CI_REGISTRY_PASS_LOGIN=$(CI_REGISTRY_PASS_LOGIN)" \ + --env "CI_REGISTRY=$(CI_REGISTRY)" \ + --env "KUBE_CONFIG_BASE64=$(KUBE_CONFIG_BASE64)" \ + --env "KUBECONFIG=$(KUBECONFIG)" \ + --env "KUBE_NAMESPACE=$${KUBE_NAMESPACE}" \ + test-chart || true + + +helm_tests: ## run Helm chart tests + helm test $(HELM_RELEASE) --cleanup + +ingress_check: ## curl test Tango REST API - https://tango-controls.readthedocs.io/en/latest/development/advanced/rest-api.html#tango-rest-api-implementations + @echo "---------------------------------------------------" + @echo "Test HTTP:"; echo "" + curl -u "tango-cs:tango" -XGET http://$(INGRESS_HOST)/tango/rest/rc4/hosts/databaseds-tango-example-$(HELM_RELEASE)/10000 | json_pp + @echo "", echo "" + @echo "---------------------------------------------------" + @echo "Test HTTPS:"; echo "" + curl -k -u "tango-cs:tango" -XGET https://$(INGRESS_HOST)/tango/rest/rc4/hosts/databaseds-tango-example-$(HELM_RELEASE)/10000 | json_pp + @echo "" + +help: ## show this help. + @echo "make targets:" + @grep -hE '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + @echo ""; echo "make vars (+defaults):" + @grep -hE '^[0-9a-zA-Z_-]+ \?=.*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = " \?\= "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\#\#/ \#/' + +depends: + helm dependency update charts/$(HELM_CHART)/ diff --git a/csp-lmc-mid/.make/postdeploy.mk b/csp-lmc-mid/.make/postdeploy.mk new file mode 100644 index 0000000..ffc6536 --- /dev/null +++ b/csp-lmc-mid/.make/postdeploy.mk @@ -0,0 +1,130 @@ +.PHONY: k8s_test smoketest template_tests tango_rest_ingress_check + +# +# IMAGE_TO_TEST defines the tag of the Docker image to test +# +IMAGE_TO_TEST ?= nexus.engageska-portugal.pt/ska-docker/tango-vscode:0.2.4## docker image that will be run for testing purpose +#IMAGE_TO_TEST = $(DOCKER_REGISTRY_HOST)/$(DOCKER_REGISTRY_USER)/$(PROJECT):latest +# Test runner - run to completion job in K8s +TEST_RUNNER = test-makefile-runner-$(CI_JOB_ID)-$(KUBE_NAMESPACE)-$(HELM_RELEASE)##name of the pod running the k8s_tests +# +# defines a function to copy the ./test-harness directory into the K8s TEST_RUNNER +# and then runs the requested make target in the container. +# capture the output of the test in a build folder inside the container +# +TANGO_HOST = databaseds-tango-base-$(HELM_RELEASE):10000 +MARK ?= fast## this will allow to add the mark parameter of pytest +SLEEPTIME ?= 30s ##amount of sleep time for the smoketest target + +# +# defines a function to copy the ./test-harness directory into the K8s TEST_RUNNER +# and then runs the requested make target in the container. +# capture the output of the test in a tar file +# stream the tar file base64 encoded to the Pod logs +# +ktest = tar -c post-deployment/ | \ + kubectl run $(TEST_RUNNER) \ + --namespace $(KUBE_NAMESPACE) -i --wait --restart=Never \ + --image-pull-policy=IfNotPresent \ + --image=$(IMAGE_TO_TEST) -- \ + /bin/bash -c "mkdir csp-lmc-mid && tar xv --directory csp-lmc-mid --strip-components 1 --warning=all && cd csp-lmc-mid && \ + make KUBE_NAMESPACE=$(KUBE_NAMESPACE) HELM_RELEASE=$(HELM_RELEASE) TANGO_HOST=$(TANGO_HOST) MARK=$(MARK) $1 && \ + tar -czvf /tmp/build.tgz build && \ + echo '~~~~BOUNDARY~~~~' && \ + cat /tmp/build.tgz | base64 && \ + echo '~~~~BOUNDARY~~~~'" \ + 2>&1 + +# run the test function +# save the status +# clean out build dir +# print the logs minus the base64 encoded payload +# pull out the base64 payload and unpack build/ dir +# base64 payload is given a boundary "~~~~BOUNDARY~~~~" and extracted using perl +# clean up the run to completion container +# exit the saved status +ktest: smoketest## test the application on K8s + $(call ktest,test); \ + status=$$?; \ + rm -fr build; \ + kubectl --namespace $(KUBE_NAMESPACE) logs $(TEST_RUNNER) | \ + perl -ne 'BEGIN {$$on=0;}; if (index($$_, "~~~~BOUNDARY~~~~")!=-1){$$on+=1;next;}; print if $$on % 2;' | \ + base64 -d | tar -xzf -; \ + kubectl --namespace $(KUBE_NAMESPACE) delete pod $(TEST_RUNNER); \ + exit $$status + + +smoketest: ## check that the number of waiting containers is zero (10 attempts, wait time 30s). + @echo "Smoke test START"; \ + n=10; \ + while [ $$n -gt 0 ]; do \ + waiting=`kubectl get pods -n $(KUBE_NAMESPACE) -o=jsonpath='{.items[*].status.containerStatuses[*].state.waiting.reason}' | wc -w`; \ + echo "Waiting containers=$$waiting"; \ + if [ $$waiting -ne 0 ]; then \ + echo "Waiting $(SLEEPTIME) for pods to become running...#$$n"; \ + sleep $(SLEEPTIME); \ + fi; \ + if [ $$waiting -eq 0 ]; then \ + echo "Smoke test SUCCESS"; \ + exit 0; \ + fi; \ + if [ $$n -eq 1 ]; then \ + waiting=`kubectl get pods -n $(KUBE_NAMESPACE) -o=jsonpath='{.items[*].status.containerStatuses[*].state.waiting.reason}' | wc -w`; \ + echo "Smoke test FAILS"; \ + echo "Found $$waiting waiting containers: "; \ + kubectl get pods -n $(KUBE_NAMESPACE) -o=jsonpath='{range .items[*].status.containerStatuses[?(.state.waiting)]}{.state.waiting.message}{"\n"}{end}'; \ + exit 1; \ + fi; \ + n=`expr $$n - 1`; \ + done + +template_tests: + rc=0; \ + for chrt in `ls charts/`; do \ + helm unittest -f template_tests/*_test.yaml charts/$$chrt \ + || rc=2 && continue; \ + done; \ + exit $$rc + +tango_rest_ingress_check: ## curl test Tango REST API - https://tango-controls.readthedocs.io/en/latest/development/advanced/rest-api.html#tango-rest-api-implementations + @echo "---------------------------------------------------" + @echo "Test HTTP:"; echo "" + curl -u "tango-cs:tango" -XGET http://tango.rest.$(INGRESS_HOST)/tango/rest/rc4/hosts/databaseds-tango-base-$(HELM_RELEASE)/10000 | json_pp + # @echo "", echo "" + # @echo "---------------------------------------------------" + # @echo "Test HTTPS:"; echo "" + # curl -k -u "tango-cs:tango" -XGET https://tango.rest.$(INGRESS_HOST)/tango/rest/rc4/hosts/databaseds-tango-base-$(HELM_RELEASE)/10000 | json_pp + # @echo "" + +oet_podname = $(shell kubectl get pods -l app=rest-oet-$(HELM_RELEASE) -o=jsonpath='{..metadata.name}') +sut_cdm_ver= $(shell kubectl exec -it $(oet_podname) pip list | grep "cdm-shared-library" | awk ' {print $$2}' | awk 'BEGIN { FS = "+" } ; {print $$1}') +sut_cdm_cur_ver=$(shell grep "cdm-shared-library" post-deployment/SUT_requirements.txt | awk 'BEGIN { FS = "==" } ; {print $$2}') +sut_oet_ver = $(shell kubectl exec -it $(oet_podname) pip list | grep "observation-execution-tool" | awk ' {print $$2}' | awk 'BEGIN { FS = "+" } ; {print $$1}') +sut_oet_cur_ver=$(shell grep "observation-execution-tool" post-deployment/SUT_requirements.txt | awk 'BEGIN { FS = "==" } ; {print $$2}') + +check_oet_packages: + @echo "MVP is based on cdm-shared-library=$(sut_cdm_ver)" + @echo "Test are based on cdm-shared-library=$(sut_cdm_cur_ver)" + @if [ $(sut_cdm_ver) != $(sut_cdm_cur_ver) ] ; then \ + echo "Warning: cdm-shared-library package for MVP is not the same as used for testing!"; \ + fi + @echo "MVP is based on observation-execution-tool=$(sut_oet_ver)" + @echo "Test are based on observation-execution-tool=$(sut_oet_cur_ver)" + @if [ $(sut_oet_ver) != $(sut_oet_cur_ver) ] ; then \ + echo "Warning: observation-execution-tool package for MVP is not the same as used for testing!"; \ + fi + +##the following section is for developers requiring the testing pod to be instantiated with a volume mappig to skampi +-include dev-testing.mk + +timestamp=$(shell date -u +"%s") + +sleepy_time: + sleep 5s + +measure_time: + time1=$$SECONDS; \ + make sleepy_time; \ + time2=$$SECONDS; \ + elapsed=$$((time2 - time1)); \ + echo $$elapsed diff --git a/csp-lmc-mid/.make/release.mk b/csp-lmc-mid/.make/release.mk new file mode 100644 index 0000000..1abb8f1 --- /dev/null +++ b/csp-lmc-mid/.make/release.mk @@ -0,0 +1,119 @@ +# +# Copyright 2015 Xebia Nederland B.V. +# +# 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. +# +ifeq ($(strip $(PROJECT)),) + NAME=$(shell basename $(CURDIR)) +else + NAME=$(PROJECT) +endif + +RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support + +ifeq ($(strip $(DOCKER_REGISTRY_HOST)),) + DOCKER_REGISTRY_HOST = nexus.engageska-portugal.pt +endif + +ifeq ($(strip $(DOCKER_REGISTRY_USER)),) + DOCKER_REGISTRY_USER = ska-docker +endif + +IMAGE=$(DOCKER_REGISTRY_HOST)/$(DOCKER_REGISTRY_USER)/$(NAME) + +VERSION=$(shell . $(RELEASE_SUPPORT) ; getVersion) +TAG=$(shell . $(RELEASE_SUPPORT); getTag) + +SHELL=/bin/bash + +DOCKER_BUILD_CONTEXT=. +DOCKER_FILE_PATH=Dockerfile + +.PHONY: pre-build docker-build post-build build release patch-release minor-release major-release tag check-status check-release showver \ + push pre-push do-push post-push + +build: pre-build docker-build post-build ## build the application image + +pre-build: + +post-build: + +pre-push: + +post-push: + +docker-build: .release + docker build $(DOCKER_BUILD_ARGS) -t $(IMAGE):$(VERSION) $(DOCKER_BUILD_CONTEXT) -f $(DOCKER_FILE_PATH) --build-arg DOCKER_REGISTRY_HOST=$(DOCKER_REGISTRY_HOST) --build-arg DOCKER_REGISTRY_USER=$(DOCKER_REGISTRY_USER) + @DOCKER_MAJOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f1) ; \ + DOCKER_MINOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f2) ; \ + if [ $$DOCKER_MAJOR -eq 1 ] && [ $$DOCKER_MINOR -lt 10 ] ; then \ + echo docker tag -f $(IMAGE):$(VERSION) $(IMAGE):latest ;\ + docker tag -f $(IMAGE):$(VERSION) $(IMAGE):latest ;\ + else \ + echo docker tag $(IMAGE):$(VERSION) $(IMAGE):latest ;\ + docker tag $(IMAGE):$(VERSION) $(IMAGE):latest ; \ + fi + +.release: + @echo "release=0.0.0" > .release + @echo "tag=$(NAME)-0.0.0" >> .release + @echo INFO: .release created + @cat .release + +release: check-status check-release build push + +push: pre-push do-push post-push ## push the image to the Docker registry + +do-push: +# docker push $(IMAGE):$(VERSION) + docker push $(IMAGE):latest + +snapshot: build push + +showver: .release + @. $(RELEASE_SUPPORT); getVersion + +bump-patch-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextPatchLevel) +bump-patch-release: .release tag + +bump-minor-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextMinorLevel) +bump-minor-release: .release tag + +bump-major-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextMajorLevel) +bump-major-release: .release tag + +patch-release: tag-patch-release release + @echo $(VERSION) + +minor-release: tag-minor-release release + @echo $(VERSION) + +major-release: tag-major-release release + @echo $(VERSION) + +tag: TAG=$(shell . $(RELEASE_SUPPORT); getTag $(VERSION)) +tag: check-status +# @. $(RELEASE_SUPPORT) ; ! tagExists $(TAG) || (echo "ERROR: tag $(TAG) for version $(VERSION) already tagged in git" >&2 && exit 1) ; + @. $(RELEASE_SUPPORT) ; setRelease $(VERSION) +# git add . +# git commit -m "bumped to version $(VERSION)" ; +# git tag $(TAG) ; +# @ if [ -n "$(shell git remote -v)" ] ; then git push --tags ; else echo 'no remote to push tags to' ; fi + +check-status: + @. $(RELEASE_SUPPORT) ; ! hasChanges || (echo "ERROR: there are still outstanding changes" >&2 && exit 1) ; + +check-release: .release + @. $(RELEASE_SUPPORT) ; tagExists $(TAG) || (echo "ERROR: version not yet tagged in git. make [minor,major,patch]-release." >&2 && exit 1) ; + @. $(RELEASE_SUPPORT) ; ! differsFromRelease $(TAG) || (echo "ERROR: current directory differs from tagged $(TAG). make [minor,major,patch]-release." ; exit 1) + diff --git a/csp-lmc-mid/.release b/csp-lmc-mid/.release new file mode 100644 index 0000000..f5a4952 --- /dev/null +++ b/csp-lmc-mid/.release @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# +# This file is part of the CSP.LMC prototype project +# +# +# Distributed under the terms of the BSD-3-Clause license. +# See LICENSE.txt for more info. + +"""Release information for Python Package""" + +name = """MID CSP.LMC""" +version = "0.6.9" +version_info = version.split(".") +description = """SKA MID CSP.LMC Classes""" +author = "E.G" +author_email = "elisabetta.giani@inaf.it" +license = """BSD-3-Clause""" +url = """www.tango-controls.org""" +copyright = """""" + +release=0.6.9 +tag=mid-csp-lmc-0.6.9 diff --git a/csp-lmc-mid/Dockerfile b/csp-lmc-mid/Dockerfile new file mode 100644 index 0000000..2456a5e --- /dev/null +++ b/csp-lmc-mid/Dockerfile @@ -0,0 +1,10 @@ +FROM nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:9.3.2 AS buildenv +FROM nexus.engageska-portugal.pt/ska-docker/ska-python-runtime:9.3.2 AS runtime + +# create ipython profile to so that itango doesn't fail if ipython hasn't run yet +RUN ipython profile create + +ENV PATH=/home/tango/.local/bin:$PATH +RUN python3 -m pip install . --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple + +CMD ["/venv/bin/python","/app/csp_lmc_mid/MidCspMaster.py"] diff --git a/csp-lmc-mid/Makefile b/csp-lmc-mid/Makefile new file mode 100644 index 0000000..7ba51c4 --- /dev/null +++ b/csp-lmc-mid/Makefile @@ -0,0 +1,91 @@ +# +# Project makefile for a Tango project. You should normally only need to modify +# DOCKER_REGISTRY_USER and PROJECT below. +# + +# +# DOCKER_REGISTRY_HOST, DOCKER_REGISTRY_USER and PROJECT are combined to define +# the Docker tag for this project. The definition below inherits the standard +# value for DOCKER_REGISTRY_HOST (=rnexus.engageska-portugal.pt) and overwrites +# DOCKER_REGISTRY_USER and PROJECT to give a final Docker tag of +# nexus.engageska-portugal.pt/tango-example/powersupply +# +PROJECT = mid-csp-lmc +DSCONFIG_JSON_FILE ?= csp-lmc-mid/charts/csp-lmc-mid/data/configuration.json + + +# KUBE_NAMESPACE defines the Kubernetes Namespace that will be deployed to +# using Helm. If this does not already exist it will be created +KUBE_NAMESPACE ?= integration + +# HELM_RELEASE is the release that all Kubernetes resources will be labelled +# with +HELM_RELEASE ?= test + +# HELM_CHART the chart name +HELM_CHART ?= mid-csp + +# HELM CHART PACKAGE +HELM_PACKAGE ?= charts/csp-proto + +# INGRESS_HOST is the host name used in the Ingress resource definition for +# publishing services via the Ingress Controller +INGRESS_HOST ?= $(HELM_RELEASE).$(HELM_CHART).local + +# Optional creation of the tango-base dependency +ENABLE_TANGO_BASE ?= true + +# Fixed variables +# Timeout for gitlab-runner when run locally +TIMEOUT = 86400 +# Helm version +HELM_VERSION = v3.2.4 +# kubectl version +KUBERNETES_VERSION = v1.14.1 + +# Docker, K8s and Gitlab CI variables +# gitlab-runner debug mode - turn on with non-empty value +RDEBUG ?= +# gitlab-runner executor - shell or docker +EXECUTOR ?= shell +# DOCKER_HOST connector to gitlab-runner - local domain socket for shell exec +DOCKER_HOST ?= unix:///var/run/docker.sock +# DOCKER_VOLUMES pass in local domain socket for DOCKER_HOST +DOCKER_VOLUMES ?= /var/run/docker.sock:/var/run/docker.sock +# registry credentials - user/pass/registry - set these in PrivateRules.mak +DOCKER_REGISTRY_USER_LOGIN ?= ## registry credentials - user - set in PrivateRules.mak +CI_REGISTRY_PASS_LOGIN ?= ## registry credentials - pass - set in PrivateRules.mak +CI_REGISTRY ?= gitlab.com/ska-telescope/csp-lmc + +CI_PROJECT_DIR ?= . + +KUBE_CONFIG_BASE64 ?= ## base64 encoded kubectl credentials for KUBECONFIG +KUBECONFIG ?= /etc/deploy/config ## KUBECONFIG location + +XAUTHORITYx ?= ${XAUTHORITY} +ifneq ($(CI_JOB_ID),) +THIS_HOST := $(shell ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p' | head -n1) +DISPLAY := $(THIS_HOST):0 +endif + +# define private overrides for above variables in here +-include PrivateRules.mak + +# Test runner - run to completion job in K8s +TEST_RUNNER = test-runner-$(HELM_CHART)-$(HELM_RELEASE) + +# +# include makefile to pick up the standard Make targets, e.g., 'make build' +# build, 'make push' docker push procedure, etc. The other Make targets +# ('make interactive', 'make test', etc.) are defined in this file. +# +include .make/release.mk +include .make/k8s.mk +include .make/postdeploy.mk + +package: ## package all existing charts into a git based repo + mkdir -p helm-repo + helm package $(HELM_PACKAGE) --destination ./helm-repo ; \ + cd ./helm-repo && helm repo index . + +.PHONY: all test up down help k8s show lint deploy delete logs describe mkcerts localip namespace delete_namespace ingress_check kubeconfig kubectl_dependencies helm_dependencies rk8s_test k8s_test rlint diff --git a/csp-lmc-mid/charts/csp-proto/Chart.yaml b/csp-lmc-mid/charts/csp-proto/Chart.yaml new file mode 100644 index 0000000..f022adf --- /dev/null +++ b/csp-lmc-mid/charts/csp-proto/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +appVersion: "1.0" +description: A Helm chart for deploying the Mid_CSP.LMC devices on Kubernetes +name: csp-proto +version: 0.5.3 +icon: https://www.skatelescope.org/wp-content/uploads/2016/07/09545_NEW_LOGO_2014.png diff --git a/csp-lmc-mid/charts/csp-proto/data/configuration.json b/csp-lmc-mid/charts/csp-proto/data/configuration.json new file mode 100644 index 0000000..fd23f9d --- /dev/null +++ b/csp-lmc-mid/charts/csp-proto/data/configuration.json @@ -0,0 +1,1563 @@ +{ + "servers": { + "CspMaster": { + "csp": { + "CspMaster": { + "mid_csp/elt/master": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "fspMembership": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportFSPSubarrayMembership" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "reportFSPAdminMode": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportFSPAdminMode" + ] + }, + "reportFSPHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportFSPHealthState" + ] + }, + "reportFSPState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportFSPState" + ] + }, + "reportVCCAdminMode": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportVCCAdminMode" + ] + }, + "reportVCCHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportVCCHealthState" + ] + }, + "reportVCCState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportVCCState" + ] + }, + "vccMembership": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportVCCSubarrayMembership" + ] + } + }, + "properties": { + "CspMidCbf": [ + "mid_csp_cbf/sub_elt/master" + ], + "CspMidPss": [ + "mid_csp_pss/sub_elt/master" + ], + "CspMidPst": [ + "mid_csp_pst/sub_elt/master" + ], + "CspSubarrays": [ + "mid_csp/elt/subarray_01", + "mid_csp/elt/subarray_02", + "mid_csp/elt/subarray_03" + ], + "MaxCapabilities": [ + "Subarray:16", + "VlbiBeam:20", + "TimingBeam:16", + "SearchBeam:1500" + ], + "polled_attr": [ + "healthstate", + "1000", + "adminmode", + "1000", + "state", + "1000", + "csppststate", + "1000", + "cspcbfstate", + "1000", + "csppsthealthstate", + "1000", + "pssadminmode", + "1000", + "cbfadminmode", + "1000", + "csppssstate", + "1000", + "pstadminmode", + "1000", + "commandprogress", + "3000", + "cspcbfhealthstate", + "1000", + "csppsshealthstate", + "1000" + ] + } + } + } + } + }, + "CspSubarray": { + "sub1": { + "CspSubarray": { + "mid_csp/elt/subarray_01": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "receptors": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_01/receptors" + ] + }, + "vccHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_01/vccHealthState" + ] + }, + "vccState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_01/vccState" + ] + }, + "cbfOutputLink": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_01/outputLinksDistribution" + ] + } + }, + "properties": { + "CspMaster": [ + "mid_csp/elt/master" + ], + "SubID": [ + "1" + ], + "polled_attr": [ + "state", + "1000", + "healthstate", + "1000", + "adminmode", + "1000", + "obsstate", + "1000", + "obsmode", + "1000" + ] + } + } + } + }, + "sub2": { + "CspSubarray": { + "mid_csp/elt/subarray_02": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "receptors": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_02/receptors" + ] + }, + "vccHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_02/vccHealthState" + ] + }, + "vccState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_02/vccState" + ] + }, + "cbfOutputLink": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_02/outputLinksDistribution" + ] + } + }, + "properties": { + "CspMaster": [ + "mid_csp/elt/master" + ], + "SubID": [ + "2" + ], + "polled_attr": [ + "state", + "1000", + "healthstate", + "1000", + "adminmode", + "1000", + "obsstate", + "1000", + "obsmode", + "1000" + ] + } + } + } + }, + "sub3": { + "CspSubarray": { + "mid_csp/elt/subarray_03": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "receptors": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_03/receptors" + ] + }, + "vccHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_03/vccHealthState" + ] + }, + "vccState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_03/vccState" + ] + }, + "cbfOutputLink": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_03/outputLinksDistribution" + ] + } + }, + "properties": { + "CspMaster": [ + "mid_csp/elt/master" + ], + "SubID": [ + "3" + ], + "polled_attr": [ + "state", + "1000", + "healthstate", + "1000", + "adminmode", + "1000", + "obsstate", + "1000", + "obsmode", + "1000" + ] + } + } + } + } + }, + "CspTelState": { + "csp": { + "CspTelState": { + "mid_csp/elt/telstate": { + "attribute_properties": { + }, + "properties": { + } + } + } + } + }, + "DataBaseds": { + "2": { + "DataBase": { + "sys/database/2": {} + } + } + }, + "CbfMaster": { + "master": { + "CbfMaster": { + "mid_csp_cbf/sub_elt/master": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfSubarray": [ + "mid_csp_cbf/sub_elt/subarray_01", + "mid_csp_cbf/sub_elt/subarray_02", + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FSP": [ + "mid_csp_cbf/fsp/01", + "mid_csp_cbf/fsp/02", + "mid_csp_cbf/fsp/03", + "mid_csp_cbf/fsp/04" + ], + "MaxCapabilities": [ + "VCC:4", + "FSP:4", + "Subarray:3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ], + "polled_attr": [ + "reportfspstate", + "1000", + "reportvccadminmode", + "1000", + "reportvcchealthstate", + "1000", + "receptortovcc", + "1000", + "reportvccsubarraymembership", + "1000", + "reportfspsubarraymembership", + "1000", + "reportfsphealthstate", + "1000", + "healthstate", + "1000", + "adminmode", + "1000", + "subarrayscanid", + "1000", + "reportfspadminmode", + "1000", + "commandprogress", + "2000", + "reportsubarrayhealthstate", + "1000", + "reportvccstate", + "1000", + "reportsubarrayadminmode", + "1000", + "vcctoreceptor", + "3000", + "reportsubarraystate", + "3000", + "state", + "1000" + ] + } + } + } + } + }, + "CbfSubarrayMulti": { + "cbfSubarray-01": { + "CbfSubarray": { + "mid_csp_cbf/sub_elt/subarray_01": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "scanID": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "FSP": [ + "mid_csp_cbf/fsp/01", + "mid_csp_cbf/fsp/02", + "mid_csp_cbf/fsp/03", + "mid_csp_cbf/fsp/04" + ], + "FspSubarray": [ + "mid_csp_cbf/fspSubarray/01_01", + "mid_csp_cbf/fspSubarray/02_01", + "mid_csp_cbf/fspSubarray/03_01", + "mid_csp_cbf/fspSubarray/04_01" + ], + "SW1Address": [ + "mid_csp_cbf/sw1/01" + ], + "SW2Address": [ + "mid_csp_cbf/sw2/01" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ], + "polled_attr": [ + "state", + "1000", + "healthstate", + "1000", + "adminmode", + "1000", + "fsphealthstate", + "1000", + "fspstate", + "1000", + "vccstate", + "1000", + "vcchealthstate", + "1000", + "obsstate", + "1000", + "scanid", + "1000", + "outputLinksDistribution", + "1000" + ] + } + } + }, + "SearchWindow": { + "mid_csp_cbf/sw1/01": {}, + "mid_csp_cbf/sw2/01": {} + } + }, + "cbfSubarray-02": { + "CbfSubarray": { + "mid_csp_cbf/sub_elt/subarray_02": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "scanID": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "FSP": [ + "mid_csp_cbf/fsp/01", + "mid_csp_cbf/fsp/02", + "mid_csp_cbf/fsp/03", + "mid_csp_cbf/fsp/04" + ], + "FspSubarray": [ + "mid_csp_cbf/fspSubarray/01_02", + "mid_csp_cbf/fspSubarray/02_02", + "mid_csp_cbf/fspSubarray/03_02", + "mid_csp_cbf/fspSubarray/04_02" + ], + "SW1Address": [ + "mid_csp_cbf/sw1/02" + ], + "SW2Address": [ + "mid_csp_cbf/sw2/02" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ], + "polled_attr": [ + "scanid", + "1000", + "healthstate", + "1000", + "state", + "1000", + "obsstate", + "1000", + "vcchealthstate", + "1000", + "adminmode", + "1000", + "fspstate", + "1000", + "fsphealthstate", + "1000", + "vccstate", + "1000" + ] + } + } + }, + "SearchWindow": { + "mid_csp_cbf/sw1/02": {}, + "mid_csp_cbf/sw2/02": {} + } + }, + "cbfSubarray-03": { + "CbfSubarray": { + "mid_csp_cbf/sub_elt/subarray_03": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "scanID": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "FSP": [ + "mid_csp_cbf/fsp/01", + "mid_csp_cbf/fsp/02", + "mid_csp_cbf/fsp/03", + "mid_csp_cbf/fsp/04" + ], + "FspSubarray": [ + "mid_csp_cbf/fspSubarray/01_03", + "mid_csp_cbf/fspSubarray/02_03", + "mid_csp_cbf/fspSubarray/03_03", + "mid_csp_cbf/fspSubarray/04_03" + ], + "SW1Address": [ + "mid_csp_cbf/sw1/03" + ], + "SW2Address": [ + "mid_csp_cbf/sw2/03" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ], + "polled_attr": [ + "scanid", + "1000", + "healthstate", + "1000", + "state", + "1000", + "obsstate", + "1000", + "vcchealthstate", + "1000", + "adminmode", + "1000", + "fspstate", + "1000", + "fsphealthstate", + "1000", + "vccstate", + "1000" + ] + } + } + }, + "SearchWindow": { + "mid_csp_cbf/sw1/03": {}, + "mid_csp_cbf/sw2/03": {} + } + } + }, + "FspMulti": { + "fsp-01": { + "Fsp": { + "mid_csp_cbf/fsp/01": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CorrelationAddress": [ + "mid_csp_cbf/fsp_corr/01" + ], + "FspID": [ + "1" + ], + "PSSAddress": [ + "mid_csp_cbf/fsp_pss/01" + ], + "PSTAddress": [ + "mid_csp_cbf/fsp_pst/01" + ], + "VLBIAddress": [ + "mid_csp_cbf/fsp_vlbi/01" + ], + "FspSubarray": [ + "mid_csp_cbf/fspSubarray/01_01", + "mid_csp_cbf/fspSubarray/01_02", + "mid_csp_cbf/fspSubarray/01_03" + ], + "polled_attr": [ + "adminmode", + "1000", + "healthstate", + "1000", + "state", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "FspCorr": { + "mid_csp_cbf/fsp_corr/01": {} + }, + "FspPss": { + "mid_csp_cbf/fsp_pss/01": {} + }, + "FspPst": { + "mid_csp_cbf/fsp_pst/01": {} + }, + "FspSubarray": { + "mid_csp_cbf/fspSubarray/01_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "1" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspSubarray/01_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "1" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspSubarray/01_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "1" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspVlbi": { + "mid_csp_cbf/fsp_vlbi/01": {} + } + }, + "fsp-02": { + "Fsp": { + "mid_csp_cbf/fsp/02": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CorrelationAddress": [ + "mid_csp_cbf/fsp_corr/02" + ], + "FspID": [ + "2" + ], + "PSSAddress": [ + "mid_csp_cbf/fsp_pss/02" + ], + "PSTAddress": [ + "mid_csp_cbf/fsp_pst/02" + ], + "VLBIAddress": [ + "mid_csp_cbf/fsp_vlbi/02" + ], + "FspSubarray": [ + "mid_csp_cbf/fspSubarray/02_01", + "mid_csp_cbf/fspSubarray/02_02", + "mid_csp_cbf/fspSubarray/02_03" + ], + "polled_attr": [ + "adminmode", + "1000", + "healthstate", + "1000", + "state", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "FspCorr": { + "mid_csp_cbf/fsp_corr/02": {} + }, + "FspPss": { + "mid_csp_cbf/fsp_pss/02": {} + }, + "FspPst": { + "mid_csp_cbf/fsp_pst/02": {} + }, + "FspSubarray": { + "mid_csp_cbf/fspSubarray/02_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "2" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspSubarray/02_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "2" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspSubarray/02_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "2" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspVlbi": { + "mid_csp_cbf/fsp_vlbi/02": {} + } + }, + "fsp-03": { + "Fsp": { + "mid_csp_cbf/fsp/03": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CorrelationAddress": [ + "mid_csp_cbf/fsp_corr/03" + ], + "FspID": [ + "3" + ], + "PSSAddress": [ + "mid_csp_cbf/fsp_pss/03" + ], + "PSTAddress": [ + "mid_csp_cbf/fsp_pst/03" + ], + "VLBIAddress": [ + "mid_csp_cbf/fsp_vlbi/03" + ], + "FspSubarray": [ + "mid_csp_cbf/fspSubarray/03_01", + "mid_csp_cbf/fspSubarray/03_02" + ], + "polled_attr": [ + "adminmode", + "1000", + "healthstate", + "1000", + "state", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "FspCorr": { + "mid_csp_cbf/fsp_corr/03": {} + }, + "FspPss": { + "mid_csp_cbf/fsp_pss/03": {} + }, + "FspPst": { + "mid_csp_cbf/fsp_pst/03": {} + }, + "FspSubarray": { + "mid_csp_cbf/fspSubarray/03_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "3" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspSubarray/03_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "3" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspSubarray/03_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "3" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspVlbi": { + "mid_csp_cbf/fsp_vlbi/03": {} + } + }, + "fsp-04": { + "Fsp": { + "mid_csp_cbf/fsp/04": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CorrelationAddress": [ + "mid_csp_cbf/fsp_corr/04" + ], + "FspID": [ + "4" + ], + "PSSAddress": [ + "mid_csp_cbf/fsp_pss/04" + ], + "PSTAddress": [ + "mid_csp_cbf/fsp_pst/04" + ], + "VLBIAddress": [ + "mid_csp_cbf/fsp_vlbi/04" + ], + "FspSubarray": [ + "mid_csp_cbf/fspSubarray/04_01", + "mid_csp_cbf/fspSubarray/04_02" + ], + "polled_attr": [ + "adminmode", + "1000", + "healthstate", + "1000", + "state", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "FspCorr": { + "mid_csp_cbf/fsp_corr/04": {} + }, + "FspPss": { + "mid_csp_cbf/fsp_pss/04": {} + }, + "FspPst": { + "mid_csp_cbf/fsp_pst/04": {} + }, + "FspSubarray": { + "mid_csp_cbf/fspSubarray/04_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "4" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspSubarray/04_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "4" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspSubarray/04_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "4" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspVlbi": { + "mid_csp_cbf/fsp_vlbi/04": {} + } + } + }, + "VccMulti": { + "vcc-001": { + "Vcc": { + "mid_csp_cbf/vcc/001": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "Band1And2Address": [ + "mid_csp_cbf/vcc_band12/001" + ], + "Band3Address": [ + "mid_csp_cbf/vcc_band3/001" + ], + "Band4Address": [ + "mid_csp_cbf/vcc_band4/001" + ], + "Band5Address": [ + "mid_csp_cbf/vcc_band5/001" + ], + "SW1Address": [ + "mid_csp_cbf/vcc_sw1/001" + ], + "SW2Address": [ + "mid_csp_cbf/vcc_sw2/001" + ], + "VccID": [ + "1" + ], + "polled_attr": [ + "state", + "1000", + "healthstate", + "1000", + "adminmode", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "VccBand1And2": { + "mid_csp_cbf/vcc_band12/001": {} + }, + "VccBand3": { + "mid_csp_cbf/vcc_band3/001": {} + }, + "VccBand4": { + "mid_csp_cbf/vcc_band4/001": {} + }, + "VccBand5": { + "mid_csp_cbf/vcc_band5/001": {} + }, + "VccSearchWindow": { + "mid_csp_cbf/vcc_sw1/001": {}, + "mid_csp_cbf/vcc_sw2/001": {} + } + }, + "vcc-002": { + "Vcc": { + "mid_csp_cbf/vcc/002": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "Band1And2Address": [ + "mid_csp_cbf/vcc_band12/002" + ], + "Band3Address": [ + "mid_csp_cbf/vcc_band3/002" + ], + "Band4Address": [ + "mid_csp_cbf/vcc_band4/002" + ], + "Band5Address": [ + "mid_csp_cbf/vcc_band5/002" + ], + "SW1Address": [ + "mid_csp_cbf/vcc_sw1/002" + ], + "SW2Address": [ + "mid_csp_cbf/vcc_sw2/002" + ], + "VccID": [ + "2" + ], + "polled_attr": [ + "state", + "1000", + "healthstate", + "1000", + "adminmode", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "VccBand1And2": { + "mid_csp_cbf/vcc_band12/002": {} + }, + "VccBand3": { + "mid_csp_cbf/vcc_band3/002": {} + }, + "VccBand4": { + "mid_csp_cbf/vcc_band4/002": {} + }, + "VccBand5": { + "mid_csp_cbf/vcc_band5/002": {} + }, + "VccSearchWindow": { + "mid_csp_cbf/vcc_sw1/002": {}, + "mid_csp_cbf/vcc_sw2/002": {} + } + }, + "vcc-003": { + "Vcc": { + "mid_csp_cbf/vcc/003": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "Band1And2Address": [ + "mid_csp_cbf/vcc_band12/003" + ], + "Band3Address": [ + "mid_csp_cbf/vcc_band3/003" + ], + "Band4Address": [ + "mid_csp_cbf/vcc_band4/003" + ], + "Band5Address": [ + "mid_csp_cbf/vcc_band5/003" + ], + "SW1Address": [ + "mid_csp_cbf/vcc_sw1/003" + ], + "SW2Address": [ + "mid_csp_cbf/vcc_sw2/003" + ], + "VccID": [ + "3" + ], + "polled_attr": [ + "state", + "1000", + "healthstate", + "1000", + "adminmode", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "VccBand1And2": { + "mid_csp_cbf/vcc_band12/003": {} + }, + "VccBand3": { + "mid_csp_cbf/vcc_band3/003": {} + }, + "VccBand4": { + "mid_csp_cbf/vcc_band4/003": {} + }, + "VccBand5": { + "mid_csp_cbf/vcc_band5/003": {} + }, + "VccSearchWindow": { + "mid_csp_cbf/vcc_sw1/003": {}, + "mid_csp_cbf/vcc_sw2/003": {} + } + }, + "vcc-004": { + "Vcc": { + "mid_csp_cbf/vcc/004": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "Band1And2Address": [ + "mid_csp_cbf/vcc_band12/004" + ], + "Band3Address": [ + "mid_csp_cbf/vcc_band3/004" + ], + "Band4Address": [ + "mid_csp_cbf/vcc_band4/004" + ], + "Band5Address": [ + "mid_csp_cbf/vcc_band5/004" + ], + "SW1Address": [ + "mid_csp_cbf/vcc_sw1/004" + ], + "SW2Address": [ + "mid_csp_cbf/vcc_sw2/004" + ], + "VccID": [ + "4" + ], + "polled_attr": [ + "state", + "1000", + "healthstate", + "1000", + "adminmode", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "VccBand1And2": { + "mid_csp_cbf/vcc_band12/004": {} + }, + "VccBand3": { + "mid_csp_cbf/vcc_band3/004": {} + }, + "VccBand4": { + "mid_csp_cbf/vcc_band4/004": {} + }, + "VccBand5": { + "mid_csp_cbf/vcc_band5/004": {} + }, + "VccSearchWindow": { + "mid_csp_cbf/vcc_sw1/004": {}, + "mid_csp_cbf/vcc_sw2/004": {} + } + } + }, + "DataBaseds": { + "2": { + "DataBase": { + "sys/database/2": {} + } + } + }, + "TangoAccessControl": { + "1": { + "TangoAccessControl": { + "sys/access_control/1": {} + } + } + }, + "TangoTest": { + "test": { + "TangoTest": { + "sys/tg_test/1": {} + } + } + } + } +} + diff --git a/csp-lmc-mid/charts/csp-proto/data/cspconfig.json b/csp-lmc-mid/charts/csp-proto/data/cspconfig.json new file mode 100644 index 0000000..08bb41f --- /dev/null +++ b/csp-lmc-mid/charts/csp-proto/data/cspconfig.json @@ -0,0 +1,838 @@ +{ + "servers": { + "MidCspCapabilityMonitor": { + "monitor": { + "CspCapabilityMonitor": { + "mid_csp/capability_monitor/vcc": { + "properties": { + "CapabilityDevices": [ + "mid_csp/vcc/004", + "mid_csp/vcc/003", + "mid_csp/vcc/002", + "mid_csp/vcc/001" + ], + "SkaLevel": [ + "2" + ] + } + }, + "mid_csp/capability_monitor/timing_beams": { + "properties": { + "CapabilityDevices": [ + "mid_csp/timing_beams/04", + "mid_csp/timing_beams/03", + "mid_csp/timing_beams/01", + "mid_csp/timing_beams/02" + ], + "SkaLevel": [ + "2" + ] + } + }, + "mid_csp/capability_monitor/vlbi_beams": { + "properties": { + "CapabilityDevices": [ + "mid_csp/vlbi_beams/03", + "mid_csp/vlbi_beams/04", + "mid_csp/vlbi_beams/02", + "mid_csp/vlbi_beams/01" + ], + "SkaLevel": [ + "2" + ] + } + } + }, + "CspSearchBeamsMonitor": { + "mid_csp/capability_monitor/search_beams": { + "properties": { + "CapabilityDevices": [ + "mid_csp/search_beams/04", + "mid_csp/search_beams/03", + "mid_csp/search_beams/01", + "mid_csp/search_beams/02" + ], + "SkaLevel": [ + "2" + ] + } + } + } + } + }, + "MidCspMaster": { + "master": { + "MidCspMasterBase": { + "mid_csp/elt/master": { + "attribute_properties": { + "adminMode": { + "__value": [ + "0" + ], + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "reportFSPAdminMode": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportFSPAdminMode" + ] + }, + "reportFSPHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportFSPHealthState" + ] + }, + "reportFSPState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportFSPState" + ] + }, + "reportSearchBeamAdminMode": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/capabilityAdminMode" + ] + }, + "reportSearchBeamHealthState": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/capabilityHealthState" + ] + }, + "reportSearchBeamObsState": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/capabilityObsState" + ] + }, + "reportSearchBeamState": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/capabilityState" + ] + }, + "reportTimingBeamAdminMode": { + "__root_att": [ + "mid_csp/capability_monitor/timing_beams/capabilityAdminMode" + ] + }, + "reportTimingBeamHealthState": { + "__root_att": [ + "mid_csp/capability_monitor/timing_beams/capabilityHealthState" + ] + }, + "reportTimingBeamObsState": { + "__root_att": [ + "mid_csp/capability_monitor/timing_beams/capabilityObsState" + ] + }, + "reportTimingBeamState": { + "__root_att": [ + "mid_csp/capability_monitor/timing_beams/capabilityState" + ] + }, + "reportVCCAdminMode": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportVCCAdminMode" + ] + }, + "reportVCCHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportVCCHealthState" + ] + }, + "reportVCCState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportVCCState" + ] + }, + "reportVlbiBeamAdminMode": { + "__root_att": [ + "mid_csp/capability_monitor/vlbi_beams/capabilityAdminMode" + ] + }, + "reportVlbiBeamHealthState": { + "__root_att": [ + "mid_csp/capability_monitor/vlbi_beams/capabilityHealthState" + ] + }, + "reportVlbiBeamObsState": { + "__root_att": [ + "mid_csp/capability_monitor/vlbi_beams/capabilityObsState" + ] + }, + "reportVlbiBeamState": { + "__root_att": [ + "mid_csp/capability_monitor/vlbi_beams/capabilityState" + ] + }, + "searchBeamMembership": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/capabilityMembership" + ] + }, + "timingBeamMembership": { + "__root_att": [ + "mid_csp/capability_monitor/timing_beams/capabilityMembership" + ] + }, + "unassignedSearchBeamIDs": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/unassignedIDs" + ] + }, + "numOfUnassignedSearchBeams": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/numOfUnassignedIDs" + ] + }, + "numOfReservedSearchBeams": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/numOfReservedIDs" + ] + }, + "unassignedTimingBeamIDs": { + "__root_att": [ + "mid_csp/capability_monitor/timing_beams/unassignedIDs" + ] + }, + "numOfUnassignedTimingBeams": { + "__root_att": [ + "mid_csp/capability_monitor/timing_beams/numOfUnassignedIDs" + ] + }, + "numOfUnassignedVlbiBeams": { + "__root_att": [ + "mid_csp/capability_monitor/vlbi_beams/numOfUnassignedIDs" + ] + }, + "unassignedVlbiBeamIDs": { + "__root_att": [ + "mid_csp/capability_monitor/vlbi_beams/unassignedIDs" + ] + }, + "vccMembership": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportVCCSubarrayMembership" + ] + }, + "vlbiBeamMembership": { + "__root_att": [ + "mid_csp/capability_monitor/vlbi_beams/capabilityMembership" + ] + } + }, + "properties": { + "CspCbf": [ + "mid_csp_cbf/sub_elt/master" + ], + "CspPss": [ + "mid_csp_pss/sub_elt/master" + ], + "CspPst": [ + "mid_csp_pst/sub_elt/master" + ], + "CspSubarrays": [ + "mid_csp/elt/subarray_01", + "mid_csp/elt/subarray_02", + "mid_csp/elt/subarray_03" + ], + "MaxCapabilities": [ + "VCC:4", + "SearchBeams:1500", + "TimingBeams:16", + "VlbiBeams:20" + ], + "SearchBeamsMonitor": [ + "mid_csp/capability_monitor/search_beams" + ], + "TimingBeamsMonitor": [ + "mid_csp/capability_monitor/timing_beams" + ], + "VlbiBeamsMonitor": [ + "mid_csp/capability_monitor/vlbi_beams" + ], + "SkaLevel": [ + "1" + ], + "polled_attr": [ + "healthstate", + "1000", + "adminmode", + "1000", + "state", + "1000", + "csppssadminmode", + "1000", + "csppstadminmode", + "1000", + "cspcbfadminmode", + "1000", + "oncommandprogress", + "1500", + "offcommandprogress", + "1500", + "offcmddurationexpected", + "1500", + "standbycommandprogress", + "1500", + "oncmddurationexpected", + "1500", + "standbycmddurationexpected", + "1500", + "oncmddurationmeasured", + "1500", + "offcmddurationmeasured", + "1500", + "standbycmddurationmeasured", + "1500", + "offcmdtimeoutexpired", + "1500", + "oncmdtimeoutexpired", + "1500", + "csppssstate", + "1000", + "standbycmdtimeoutexpired", + "1000", + "csppststate", + "1000", + "cspcbfhealthstate", + "1000", + "csppsshealthstate", + "1000", + "csppsthealthstate", + "1000", + "cspcbfadminmode", + "1000", + "oncmdfailure", + "2000", + "offcmdfailure", + "2000", + "standbycmdfailure", + "2000", + "cspcbfstate", + "1000" + ] + } + } + } + } + }, + "MidCspSubarray": { + "subarray1": { + "MidCspSubarrayBase": { + "mid_csp/elt/subarray_01": { + "attribute_properties": { + "adminMode": { + "__value": [ + "0" + ], + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "assignedFspHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_01/fspHealthState" + ] + }, + "assignedFspState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_01/fspState" + ] + }, + "assignedReceptors": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_01/receptors" + ] + }, + "assignedVccHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_01/vccHealthState" + ] + }, + "assignedVccState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_01/vccState" + ] + } + }, + "properties": { + "CbfSubarray": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "CspMaster": [ + "mid_csp/elt/master" + ], + "PssSubarray": [ + "mid_csp_pss/sub_elt/subarray_01" + ], + "SkaLevel": [ + "2" + ], + "SubID": [ + "1" + ], + "SubarrayProcModeCorrelation": [ + "mid_csp/elt/correlation-01" + ], + "SubarrayProcModePss": [ + "mid_csp/elt/pss-01" + ], + "SubarrayProcModePst": [ + "mid_csp/elt/pst-01" + ], + "SubarrayProcModeVlbi": [ + "mid_csp/elt/vlbi-01" + ], + "polled_attr": [ + "healthstate", + "1000", + "obsmode", + "1000", + "failureraisedflag", + "1000", + "timeoutexpiredflag", + "1000", + "scancmdprogress", + "1500", + "removeresourcescmdprogress", + "1500", + "addresourcescmdprogress", + "1500", + "endscancmdprogress", + "1500", + "gotoidlecmdprogress", + "1500" + ] + } + } + }, + "MidCspSubarrayProcModeCorrelation": { + "mid_csp/elt/correlation-01": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "CORRELATION" + ], + "subID": [ + "1" + ] + } + } + }, + "MidCspSubarrayProcModePss": { + "mid_csp/elt/pss-01": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "PSS" + ], + "subID": [ + "1" + ] + } + } + }, + "MidCspSubarrayProcModePst": { + "mid_csp/elt/pst-01": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "PST" + ], + "subID": [ + "1" + ] + } + } + }, + "MidCspSubarrayProcModeVlbi": { + "mid_csp/elt/vlbi-01": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "VLBI" + ], + "subID": [ + "1" + ] + } + } + } + }, + "subarray2": { + "MidCspSubarrayBase": { + "mid_csp/elt/subarray_02": { + "attribute_properties": { + "adminMode": { + "__value": [ + "0" + ], + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "assignedFspHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_02/fspHealthState" + ] + }, + "assignedFspState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_02/fspState" + ] + }, + "assignedReceptors": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_02/receptors" + ] + }, + "assignedVccHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_02/vccHealthState" + ] + }, + "assignedVccState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_02/vccState" + ] + } + }, + "properties": { + "CbfSubarray": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "CspMaster": [ + "mid_csp/elt/master" + ], + "PssSubarray": [ + "mid_csp_pss/sub_elt/subarray_02" + ], + "SkaLevel": [ + "2" + ], + "SubID": [ + "2" + ], + "SubarrayProcModeCorrelation": [ + "mid_csp/elt/correlation-02" + ], + "SubarrayProcModePss": [ + "mid_csp/elt/pss-02" + ], + "SubarrayProcModePst": [ + "mid_csp/elt/pst-02" + ], + "SubarrayProcModeVlbi": [ + "mid_csp/elt/vlbi-02" + ], + "polled_attr": [ + "healthstate", + "1000", + "obsmode", + "1000", + "failureraisedflag", + "1000", + "timeoutexpiredflag", + "1000", + "scancmdprogress", + "1500", + "removeresourcescmdprogress", + "1500", + "addresourcescmdprogress", + "1500", + "endscancmdprogress", + "1500", + "gotoidlecmdprogress", + "1500" + ] + } + } + }, + "MidCspSubarrayProcModeCorrelation": { + "mid_csp/elt/correlation-02": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "CORRELATION" + ], + "subID": [ + "2" + ] + } + } + }, + "MidCspSubarrayProcModePss": { + "mid_csp/elt/pss-02": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "PSS" + ], + "subID": [ + "2" + ] + } + } + }, + "MidCspSubarrayProcModePst": { + "mid_csp/elt/pst-02": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "PST" + ], + "subID": [ + "2" + ] + } + } + }, + "MidCspSubarrayProcModeVlbi": { + "mid_csp/elt/vlbi-02": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "VLBI" + ], + "subID": [ + "2" + ] + } + } + } + }, + "subarray3": { + "MidCspSubarrayBase": { + "mid_csp/elt/subarray_03": { + "attribute_properties": { + "adminMode": { + "__value": [ + "0" + ], + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "assignedFspHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_03/fspHealthState" + ] + }, + "assignedFspState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_03/fspState" + ] + }, + "assignedReceptors": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_03/receptors" + ] + }, + "assignedVccHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_03/vccHealthState" + ] + }, + "assignedVccState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_03/vccState" + ] + } + }, + "properties": { + "CbfSubarray": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "CspMaster": [ + "mid_csp/elt/master" + ], + "PssSubarray": [ + "mid_csp_pss/sub_elt/subarray_03" + ], + "SkaLevel": [ + "2" + ], + "SubID": [ + "3" + ], + "SubarrayProcModeCorrelation": [ + "mid_csp/elt/correlation-03" + ], + "SubarrayProcModePss": [ + "mid_csp/elt/pss-03" + ], + "SubarrayProcModePst": [ + "mid_csp/elt/pst-03" + ], + "SubarrayProcModeVlbi": [ + "mid_csp/elt/vlbi-03" + ], + "polled_attr": [ + "healthstate", + "1000", + "obsmode", + "1000", + "failureraisedflag", + "1000", + "timeoutexpiredflag", + "1000", + "scancmdprogress", + "1500", + "removeresourcescmdprogress", + "1500", + "addresourcescmdprogress", + "1500", + "endscancmdprogress", + "1500", + "gotoidlecmdprogress", + "1500" + ] + } + } + }, + "MidCspSubarrayProcModeCorrelation": { + "mid_csp/elt/correlation-03": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "CORRELATION" + ], + "subID": [ + "3" + ] + } + } + }, + "MidCspSubarrayProcModePss": { + "mid_csp/elt/pss-03": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "PSS" + ], + "subID": [ + "3" + ] + } + } + }, + "MidCspSubarrayProcModePst": { + "mid_csp/elt/pst-03": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "PST" + ], + "subID": [ + "3" + ] + } + } + }, + "MidCspSubarrayProcModeVlbi": { + "mid_csp/elt/vlbi-03": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "VLBI" + ], + "subID": [ + "3" + ] + } + } + } + } + }, + "DataBaseds": { + "2": { + "DataBase": { + "sys/database/2": {} + } + } + }, + "TangoAccessControl": { + "1": { + "TangoAccessControl": { + "sys/access_control/1": {} + } + } + }, + "TangoTest": { + "test": { + "TangoTest": { + "sys/tg_test/1": {} + } + } + } + } +} diff --git a/csp-lmc-mid/charts/csp-proto/secrets/.gitkeep b/csp-lmc-mid/charts/csp-proto/secrets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/csp-lmc-mid/charts/csp-proto/secrets/tls.crt b/csp-lmc-mid/charts/csp-proto/secrets/tls.crt new file mode 100644 index 0000000..281f413 --- /dev/null +++ b/csp-lmc-mid/charts/csp-proto/secrets/tls.crt @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDRTCCAi2gAwIBAgIUCWlGy8z2r11G2Sc52B0zjGpytywwDQYJKoZIhvcNAQEL +BQAwMjEdMBsGA1UEAwwUdGVzdC5jc3AtcHJvdG8ubG9jYWwxETAPBgNVBAoMCE1p +bmlrdWJlMB4XDTIwMDkwNDA2NDM0OFoXDTIxMDkwNDA2NDM0OFowMjEdMBsGA1UE +AwwUdGVzdC5jc3AtcHJvdG8ubG9jYWwxETAPBgNVBAoMCE1pbmlrdWJlMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+y4kIIi+hU5fNdV1JTc4qCDh2VAO +lhXX5LmJAQbWWkzOWszOcqGB0g6P4CNIAgNVmFjPoPNsbxlBrKFpoI78p4y1iW4C +LOGkg4gwND1f8SNE7VJyqCiMti7SdBFF6LRNdp6WwmVKVuRdN4Tk+B+39dlTSVjx +Ykziqy7vRLwBsJlbhxIFRkFNdmzpucYTcjUfB4PM5my30ZGdqMnsZ5Mpzw/BkC+s +VRVMSKq1nmtgMYIZUTgdue/sC/SKuqH4FffiQZ6RLAABl1qXFU/A2RkjSn3VBuYh +CWXPgSvi5mxCWDqf4lGZR+yxWMD+t7AG4IuLUl+KeV8PIjvMWSKb+Fdy9wIDAQAB +o1MwUTAdBgNVHQ4EFgQUdnM99TO9Jn3Oi16QbSIqeDkQr1cwHwYDVR0jBBgwFoAU +dnM99TO9Jn3Oi16QbSIqeDkQr1cwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0B +AQsFAAOCAQEA5d3w4vrLHbto4NGfKyjORnqQyxEeI5eZe9xRBaxobdhMlFDshNjC +GTcOdcAiGU9jRn95fItJZraXMYCR+Ysf9edU+YEaVnKioWnCUflxBNa2tZ7c+sNC +zqvcRIYZIGGg1J4RYZ0i0XJsYKn+RCuhSPjR3C1nSN47PPjnk85hnUyofdGHDJ2W +p71ozY2o3lKuw9NiU9kqnW2NRW/QBZvKnGHdq2izP8ciZZJtCsz8Tz9I1AzL2qqx +G8UThABjlIVMzhoRjzQ6vI5mcP/ucJZ1nU2/sqOGI4aLVRNTlv5DsiuPmC6zHD/s +ApaI7734oQBu6SkIrJLNyNwk2cQusgX44Q== +-----END CERTIFICATE----- diff --git a/csp-lmc-mid/charts/csp-proto/secrets/tls.key b/csp-lmc-mid/charts/csp-proto/secrets/tls.key new file mode 100644 index 0000000..5747df7 --- /dev/null +++ b/csp-lmc-mid/charts/csp-proto/secrets/tls.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD7LiQgiL6FTl81 +1XUlNzioIOHZUA6WFdfkuYkBBtZaTM5azM5yoYHSDo/gI0gCA1WYWM+g82xvGUGs +oWmgjvynjLWJbgIs4aSDiDA0PV/xI0TtUnKoKIy2LtJ0EUXotE12npbCZUpW5F03 +hOT4H7f12VNJWPFiTOKrLu9EvAGwmVuHEgVGQU12bOm5xhNyNR8Hg8zmbLfRkZ2o +yexnkynPD8GQL6xVFUxIqrWea2AxghlROB257+wL9Iq6ofgV9+JBnpEsAAGXWpcV +T8DZGSNKfdUG5iEJZc+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OEI18D +Ga/GorxdovA6dyoqjgOMkWzRz0XdubyKr7muDEZH+wKBgDw3y6Ujx0fTgENMgrLD +lj205wSOUZe9a5QJQ3HbsKh2qDY0nK2COMo8OW76+a5Vlk2PJLyXQGU2Ceuj+rUq +yY3+cVQfjI3dYv+5nTh4O1XRiZwVhHm/AkUlQ5n0C9KSa4Ejhpb8A7RUDAC8B8cn +p+IuCq0Nk9KtGwdvh9fH/hJ5 +-----END PRIVATE KEY----- diff --git a/csp-lmc-mid/charts/csp-proto/templates/_helpers.tpl b/csp-lmc-mid/charts/csp-proto/templates/_helpers.tpl new file mode 100644 index 0000000..c1891ce --- /dev/null +++ b/csp-lmc-mid/charts/csp-proto/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "csp-proto.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "csp-proto.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "csp-proto.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/csp-lmc-mid/charts/csp-proto/templates/csplmc.yaml b/csp-lmc-mid/charts/csp-proto/templates/csplmc.yaml new file mode 100644 index 0000000..29afbb5 --- /dev/null +++ b/csp-lmc-mid/charts/csp-proto/templates/csplmc.yaml @@ -0,0 +1,147 @@ +{{ if .Values.csplmc.enabled }} + +--- +# Device Server configurations +apiVersion: v1 +kind: ConfigMap +metadata: + name: "csp-proto-configuration-json-{{ template "csp-proto.name" . }}-{{ .Release.Name }}" + namespace: {{ .Release.Namespace }} +data: + cspconfig.json: +{{ (tpl (.Files.Glob "data/cspconfig.json").AsConfig . ) | indent 2 }} + bootstrap.sh: | + #/bin/sh + /usr/local/bin/wait-for-it.sh databaseds-tango-base-{{ .Release.Name }}:10000 \ + --timeout=30 \ + --strict \ + -- json2tango -w -a -u data/cspconfig.json + rc=$? + if [ $rc -eq 0 ]; then + echo "finished normally." + exit 0 + else + if [ $rc -eq 2 ]; then + echo "finished with an update." + exit 0 + else + echo "finished with an ERROR." + exit $rc + fi + fi + +--- +# run once Job for loading Device Server config +apiVersion: batch/v1 +kind: Job +metadata: + name: midcsplmc-configurator-{{ template "csp-proto.name" . }}-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} +spec: + ttlSecondsAfterFinished: 100 + template: + spec: + containers: + - name: dsconfig + image: "{{ .Values.dsconfig.image.registry }}/{{ .Values.dsconfig.image.image }}:{{ .Values.dsconfig.image.tag }}" + imagePullPolicy: {{ .Values.dsconfig.image.pullPolicy }} + command: # exit code 2 is CONFIG_APPLIED - https://github.com/MaxIV-KitsControls/lib-maxiv-dsconfig/blob/master/dsconfig/utils.py#L11 !!!! this should not be an error !!!! + - sh + - data/bootstrap.sh + env: + - name: TANGO_HOST + value: databaseds-tango-base-{{ .Release.Name }}:10000 + volumeMounts: + - name: configuration + mountPath: data + readOnly: true + volumes: + - name: configuration + configMap: + name: "csp-proto-configuration-json-{{ template "csp-proto.name" . }}-{{ .Release.Name }}" + restartPolicy: Never + +{{- $global := . }} +{{- range $deviceserver := .Values.deviceServers }} + +--- +# giving a dummy Service entry ensures that the single pod is DNS addressable +apiVersion: v1 +kind: Service +metadata: + name: midcsplmc-{{ template "csp-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + namespace: {{ $global.Release.Namespace }} + labels: + app: midcsplmc-{{ template "csp-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + chart: {{ template "csp-proto.chart" $global }} + release: {{ $global.Release.Name }} + heritage: {{ $global.Release.Service }} +spec: + clusterIP: None + ports: + - name: dummy # Actually, no port is needed. + port: 1234 + targetPort: 1234 + selector: + app: midcsplmc-{{ template "csp-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + chart: {{ template "csp-proto.chart" $global }} + release: {{ $global.Release.Name }} + +--- +# Single Pod separate statefulset per Device Server +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: midcsplmc-{{ template "csp-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + namespace: {{ $global.Release.Namespace }} + labels: + app: midcsplmc-{{ template "csp-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + chart: {{ template "csp-proto.chart" $global }} + release: {{ $global.Release.Name }} + heritage: {{ $global.Release.Service }} +spec: + selector: + matchLabels: + app: midcsplmc-{{ template "csp-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + chart: {{ template "csp-proto.chart" $global }} + release: {{ $global.Release.Name }} + serviceName: midcsplmc-{{ template "csp-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + replicas: 1 + template: + metadata: + labels: + app: midcsplmc-{{ template "csp-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + chart: {{ template "csp-proto.chart" $global }} + release: {{ $global.Release.Name }} + heritage: {{ $global.Release.Service }} + cspServer: {{$deviceserver.name}} + spec: + containers: + - name: deviceserver + image: "{{ $global.Values.csplmc.image.registry }}/{{ $global.Values.csplmc.image.image }}:{{ $global.Values.csplmc.image.tag }}" + imagePullPolicy: {{ $global.Values.csplmc.image.pullPolicy }} + command: + - sh + args: +{{ toYaml $deviceserver.args | indent 10 }} + env: + - name: TANGO_HOST + value: databaseds-tango-base-{{ $global.Release.Name }}:10000 + resources: +{{ toYaml $global.Values.resources | indent 10 }} +{{- with $global.Values.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} +{{- end }} +{{- with $global.Values.affinity }} + affinity: +{{ toYaml . | indent 8 }} +{{- end }} +{{- with $global.Values.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} +{{- end }} + +{{- end }} # end of range + +{{ end }} diff --git a/csp-lmc-mid/charts/csp-proto/values.yaml b/csp-lmc-mid/charts/csp-proto/values.yaml new file mode 100644 index 0000000..0224b03 --- /dev/null +++ b/csp-lmc-mid/charts/csp-proto/values.yaml @@ -0,0 +1,79 @@ +# Default values for csp-proto. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +display: ":0" +xauthority: "~/.Xauthority" + +system: csp +subsystem: csp-lmc +telescope: SKA-mid + +csplmc: + enabled: true + image: + registry: nexus.engageska-portugal.pt/ska-docker + image: mid-csp-lmc + tag: latest + pullPolicy: IfNotPresent + +deviceServers: + - name: midcapabilitymonitor + function: csp-capability-monitoring + domain: csp-monitoring + args: + - "-c" + - "/venv/bin/python /app/csp_lmc_mid/MidCspCapabilityMonitor.py monitor" + - name: midcspmaster + function: csp-central-control + domain: csp-monitoring + args: + - "-c" + - "retry --max=20 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\ + retry --max=5 -- tango_admin --ping-device mid_csp/capability_monitor/search_beams &&\ + /venv/bin/python /app/csp_lmc_mid/MidCspMaster.py master" + - name: midcspsubarray01 + function: csp-subarray-observation + domain: subarray + args: + - "-c" + - "retry --max=10 -- tango_admin --ping-device mid_csp/elt/master &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_01 &&\ + /venv/bin/python /app/csp_lmc_mid/MidCspSubarray.py subarray1" + - name: midcspsubarray02 + function: csp-subarray-observation + domain: subarray + args: + - "-c" + - "retry --max=10 -- tango_admin --ping-device mid_csp/elt/master &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_02 &&\ + /venv/bin/python /app/csp_lmc_mid/MidCspSubarray.py subarray2" + - name: midcspsubarray03 + function: csp-subarray-observation + domain: subarray + args: + - "-c" + - "retry --max=10 -- tango_admin --ping-device mid_csp/elt/master &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_03 &&\ + /venv/bin/python /app/csp_lmc_mid/MidCspSubarray.py subarray3" + +dsconfig: + image: + registry: nexus.engageska-portugal.pt/ska-docker + image: tango-dsconfig + tag: 1.2.5.1 + pullPolicy: IfNotPresent + +nodeSelector: {} + +affinity: {} + +tolerations: [] + +resources: + requests: + cpu: 150m # 150m = 0.15 CPU + memory: 128Mi # 128Mi = 0.12 GB mem + limits: + cpu: 250m # 250m = 0.25 CPU + memory: 256Mi # 256Mi = 0.25 GB mem diff --git a/csp-lmc-mid/charts/csp-proto/values.yaml.new b/csp-lmc-mid/charts/csp-proto/values.yaml.new new file mode 100644 index 0000000..9700530 --- /dev/null +++ b/csp-lmc-mid/charts/csp-proto/values.yaml.new @@ -0,0 +1,59 @@ +# Default values for csp-proto. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +display: ":0" +xauthority: "~/.Xauthority" + + +csplmc: + enabled: true + image: + registry: nexus.engageska-portugal.pt/ska-docker + image: mid-csp-lmc + tag: 0.6.8-452d0a0-dirty + pullPolicy: IfNotPresent + +deviceServers: + - name: midcapabilitymonitor + args: + - "-c" + - "/venv/bin/python /app/csp_lmc_mid/MidCspCapabilityMonitor.py monitor" + - name: midcspmaster + args: + - "-c" + - "retry --max=5 -- tango_admin --ping-device mid_csp/capability_monitor/search_beams &&\ + /venv/bin/python /app/csp_lmc_mid/MidCspMaster.py master" + - name: midcspsubarray01 + args: + - "-c" + - " /venv/bin/python /app/csp_lmc_mid/MidCspSubarray.py subarray1" + - name: midcspsubarray02 + args: + - "-c" + - "/venv/bin/python /app/csp_lmc_mid/MidCspSubarray.py subarray2" + - name: midcspsubarray03 + args: + - "-c" + - "/venv/bin/python /app/csp_lmc_mid/MidCspSubarray.py subarray3" + +dsconfig: + image: + registry: nexus.engageska-portugal.pt/ska-docker + image: tango-dsconfig + tag: 1.2.5.1 + pullPolicy: IfNotPresent + +nodeSelector: {} + +affinity: {} + +tolerations: [] + +resources: + requests: + cpu: 150m # 150m = 0.15 CPU + memory: 128Mi # 128Mi = 0.12 GB mem + limits: + cpu: 250m # 250m = 0.25 CPU + memory: 256Mi # 256Mi = 0.25 GB mem diff --git a/csp-lmc-mid/charts/mid-csp/Chart.lock b/csp-lmc-mid/charts/mid-csp/Chart.lock new file mode 100644 index 0000000..e6a9d22 --- /dev/null +++ b/csp-lmc-mid/charts/mid-csp/Chart.lock @@ -0,0 +1,9 @@ +dependencies: +- name: csp-lmc + repository: "file://../csp-proto" + version: 0.5.3 +- name: tango-base + repository: https://gitlab.com/ska-telescope/skampi/-/raw/master/repository + version: 0.1.1 +digest: sha256:9d9ae70d4070c7eba89e967b744e8f37fda46778dd0af3b05e49cb642ae32a36 +generated: "2020-09-04T08:16:47.853296221+02:00" diff --git a/csp-lmc-mid/charts/mid-csp/Chart.yaml b/csp-lmc-mid/charts/mid-csp/Chart.yaml new file mode 100644 index 0000000..5befbd7 --- /dev/null +++ b/csp-lmc-mid/charts/mid-csp/Chart.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +appVersion: 0.6.8 +description: A Helm chart for deploying the whole Mid_CSP prototype on Kubernetes +name: mid-csp +version: 0.1.0 +icon: https://www.skatelescope.org/wp-content/uploads/2016/07/09545_NEW_LOGO_2014.png +dependencies: +- name: tango-base + version: 0.1.1 + repository: https://gitlab.com/ska-telescope/skampi/-/raw/master/repository + condition: tango-base.enabled +- name: csp-proto + version: 0.5.3 + repository: "file://../csp-proto" + condition: csp-proto.enabled diff --git a/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/Chart.yaml b/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/Chart.yaml new file mode 100644 index 0000000..d86101a --- /dev/null +++ b/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +appVersion: "1.0" +description: A Helm chart for deploying the CSP_Mid.LMC CBF prototype on Kubernetes +name: cbf-proto +version: 0.4.0 +icon: https://www.skatelescope.org/wp-content/uploads/2016/07/09545_NEW_LOGO_2014.png diff --git a/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/data/midcbfconfig.json b/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/data/midcbfconfig.json new file mode 100644 index 0000000..e2fcaa5 --- /dev/null +++ b/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/data/midcbfconfig.json @@ -0,0 +1,1719 @@ +{ + "servers": { + "CbfMaster": { + "master": { + "CbfMaster": { + "mid_csp_cbf/sub_elt/master": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfSubarray": [ + "mid_csp_cbf/sub_elt/subarray_01", + "mid_csp_cbf/sub_elt/subarray_02", + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FSP": [ + "mid_csp_cbf/fsp/01", + "mid_csp_cbf/fsp/02", + "mid_csp_cbf/fsp/03", + "mid_csp_cbf/fsp/04" + ], + "MaxCapabilities": [ + "VCC:4", + "FSP:4", + "Subarray:2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ], + "polled_attr": [ + "reportfspstate", + "1000", + "reportvccadminmode", + "1000", + "reportvcchealthstate", + "1000", + "receptortovcc", + "1000", + "reportfspCorrSubarraymembership", + "1000", + "reportfsphealthstate", + "1000", + "healthstate", + "1000", + "adminmode", + "1000", + "subarrayconfigid", + "1000", + "reportfspadminmode", + "1000", + "commandprogress", + "2000", + "reportsubarrayhealthstate", + "1000", + "reportvccstate", + "1000", + "reportsubarrayadminmode", + "1000", + "vcctoreceptor", + "3000", + "reportsubarraystate", + "3000", + "state", + "1000" + ] + } + } + } + } + }, + "CbfSubarrayMulti": { + "cbfSubarray-01": { + "CbfSubarray": { + "mid_csp_cbf/sub_elt/subarray_01": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "scanID": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "FSP": [ + "mid_csp_cbf/fsp/01", + "mid_csp_cbf/fsp/02", + "mid_csp_cbf/fsp/03", + "mid_csp_cbf/fsp/04" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/01_01", + "mid_csp_cbf/fspCorrSubarray/02_01", + "mid_csp_cbf/fspCorrSubarray/03_01", + "mid_csp_cbf/fspCorrSubarray/04_01" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/01_01", + "mid_csp_cbf/fspPssSubarray/02_01", + "mid_csp_cbf/fspPssSubarray/03_01", + "mid_csp_cbf/fspPssSubarray/04_01" + ], + "SW1Address": [ + "mid_csp_cbf/sw1/01" + ], + "SW2Address": [ + "mid_csp_cbf/sw2/01" + ], + "PssConfigAddress": [ + "mid_csp_cbf/pssconfig/01" + ], + "CorrConfigAddress": [ + "mid_csp_cbf/corrconfig/01" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ], + "polled_attr": [ + "healthstate", + "1000", + "fsphealthstate", + "1000", + "fspstate", + "1000", + "vccstate", + "1000", + "vcchealthstate", + "1000", + "configid", + "1000", + "fspList", + "1000", + "outputLinksDistribution", + "1000" + ] + } + } + }, + "SearchWindow": { + "mid_csp_cbf/sw1/01": {}, + "mid_csp_cbf/sw2/01": {} + }, + "CbfSubarrayPssConfig": { + "mid_csp_cbf/pssConfig/01": { + "properties": { + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/01_01", + "mid_csp_cbf/fspPssSubarray/02_01", + "mid_csp_cbf/fspPssSubarray/03_01", + "mid_csp_cbf/fspPssSubarray/04_01" + ], + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ] + } + } + }, + "CbfSubarrayCorrConfig": { + "mid_csp_cbf/corrConfig/01": { + "properties": { + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/01_01", + "mid_csp_cbf/fspCorrSubarray/02_01", + "mid_csp_cbf/fspCorrSubarray/03_01", + "mid_csp_cbf/fspCorrSubarray/04_01" + ], + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ] + } + } + }, + "SendConfig": { + "mid_csp_cbf/SendConfig/01": { + "properties": { + "SubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ] + } + } + } + }, + "cbfSubarray-02": { + "CbfSubarray": { + "mid_csp_cbf/sub_elt/subarray_02": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "scanID": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "FSP": [ + "mid_csp_cbf/fsp/01", + "mid_csp_cbf/fsp/02", + "mid_csp_cbf/fsp/03", + "mid_csp_cbf/fsp/04" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/01_02", + "mid_csp_cbf/fspCorrSubarray/02_02", + "mid_csp_cbf/fspCorrSubarray/03_02", + "mid_csp_cbf/fspCorrSubarray/04_02" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/01_02", + "mid_csp_cbf/fspPssSubarray/02_02", + "mid_csp_cbf/fspPssSubarray/03_02", + "mid_csp_cbf/fspPssSubarray/04_02" + ], + "SW1Address": [ + "mid_csp_cbf/sw1/02" + ], + "SW2Address": [ + "mid_csp_cbf/sw2/02" + ], + "PssConfigAddress": [ + "mid_csp_cbf/pssconfig/02" + ], + "CorrConfigAddress": [ + "mid_csp_cbf/corrconfig/02" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ], + "polled_attr": [ + "configid", + "1000", + "healthstate", + "1000", + "vcchealthstate", + "1000", + "adminmode", + "1000", + "fspstate", + "1000", + "fspList", + "1000", + "fsphealthstate", + "1000", + "vccstate", + "1000", + "outputLinksDistribution", + "1000" + ] + } + } + }, + "SearchWindow": { + "mid_csp_cbf/sw1/02": {}, + "mid_csp_cbf/sw2/02": {} + }, + "CbfSubarrayPssConfig": { + "mid_csp_cbf/pssConfig/02": { + "properties": { + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/01_02", + "mid_csp_cbf/fspPssSubarray/02_02", + "mid_csp_cbf/fspPssSubarray/03_02", + "mid_csp_cbf/fspPssSubarray/04_02" + ], + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ] + } + } + }, + "CbfSubarrayCorrConfig": { + "mid_csp_cbf/corrConfig/02": { + "properties": { + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/01_02", + "mid_csp_cbf/fspCorrSubarray/02_02", + "mid_csp_cbf/fspCorrSubarray/03_02", + "mid_csp_cbf/fspCorrSubarray/04_02" + ], + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ] + } + } + }, + "SendConfig": { + "mid_csp_cbf/SendConfig/02": { + "properties": { + "SubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ] + } + } + } + + }, + "cbfSubarray-03": { + "CbfSubarray": { + "mid_csp_cbf/sub_elt/subarray_03": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "scanID": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "FSP": [ + "mid_csp_cbf/fsp/01", + "mid_csp_cbf/fsp/02", + "mid_csp_cbf/fsp/03", + "mid_csp_cbf/fsp/04" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/01_03", + "mid_csp_cbf/fspCorrSubarray/02_03", + "mid_csp_cbf/fspCorrSubarray/03_03", + "mid_csp_cbf/fspCorrSubarray/04_03" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/01_03", + "mid_csp_cbf/fspPssSubarray/02_03", + "mid_csp_cbf/fspPssSubarray/03_03", + "mid_csp_cbf/fspPssSubarray/04_03" + ], + "SW1Address": [ + "mid_csp_cbf/sw1/03" + ], + "SW2Address": [ + "mid_csp_cbf/sw2/03" + ], + "PssConfigAddress": [ + "mid_csp_cbf/pssconfig/03" + ], + "CorrConfigAddress": [ + "mid_csp_cbf/corrconfig/03" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ], + "polled_attr": [ + "healthstate", + "1000", + "fsphealthstate", + "1000", + "fspstate", + "1000", + "vccstate", + "1000", + "vcchealthstate", + "1000", + "configid", + "1000", + "fspList", + "1000", + "outputLinksDistribution", + "1000" + ] + } + } + }, + "SearchWindow": { + "mid_csp_cbf/sw1/03": {}, + "mid_csp_cbf/sw2/03": {} + }, + "CbfSubarrayPssConfig": { + "mid_csp_cbf/pssConfig/03": { + "properties": { + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/01_03", + "mid_csp_cbf/fspPssSubarray/02_03", + "mid_csp_cbf/fspPssSubarray/03_03", + "mid_csp_cbf/fspPssSubarray/04_03" + ], + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ] + } + } + }, + "CbfSubarrayCorrConfig": { + "mid_csp_cbf/corrConfig/03": { + "properties": { + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/01_03", + "mid_csp_cbf/fspCorrSubarray/02_03", + "mid_csp_cbf/fspCorrSubarray/03_03", + "mid_csp_cbf/fspCorrSubarray/04_03" + ], + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ] + } + } + }, + "SendConfig": { + "mid_csp_cbf/SendConfig/03": { + "properties": { + "SubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ] + } + } + } + } + }, + "DataBaseds": { + "2": { + "DataBase": { + "sys/database/2": {} + } + } + }, + "FspMulti": { + "fsp-01": { + "Fsp": { + "mid_csp_cbf/fsp/01": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CorrelationAddress": [ + "mid_csp_cbf/fsp_corr/01" + ], + "FspID": [ + "1" + ], + "PSSAddress": [ + "mid_csp_cbf/fsp_pss/01" + ], + "PSTAddress": [ + "mid_csp_cbf/fsp_pst/01" + ], + "VLBIAddress": [ + "mid_csp_cbf/fsp_vlbi/01" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/01_01", + "mid_csp_cbf/fspCorrSubarray/01_02", + "mid_csp_cbf/fspCorrSubarray/01_03" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/01_01", + "mid_csp_cbf/fspPssSubarray/01_02", + "mid_csp_cbf/fspPssSubarray/01_03" + ], + "polled_attr": [ + "adminmode", + "1000", + "healthstate", + "1000", + "state", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "FspCorr": { + "mid_csp_cbf/fsp_corr/01": {} + }, + "FspPss": { + "mid_csp_cbf/fsp_pss/01": {} + }, + "FspPst": { + "mid_csp_cbf/fsp_pst/01": {} + }, + "FspCorrSubarray": { + "mid_csp_cbf/fspCorrSubarray/01_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "1" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/01_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "1" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/01_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "1" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspPssSubarray": { + "mid_csp_cbf/fspPssSubarray/01_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "1" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/01_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "1" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/01_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "1" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspVlbi": { + "mid_csp_cbf/fsp_vlbi/01": {} + } + }, + "fsp-02": { + "Fsp": { + "mid_csp_cbf/fsp/02": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CorrelationAddress": [ + "mid_csp_cbf/fsp_corr/02" + ], + "FspID": [ + "2" + ], + "PSSAddress": [ + "mid_csp_cbf/fsp_pss/02" + ], + "PSTAddress": [ + "mid_csp_cbf/fsp_pst/02" + ], + "VLBIAddress": [ + "mid_csp_cbf/fsp_vlbi/02" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/02_01", + "mid_csp_cbf/fspCorrSubarray/02_02", + "mid_csp_cbf/fspCorrSubarray/02_03" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/02_01", + "mid_csp_cbf/fspPssSubarray/02_02", + "mid_csp_cbf/fspPssSubarray/02_03" + ], + "polled_attr": [ + "adminmode", + "1000", + "healthstate", + "1000", + "state", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "FspCorr": { + "mid_csp_cbf/fsp_corr/02": {} + }, + "FspPss": { + "mid_csp_cbf/fsp_pss/02": {} + }, + "FspPst": { + "mid_csp_cbf/fsp_pst/02": {} + }, + "FspCorrSubarray": { + "mid_csp_cbf/fspCorrSubarray/02_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "2" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/02_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "2" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/02_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "2" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspPssSubarray": { + "mid_csp_cbf/fspPssSubarray/02_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "2" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/02_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "2" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/02_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "2" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspVlbi": { + "mid_csp_cbf/fsp_vlbi/02": {} + } + }, + "fsp-03": { + "Fsp": { + "mid_csp_cbf/fsp/03": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CorrelationAddress": [ + "mid_csp_cbf/fsp_corr/03" + ], + "FspID": [ + "3" + ], + "PSSAddress": [ + "mid_csp_cbf/fsp_pss/03" + ], + "PSTAddress": [ + "mid_csp_cbf/fsp_pst/03" + ], + "VLBIAddress": [ + "mid_csp_cbf/fsp_vlbi/03" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/03_01", + "mid_csp_cbf/fspCorrSubarray/03_02", + "mid_csp_cbf/fspCorrSubarray/03_03" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/03_01", + "mid_csp_cbf/fspPssSubarray/03_02", + "mid_csp_cbf/fspPssSubarray/03_03" + ], + "polled_attr": [ + "adminmode", + "1000", + "healthstate", + "1000", + "state", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "FspCorr": { + "mid_csp_cbf/fsp_corr/03": {} + }, + "FspPss": { + "mid_csp_cbf/fsp_pss/03": {} + }, + "FspPst": { + "mid_csp_cbf/fsp_pst/03": {} + }, + "FspCorrSubarray": { + "mid_csp_cbf/fspCorrSubarray/03_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "3" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/03_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "3" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/03_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "3" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspPssSubarray": { + "mid_csp_cbf/fspPssSubarray/03_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "3" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/03_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "3" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/03_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "3" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspVlbi": { + "mid_csp_cbf/fsp_vlbi/03": {} + } + }, + "fsp-04": { + "Fsp": { + "mid_csp_cbf/fsp/04": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CorrelationAddress": [ + "mid_csp_cbf/fsp_corr/04" + ], + "FspID": [ + "4" + ], + "PSSAddress": [ + "mid_csp_cbf/fsp_pss/04" + ], + "PSTAddress": [ + "mid_csp_cbf/fsp_pst/04" + ], + "VLBIAddress": [ + "mid_csp_cbf/fsp_vlbi/04" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/04_01", + "mid_csp_cbf/fspCorrSubarray/04_02", + "mid_csp_cbf/fspCorrSubarray/04_03" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/04_01", + "mid_csp_cbf/fspPssSubarray/04_02", + "mid_csp_cbf/fspPssSubarray/04_03" + ], + "polled_attr": [ + "adminmode", + "1000", + "healthstate", + "1000", + "state", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "FspCorr": { + "mid_csp_cbf/fsp_corr/04": {} + }, + "FspPss": { + "mid_csp_cbf/fsp_pss/04": {} + }, + "FspPst": { + "mid_csp_cbf/fsp_pst/04": {} + }, + "FspCorrSubarray": { + "mid_csp_cbf/fspCorrSubarray/04_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "4" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/04_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "4" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/04_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "4" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspPssSubarray": { + "mid_csp_cbf/fspPssSubarray/04_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "4" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/04_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "4" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/04_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "4" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspVlbi": { + "mid_csp_cbf/fsp_vlbi/04": {} + } + } + }, + "TangoAccessControl": { + "1": { + "TangoAccessControl": { + "sys/access_control/1": {} + } + } + }, + "TangoTest": { + "test": { + "TangoTest": { + "sys/tg_test/1": {} + } + } + }, + "VccMulti": { + "vcc-001": { + "Vcc": { + "mid_csp_cbf/vcc/001": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "Band1And2Address": [ + "mid_csp_cbf/vcc_band12/001" + ], + "Band3Address": [ + "mid_csp_cbf/vcc_band3/001" + ], + "Band4Address": [ + "mid_csp_cbf/vcc_band4/001" + ], + "Band5Address": [ + "mid_csp_cbf/vcc_band5/001" + ], + "SW1Address": [ + "mid_csp_cbf/vcc_sw1/001" + ], + "SW2Address": [ + "mid_csp_cbf/vcc_sw2/001" + ], + "VccID": [ + "1" + ], + "polled_attr": [ + "healthstate", + "1000", + "adminmode", + "1000" + ] + } + } + }, + "VccBand1And2": { + "mid_csp_cbf/vcc_band12/001": {} + }, + "VccBand3": { + "mid_csp_cbf/vcc_band3/001": {} + }, + "VccBand4": { + "mid_csp_cbf/vcc_band4/001": {} + }, + "VccBand5": { + "mid_csp_cbf/vcc_band5/001": {} + }, + "VccSearchWindow": { + "mid_csp_cbf/vcc_sw1/001": {}, + "mid_csp_cbf/vcc_sw2/001": {} + } + }, + "vcc-002": { + "Vcc": { + "mid_csp_cbf/vcc/002": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "Band1And2Address": [ + "mid_csp_cbf/vcc_band12/002" + ], + "Band3Address": [ + "mid_csp_cbf/vcc_band3/002" + ], + "Band4Address": [ + "mid_csp_cbf/vcc_band4/002" + ], + "Band5Address": [ + "mid_csp_cbf/vcc_band5/002" + ], + "SW1Address": [ + "mid_csp_cbf/vcc_sw1/002" + ], + "SW2Address": [ + "mid_csp_cbf/vcc_sw2/002" + ], + "VccID": [ + "2" + ], + "polled_attr": [ + "healthstate", + "1000", + "adminmode", + "1000" + ] + } + } + }, + "VccBand1And2": { + "mid_csp_cbf/vcc_band12/002": {} + }, + "VccBand3": { + "mid_csp_cbf/vcc_band3/002": {} + }, + "VccBand4": { + "mid_csp_cbf/vcc_band4/002": {} + }, + "VccBand5": { + "mid_csp_cbf/vcc_band5/002": {} + }, + "VccSearchWindow": { + "mid_csp_cbf/vcc_sw1/002": {}, + "mid_csp_cbf/vcc_sw2/002": {} + } + }, + "vcc-003": { + "Vcc": { + "mid_csp_cbf/vcc/003": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "Band1And2Address": [ + "mid_csp_cbf/vcc_band12/003" + ], + "Band3Address": [ + "mid_csp_cbf/vcc_band3/003" + ], + "Band4Address": [ + "mid_csp_cbf/vcc_band4/003" + ], + "Band5Address": [ + "mid_csp_cbf/vcc_band5/003" + ], + "SW1Address": [ + "mid_csp_cbf/vcc_sw1/003" + ], + "SW2Address": [ + "mid_csp_cbf/vcc_sw2/003" + ], + "VccID": [ + "3" + ], + "polled_attr": [ + "healthstate", + "1000", + "adminmode", + "1000" + ] + } + } + }, + "VccBand1And2": { + "mid_csp_cbf/vcc_band12/003": {} + }, + "VccBand3": { + "mid_csp_cbf/vcc_band3/003": {} + }, + "VccBand4": { + "mid_csp_cbf/vcc_band4/003": {} + }, + "VccBand5": { + "mid_csp_cbf/vcc_band5/003": {} + }, + "VccSearchWindow": { + "mid_csp_cbf/vcc_sw1/003": {}, + "mid_csp_cbf/vcc_sw2/003": {} + } + }, + "vcc-004": { + "Vcc": { + "mid_csp_cbf/vcc/004": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "Band1And2Address": [ + "mid_csp_cbf/vcc_band12/004" + ], + "Band3Address": [ + "mid_csp_cbf/vcc_band3/004" + ], + "Band4Address": [ + "mid_csp_cbf/vcc_band4/004" + ], + "Band5Address": [ + "mid_csp_cbf/vcc_band5/004" + ], + "SW1Address": [ + "mid_csp_cbf/vcc_sw1/004" + ], + "SW2Address": [ + "mid_csp_cbf/vcc_sw2/004" + ], + "VccID": [ + "4" + ], + "polled_attr": [ + "healthstate", + "1000", + "adminmode", + "1000" + ] + } + } + }, + "VccBand1And2": { + "mid_csp_cbf/vcc_band12/004": {} + }, + "VccBand3": { + "mid_csp_cbf/vcc_band3/004": {} + }, + "VccBand4": { + "mid_csp_cbf/vcc_band4/004": {} + }, + "VccBand5": { + "mid_csp_cbf/vcc_band5/004": {} + }, + "VccSearchWindow": { + "mid_csp_cbf/vcc_sw1/004": {}, + "mid_csp_cbf/vcc_sw2/004": {} + } + } + }, + "TmCspSubarrayLeafNodeTest": { + "tm": { + "TmCspSubarrayLeafNodeTest": { + "ska_mid/tm_leaf_node/csp_subarray01": { + "attribute_properties": { + "dopplerPhaseCorrection": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + + "polled_attr": [ + "delaymodel", + "1000", + "visdestinationaddress", + "1000", + "dopplerphasecorrection", + "1000" + ] + } + } + } + }, + "tm2": { + "TmCspSubarrayLeafNodeTest": { + "ska_mid/tm_leaf_node/csp_subarray02": { + "attribute_properties": { + "dopplerPhaseCorrection": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + + "polled_attr": [ + "delaymodel", + "1000", + "visdestinationaddress", + "1000", + "dopplerphasecorrection", + "1000" + ] + } + } + } + } + } + } +} diff --git a/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/secrets/.gitkeep b/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/secrets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/templates/_helpers.tpl b/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/templates/_helpers.tpl new file mode 100644 index 0000000..cc68915 --- /dev/null +++ b/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "cbf-proto.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "cbf-proto.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "cbf-proto.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/templates/midcbf.yaml b/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/templates/midcbf.yaml new file mode 100644 index 0000000..1ab14e4 --- /dev/null +++ b/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/templates/midcbf.yaml @@ -0,0 +1,146 @@ +{{ if .Values.midcbfmcs.enabled }} + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: "mid-cbf-configuration-json-{{ template "cbf-proto.name" . }}-{{ .Release.Name }}" + namespace: {{ .Release.Namespace }} +data: + midcbfconfig.json: +{{ (tpl (.Files.Glob "data/midcbfconfig.json").AsConfig . ) | indent 2 }} + bootstrap.sh: | + #/bin/sh + /usr/local/bin/wait-for-it.sh databaseds-tango-base-{{ .Release.Name }}:10000 \ + --timeout=30 \ + --strict \ + -- json2tango -w -a -u data/midcbfconfig.json + rc=$? + if [ $rc -eq 0 ]; then + echo "finished normally." + exit 0 + else + if [ $rc -eq 2 ]; then + echo "finished with an update." + exit 0 + else + echo "finished with an ERROR." + exit $rc + fi + fi + +--- +# run once Job for loading Device Server config +apiVersion: batch/v1 +kind: Job +metadata: + name: mid-cbf-configurator-{{ template "cbf-proto.name" . }}-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} +spec: + ttlSecondsAfterFinished: 100 + template: + spec: + containers: + - name: dsconfig + image: "{{ .Values.dsconfig.image.registry }}/{{ .Values.dsconfig.image.image }}:{{ .Values.dsconfig.image.tag }}" + imagePullPolicy: {{ .Values.dsconfig.image.pullPolicy }} + command: # exit code 2 is CONFIG_APPLIED - https://github.com/MaxIV-KitsControls/lib-maxiv-dsconfig/blob/master/dsconfig/utils.py#L11 !!!! this should not be an error !!!! + - sh + - data/bootstrap.sh + env: + - name: TANGO_HOST + value: databaseds-tango-base-{{ .Release.Name }}:10000 + volumeMounts: + - name: configuration + mountPath: data + readOnly: true + volumes: + - name: configuration + configMap: + name: "mid-cbf-configuration-json-{{ template "cbf-proto.name" . }}-{{ .Release.Name }}" + restartPolicy: Never + +{{- $global := . }} +{{- range $deviceserver := .Values.deviceServers }} + +--- +# giving a dummy Service entry ensures that the single pod is DNS addressable +apiVersion: v1 +kind: Service +metadata: + name: mid-cbf-{{ template "cbf-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + namespace: {{ $global.Release.Namespace }} + labels: + app: mid-cbf-{{ template "cbf-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + chart: {{ template "cbf-proto.chart" $global }} + release: {{ $global.Release.Name }} + heritage: {{ $global.Release.Service }} +spec: + clusterIP: None + ports: + - name: dummy # Actually, no port is needed. + port: 1234 + targetPort: 1234 + selector: + app: mid-cbf-{{ template "cbf-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + chart: {{ template "cbf-proto.chart" $global }} + release: {{ $global.Release.Name }} + +--- +# Single Pod separate statefulset per Device Server +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: mid-cbf-{{ template "cbf-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + namespace: {{ $global.Release.Namespace }} + labels: + app: mid-cbf-{{ template "cbf-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + chart: {{ template "cbf-proto.chart" $global }} + release: {{ $global.Release.Name }} + heritage: {{ $global.Release.Service }} +spec: + selector: + matchLabels: + app: mid-cbf-{{ template "cbf-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + chart: {{ template "cbf-proto.chart" $global }} + release: {{ $global.Release.Name }} + serviceName: mid-cbf-{{ template "cbf-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + replicas: 1 + template: + metadata: + labels: + app: mid-cbf-{{ template "cbf-proto.name" $global }}-{{ $deviceserver.name }}-{{ $global.Release.Name }} + chart: {{ template "cbf-proto.chart" $global }} + release: {{ $global.Release.Name }} + heritage: {{ $global.Release.Service }} + cspServer: {{$deviceserver.name}} + spec: + containers: + - name: deviceserver + image: "{{ $global.Values.midcbfmcs.image.registry }}/{{ $global.Values.midcbfmcs.image.image }}:{{ $global.Values.midcbfmcs.image.tag }}" + imagePullPolicy: {{ $global.Values.midcbfmcs.image.pullPolicy }} + command: + - sh + args: +{{ toYaml $deviceserver.args | indent 10 }} + env: + - name: TANGO_HOST + value: databaseds-tango-base-{{ $global.Release.Name }}:10000 + resources: +{{ toYaml $global.Values.resources | indent 10 }} +{{- with $global.Values.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} +{{- end }} +{{- with $global.Values.affinity }} + affinity: +{{ toYaml . | indent 8 }} +{{- end }} +{{- with $global.Values.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} +{{- end }} + +{{- end }} # end of range + +{{ end }} diff --git a/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/values.yaml b/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/values.yaml new file mode 100644 index 0000000..15b7be2 --- /dev/null +++ b/csp-lmc-mid/charts/mid-csp/charts/cbf-proto/values.yaml @@ -0,0 +1,154 @@ +# Default values for csp-proto. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +display: ":0" +xauthority: "~/.Xauthority" + +system: csp +subsystem: cbfmcs-mid +telescope: SKA-mid + +midcbfmcs: + enabled: true + image: + registry: nexus.engageska-portugal.pt/ska-docker + image: mid-cbf-mcs + tag: 0.4.5-2e83f4c + pullPolicy: IfNotPresent + +dsconfig: + image: + registry: nexus.engageska-portugal.pt/ska-docker + image: tango-dsconfig + tag: 1.2.5.1 + pullPolicy: IfNotPresent + +deviceServers: + - name: cbfmaster + function: cbf-central-control + domain: csp-monitoring + args: + - -c + - "retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/001 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/002 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/003 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/004 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/fsp/01 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/fsp/02 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/fsp/03 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/fsp/04 &&\ + /venv/bin/python /app/tangods/CbfMaster/CbfMaster/CbfMaster.py master" + - name: cbfsubarray01 + function: cbf-subarray-observation + domain: subarray + args: + - -c + - "retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\ + /venv/bin/python /app/tangods/CbfSubarray/CbfSubarrayMulti/CbfSubarrayMulti.py cbfSubarray-01" + - name: cbfsubarray02 + function: cbf-subarray-observation + domain: subarray + args: + - -c + - "retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\ + /venv/bin/python /app/tangods/CbfSubarray/CbfSubarrayMulti/CbfSubarrayMulti.py cbfSubarray-02" + - name: cbfsubarray03 + function: cbf-subarray-observation + domain: subarray + args: + - -c + - "retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\ + /venv/bin/python /app/tangods/CbfSubarray/CbfSubarrayMulti/CbfSubarrayMulti.py cbfSubarray-03" + - name: vcc001 + function: coarse-channelisation + domain: sensing + args: + - -c + - "/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-001" + - name: vcc002 + function: coarse-channelisation + domain: sensing + args: + - -c + - "/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-002" + - name: vcc003 + function: coarse-channelisation + domain: sensing + args: + - -c + - "/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-003" + - name: vcc004 + function: coarse-channelisation + domain: sensing + args: + - -c + - "/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-004" + - name: fsp01 + function: fsp-processing + domain: signal-processing + args: + - -c + - "retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/001 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/002 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/003 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/004 &&\ + /venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-01" + - name: fsp02 + function: fsp-processing + domain: signal-processing + args: + - -c + - "retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/001 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/002 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/003 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/004 &&\ + /venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-02" + - name: fsp03 + function: fsp-processing + domain: signal-processing + args: + - -c + - "retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/001 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/002 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/003 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/004 &&\ + /venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-03" + - name: fsp04 + function: fsp-processing + domain: signal-processing + args: + - -c + - "retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/001 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/002 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/003 &&\ + retry --max=10 -- tango_admin --ping-device mid_csp_cbf/vcc/004 &&\ + /venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-04" + - name: tmcspsubarrayleafnodetest + function: simul-observation + domain: telstate + args: + - -c + - "retry --max=10 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_01 &&\ + /venv/bin/python /app/tangods/TmCspSubarrayLeafNodeTest/TmCspSubarrayLeafNodeTest.py tm" + - name: tmcspsubarrayleafnodetest2 + function: simul-observation + domain: telstate + args: + - -c + - "retry --max=10 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_02 &&\ + /venv/bin/python /app/tangods/TmCspSubarrayLeafNodeTest/TmCspSubarrayLeafNodeTest.py tm2" + +nodeSelector: {} + +affinity: {} + +tolerations: [] + +resources: + requests: + cpu: 100m # 100m = 0.10 CPU + memory: 128Mi # 128Mi = 0.12 GB mem + limits: + cpu: 200m # 200m = 0.20 CPU + memory: 256Mi # 256Mi = 0.25 GB mem diff --git a/csp-lmc-mid/charts/mid-csp/charts/csp-proto-0.5.3.tgz b/csp-lmc-mid/charts/mid-csp/charts/csp-proto-0.5.3.tgz new file mode 100644 index 0000000000000000000000000000000000000000..d1d4bcbed9648603e72a4e5703b208477035e334 GIT binary patch literal 10344 zcmZv?bx@r>^zVxmcPp}Sm*VbH++pMH?hYF$?o!;{T?-p`x8hK&xKk*wa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nzERndcFC$mT#EtSnoz|#d1;8FnSH; zvUM|%+kGWfEUA)ovl8xODpZ%z>uD638KWW*vmg`C5s>bdGOES6!($Db6pill7cf%!~aZ7jI3Ls~N)x@ouk?Xe}wUO7u%Jy^C{86R~+^ zdUKx0r`mPY5WC}xGBz&R(*3ejFHG7sf};ha)SD$2vnDfJUW)4Fh#E{%X1`Z4OEui= zrcq{uL~>t*OmTi+n{dgMQNPLXw{==YNUGfTlmgC;OJnU8<_np&vXqK(N;0m^Y76(O z&0;AkHKkI4ZE5rAWH8I~Ej20i25eE}@~y6hWxc?&RldU3MohQ1YS3Djom17aWa#br z0FNA&6|b`4U_Lcdp z8qXWCipZBIjZq~T9o#fKE0K;5ZYx!MSsmZ5giAeBG&_^qnOt2?=8MLyT0A$~RNbV< zDnA&?63#^P!}hq58019KuJ)DARq?)1i*+PHxkQsx;-ba1l={4%TO|uQx@>WrYg3Gw zxNNLe@e4t#4Mzj6RqPLidL==MH^o&y*Va3z$<#G;!^|7YS{#$hLLt`AHwoc75Y2h& zyd~@Bjd5>wHBF6gWZ_&gJEhEJGkJ|FHBoI$ni)Y)rEm#FOTGF?UG}aNx_T=_1(dta zTsNuPYO;)n+@R4>Z|i0q=FemCrm95~BC{AI1|_v$nwzyg&9$mIF*m#?19nzps@1FV z6~7$IEo#whj&iA()|L~s)+}|+<8it+T=hzFf~jA{ZW)xh=@6xr(l5X7aRFV`01f{qfA)=xj5HS28ygd zoE-)d$pSpqOj!UJ5zhry0I74y&{PGf1k9l!!J&)*(SSrS&=x9?)G#lbm>|Rca=Z!^ zXRFuxaxhr6s}-?-ZSPC_ znf@h$)Op|vF{F|#@NGkR;*ze-HC?;!)Oy6fbEDRVfS~cF)ly|uK+7y(sMEN2f)kwJ Ti^2a700960Hr8S}0PFw&(LuR# literal 0 HcmV?d00001 diff --git a/csp-lmc-mid/charts/mid-csp/requirements.lock b/csp-lmc-mid/charts/mid-csp/requirements.lock new file mode 100644 index 0000000..960fbce --- /dev/null +++ b/csp-lmc-mid/charts/mid-csp/requirements.lock @@ -0,0 +1,9 @@ +dependencies: +- name: tango-base + repository: https://gitlab.com/ska-telescope/skampi/-/raw/master/repository + version: 0.1.1 +- name: csp-proto + repository: file://../csp-proto + version: 0.5.3 +digest: sha256:f1b7d43a364ae0179be5951171251ee99fac77741e03b381285b28a6cdcb6167 +generated: "2020-09-11T11:08:19.206867376+02:00" diff --git a/csp-lmc-mid/charts/mid-csp/secrets/.gitkeep b/csp-lmc-mid/charts/mid-csp/secrets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/csp-lmc-mid/charts/mid-csp/secrets/tls.crt b/csp-lmc-mid/charts/mid-csp/secrets/tls.crt new file mode 100644 index 0000000..281f413 --- /dev/null +++ b/csp-lmc-mid/charts/mid-csp/secrets/tls.crt @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDRTCCAi2gAwIBAgIUCWlGy8z2r11G2Sc52B0zjGpytywwDQYJKoZIhvcNAQEL +BQAwMjEdMBsGA1UEAwwUdGVzdC5jc3AtcHJvdG8ubG9jYWwxETAPBgNVBAoMCE1p +bmlrdWJlMB4XDTIwMDkwNDA2NDM0OFoXDTIxMDkwNDA2NDM0OFowMjEdMBsGA1UE +AwwUdGVzdC5jc3AtcHJvdG8ubG9jYWwxETAPBgNVBAoMCE1pbmlrdWJlMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+y4kIIi+hU5fNdV1JTc4qCDh2VAO +lhXX5LmJAQbWWkzOWszOcqGB0g6P4CNIAgNVmFjPoPNsbxlBrKFpoI78p4y1iW4C +LOGkg4gwND1f8SNE7VJyqCiMti7SdBFF6LRNdp6WwmVKVuRdN4Tk+B+39dlTSVjx +Ykziqy7vRLwBsJlbhxIFRkFNdmzpucYTcjUfB4PM5my30ZGdqMnsZ5Mpzw/BkC+s +VRVMSKq1nmtgMYIZUTgdue/sC/SKuqH4FffiQZ6RLAABl1qXFU/A2RkjSn3VBuYh +CWXPgSvi5mxCWDqf4lGZR+yxWMD+t7AG4IuLUl+KeV8PIjvMWSKb+Fdy9wIDAQAB +o1MwUTAdBgNVHQ4EFgQUdnM99TO9Jn3Oi16QbSIqeDkQr1cwHwYDVR0jBBgwFoAU +dnM99TO9Jn3Oi16QbSIqeDkQr1cwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0B +AQsFAAOCAQEA5d3w4vrLHbto4NGfKyjORnqQyxEeI5eZe9xRBaxobdhMlFDshNjC +GTcOdcAiGU9jRn95fItJZraXMYCR+Ysf9edU+YEaVnKioWnCUflxBNa2tZ7c+sNC +zqvcRIYZIGGg1J4RYZ0i0XJsYKn+RCuhSPjR3C1nSN47PPjnk85hnUyofdGHDJ2W +p71ozY2o3lKuw9NiU9kqnW2NRW/QBZvKnGHdq2izP8ciZZJtCsz8Tz9I1AzL2qqx +G8UThABjlIVMzhoRjzQ6vI5mcP/ucJZ1nU2/sqOGI4aLVRNTlv5DsiuPmC6zHD/s +ApaI7734oQBu6SkIrJLNyNwk2cQusgX44Q== +-----END CERTIFICATE----- diff --git a/csp-lmc-mid/charts/mid-csp/secrets/tls.key b/csp-lmc-mid/charts/mid-csp/secrets/tls.key new file mode 100644 index 0000000..5747df7 --- /dev/null +++ b/csp-lmc-mid/charts/mid-csp/secrets/tls.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD7LiQgiL6FTl81 +1XUlNzioIOHZUA6WFdfkuYkBBtZaTM5azM5yoYHSDo/gI0gCA1WYWM+g82xvGUGs +oWmgjvynjLWJbgIs4aSDiDA0PV/xI0TtUnKoKIy2LtJ0EUXotE12npbCZUpW5F03 +hOT4H7f12VNJWPFiTOKrLu9EvAGwmVuHEgVGQU12bOm5xhNyNR8Hg8zmbLfRkZ2o +yexnkynPD8GQL6xVFUxIqrWea2AxghlROB257+wL9Iq6ofgV9+JBnpEsAAGXWpcV +T8DZGSN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utVAgW2gcZu4rOEI18D +Ga/GorxdovA6dyoqjgOMkWzRz0XdubyKr7muDEZH+wKBgDw3y6Ujx0fTgENMgrLD +lj205wSOUZe9a5QJQ3HbsKh2qDY0nK2COMo8OW76+a5Vlk2PJLyXQGU2Ceuj+rUq +yY3+cVQfjI3dYv+5nTh4O1XRiZwVhHm/AkUlQ5n0C9KSa4Ejhpb8A7RUDAC8B8cn +p+IuCq0Nk9KtGwdvh9fH/hJ5 +-----END PRIVATE KEY----- diff --git a/csp-lmc-mid/docker/.make/Makefile.mk b/csp-lmc-mid/docker/.make/Makefile.mk index 4534f2f..323b970 100644 --- a/csp-lmc-mid/docker/.make/Makefile.mk +++ b/csp-lmc-mid/docker/.make/Makefile.mk @@ -56,14 +56,14 @@ DOCKER_FILE_PATH=Dockerfile build: pre-build docker-build post-build ## build the application image pre-build: - + cp ../.release . post-build: pre-push: post-push: -docker-build: .release +docker-build: @echo "VERSION: $(VERSION)" @echo "Building image: $(IMAGE):$(VERSION)" @echo "NAME: $(NAME)" diff --git a/csp-lmc-mid/docker/config/config_result.json b/csp-lmc-mid/docker/config/config_result.json new file mode 100644 index 0000000..19ef30b --- /dev/null +++ b/csp-lmc-mid/docker/config/config_result.json @@ -0,0 +1,2542 @@ +{ + "servers": { + "CbfMaster": { + "master": { + "CbfMaster": { + "mid_csp_cbf/sub_elt/master": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfSubarray": [ + "mid_csp_cbf/sub_elt/subarray_01", + "mid_csp_cbf/sub_elt/subarray_02", + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FSP": [ + "mid_csp_cbf/fsp/01", + "mid_csp_cbf/fsp/02", + "mid_csp_cbf/fsp/03", + "mid_csp_cbf/fsp/04" + ], + "MaxCapabilities": [ + "VCC:4", + "FSP:4", + "Subarray:2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ], + "polled_attr": [ + "reportfspstate", + "1000", + "reportvccadminmode", + "1000", + "reportvcchealthstate", + "1000", + "receptortovcc", + "1000", + "reportfspCorrSubarraymembership", + "1000", + "reportfsphealthstate", + "1000", + "healthstate", + "1000", + "adminmode", + "1000", + "subarrayconfigid", + "1000", + "reportfspadminmode", + "1000", + "commandprogress", + "2000", + "reportsubarrayhealthstate", + "1000", + "reportvccstate", + "1000", + "reportsubarrayadminmode", + "1000", + "vcctoreceptor", + "3000", + "reportsubarraystate", + "3000", + "state", + "1000" + ] + } + } + } + } + }, + "CbfSubarrayMulti": { + "cbfSubarray-01": { + "CbfSubarray": { + "mid_csp_cbf/sub_elt/subarray_01": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "scanID": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CorrConfigAddress": [ + "mid_csp_cbf/corrconfig/01" + ], + "FSP": [ + "mid_csp_cbf/fsp/01", + "mid_csp_cbf/fsp/02", + "mid_csp_cbf/fsp/03", + "mid_csp_cbf/fsp/04" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/01_01", + "mid_csp_cbf/fspCorrSubarray/02_01", + "mid_csp_cbf/fspCorrSubarray/03_01", + "mid_csp_cbf/fspCorrSubarray/04_01" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/01_01", + "mid_csp_cbf/fspPssSubarray/02_01", + "mid_csp_cbf/fspPssSubarray/03_01", + "mid_csp_cbf/fspPssSubarray/04_01" + ], + "PssConfigAddress": [ + "mid_csp_cbf/pssconfig/01" + ], + "SW1Address": [ + "mid_csp_cbf/sw1/01" + ], + "SW2Address": [ + "mid_csp_cbf/sw2/01" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ], + "polled_attr": [ + "healthstate", + "1000", + "fsphealthstate", + "1000", + "fspstate", + "1000", + "vccstate", + "1000", + "vcchealthstate", + "1000", + "configid", + "1000", + "fspList", + "1000", + "outputLinksDistribution", + "1000" + ] + } + } + }, + "CbfSubarrayCorrConfig": { + "mid_csp_cbf/corrConfig/01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/01_01", + "mid_csp_cbf/fspCorrSubarray/02_01", + "mid_csp_cbf/fspCorrSubarray/03_01", + "mid_csp_cbf/fspCorrSubarray/04_01" + ] + } + } + }, + "CbfSubarrayPssConfig": { + "mid_csp_cbf/pssConfig/01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/01_01", + "mid_csp_cbf/fspPssSubarray/02_01", + "mid_csp_cbf/fspPssSubarray/03_01", + "mid_csp_cbf/fspPssSubarray/04_01" + ] + } + } + }, + "SearchWindow": { + "mid_csp_cbf/sw1/01": {}, + "mid_csp_cbf/sw2/01": {} + }, + "SendConfig": { + "mid_csp_cbf/SendConfig/01": { + "properties": { + "SubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ] + } + } + } + }, + "cbfSubarray-02": { + "CbfSubarray": { + "mid_csp_cbf/sub_elt/subarray_02": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "scanID": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CorrConfigAddress": [ + "mid_csp_cbf/corrconfig/02" + ], + "FSP": [ + "mid_csp_cbf/fsp/01", + "mid_csp_cbf/fsp/02", + "mid_csp_cbf/fsp/03", + "mid_csp_cbf/fsp/04" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/01_02", + "mid_csp_cbf/fspCorrSubarray/02_02", + "mid_csp_cbf/fspCorrSubarray/03_02", + "mid_csp_cbf/fspCorrSubarray/04_02" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/01_02", + "mid_csp_cbf/fspPssSubarray/02_02", + "mid_csp_cbf/fspPssSubarray/03_02", + "mid_csp_cbf/fspPssSubarray/04_02" + ], + "PssConfigAddress": [ + "mid_csp_cbf/pssconfig/02" + ], + "SW1Address": [ + "mid_csp_cbf/sw1/02" + ], + "SW2Address": [ + "mid_csp_cbf/sw2/02" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ], + "polled_attr": [ + "configid", + "1000", + "healthstate", + "1000", + "vcchealthstate", + "1000", + "adminmode", + "1000", + "fspstate", + "1000", + "fspList", + "1000", + "fsphealthstate", + "1000", + "vccstate", + "1000", + "outputLinksDistribution", + "1000" + ] + } + } + }, + "CbfSubarrayCorrConfig": { + "mid_csp_cbf/corrConfig/02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/01_02", + "mid_csp_cbf/fspCorrSubarray/02_02", + "mid_csp_cbf/fspCorrSubarray/03_02", + "mid_csp_cbf/fspCorrSubarray/04_02" + ] + } + } + }, + "CbfSubarrayPssConfig": { + "mid_csp_cbf/pssConfig/02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/01_02", + "mid_csp_cbf/fspPssSubarray/02_02", + "mid_csp_cbf/fspPssSubarray/03_02", + "mid_csp_cbf/fspPssSubarray/04_02" + ] + } + } + }, + "SearchWindow": { + "mid_csp_cbf/sw1/02": {}, + "mid_csp_cbf/sw2/02": {} + }, + "SendConfig": { + "mid_csp_cbf/SendConfig/02": { + "properties": { + "SubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ] + } + } + } + }, + "cbfSubarray-03": { + "CbfSubarray": { + "mid_csp_cbf/sub_elt/subarray_03": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "scanID": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CorrConfigAddress": [ + "mid_csp_cbf/corrconfig/03" + ], + "FSP": [ + "mid_csp_cbf/fsp/01", + "mid_csp_cbf/fsp/02", + "mid_csp_cbf/fsp/03", + "mid_csp_cbf/fsp/04" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/01_03", + "mid_csp_cbf/fspCorrSubarray/02_03", + "mid_csp_cbf/fspCorrSubarray/03_03", + "mid_csp_cbf/fspCorrSubarray/04_03" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/01_03", + "mid_csp_cbf/fspPssSubarray/02_03", + "mid_csp_cbf/fspPssSubarray/03_03", + "mid_csp_cbf/fspPssSubarray/04_03" + ], + "PssConfigAddress": [ + "mid_csp_cbf/pssconfig/03" + ], + "SW1Address": [ + "mid_csp_cbf/sw1/03" + ], + "SW2Address": [ + "mid_csp_cbf/sw2/03" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ], + "polled_attr": [ + "healthstate", + "1000", + "fsphealthstate", + "1000", + "fspstate", + "1000", + "vccstate", + "1000", + "vcchealthstate", + "1000", + "configid", + "1000", + "fspList", + "1000", + "outputLinksDistribution", + "1000" + ] + } + } + }, + "CbfSubarrayCorrConfig": { + "mid_csp_cbf/corrConfig/03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/01_03", + "mid_csp_cbf/fspCorrSubarray/02_03", + "mid_csp_cbf/fspCorrSubarray/03_03", + "mid_csp_cbf/fspCorrSubarray/04_03" + ] + } + } + }, + "CbfSubarrayPssConfig": { + "mid_csp_cbf/pssConfig/03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/01_03", + "mid_csp_cbf/fspPssSubarray/02_03", + "mid_csp_cbf/fspPssSubarray/03_03", + "mid_csp_cbf/fspPssSubarray/04_03" + ] + } + } + }, + "SearchWindow": { + "mid_csp_cbf/sw1/03": {}, + "mid_csp_cbf/sw2/03": {} + }, + "SendConfig": { + "mid_csp_cbf/SendConfig/03": { + "properties": { + "SubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ] + } + } + } + } + }, + "DataBaseds": { + "2": { + "DataBase": { + "sys/database/2": {} + } + } + }, + "FspMulti": { + "fsp-01": { + "Fsp": { + "mid_csp_cbf/fsp/01": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CorrelationAddress": [ + "mid_csp_cbf/fsp_corr/01" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/01_01", + "mid_csp_cbf/fspCorrSubarray/01_02", + "mid_csp_cbf/fspCorrSubarray/01_03" + ], + "FspID": [ + "1" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/01_01", + "mid_csp_cbf/fspPssSubarray/01_02", + "mid_csp_cbf/fspPssSubarray/01_03" + ], + "PSSAddress": [ + "mid_csp_cbf/fsp_pss/01" + ], + "PSTAddress": [ + "mid_csp_cbf/fsp_pst/01" + ], + "VLBIAddress": [ + "mid_csp_cbf/fsp_vlbi/01" + ], + "polled_attr": [ + "adminmode", + "1000", + "healthstate", + "1000", + "state", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "FspCorr": { + "mid_csp_cbf/fsp_corr/01": {} + }, + "FspCorrSubarray": { + "mid_csp_cbf/fspCorrSubarray/01_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "1" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/01_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "1" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/01_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "1" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspPss": { + "mid_csp_cbf/fsp_pss/01": {} + }, + "FspPssSubarray": { + "mid_csp_cbf/fspPssSubarray/01_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "1" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/01_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "1" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/01_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "1" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspPst": { + "mid_csp_cbf/fsp_pst/01": {} + }, + "FspVlbi": { + "mid_csp_cbf/fsp_vlbi/01": {} + } + }, + "fsp-02": { + "Fsp": { + "mid_csp_cbf/fsp/02": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CorrelationAddress": [ + "mid_csp_cbf/fsp_corr/02" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/02_01", + "mid_csp_cbf/fspCorrSubarray/02_02", + "mid_csp_cbf/fspCorrSubarray/02_03" + ], + "FspID": [ + "2" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/02_01", + "mid_csp_cbf/fspPssSubarray/02_02", + "mid_csp_cbf/fspPssSubarray/02_03" + ], + "PSSAddress": [ + "mid_csp_cbf/fsp_pss/02" + ], + "PSTAddress": [ + "mid_csp_cbf/fsp_pst/02" + ], + "VLBIAddress": [ + "mid_csp_cbf/fsp_vlbi/02" + ], + "polled_attr": [ + "adminmode", + "1000", + "healthstate", + "1000", + "state", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "FspCorr": { + "mid_csp_cbf/fsp_corr/02": {} + }, + "FspCorrSubarray": { + "mid_csp_cbf/fspCorrSubarray/02_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "2" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/02_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "2" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/02_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "2" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspPss": { + "mid_csp_cbf/fsp_pss/02": {} + }, + "FspPssSubarray": { + "mid_csp_cbf/fspPssSubarray/02_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "2" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/02_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "2" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/02_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "2" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspPst": { + "mid_csp_cbf/fsp_pst/02": {} + }, + "FspVlbi": { + "mid_csp_cbf/fsp_vlbi/02": {} + } + }, + "fsp-03": { + "Fsp": { + "mid_csp_cbf/fsp/03": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CorrelationAddress": [ + "mid_csp_cbf/fsp_corr/03" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/03_01", + "mid_csp_cbf/fspCorrSubarray/03_02", + "mid_csp_cbf/fspCorrSubarray/03_03" + ], + "FspID": [ + "3" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/03_01", + "mid_csp_cbf/fspPssSubarray/03_02", + "mid_csp_cbf/fspPssSubarray/03_03" + ], + "PSSAddress": [ + "mid_csp_cbf/fsp_pss/03" + ], + "PSTAddress": [ + "mid_csp_cbf/fsp_pst/03" + ], + "VLBIAddress": [ + "mid_csp_cbf/fsp_vlbi/03" + ], + "polled_attr": [ + "adminmode", + "1000", + "healthstate", + "1000", + "state", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "FspCorr": { + "mid_csp_cbf/fsp_corr/03": {} + }, + "FspCorrSubarray": { + "mid_csp_cbf/fspCorrSubarray/03_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "3" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/03_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "3" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/03_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "3" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspPss": { + "mid_csp_cbf/fsp_pss/03": {} + }, + "FspPssSubarray": { + "mid_csp_cbf/fspPssSubarray/03_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "3" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/03_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "3" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/03_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "3" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspPst": { + "mid_csp_cbf/fsp_pst/03": {} + }, + "FspVlbi": { + "mid_csp_cbf/fsp_vlbi/03": {} + } + }, + "fsp-04": { + "Fsp": { + "mid_csp_cbf/fsp/04": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CorrelationAddress": [ + "mid_csp_cbf/fsp_corr/04" + ], + "FspCorrSubarray": [ + "mid_csp_cbf/fspCorrSubarray/04_01", + "mid_csp_cbf/fspCorrSubarray/04_02", + "mid_csp_cbf/fspCorrSubarray/04_03" + ], + "FspID": [ + "4" + ], + "FspPssSubarray": [ + "mid_csp_cbf/fspPssSubarray/04_01", + "mid_csp_cbf/fspPssSubarray/04_02", + "mid_csp_cbf/fspPssSubarray/04_03" + ], + "PSSAddress": [ + "mid_csp_cbf/fsp_pss/04" + ], + "PSTAddress": [ + "mid_csp_cbf/fsp_pst/04" + ], + "VLBIAddress": [ + "mid_csp_cbf/fsp_vlbi/04" + ], + "polled_attr": [ + "adminmode", + "1000", + "healthstate", + "1000", + "state", + "1000", + "subarraymembership", + "1000" + ] + } + } + }, + "FspCorr": { + "mid_csp_cbf/fsp_corr/04": {} + }, + "FspCorrSubarray": { + "mid_csp_cbf/fspCorrSubarray/04_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "4" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/04_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "4" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspCorrSubarray/04_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "4" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspPss": { + "mid_csp_cbf/fsp_pss/04": {} + }, + "FspPssSubarray": { + "mid_csp_cbf/fspPssSubarray/04_01": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "FspID": [ + "4" + ], + "SubID": [ + "1" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/04_02": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "FspID": [ + "4" + ], + "SubID": [ + "2" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + }, + "mid_csp_cbf/fspPssSubarray/04_03": { + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "FspID": [ + "4" + ], + "SubID": [ + "3" + ], + "VCC": [ + "mid_csp_cbf/vcc/001", + "mid_csp_cbf/vcc/002", + "mid_csp_cbf/vcc/003", + "mid_csp_cbf/vcc/004" + ] + } + } + }, + "FspPst": { + "mid_csp_cbf/fsp_pst/04": {} + }, + "FspVlbi": { + "mid_csp_cbf/fsp_vlbi/04": {} + } + } + }, + "MidCspCapabilityMonitor": { + "monitor": { + "CspCapabilityMonitor": { + "mid_csp/capability_monitor/timing_beams": { + "properties": { + "CapabilityDevices": [ + "mid_csp/timing_beams/04", + "mid_csp/timing_beams/03", + "mid_csp/timing_beams/01", + "mid_csp/timing_beams/02" + ], + "SkaLevel": [ + "2" + ] + } + }, + "mid_csp/capability_monitor/vcc": { + "properties": { + "CapabilityDevices": [ + "mid_csp/vcc/004", + "mid_csp/vcc/003", + "mid_csp/vcc/002", + "mid_csp/vcc/001" + ], + "SkaLevel": [ + "2" + ] + } + }, + "mid_csp/capability_monitor/vlbi_beams": { + "properties": { + "CapabilityDevices": [ + "mid_csp/vlbi_beams/03", + "mid_csp/vlbi_beams/04", + "mid_csp/vlbi_beams/02", + "mid_csp/vlbi_beams/01" + ], + "SkaLevel": [ + "2" + ] + } + } + }, + "CspSearchBeamsMonitor": { + "mid_csp/capability_monitor/search_beams": { + "properties": { + "CapabilityDevices": [ + "mid_csp/search_beams/04", + "mid_csp/search_beams/03", + "mid_csp/search_beams/01", + "mid_csp/search_beams/02" + ], + "SkaLevel": [ + "2" + ] + } + } + } + } + }, + "MidCspMaster": { + "master": { + "MidCspMasterBase": { + "mid_csp/elt/master": { + "attribute_properties": { + "adminMode": { + "__value": [ + "0" + ], + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "numOfReservedSearchBeams": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/numOfReservedIDs" + ] + }, + "numOfUnassignedSearchBeams": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/numOfUnassignedIDs" + ] + }, + "numOfUnassignedTimingBeams": { + "__root_att": [ + "mid_csp/capability_monitor/timing_beams/numOfUnassignedIDs" + ] + }, + "numOfUnassignedVlbiBeams": { + "__root_att": [ + "mid_csp/capability_monitor/vlbi_beams/numOfUnassignedIDs" + ] + }, + "reportFSPAdminMode": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportFSPAdminMode" + ] + }, + "reportFSPHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportFSPHealthState" + ] + }, + "reportFSPState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportFSPState" + ] + }, + "reportSearchBeamAdminMode": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/capabilityAdminMode" + ] + }, + "reportSearchBeamHealthState": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/capabilityHealthState" + ] + }, + "reportSearchBeamObsState": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/capabilityObsState" + ] + }, + "reportSearchBeamState": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/capabilityState" + ] + }, + "reportTimingBeamAdminMode": { + "__root_att": [ + "mid_csp/capability_monitor/timing_beams/capabilityAdminMode" + ] + }, + "reportTimingBeamHealthState": { + "__root_att": [ + "mid_csp/capability_monitor/timing_beams/capabilityHealthState" + ] + }, + "reportTimingBeamObsState": { + "__root_att": [ + "mid_csp/capability_monitor/timing_beams/capabilityObsState" + ] + }, + "reportTimingBeamState": { + "__root_att": [ + "mid_csp/capability_monitor/timing_beams/capabilityState" + ] + }, + "reportVCCAdminMode": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportVCCAdminMode" + ] + }, + "reportVCCHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportVCCHealthState" + ] + }, + "reportVCCState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportVCCState" + ] + }, + "reportVlbiBeamAdminMode": { + "__root_att": [ + "mid_csp/capability_monitor/vlbi_beams/capabilityAdminMode" + ] + }, + "reportVlbiBeamHealthState": { + "__root_att": [ + "mid_csp/capability_monitor/vlbi_beams/capabilityHealthState" + ] + }, + "reportVlbiBeamObsState": { + "__root_att": [ + "mid_csp/capability_monitor/vlbi_beams/capabilityObsState" + ] + }, + "reportVlbiBeamState": { + "__root_att": [ + "mid_csp/capability_monitor/vlbi_beams/capabilityState" + ] + }, + "searchBeamMembership": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/capabilityMembership" + ] + }, + "timingBeamMembership": { + "__root_att": [ + "mid_csp/capability_monitor/timing_beams/capabilityMembership" + ] + }, + "unassignedSearchBeamIDs": { + "__root_att": [ + "mid_csp/capability_monitor/search_beams/unassignedIDs" + ] + }, + "unassignedTimingBeamIDs": { + "__root_att": [ + "mid_csp/capability_monitor/timing_beams/unassignedIDs" + ] + }, + "unassignedVlbiBeamIDs": { + "__root_att": [ + "mid_csp/capability_monitor/vlbi_beams/unassignedIDs" + ] + }, + "vccMembership": { + "__root_att": [ + "mid_csp_cbf/sub_elt/master/reportVCCSubarrayMembership" + ] + }, + "vlbiBeamMembership": { + "__root_att": [ + "mid_csp/capability_monitor/vlbi_beams/capabilityMembership" + ] + } + }, + "properties": { + "CspCbf": [ + "mid_csp_cbf/sub_elt/master" + ], + "CspPss": [ + "mid_csp_pss/sub_elt/master" + ], + "CspPst": [ + "mid_csp_pst/sub_elt/master" + ], + "CspSubarrays": [ + "mid_csp/elt/subarray_01", + "mid_csp/elt/subarray_02", + "mid_csp/elt/subarray_03" + ], + "MaxCapabilities": [ + "VCC:4", + "SearchBeams:1500", + "TimingBeams:16", + "VlbiBeams:20" + ], + "SearchBeamsMonitor": [ + "mid_csp/capability_monitor/search_beams" + ], + "SkaLevel": [ + "1" + ], + "TimingBeamsMonitor": [ + "mid_csp/capability_monitor/timing_beams" + ], + "VlbiBeamsMonitor": [ + "mid_csp/capability_monitor/vlbi_beams" + ], + "polled_attr": [ + "healthstate", + "1000", + "adminmode", + "1000", + "state", + "1000", + "csppssadminmode", + "1000", + "csppstadminmode", + "1000", + "cspcbfadminmode", + "1000", + "oncommandprogress", + "1500", + "offcommandprogress", + "1500", + "offcmddurationexpected", + "1500", + "standbycommandprogress", + "1500", + "oncmddurationexpected", + "1500", + "standbycmddurationexpected", + "1500", + "oncmddurationmeasured", + "1500", + "offcmddurationmeasured", + "1500", + "standbycmddurationmeasured", + "1500", + "offcmdtimeoutexpired", + "1500", + "oncmdtimeoutexpired", + "1500", + "csppssstate", + "1000", + "standbycmdtimeoutexpired", + "1000", + "csppststate", + "1000", + "cspcbfhealthstate", + "1000", + "csppsshealthstate", + "1000", + "csppsthealthstate", + "1000", + "cspcbfadminmode", + "1000", + "oncmdfailure", + "2000", + "offcmdfailure", + "2000", + "standbycmdfailure", + "2000", + "cspcbfstate", + "1000" + ] + } + } + } + } + }, + "MidCspSubarray": { + "subarray1": { + "MidCspSubarrayBase": { + "mid_csp/elt/subarray_01": { + "attribute_properties": { + "adminMode": { + "__value": [ + "0" + ], + "abs_change": [ + "-1", + "1" + ] + }, + "assignedFspHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_01/fspHealthState" + ] + }, + "assignedFspState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_01/fspState" + ] + }, + "assignedReceptors": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_01/receptors" + ] + }, + "assignedVccHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_01/vccHealthState" + ] + }, + "assignedVccState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_01/vccState" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "testNumber": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfSubarray": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "CspMaster": [ + "mid_csp/elt/master" + ], + "PssSubarray": [ + "mid_csp_pss/sub_elt/subarray_01" + ], + "SkaLevel": [ + "2" + ], + "SubID": [ + "1" + ], + "SubarrayProcModeCorrelation": [ + "mid_csp/elt/correlation-01" + ], + "SubarrayProcModePss": [ + "mid_csp/elt/pss-01" + ], + "SubarrayProcModePst": [ + "mid_csp/elt/pst-01" + ], + "SubarrayProcModeVlbi": [ + "mid_csp/elt/vlbi-01" + ], + "polled_attr": [ + "failureraisedflag", + "1000", + "timeoutexpiredflag", + "1000", + "scancmdprogress", + "1500", + "removeresourcescmdprogress", + "1500", + "addresourcescmdprogress", + "1500", + "endscancmdprogress", + "1500", + "gotoidlecmdprogress", + "1500" + ] + } + } + }, + "MidCspSubarrayProcModeCorrelation": { + "mid_csp/elt/correlation-01": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "CORRELATION" + ], + "subID": [ + "1" + ] + } + } + }, + "MidCspSubarrayProcModePss": { + "mid_csp/elt/pss-01": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "PSS" + ], + "subID": [ + "1" + ] + } + } + }, + "MidCspSubarrayProcModePst": { + "mid_csp/elt/pst-01": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "PST" + ], + "subID": [ + "1" + ] + } + } + }, + "MidCspSubarrayProcModeVlbi": { + "mid_csp/elt/vlbi-01": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "VLBI" + ], + "subID": [ + "1" + ] + } + } + } + }, + "subarray2": { + "MidCspSubarrayBase": { + "mid_csp/elt/subarray_02": { + "attribute_properties": { + "adminMode": { + "__value": [ + "0" + ], + "abs_change": [ + "-1", + "1" + ] + }, + "assignedFspHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_02/fspHealthState" + ] + }, + "assignedFspState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_02/fspState" + ] + }, + "assignedReceptors": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_02/receptors" + ] + }, + "assignedVccHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_02/vccHealthState" + ] + }, + "assignedVccState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_02/vccState" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "testNumber": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfSubarray": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "CspMaster": [ + "mid_csp/elt/master" + ], + "PssSubarray": [ + "mid_csp_pss/sub_elt/subarray_02" + ], + "SkaLevel": [ + "2" + ], + "SubID": [ + "2" + ], + "SubarrayProcModeCorrelation": [ + "mid_csp/elt/correlation-02" + ], + "SubarrayProcModePss": [ + "mid_csp/elt/pss-02" + ], + "SubarrayProcModePst": [ + "mid_csp/elt/pst-02" + ], + "SubarrayProcModeVlbi": [ + "mid_csp/elt/vlbi-02" + ], + "polled_attr": [ + "failureraisedflag", + "1000", + "timeoutexpiredflag", + "1000", + "scancmdprogress", + "1500", + "removeresourcescmdprogress", + "1500", + "addresourcescmdprogress", + "1500", + "endscancmdprogress", + "1500", + "gotoidlecmdprogress", + "1500" + ] + } + } + }, + "MidCspSubarrayProcModeCorrelation": { + "mid_csp/elt/correlation-02": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "CORRELATION" + ], + "subID": [ + "2" + ] + } + } + }, + "MidCspSubarrayProcModePss": { + "mid_csp/elt/pss-02": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "PSS" + ], + "subID": [ + "2" + ] + } + } + }, + "MidCspSubarrayProcModePst": { + "mid_csp/elt/pst-02": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "PST" + ], + "subID": [ + "2" + ] + } + } + }, + "MidCspSubarrayProcModeVlbi": { + "mid_csp/elt/vlbi-02": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "VLBI" + ], + "subID": [ + "2" + ] + } + } + } + }, + "subarray3": { + "MidCspSubarrayBase": { + "mid_csp/elt/subarray_03": { + "attribute_properties": { + "adminMode": { + "__value": [ + "0" + ], + "abs_change": [ + "-1", + "1" + ] + }, + "assignedFspHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_03/fspHealthState" + ] + }, + "assignedFspState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_03/fspState" + ] + }, + "assignedReceptors": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_03/receptors" + ] + }, + "assignedVccHealthState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_03/vccHealthState" + ] + }, + "assignedVccState": { + "__root_att": [ + "mid_csp_cbf/sub_elt/subarray_03/vccState" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "obsState": { + "abs_change": [ + "-1", + "1" + ] + }, + "testNumber": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfSubarray": [ + "mid_csp_cbf/sub_elt/subarray_03" + ], + "CspMaster": [ + "mid_csp/elt/master" + ], + "PssSubarray": [ + "mid_csp_pss/sub_elt/subarray_03" + ], + "SkaLevel": [ + "2" + ], + "SubID": [ + "3" + ], + "SubarrayProcModeCorrelation": [ + "mid_csp/elt/correlation-03" + ], + "SubarrayProcModePss": [ + "mid_csp/elt/pss-03" + ], + "SubarrayProcModePst": [ + "mid_csp/elt/pst-03" + ], + "SubarrayProcModeVlbi": [ + "mid_csp/elt/vlbi-03" + ], + "polled_attr": [ + "failureraisedflag", + "1000", + "timeoutexpiredflag", + "1000", + "scancmdprogress", + "1500", + "removeresourcescmdprogress", + "1500", + "addresourcescmdprogress", + "1500", + "endscancmdprogress", + "1500", + "gotoidlecmdprogress", + "1500" + ] + } + } + }, + "MidCspSubarrayProcModeCorrelation": { + "mid_csp/elt/correlation-03": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "CORRELATION" + ], + "subID": [ + "3" + ] + } + } + }, + "MidCspSubarrayProcModePss": { + "mid_csp/elt/pss-03": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "PSS" + ], + "subID": [ + "3" + ] + } + } + }, + "MidCspSubarrayProcModePst": { + "mid_csp/elt/pst-03": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "PST" + ], + "subID": [ + "3" + ] + } + } + }, + "MidCspSubarrayProcModeVlbi": { + "mid_csp/elt/vlbi-03": { + "properties": { + "CapID": [ + "1" + ], + "CapType": [ + "VLBI" + ], + "subID": [ + "3" + ] + } + } + } + } + }, + "TangoAccessControl": { + "1": { + "TangoAccessControl": { + "sys/access_control/1": {} + } + } + }, + "TangoRestServer": { + "rest": { + "TangoRestServer": { + "sys/rest/0": {} + } + } + }, + "TangoTest": { + "test": { + "TangoTest": { + "sys/tg_test/1": {} + } + } + }, + "TmCspSubarrayLeafNodeTest": { + "tm": { + "TmCspSubarrayLeafNodeTest": { + "ska_mid/tm_leaf_node/csp_subarray01": { + "attribute_properties": { + "dopplerPhaseCorrection": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_01" + ], + "polled_attr": [ + "delaymodel", + "1000", + "visdestinationaddress", + "1000", + "dopplerphasecorrection", + "1000" + ] + } + } + } + }, + "tm2": { + "TmCspSubarrayLeafNodeTest": { + "ska_mid/tm_leaf_node/csp_subarray02": { + "attribute_properties": { + "dopplerPhaseCorrection": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "CbfMasterAddress": [ + "mid_csp_cbf/sub_elt/master" + ], + "CbfSubarrayAddress": [ + "mid_csp_cbf/sub_elt/subarray_02" + ], + "polled_attr": [ + "delaymodel", + "1000", + "visdestinationaddress", + "1000", + "dopplerphasecorrection", + "1000" + ] + } + } + } + } + }, + "VccMulti": { + "vcc-001": { + "Vcc": { + "mid_csp_cbf/vcc/001": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "Band1And2Address": [ + "mid_csp_cbf/vcc_band12/001" + ], + "Band3Address": [ + "mid_csp_cbf/vcc_band3/001" + ], + "Band4Address": [ + "mid_csp_cbf/vcc_band4/001" + ], + "Band5Address": [ + "mid_csp_cbf/vcc_band5/001" + ], + "SW1Address": [ + "mid_csp_cbf/vcc_sw1/001" + ], + "SW2Address": [ + "mid_csp_cbf/vcc_sw2/001" + ], + "VccID": [ + "1" + ], + "polled_attr": [ + "healthstate", + "1000", + "adminmode", + "1000" + ] + } + } + }, + "VccBand1And2": { + "mid_csp_cbf/vcc_band12/001": {} + }, + "VccBand3": { + "mid_csp_cbf/vcc_band3/001": {} + }, + "VccBand4": { + "mid_csp_cbf/vcc_band4/001": {} + }, + "VccBand5": { + "mid_csp_cbf/vcc_band5/001": {} + }, + "VccSearchWindow": { + "mid_csp_cbf/vcc_sw1/001": {}, + "mid_csp_cbf/vcc_sw2/001": {} + } + }, + "vcc-002": { + "Vcc": { + "mid_csp_cbf/vcc/002": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "Band1And2Address": [ + "mid_csp_cbf/vcc_band12/002" + ], + "Band3Address": [ + "mid_csp_cbf/vcc_band3/002" + ], + "Band4Address": [ + "mid_csp_cbf/vcc_band4/002" + ], + "Band5Address": [ + "mid_csp_cbf/vcc_band5/002" + ], + "SW1Address": [ + "mid_csp_cbf/vcc_sw1/002" + ], + "SW2Address": [ + "mid_csp_cbf/vcc_sw2/002" + ], + "VccID": [ + "2" + ], + "polled_attr": [ + "healthstate", + "1000", + "adminmode", + "1000" + ] + } + } + }, + "VccBand1And2": { + "mid_csp_cbf/vcc_band12/002": {} + }, + "VccBand3": { + "mid_csp_cbf/vcc_band3/002": {} + }, + "VccBand4": { + "mid_csp_cbf/vcc_band4/002": {} + }, + "VccBand5": { + "mid_csp_cbf/vcc_band5/002": {} + }, + "VccSearchWindow": { + "mid_csp_cbf/vcc_sw1/002": {}, + "mid_csp_cbf/vcc_sw2/002": {} + } + }, + "vcc-003": { + "Vcc": { + "mid_csp_cbf/vcc/003": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "Band1And2Address": [ + "mid_csp_cbf/vcc_band12/003" + ], + "Band3Address": [ + "mid_csp_cbf/vcc_band3/003" + ], + "Band4Address": [ + "mid_csp_cbf/vcc_band4/003" + ], + "Band5Address": [ + "mid_csp_cbf/vcc_band5/003" + ], + "SW1Address": [ + "mid_csp_cbf/vcc_sw1/003" + ], + "SW2Address": [ + "mid_csp_cbf/vcc_sw2/003" + ], + "VccID": [ + "3" + ], + "polled_attr": [ + "healthstate", + "1000", + "adminmode", + "1000" + ] + } + } + }, + "VccBand1And2": { + "mid_csp_cbf/vcc_band12/003": {} + }, + "VccBand3": { + "mid_csp_cbf/vcc_band3/003": {} + }, + "VccBand4": { + "mid_csp_cbf/vcc_band4/003": {} + }, + "VccBand5": { + "mid_csp_cbf/vcc_band5/003": {} + }, + "VccSearchWindow": { + "mid_csp_cbf/vcc_sw1/003": {}, + "mid_csp_cbf/vcc_sw2/003": {} + } + }, + "vcc-004": { + "Vcc": { + "mid_csp_cbf/vcc/004": { + "attribute_properties": { + "adminMode": { + "abs_change": [ + "-1", + "1" + ] + }, + "healthState": { + "abs_change": [ + "-1", + "1" + ] + }, + "subarrayMembership": { + "abs_change": [ + "-1", + "1" + ] + } + }, + "properties": { + "Band1And2Address": [ + "mid_csp_cbf/vcc_band12/004" + ], + "Band3Address": [ + "mid_csp_cbf/vcc_band3/004" + ], + "Band4Address": [ + "mid_csp_cbf/vcc_band4/004" + ], + "Band5Address": [ + "mid_csp_cbf/vcc_band5/004" + ], + "SW1Address": [ + "mid_csp_cbf/vcc_sw1/004" + ], + "SW2Address": [ + "mid_csp_cbf/vcc_sw2/004" + ], + "VccID": [ + "4" + ], + "polled_attr": [ + "healthstate", + "1000", + "adminmode", + "1000" + ] + } + } + }, + "VccBand1And2": { + "mid_csp_cbf/vcc_band12/004": {} + }, + "VccBand3": { + "mid_csp_cbf/vcc_band3/004": {} + }, + "VccBand4": { + "mid_csp_cbf/vcc_band4/004": {} + }, + "VccBand5": { + "mid_csp_cbf/vcc_band5/004": {} + }, + "VccSearchWindow": { + "mid_csp_cbf/vcc_sw1/004": {}, + "mid_csp_cbf/vcc_sw2/004": {} + } + } + } + } +} diff --git a/csp-lmc-mid/docker/mid-cbf-mcs.yml b/csp-lmc-mid/docker/mid-cbf-mcs.yml index 96879d8..882c714 100644 --- a/csp-lmc-mid/docker/mid-cbf-mcs.yml +++ b/csp-lmc-mid/docker/mid-cbf-mcs.yml @@ -23,9 +23,9 @@ services: - TANGO_HOST=${TANGO_HOST} command: > sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict -- - json2tango -w -a -u csplmc/config/midcbf_dsconfig.json && sleep infinity" + json2tango -w -a -u ../csplmc/charts/mid-csp/charts/cbf-proto/data/midcbfconfig.json && sleep infinity" volumes: - - .:/csplmc + - ..:/csplmc cbfmaster: image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.5-2e83f4c diff --git a/csp-lmc-mid/docker/mid-csp-lmc.yml b/csp-lmc-mid/docker/mid-csp-lmc.yml index 5b40e9c..5340c29 100644 --- a/csp-lmc-mid/docker/mid-csp-lmc.yml +++ b/csp-lmc-mid/docker/mid-csp-lmc.yml @@ -23,9 +23,9 @@ services: - TANGO_HOST=${TANGO_HOST} command: > sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict -- - json2tango -w -a -u csplmc/config/midcsplmc_dsconfig.json && sleep infinity" + json2tango -w -a -u csplmc/charts/csp-proto/data/cspconfig.json && sleep infinity" volumes: - - .:/csplmc + - ..:/csplmc midcsp_dumpdsconfig: image: nexus.engageska-portugal.pt/ska-docker/tango-dsconfig:latest diff --git a/csp-lmc-mid/requirements-tst.txt b/csp-lmc-mid/requirements-tst.txt new file mode 100644 index 0000000..67c373b --- /dev/null +++ b/csp-lmc-mid/requirements-tst.txt @@ -0,0 +1,9 @@ +pytest +pytest-bdd +pytest-cov +pytest-json-report +pytest-mock +#pytest-xdist == 1.34.0 +pycodestyle +coverage +mock diff --git a/csp-lmc-mid/requirements.txt b/csp-lmc-mid/requirements.txt new file mode 100644 index 0000000..5a67db3 --- /dev/null +++ b/csp-lmc-mid/requirements.txt @@ -0,0 +1,5 @@ +numpy == 1.17.2 +pytango >= 9.3.2 +jsonschema >= 3.2.0 +lmcbaseclasses >= 0.6.4 +csp-lmc-common >= 0.6.8 diff --git a/csp-lmc-mid/setup.cfg b/csp-lmc-mid/setup.cfg index 40bde55..d7e22e1 100644 --- a/csp-lmc-mid/setup.cfg +++ b/csp-lmc-mid/setup.cfg @@ -26,7 +26,7 @@ addopts = --forked --cov-report=term --cov-report=html --cov-report=xml - --junitxml=/build/reports/csp-lmc-mid-unit-tests.xml + --junitxml=build/reports/csp-lmc-mid-unit-tests.xml console_output_style = progress junit_family=legacy filterwarnings = diff --git a/csp-lmc-mid/setup.py b/csp-lmc-mid/setup.py index 34a15bd..14177cd 100644 --- a/csp-lmc-mid/setup.py +++ b/csp-lmc-mid/setup.py @@ -63,7 +63,6 @@ setup( 'assertpy', 'pytest-forked', 'mock', - 'mid-csp-lmc' ], extras_require={ 'dev': ['prospector[with_pyroma]', 'yapf', 'isort'] diff --git a/csp-lmc-mid/test-harness/Makefile b/csp-lmc-mid/test-harness/Makefile new file mode 100644 index 0000000..b10e569 --- /dev/null +++ b/csp-lmc-mid/test-harness/Makefile @@ -0,0 +1,31 @@ +# Use bash shell with pipefail option enabled so that the return status of a +# piped command is the value of the last (rightmost) commnand to exit with a +# non-zero status. This lets us pipe output into tee but still exit on test +# failures. +SHELL = /bin/bash +.SHELLFLAGS = -o pipefail -c + +all: test + +# wait for the device to be available before beginning the test +# A temporary volume is mounted at /build when 'make test' is executing. +# The following steps copy across useful output to this volume which can +# then be extracted to form the CI summary for the test procedure. +test: + retry --max=15 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_01 + retry --max=15 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_02 + retry --max=15 -- tango_admin --ping-device mid_csp/elt/master + retry --max=15 -- tango_admin --ping-device mid_csp/elt/subarray_01 + retry --max=15 -- tango_admin --ping-device mid_csp/elt/subarray_02 + cd /app && python3 setup.py test| tee integration-test.stdout + mkdir -p build/reports && \ + if [ -d build ]; then \ + mv /app/integration-test.stdout ./build/csp-lmc-mid-setup-test.stdout; \ + mv /app/htmlcov ./build/csp-lmc-mid_htmlcov; \ + cp /app/coverage.xml ./build/coverage-csp-lmc-mid.xml; \ + fi; + + #cd /build && coverage combine csp-lmc-mid_coverage csp-lmc-common_coverage && coverage xml + #cd /build && mv coverage.xml ./reports/code-coverage.xml + +.PHONY: all test diff --git a/csp-lmc-mid/test-harness/README.md b/csp-lmc-mid/test-harness/README.md new file mode 100644 index 0000000..a3c9a49 --- /dev/null +++ b/csp-lmc-mid/test-harness/README.md @@ -0,0 +1,3 @@ +This directory is uploaded to the container when 'make test' is executed. Files +in this directory will be found inside /build once uploaded to the container. + diff --git a/csp-lmc-mid/test-harness/requirements-tst.txt b/csp-lmc-mid/test-harness/requirements-tst.txt new file mode 100644 index 0000000..67c373b --- /dev/null +++ b/csp-lmc-mid/test-harness/requirements-tst.txt @@ -0,0 +1,9 @@ +pytest +pytest-bdd +pytest-cov +pytest-json-report +pytest-mock +#pytest-xdist == 1.34.0 +pycodestyle +coverage +mock diff --git a/csp-lmc-mid/test-harness/requirements.txt b/csp-lmc-mid/test-harness/requirements.txt new file mode 100644 index 0000000..5a67db3 --- /dev/null +++ b/csp-lmc-mid/test-harness/requirements.txt @@ -0,0 +1,5 @@ +numpy == 1.17.2 +pytango >= 9.3.2 +jsonschema >= 3.2.0 +lmcbaseclasses >= 0.6.4 +csp-lmc-common >= 0.6.8 diff --git a/csp-lmc-mid/tests/MidCspMaster_test.py b/csp-lmc-mid/tests/integration/MidCspMaster_test.py similarity index 99% rename from csp-lmc-mid/tests/MidCspMaster_test.py rename to csp-lmc-mid/tests/integration/MidCspMaster_test.py index 44925cb..51396a1 100644 --- a/csp-lmc-mid/tests/MidCspMaster_test.py +++ b/csp-lmc-mid/tests/integration/MidCspMaster_test.py @@ -34,7 +34,7 @@ sys.path.insert(0, os.path.abspath(path)) print(commons_pkg_path) #Local imports from ska.base.control_model import AdminMode -from acceptance_tests.utils import Probe, Poller +from unit.utils import Probe, Poller LOGGER = logging.getLogger(__name__) # Device test case @@ -112,7 +112,6 @@ class TestCspMaster(TestBase): Poller(4, 0.2).check(prober_admin_mode) prober_state = Probe(self.midcsp_master, "state", DevState.DISABLE, f"CSP Master not OFFLINE") Poller(4, 0.2).check(prober_state) - ''' def test_properties(self): """ Test the device property MaxCapability""" self._setup_master() @@ -120,6 +119,7 @@ class TestCspMaster(TestBase): capability_list.sort() #Oss: maxCapability returns a tuple assert self.midcsp_master.maxCapabilities == tuple(capability_list) + ''' def test_forwarded_attributes(self): """ Test the reportVCCState forwarded attribute""" diff --git a/csp-lmc-mid/tests/integration/MidCspSubarrayConfiguration_test.py b/csp-lmc-mid/tests/integration/MidCspSubarrayConfiguration_test.py deleted file mode 100644 index 069dadc..0000000 --- a/csp-lmc-mid/tests/integration/MidCspSubarrayConfiguration_test.py +++ /dev/null @@ -1,381 +0,0 @@ -"""Tests for ADR-4 and ADR-10 implementation into CSP.LMC Subarray.""" - -# Standard imports -import sys -import os -import time -import logging -import pytest -import unittest -from pytest import fail - -# Tango imports -import tango -from tango import DevState, EventType - -# Local imports -import json -from ska.base.control_model import ObsState -from utils import Poller, Probe -from assertpy import assert_that - -file_path = os.path.dirname(os.path.abspath(__file__)) -LOGGER = logging.getLogger(__name__) - -def prepare_configuration_string(filename="test_ConfigureScan_ADR4.json"): - """Create the config string for CSP-CBF""" - try: - file_to_load = filename - file_path = os.path.dirname(os.path.abspath(__file__)) - LOGGER.info(f" Reading configuration from {file_to_load}") - json_file = open(file_path + "/" + file_to_load) - configuration_string = json_file.read().replace("\n", "") - return configuration_string - except Exception as e: - LOGGER.warning(f"Unable to locate file {filename}") - - -# Device test case -@pytest.mark.usefixtures("midcsp_master", "midcsp_subarray01", "cbf_subarray01") -class TestBase(unittest.TestCase): - fixture_names = () - - @pytest.fixture(autouse=True) - def auto_injector_fixture(self, request): - names = self.fixture_names - for name in names: - setattr(self, name, request.getfixturevalue(name)) - -class TestCspSubarrayConfiguration(TestBase): - fixture_names = ("midcsp_master", "midcsp_subarray01", "cbf_subarray01") - - def __set_csp_subarray_to_on(self): - """ - Set the CSP Subarray to ON state. - """ - # read from the CSP Master the list of available receptors - unassigned_receptors = self.midcsp_master.unassignedReceptorIDs - # assign the first one to the CSP subarray to force - # the transition to ON - receptor_to_add = unassigned_receptors[0] - LOGGER.debug("Set CSP Subarray adding receptor:{}".format(receptor_to_add)) - self.midcsp_subarray01.AddReceptors([receptor_to_add, ]) - prober_cmd_in_progress = Probe(self.midcsp_subarray01, 'isCmdInProgress', False, - f"Wrong value for command in progress") - Poller(10, 0.2).check(prober_cmd_in_progress) - prober_subarray_state = Probe(self.midcsp_subarray01, 'state', DevState.ON, - f"Wrong CspSubarray state") - Poller(10, 0.2).check(prober_subarray_state) - state = self.midcsp_subarray01.State() - assert state == DevState.ON - - def _set_cspsubarray_to_idle_state(self): - obs_state = self.midcsp_subarray01.obsState - if obs_state == ObsState.READY: - self.midcsp_subarray01.GoToIdle() - prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.IDLE, f"CSP Subarray not IDLE") - Poller(7, 0.2).check(prober_obs_state) - - def _reset_subarray_to_disable_state(self): - try: - state = self.midcsp_subarray01.State() - LOGGER.debug("CSP Subarray initial State:{}".format(state)) - if state == DevState.DISABLE: - return - if state == DevState.ON: - self._set_cspsubarray_to_idle_state() - LOGGER.debug("Remove all receptors") - self.midcsp_subarray01.RemoveAllReceptors() - # wait for the transition of the CSP sub-array to OFF - prober_subarray_state = Probe(self.midcsp_subarray01, 'state', DevState.OFF, - f"Wrong CSP Subarray state") - Poller(7, 0.2).check(prober_subarray_state) - - # Set the CSP subarray to OFF issuing the Standby command - # o CSP Master - state = self.midcsp_subarray01.State() - if state == DevState.OFF: - LOGGER.debug("CSP Subarray State is OFF...going to execute Standby") - # wait until Master is ON - prober_master_state = Probe(self.midcsp_master, 'state', DevState.ON, f"Wrong CSP Master state") - Poller(7, 0.2).check(prober_master_state) - self.midcsp_master.Standby("") - prober_subarray_state = Probe(self.midcsp_subarray01, 'state', DevState.DISABLE, - f"Wrong CSP Subarray state") - Poller(5, 0.2).check(prober_subarray_state) - prober_master_state = Probe(self.midcsp_master, 'state', DevState.STANDBY, - f"Wrong CSP Master state") - Poller(7, 0.2).check(prober_master_state) - return - - except tango.DevFailed as tango_err: - LOGGER.warning(f"Unable to reset subarray to init state") - - def _setup_csp_subarray(self): - """ - Set the CSP Subarray state to ON - """ - LOGGER.info("Setup subarray") - self._reset_subarray_to_disable_state() - # switch-on the CspMaster to force CSP Subarray - # transition to OFF - LOGGER.debug("Set CSP Subarray to OFF") - self.midcsp_master.On("") - # wait for the transition of the CSP subarray to OFF - prober_master_state = Probe(self.midcsp_master, 'state', DevState.ON, f"Wrong CSP Master state") - Poller(10, 0.2).check(prober_master_state) - # wait for the transition of the CSP subarray to OFF - prober_subarray_state = Probe(self.midcsp_subarray01, 'state', DevState.OFF, f"Wrong CSP Subarray state") - Poller(10, 0.2).check(prober_subarray_state) - state = self.midcsp_subarray01.State() - assert state in [DevState.OFF], "assuming that mid_csp_subarray_01 is OFF" - self.__set_csp_subarray_to_on() - state = self.midcsp_subarray01.State() - - @pytest.mark.csp_k8s - def test_send_configure_to_cbf_and_json_stored(self): - """ - Configure the CSP Subarray with a JSon string including - the new ADR4 fields. - """ - self._setup_csp_subarray() - configuration_string = prepare_configuration_string() - state = self.midcsp_subarray01.State() - assert state == DevState.ON, "assume the CSP subarray State is ON" - # exercise the device - obs_state = self.midcsp_subarray01.obsState - LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name)) - LOGGER.debug(f"sending configure:{configuration_string}") - LOGGER.info(f"Configuring CSP subarray01") - self.midcsp_subarray01.Configure(configuration_string) - # check - prober_subarray_obstate = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY, - f"Wrong CSP Subarray obsState {self.midcsp_subarray01.obsState}") - Poller(5, 0.2).check(prober_subarray_obstate) - stored_json = self.midcsp_subarray01.validScanConfiguration - assert stored_json == configuration_string - json_dict = json.loads(configuration_string) - configID = json_dict["id"] - stored_id = self.midcsp_subarray01.configurationID - assert stored_id == configID - - @pytest.mark.csp_k8s - def test_configure_cspsubarray_WITH_json_missing_configId(self): - """ - Configure the CSP Subarray sending a json configuration script - without the configID entry. - """ - # setup the test - # Set the CSP Subarray to ON-IDLE state - self._setup_csp_subarray() - configuration_string = prepare_configuration_string("test_ConfigureScan_without_configID.json") - - # exercise the device - state = self.midcsp_subarray01.State() - obs_state = self.midcsp_subarray01.obsState - LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name)) - LOGGER.info(f"Configuring CSP subarray01") - with pytest.raises(tango.DevFailed) as tango_err: - self.midcsp_subarray01.Configure(configuration_string) - if tango_err: - err_msg = str(tango_err.value.args[0].desc) - # TODO: aggiungere quale device fallisce - LOGGER.warning(f"Command configure failed on {self.midcsp_subarray01.dev_name()} with error: {err_msg}") - # check - obs_state = self.midcsp_subarray01.obsState - #assert obs_state == ObsState.IDLE, f"CSP Subarray obsState has wrong value ({obs_state})" - assert_that(obs_state).described_as("CSP Subarray obsState has wrong value ({obs_state}").is_equal_to(ObsState.IDLE) - - @pytest.mark.csp_k8s - def test_configure_cspsubarray_WHEN_in_wrong_state(self): - """ - Set the CSP Subarray in a wrong state and issue the - Configure command on it. - """ - # setup the test: Subarray DISABLE-IDLE - - self._setup_csp_subarray() - LOGGER.info("Force CSP Subarray to an invalid state to accept Configure") - self._reset_subarray_to_disable_state() - configuration_string = prepare_configuration_string() - init_state = self.midcsp_subarray01.State() - - # exercise the device - state = self.midcsp_subarray01.State() - obs_state = self.midcsp_subarray01.obsState - LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name)) - LOGGER.info(f"Configuring CSP subarray01") - with pytest.raises(tango.DevFailed) as df: - self.midcsp_subarray01.Configure(configuration_string) - #assert_that(self.midcsp_subarray01.Configure).raises(tango.DevFailed).when_called_with(configuration_string) - if df: - err_msg = str(df.value.args[0].desc) - # TODO: aggiungere quale device fallisce - LOGGER.error(f"Command configure failed on {self.midcsp_subarray01.dev_name()} with error: {err_msg}") - # check - # Subarray final ObsState=IDLE - obs_state = self.midcsp_subarray01.obsState - end_state = self.midcsp_subarray01.State() - assert obs_state == ObsState.IDLE, f"Current ObsState should be IDLE" - assert end_state == init_state, f"Current State should be the initial one" - #assert_that(obs_state).described_by("Current ObsState should be IDLE").is_not_equal_to(ObsState.IDLE) - - @pytest.mark.csp_k8s - def test_configure_cbf_WITHOUT_outputlink_information(self): - """ - CSP Subarray sends an invalid json configuration to - CBF Subarray. - """ - # setup the test: Subarray DISABLE-IDLE - self._setup_csp_subarray() - configuration_string = prepare_configuration_string("test_ConfigureScan_without_outputlink.json") - # print the subarray stat/obsState - init_state = self.midcsp_subarray01.State() - obs_state = self.midcsp_subarray01.obsState - LOGGER.info("CSP Subarray State before exercise :{}-{}".format(init_state, ObsState(obs_state).name)) - # exercise the device - LOGGER.info(f"Configuring CSP subarray01") - self.midcsp_subarray01.Configure(configuration_string) - # check - # Subarray final ObsState IDLE - prober_subarray_flag = Probe(self.midcsp_subarray01, 'failureRaisedFlag', True, f"Failure flag is false") - Poller(7, 0.2).check(prober_subarray_flag) - obs_state = self.midcsp_subarray01.obsState - end_state = self.midcsp_subarray01.State() - assert obs_state == ObsState.IDLE, f"Current ObsState should be IDLE" - assert end_state == init_state, f"Current State should be the initial one" - - @pytest.mark.csp_k8s - def test_configure_cbf_WITH_invalid_json(self): - """ - CSP Subarray sends an invalid json configuration to - CBF Subarray. - """ - # setup the test: Subarray DISABLE-IDLE - self._setup_csp_subarray() - configuration_string = prepare_configuration_string("test_ConfigureScan_invalid_cbf_json.json") - # print the subarray stat/obsState - init_state = self.midcsp_subarray01.State() - obs_state = self.midcsp_subarray01.obsState - LOGGER.info("CSP Subarray State before exercise :{}-{}".format(init_state, ObsState(obs_state).name)) - # exercise the device - LOGGER.info(f"Configuring CSP subarray01") - self.midcsp_subarray01.Configure(configuration_string) - # check - # Subarray final ObsState IDLE - prober_subarray_flag = Probe(self.midcsp_subarray01, 'failureRaisedFlag', True, f"Failure flag is false") - Poller(7, 0.2).check(prober_subarray_flag) - obs_state = self.midcsp_subarray01.obsState - end_state = self.midcsp_subarray01.State() - assert obs_state == ObsState.IDLE, f"Current ObsState should be IDLE" - assert end_state == init_state, f"Current State should be the initial one" - @pytest.mark.csp_k8s - def test_cspsubarray_scan_WITH_invalid_string_id(self): - """ - CSP Subarray receives the Scan command with an invalid - scanId number - """ - # setup the test: Subarray DISABLE-IDLE - self._setup_csp_subarray() - configuration_string = prepare_configuration_string("test_ConfigureScan_ADR4.json") - LOGGER.info(f"Configuring CSP subarray01") - self.midcsp_subarray01.Configure(configuration_string) - prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY, f"CSP Subarray not configured") - Poller(7, 0.2).check(prober_obs_state) - LOGGER.info(f"Issue the Scan command sending the invalid string \"abcd\" as input") - # exercise the device - state = self.midcsp_subarray01.State() - obs_state = self.midcsp_subarray01.obsState - LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name)) - with pytest.raises(tango.DevFailed) as df: - self.midcsp_subarray01.Scan("abcd") - if df: - err_msg = str(df.value.args[0].desc) - LOGGER.error(f"Command Scan failed on {self.midcsp_subarray01.dev_name()} with error: {err_msg}") - # check - obs_state = self.midcsp_subarray01.obsState - assert obs_state == ObsState.READY - - @pytest.mark.csp_k8s - def test_cspsubarray_scan_WITH_no_argument(self): - """ - CSP Subarray receives the Scan command with no - input argument - """ - # setup the test: Subarray DISABLE-IDLE - self._setup_csp_subarray() - configuration_string = prepare_configuration_string("test_ConfigureScan_ADR4.json") - LOGGER.info(f"Configuring CSP subarray01") - self.midcsp_subarray01.Configure(configuration_string) - prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY, f"CSP Subarray not configured") - Poller(7, 0.2).check(prober_obs_state) - LOGGER.info(f"Issue the Scan command with no input argument") - # exercise the device - state = self.midcsp_subarray01.State() - obs_state = self.midcsp_subarray01.obsState - LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name)) - with pytest.raises(tango.DevFailed) as df: - self.midcsp_subarray01.Scan() - if df: - err_msg = str(df.value.args[0].desc) - LOGGER.error(f"Command configure failed on {self.midcsp_subarray01.dev_name()} with error: {err_msg}") - # check - obs_state = self.midcsp_subarray01.obsState - assert obs_state == ObsState.READY - - @pytest.mark.csp_k8s - def test_cspsubarray_scan_WITH_int_argument(self): - """ - CSP Subarray receives the Scan command with an invalid - argument data type - """ - # setup the test: Subarray DISABLE-IDLE - self._setup_csp_subarray() - configuration_string = prepare_configuration_string("test_ConfigureScan_ADR4.json") - LOGGER.info(f"Configuring CSP subarray01") - self.midcsp_subarray01.Configure(configuration_string) - prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY, f"CSP Subarray not configured") - Poller(7, 0.2).check(prober_obs_state) - LOGGER.info(f"Issue the Scan command sending an int as input") - # exercise the device - state = self.midcsp_subarray01.State() - obs_state = self.midcsp_subarray01.obsState - LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name)) - with pytest.raises(tango.DevFailed) as df: - self.midcsp_subarray01.Scan(1) - if df: - err_msg = str(df.value.args[0].desc) - LOGGER.error(f"Command Scan failed on {self.midcsp_subarray01.dev_name()} with error: {err_msg}") - # check - obs_state = self.midcsp_subarray01.obsState - assert obs_state == ObsState.READY - - @pytest.mark.csp_k8s - def test_cspsubarray_scan_WITH_valid_scan_id(self): - """ - CSP Subarray receives the Scan command with a valid - input argument - """ - # setup the test: Subarray DISABLE-IDLE - self._setup_csp_subarray() - configuration_string = prepare_configuration_string("test_ConfigureScan_ADR4.json") - LOGGER.info(f"Configuring CSP subarray01") - self.midcsp_subarray01.Configure(configuration_string) - prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY, f"CSP Subarray not configured") - Poller(7, 0.2).check(prober_obs_state) - LOGGER.info(f"Issue the Scan command") - # exercise the device - state = self.midcsp_subarray01.State() - obs_state = self.midcsp_subarray01.obsState - LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name)) - scan_argin = "11" - self.midcsp_subarray01.Scan([scan_argin,]) - # check - prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.SCANNING, f"CSP Subarray wrong obstate") - Poller(7, 0.2).check(prober_obs_state) - # end the scan - self.midcsp_subarray01.EndScan() - prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY, f"CSP Subarray wrong obstate") - Poller(7, 0.2).check(prober_obs_state) - assert int(scan_argin) == self.midcsp_subarray01.scanID - diff --git a/csp-lmc-mid/tests/integration/MidCspSubarray_test.py b/csp-lmc-mid/tests/integration/MidCspSubarray_test.py index fa9713b..df27243 100755 --- a/csp-lmc-mid/tests/integration/MidCspSubarray_test.py +++ b/csp-lmc-mid/tests/integration/MidCspSubarray_test.py @@ -24,24 +24,23 @@ import tango from tango import DevState from assertpy import assert_that -# Path -file_path = os.path.dirname(os.path.abspath(__file__)) -# insert base package directory to import global_enum -# module in commons folder -print(file_path) -data_pkg_path = os.path.abspath(os.path.join(file_path, "./tests")) -sys.path.insert(0, data_pkg_path) - -path = os.path.join(os.path.dirname(__file__), os.pardir) -sys.path.insert(0, os.path.abspath(path)) - #Local imports from ska.base.control_model import ObsState -from acceptance_tests.utils import Probe, Poller +from unit.utils import Probe, Poller LOGGER = logging.getLogger(__name__) -# Device test case -@pytest.mark.usefixtures("midcsp_master", "midcsp_subarray01", "midcsp_subarray02", "cbf_subarray01") +file_path = os.path.dirname(os.path.abspath(__file__)) + +def prepare_configuration_string(filename="test_ConfigureScan_ADR4.json"): + """Create the config string for CSP-CBF""" + try: + file_to_load = file_path + '/../test_data/' + filename + LOGGER.debug(f" Reading configuration from {file_to_load}") + json_file = open(file_to_load) + configuration_string = json_file.read().replace("\n", "") + return configuration_string + except Exception as e: + LOGGER.warning(f"Unable to locate file {filename}") # Device test case @pytest.mark.usefixtures("midcsp_master", "midcsp_subarray01", "cbf_subarray01") @@ -114,11 +113,10 @@ class TestCspSubarray(TestBase): # assign all available receptors to the subarray state = self.midcsp_subarray01.State() obs_state = self.midcsp_subarray01.obsState + LOGGER.info("CSPSubarray state:{}-{}".format(state, obs_state)) + LOGGER.info("Going to assign receptors") self.midcsp_subarray01.AddReceptors(receptor_list.tolist()) # wait for the transition to IDLE - prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.RESOURCING, - f"Wrong CSP Subarray obsState is not RESOURCING") - Poller(10, 0.2).check(prober_obs_state) prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.IDLE, f"Wrong CSP Subarray obsState is not IDLE") Poller(10, 0.2).check(prober_obs_state) @@ -132,19 +130,19 @@ class TestCspSubarray(TestBase): """ obs_state = self.midcsp_subarray01.obsState assert obs_state == ObsState.IDLE + receptors = self.midcsp_subarray01.assignedReceptors + LOGGER.info("Receptor assigned to the subarray {}".format(receptors)) try: + LOGGER.info("invoke remove all receptors") self.midcsp_subarray01.RemoveAllReceptors() except Exception as e: LOGGER.info(str(e)) # wait for the transition to EMPTY prober_obs_state = Probe(self.midcsp_subarray01, "obsState", ObsState.EMPTY, f"CSP Subarray is not EMPTY") Poller(4, 0.2).check(prober_obs_state) - # Note: here we sleep for a while to let the system update the vccMemebership attribute. This has to - # configured to push event fro the device (not with polling) - #time.sleep(0.2) - receptor_list = self.midcsp_master.unassignedReceptorIDs - #if self.midcsp_subarray01.State() == DevState.OFF: - # self.midcsp_subarray01.On() + obs_state = self.midcsp_subarray01.obsState + LOGGER.info("obs_state:{}".format(obs_state)) + LOGGER.info("EMPTY:{}".format(ObsState.EMPTY)) def _goto_idle(self): """ @@ -159,28 +157,27 @@ class TestCspSubarray(TestBase): def _configure_scan(self): self._setup_subarray() self._assign_receptors() - f = open(file_path + "/acceptance_tests/test_ConfigureScan_ADR4.json") - (result_code, msg) = self.midcsp_subarray01.Configure(f.read().replace("\n", "")) - f.close() + configuration_string = prepare_configuration_string() + (result_code, msg) = self.midcsp_subarray01.Configure(configuration_string) prober_subarray_obstate = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY, f"Wrong CSP Subarray obsState {self.midcsp_subarray01.obsState}") Poller(5, 0.2).check(prober_subarray_obstate) - ''' + @pytest.mark.csp_k8s def test_AFTER_initialization(self): """ Test for State after CSP startup. The CspSubarray State at start is OFF. """ - self._setup_subarray() + self._setup_subarray_off() state = self.midcsp_subarray01.State() LOGGER.info("subarray state:{}".format(state)) prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.OFF, f"CSP Subarray not OFF") Poller(4, 0.2).check(prober_subarray_state) prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.EMPTY, f"CSP Subarray not EMPTY") Poller(4, 0.2).check(prober_subarray_obsstate) - ''' + @pytest.mark.csp_k8s def test_subarray_state_AFTER_on_command_execution(self): """ @@ -190,13 +187,13 @@ class TestCspSubarray(TestBase): self._setup_subarray_off() subarray_state = self.midcsp_subarray01.State() obs_state = self.midcsp_subarray01.obsState - #time.sleep(1) LOGGER.debug("CSPSubarray state before test:{}-{}".format(subarray_state, obs_state)) subarray_state = self.midcsp_subarray01.State() self.midcsp_subarray01.On() prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.ON, f"CSP Subarray not OFF") Poller(4, 0.2).check(prober_subarray_state) + @pytest.mark.csp_k8s def test_add_receptors_WITH_invalid_id(self): """ Test the assignment of a number of invalid receptor IDs to @@ -231,6 +228,7 @@ class TestCspSubarray(TestBase): # a 0-dimensional array or a 0-length list. Therefore, the result is True. assert not receptors.any(), f"CSP Subarray is not empty" + @pytest.mark.csp_k8s def test_add_receptors_WITH_valid_id(self): """ Test the assignment of valid receptors to a CspSubarray @@ -252,6 +250,7 @@ class TestCspSubarray(TestBase): receptors = self.midcsp_subarray01.assignedReceptors assert set(receptor_list) == set(receptors) + @pytest.mark.csp_k8s def test_add_receptors_ALREADY_belonging_to_subarray(self): """ Test the assignment of already assigned receptors to a CspSubarray @@ -273,6 +272,7 @@ class TestCspSubarray(TestBase): # check the array read first and the array read last are equal assert np.array_equal(receptors, assigned_receptors) + @pytest.mark.csp_k8s def test_subarray_state_AFTER_receptors_assignment(self): """ Test the CspSubarray State after receptors assignment. @@ -290,6 +290,7 @@ class TestCspSubarray(TestBase): f"Wrong CSP Subarray obsState") Poller(10, 0.2).check(prober_obs_state) + @pytest.mark.csp_k8s def test_partial_remove_of_receptors_FROM_the_subarray(self): """ Test the partial deallocation of receptors from a @@ -318,6 +319,7 @@ class TestCspSubarray(TestBase): final_number_of_receptors = len(assigned_receptors) assert (init_number_of_receptors - final_number_of_receptors) == 1 + @pytest.mark.csp_k8s def test_remove_all_receptors_FROM_subarray(self): """ Test the complete deallocation of receptors from a @@ -342,6 +344,7 @@ class TestCspSubarray(TestBase): # check the array is empty (any() in this case returns False) assert not assigned_receptors.any() + @pytest.mark.csp_k8s def test_configure_WHEN_subarray_is_in_wrong_state(self): """ Test that the Configure() command fails if the Subarray @@ -351,17 +354,16 @@ class TestCspSubarray(TestBase): obs_state = self.midcsp_subarray01.obsState state = self.midcsp_subarray01.State() LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name)) - filename = os.path.join(data_pkg_path, "test_ConfigureScan_basic.json") - f = open(file_path + "/test_ConfigureScan_basic.json") - LOGGER.info(f"Configuring CSP subarray01") + configuration_string = prepare_configuration_string("test_ConfigureScan_basic.json") with pytest.raises(tango.DevFailed) as df: - self.midcsp_subarray01.Configure(f.read().replace("\n", "")) + (result_code, msg) = self.midcsp_subarray01.Configure(configuration_string) if df: err_msg = str(df.value.args[0].desc) LOGGER.error(err_msg) obs_state = self.midcsp_subarray01.obsState assert obs_state == ObsState.EMPTY, f"CSP Subarray obsState is not EMPTY" + @pytest.mark.csp_k8s def test_configure_WHITH_wrong_configuration(self): """ Test that the Configure() command fails if the Subarray @@ -372,13 +374,14 @@ class TestCspSubarray(TestBase): obs_state = self.midcsp_subarray01.obsState state = self.midcsp_subarray01.State() LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name)) - f = open(file_path + "/acceptance_tests/test_ConfigureScan_without_configID.json") + configuration_string = prepare_configuration_string("test_ConfigureScan_without_configID.json") LOGGER.info(f"Configuring CSP subarray01") - self.midcsp_subarray01.Configure(f.read().replace("\n", "")) + self.midcsp_subarray01.Configure(configuration_string) # check obs_state = self.midcsp_subarray01.obsState assert_that(obs_state).described_as("CSP Subarray obsState has wrong value ({obs_state}").is_equal_to(ObsState.FAULT) + @pytest.mark.csp_k8s def test_send_configure_to_cbf_and_json_stored(self): """ Configure the CSP Subarray with a JSon string including @@ -391,9 +394,8 @@ class TestCspSubarray(TestBase): LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name)) # exercise the device LOGGER.info(f"Configuring CSP subarray01") - f = open(file_path + "/acceptance_tests/test_ConfigureScan_ADR4.json") - (result_code, msg) = self.midcsp_subarray01.Configure(f.read().replace("\n", "")) - f.close() + configuration_string = prepare_configuration_string() + (result_code, msg) = self.midcsp_subarray01.Configure(configuration_string) # check prober_subarray_obstate = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY, f"Wrong CSP Subarray obsState {self.midcsp_subarray01.obsState}") @@ -404,36 +406,7 @@ class TestCspSubarray(TestBase): #stored_id = self.midcsp_subarray01.configurationID #assert stored_id == configID - def test_reconfiguration(self): - """ - Configure the CSP Subarray with a JSon string including - the new ADR4 fields. - """ - self._setup_subarray() - self._assign_receptors() - state = self.midcsp_subarray01.State() - obs_state = self.midcsp_subarray01.obsState - LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name)) - # exercise the device - LOGGER.info(f"Configuring CSP subarray01") - f = open(file_path + "/acceptance_tests/test_ConfigureScan_ADR4.json") - (result_code, msg) = self.midcsp_subarray01.Configure(f.read().replace("\n", "")) - f.close() - # check - prober_subarray_obstate = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY, - f"Wrong CSP Subarray obsState {self.midcsp_subarray01.obsState}") - Poller(5, 0.2).check(prober_subarray_obstate) - obs_state = self.midcsp_subarray01.obsState - state = self.midcsp_subarray01.State() - LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name)) - f = open(file_path + "/acceptance_tests/test_ConfigureScan_basic.json") - (result_code, msg) = self.midcsp_subarray01.Configure(f.read().replace("\n", "")) - f.close() - # check - prober_subarray_obstate = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY, - f"Wrong CSP Subarray obsState {self.midcsp_subarray01.obsState}") - Poller(5, 0.2).check(prober_subarray_obstate) - + @pytest.mark.csp_k8s def test_start_end_scan(self): """ Test that a subarray is able to process the @@ -456,6 +429,7 @@ class TestCspSubarray(TestBase): f"Wrong CSP Subarray obsState") Poller(10, 0.2).check(prober_obs_state) + @pytest.mark.csp_k8s def test_abort_scan(self): """ Test that a subarray is able to process the @@ -477,17 +451,18 @@ class TestCspSubarray(TestBase): f"Wrong CSP Subarray obsState") Poller(10, 0.2).check(prober_obs_state) + @pytest.mark.csp_k8s def test_invoke_configure_command_AFTER_gotoidle(self): self._configure_scan() self.midcsp_subarray01.GoToIdle() LOGGER.info(f"Configuring CSP subarray01") - f = open(file_path + "/acceptance_tests/test_ConfigureScan_ADR4.json") - (result_code, msg) = self.midcsp_subarray01.Configure(f.read().replace("\n", "")) - f.close() + configuration_string = prepare_configuration_string() + (result_code, msg) = self.midcsp_subarray01.Configure(configuration_string) prober_obs_state = Probe(self.midcsp_subarray01, "obsState", ObsState.READY, f"CSP Subarray not READY") Poller(4, 0.2).check(prober_obs_state) + @pytest.mark.csp_k8s def test_obsreset_cbf_AFTER_invalid_configuration(self): """ CSP Subarray sends an invalid json configuration to @@ -496,14 +471,13 @@ class TestCspSubarray(TestBase): # setup the test: Subarray DISABLE-IDLE self._setup_subarray() self._assign_receptors() - f = open(file_path + "/acceptance_tests/test_ConfigureScan_invalid_cbf_json.json") - # print the subarray stat/obsState init_state = self.midcsp_subarray01.State() obs_state = self.midcsp_subarray01.obsState LOGGER.info("CSP Subarray State before exercise :{}-{}".format(init_state, ObsState(obs_state).name)) # exercise the device LOGGER.info(f"Configuring CSP subarray01") - self.midcsp_subarray01.Configure(f.read().replace("\n", "")) + configuration_string = prepare_configuration_string("test_ConfigureScan_invalid_cbf_json.json") + self.midcsp_subarray01.Configure(configuration_string) # check # Subarray final ObsState IDLE prober_subarray_flag = Probe(self.midcsp_subarray01, 'failureRaisedFlag', True, f"Failure flag is false") @@ -515,6 +489,7 @@ class TestCspSubarray(TestBase): prober_obs_state = Probe(self.midcsp_subarray01, "obsState", ObsState.IDLE, f"CSP Subarray not IDLE") Poller(4, 0.2).check(prober_obs_state) + @pytest.mark.csp_k8s def test_send_abort_WHILE_in_configuring(self): """ Configure the CSP Subarray with a JSon string including @@ -527,9 +502,8 @@ class TestCspSubarray(TestBase): LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name)) # exercise the device LOGGER.info(f"Configuring CSP subarray01") - f = open(file_path + "/acceptance_tests/test_ConfigureScan_ADR4.json") - (result_code, msg) = self.midcsp_subarray01.Configure(f.read().replace("\n", "")) - f.close() + configuration_string = prepare_configuration_string() + (result_code, msg) = self.midcsp_subarray01.Configure(configuration_string) #time.sleep(0.1) self.midcsp_subarray01.Abort() # check @@ -539,30 +513,13 @@ class TestCspSubarray(TestBase): obs_state = self.midcsp_subarray01.obsState assert obs_state == ObsState.ABORTED - def test_restart_AFTER_abort_with_subarray_idle(self): - """ - CSP Subarray invoke a RESTART after fault with - subarray with allocated resources. - """ - # setup the test: Subarray DISABLE-IDLE - self._setup_subarray() - self._assign_receptors() - self.midcsp_subarray01.Abort() - prober_obs_state = Probe(self.midcsp_subarray01, "obsState", ObsState.ABORTED, f"CSP Subarray not EMPTY") - Poller(4, 0.2).check(prober_obs_state) - self.midcsp_subarray01.Restart() - prober_obs_state = Probe(self.midcsp_subarray01, "obsState", ObsState.EMPTY, f"CSP Subarray not EMPTY") - Poller(4, 0.2).check(prober_obs_state) - assigned_receptors = self.midcsp_subarray01.assignedReceptors - LOGGER.info("assigned_receptors:".format(assigned_receptors)) - def test_restart_AFTER_abort_with_subarray_ready(self): self._setup_subarray() self._assign_receptors() # configure the system with invalid json to send it in FAULT - f = open(file_path + "/acceptance_tests/test_ConfigureScan_ADR4.json") + configuration_string = prepare_configuration_string() LOGGER.info(f"Configuring CSP subarray01") - self.midcsp_subarray01.Configure(f.read().replace("\n", "")) + (result_code, msg) = self.midcsp_subarray01.Configure(configuration_string) prober_obs_state = Probe(self.midcsp_subarray01, "obsState", ObsState.READY, f"CSP Subarray not READY") Poller(4, 0.2).check(prober_obs_state) self.midcsp_subarray01.Abort() @@ -581,8 +538,9 @@ class TestCspSubarray(TestBase): self._setup_subarray() self._assign_receptors() # configure the system with invalid json to send it in FAULT - f = open(file_path + "/acceptance_tests/test_ConfigureScan_without_configID.json") - self.midcsp_subarray01.Configure(f.read().replace("\n", "")) + configuration_string = prepare_configuration_string("test_ConfigureScan_without_configID.json") + LOGGER.info(f"Configuring CSP subarray01") + (result_code, msg) = self.midcsp_subarray01.Configure(configuration_string) prober_obs_state = Probe(self.midcsp_subarray01, 'obsState',ObsState.FAULT, f"Failure flag is false") Poller(7, 0.2).check(prober_obs_state) obs_state = self.midcsp_subarray01.obsState diff --git a/csp-lmc-mid/tests/integration/test_ConfigureScan_basic.json b/csp-lmc-mid/tests/integration/test_ConfigureScan_basic.json index f9baaf5..51f2dd6 100644 --- a/csp-lmc-mid/tests/integration/test_ConfigureScan_basic.json +++ b/csp-lmc-mid/tests/integration/test_ConfigureScan_basic.json @@ -1,68 +1,63 @@ { "id": "sbi-mvp01-20200325-00001-science_A", - "scanID": 1, - "frequencyBand": "5a", - "band5Tuning": [5.85, 7.25], - "frequencyBandOffsetStream1": 0, - "frequencyBandOffsetStream2": 0, - "dopplerPhaseCorrSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/dopplerPhaseCorrection", + "frequencyBand": "1", "delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/delayModel", - "visDestinationAddressSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/visDestinationAddress", - "rfiFlaggingMask": {}, - "searchWindow": [ - { - "searchWindowID": 1, - "searchWindowTuning": 6000000000, - "tdcEnable": true, - "tdcNumBits": 8, - "tdcPeriodBeforeEpoch": 5, - "tdcPeriodAfterEpoch": 25, - "tdcDestinationAddress": [ - { - "tdcDestinationAddress": ["foo", "bar", "8080"] - }, - { - "receptorID": 1, - "tdcDestinationAddress": ["fizz", "buzz", "80"] - } - ] - }, - { - "searchWindowID": 2, - "searchWindowTuning": 7000000000, - "tdcEnable": false - } - ], + "fsp": [ { "fspID": 1, "functionMode": "CORR", "frequencySliceID": 1, - "corrBandwidth": 1, - "zoomWindowTuning": 4700000, + "corrBandwidth": 0, "integrationTime": 140, + "fspChannelOffset": 0, "channelAveragingMap": [ - [1, 8], - [745, 0], - [1489, 0], - [2233, 0], - [2977, 0], - [3721, 0], - [4465, 0], - [5209, 0], - [5953, 0], - [6697, 0], - [7441, 0], - [8185, 0], - [8929, 0], - [9673, 0], - [10417, 0], - [11161, 0], - [11905, 0], - [12649, 0], - [13393, 0], - [14137, 0] - ] - } + [0, 1], + [744, 1], + [1488, 1], + [2232, 1], + [2976, 1], + [3720, 1], + [4464, 1], + [5208, 1], + [5952, 1], + [6696, 1], + [7440, 1], + [8184, 1], + [8928, 1], + [9672, 1], + [10416, 1], + [11160, 1], + [11904, 1], + [12648, 1], + [13392, 1], + [14136, 1] + ], + "outputLinkMap": [ + [0, 4], + [744, 8], + [1480, 12], + [2234, 16], + [2978, 20], + [3722, 24], + [4466, 28], + [5208, 32], + [5952, 36], + [6696, 40], + [7440, 44], + [8184, 48], + [8928, 52], + [9672, 56], + [10416, 60], + [11160, 64], + [11904, 68], + [12648, 72], + [13392, 76], + [14136, 80] + ], + "outputHost": [[0, "192.168.0.1"], [8184, "192.168.0.2"]], + "outputMac": [[0, "06-00-00-00-00-01"]], + "outputPort": [[0, 9000, 1], [8184, 9000, 1]] + } ] } diff --git a/csp-lmc-mid/tests/integration/utils.py b/csp-lmc-mid/tests/integration/utils.py index 68564b3..b437ebd 100644 --- a/csp-lmc-mid/tests/integration/utils.py +++ b/csp-lmc-mid/tests/integration/utils.py @@ -33,7 +33,7 @@ class Probe: """ device_attr = self.proxy.read_attribute(self.attr_name) self.current_state = device_attr.value - LOGGER.debug("attr_name: {} current_state:{}".format(self.attr_name, self.current_state)) + #LOGGER.debug("attr_name: {} current_state:{}".format(self.attr_name, self.current_state)) def is_satisfied(self): """ diff --git a/csp-lmc-mid/tests/test_data/configScan_sub1.json b/csp-lmc-mid/tests/test_data/configScan_sub1.json new file mode 100644 index 0000000..45f56b4 --- /dev/null +++ b/csp-lmc-mid/tests/test_data/configScan_sub1.json @@ -0,0 +1,63 @@ +{ + "id": "sbi-mvp01-20200325-00001-science_A", + "frequencyBand": "1", + "delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray01/delayModel", + + "fsp": [ + { + "fspID": 1, + "functionMode": "CORR", + "frequencySliceID": 1, + "corrBandwidth": 0, + "integrationTime": 140, + "fspChannelOffset": 0, + "channelAveragingMap": [ + [0, 1], + [744, 1], + [1488, 1], + [2232, 1], + [2976, 1], + [3720, 1], + [4464, 1], + [5208, 1], + [5952, 1], + [6696, 1], + [7440, 1], + [8184, 1], + [8928, 1], + [9672, 1], + [10416, 1], + [11160, 1], + [11904, 1], + [12648, 1], + [13392, 1], + [14136, 1] + ], + "outputLinkMap": [ + [0, 4], + [744, 8], + [1480, 12], + [2234, 16], + [2978, 20], + [3722, 24], + [4466, 28], + [5208, 32], + [5952, 36], + [6696, 40], + [7440, 44], + [8184, 48], + [8928, 52], + [9672, 56], + [10416, 60], + [11160, 64], + [11904, 68], + [12648, 72], + [13392, 76], + [14136, 80] + ], + "outputHost": [[0, "192.168.0.1"], [8184, "192.168.0.2"]], + "outputMac": [[0, "06-00-00-00-00-01"]], + "outputPort": [[0, 9000, 1], [8184, 9000, 1]] + } + ] +} diff --git a/csp-lmc-mid/tests/test_data/configScan_sub2.json b/csp-lmc-mid/tests/test_data/configScan_sub2.json new file mode 100644 index 0000000..be27a2a --- /dev/null +++ b/csp-lmc-mid/tests/test_data/configScan_sub2.json @@ -0,0 +1,63 @@ +{ + "id": "sbi-mvp01-20200325-00001-science_A", + "frequencyBand": "2", + "delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray01/delayModel", + + "fsp": [ + { + "fspID": 1, + "functionMode": "CORR", + "frequencySliceID": 1, + "corrBandwidth": 0, + "integrationTime": 140, + "fspChannelOffset": 0, + "channelAveragingMap": [ + [0, 1], + [744, 1], + [1488, 1], + [2232, 1], + [2976, 1], + [3720, 1], + [4464, 1], + [5208, 1], + [5952, 1], + [6696, 1], + [7440, 1], + [8184, 1], + [8928, 1], + [9672, 1], + [10416, 1], + [11160, 1], + [11904, 1], + [12648, 1], + [13392, 1], + [14136, 1] + ], + "outputLinkMap": [ + [0, 4], + [744, 8], + [1480, 12], + [2234, 16], + [2978, 20], + [3722, 24], + [4466, 28], + [5208, 32], + [5952, 36], + [6696, 40], + [7440, 44], + [8184, 48], + [8928, 52], + [9672, 56], + [10416, 60], + [11160, 64], + [11904, 68], + [12648, 72], + [13392, 76], + [14136, 80] + ], + "outputHost": [[0, "192.168.0.3"], [8184, "192.168.0.4"]], + "outputMac": [[0, "06-00-00-00-00-01"]], + "outputPort": [[0, 9000, 1], [8184, 9000, 1]] + } + ] +} diff --git a/csp-lmc-mid/tests/test_data/test_ConfigureScan_ADR4.json b/csp-lmc-mid/tests/test_data/test_ConfigureScan_ADR4.json new file mode 100644 index 0000000..f3c12a6 --- /dev/null +++ b/csp-lmc-mid/tests/test_data/test_ConfigureScan_ADR4.json @@ -0,0 +1,77 @@ +{ + "id": "sbi-mvp01-20200325-00002-science_A", + "frequencyBand": "1", + "delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray01/delayModel", + + "fsp": [ + { + "fspID": 1, + "functionMode": "CORR", + "frequencySliceID": 1, + "corrBandwidth": 0, + "integrationTime": 140, + "fspChannelOffset": 0, + "channelAveragingMap": [ + [0, 1], + [744, 1], + [1488, 1], + [2232, 1], + [2976, 1], + [3720, 1], + [4464, 1], + [5208, 1], + [5952, 1], + [6696, 1], + [7440, 1], + [8184, 1], + [8928, 1], + [9672, 1], + [10416, 1], + [11160, 1], + [11904, 1], + [12648, 1], + [13392, 1], + [14136, 1] + ], + "outputLinkMap": [ + [0, 4], + [744, 8], + [1480, 12], + [2234, 16], + [2978, 20], + [3722, 24], + [4466, 28], + [5208, 32], + [5952, 36], + [6696, 40], + [7440, 44], + [8184, 48], + [8928, 52], + [9672, 56], + [10416, 60], + [11160, 64], + [11904, 68], + [12648, 72], + [13392, 76], + [14136, 80] + ], + "outputHost": [[0, "192.168.0.1"], [8184, "192.168.0.2"]], + "outputMac": [[0, "06-00-00-00-00-01"]], + "outputPort": [[0, 9000, 1], [8184, 9000, 1]] + }, + { + "fspID":2, + "functionMode":"CORR", + "frequencySliceID":2, + "integrationTime":1400, + "corrBandwidth":1, + "channelAveragingMap":[[0,2],[744,0]], + "fspChannelOffset":744, + "outputLinkMap":[[0,4],[200,5]], + "zoomWindowTuning":650000, + "outputHost": [[0, "192.168.0.1"], [8184, "192.168.0.2"]], + "outputMac": [[0, "06-00-00-00-00-01"]], + "outputPort": [[0, 9000, 1], [8184, 9000, 1]] + } + ] +} diff --git a/csp-lmc-mid/tests/test_data/test_ConfigureScan_basic.json b/csp-lmc-mid/tests/test_data/test_ConfigureScan_basic.json new file mode 100644 index 0000000..45f56b4 --- /dev/null +++ b/csp-lmc-mid/tests/test_data/test_ConfigureScan_basic.json @@ -0,0 +1,63 @@ +{ + "id": "sbi-mvp01-20200325-00001-science_A", + "frequencyBand": "1", + "delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray01/delayModel", + + "fsp": [ + { + "fspID": 1, + "functionMode": "CORR", + "frequencySliceID": 1, + "corrBandwidth": 0, + "integrationTime": 140, + "fspChannelOffset": 0, + "channelAveragingMap": [ + [0, 1], + [744, 1], + [1488, 1], + [2232, 1], + [2976, 1], + [3720, 1], + [4464, 1], + [5208, 1], + [5952, 1], + [6696, 1], + [7440, 1], + [8184, 1], + [8928, 1], + [9672, 1], + [10416, 1], + [11160, 1], + [11904, 1], + [12648, 1], + [13392, 1], + [14136, 1] + ], + "outputLinkMap": [ + [0, 4], + [744, 8], + [1480, 12], + [2234, 16], + [2978, 20], + [3722, 24], + [4466, 28], + [5208, 32], + [5952, 36], + [6696, 40], + [7440, 44], + [8184, 48], + [8928, 52], + [9672, 56], + [10416, 60], + [11160, 64], + [11904, 68], + [12648, 72], + [13392, 76], + [14136, 80] + ], + "outputHost": [[0, "192.168.0.1"], [8184, "192.168.0.2"]], + "outputMac": [[0, "06-00-00-00-00-01"]], + "outputPort": [[0, 9000, 1], [8184, 9000, 1]] + } + ] +} diff --git a/csp-lmc-mid/tests/test_data/test_ConfigureScan_invalid_cbf_json.json b/csp-lmc-mid/tests/test_data/test_ConfigureScan_invalid_cbf_json.json new file mode 100644 index 0000000..9a68e25 --- /dev/null +++ b/csp-lmc-mid/tests/test_data/test_ConfigureScan_invalid_cbf_json.json @@ -0,0 +1,63 @@ +{ + "id": "sbi-mvp01-20200325-00001-science_A", + "frequencyBand": "6", + "delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray01/delayModel", + + "fsp": [ + { + "fspID": 1, + "functionMode": "CORR", + "frequencySliceID": 1, + "corrBandwidth": 0, + "integrationTime": 140, + "fspChannelOffset": 0, + "channelAveragingMap": [ + [0, 1], + [744, 1], + [1488, 1], + [2232, 1], + [2976, 1], + [3720, 1], + [4464, 1], + [5208, 1], + [5952, 1], + [6696, 1], + [7440, 1], + [8184, 1], + [8928, 1], + [9672, 1], + [10416, 1], + [11160, 1], + [11904, 1], + [12648, 1], + [13392, 1], + [14136, 1] + ], + "outputLinkMap": [ + [0, 4], + [744, 8], + [1480, 12], + [2234, 16], + [2978, 20], + [3722, 24], + [4466, 28], + [5208, 32], + [5952, 36], + [6696, 40], + [7440, 44], + [8184, 48], + [8928, 52], + [9672, 56], + [10416, 60], + [11160, 64], + [11904, 68], + [12648, 72], + [13392, 76], + [14136, 80] + ], + "outputHost": [[0, "192.168.0.1"], [8184, "192.168.0.2"]], + "outputMac": [[0, "06-00-00-00-00-01"]], + "outputPort": [[0, 9000, 1], [8184, 9000, 1]] + } + ] +} diff --git a/csp-lmc-mid/tests/test_data/test_ConfigureScan_without_configID.json b/csp-lmc-mid/tests/test_data/test_ConfigureScan_without_configID.json new file mode 100644 index 0000000..c3a9ce2 --- /dev/null +++ b/csp-lmc-mid/tests/test_data/test_ConfigureScan_without_configID.json @@ -0,0 +1,62 @@ +{ + "frequencyBand": "1", + "delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray01/delayModel", + + "fsp": [ + { + "fspID": 1, + "functionMode": "CORR", + "frequencySliceID": 1, + "corrBandwidth": 0, + "integrationTime": 140, + "fspChannelOffset": 0, + "channelAveragingMap": [ + [0, 1], + [744, 1], + [1488, 1], + [2232, 1], + [2976, 1], + [3720, 1], + [4464, 1], + [5208, 1], + [5952, 1], + [6696, 1], + [7440, 1], + [8184, 1], + [8928, 1], + [9672, 1], + [10416, 1], + [11160, 1], + [11904, 1], + [12648, 1], + [13392, 1], + [14136, 1] + ], + "outputLinkMap": [ + [0, 4], + [744, 8], + [1480, 12], + [2234, 16], + [2978, 20], + [3722, 24], + [4466, 28], + [5208, 32], + [5952, 36], + [6696, 40], + [7440, 44], + [8184, 48], + [8928, 52], + [9672, 56], + [10416, 60], + [11160, 64], + [11904, 68], + [12648, 72], + [13392, 76], + [14136, 80] + ], + "outputHost": [[0, "192.168.0.1"], [8184, "192.168.0.2"]], + "outputMac": [[0, "06-00-00-00-00-01"]], + "outputPort": [[0, 9000, 1], [8184, 9000, 1]] + } + ] +} diff --git a/csp-lmc-mid/tests/test_data/test_ConfigureScan_without_outputlink.json b/csp-lmc-mid/tests/test_data/test_ConfigureScan_without_outputlink.json new file mode 100644 index 0000000..61a121b --- /dev/null +++ b/csp-lmc-mid/tests/test_data/test_ConfigureScan_without_outputlink.json @@ -0,0 +1,41 @@ +{ + "id": "sbi-mvp01-20200325-00001-science_A", + "frequencyBand": "1", + "delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray01/delayModel", + + "fsp": [ + { + "fspID": 1, + "functionMode": "CORR", + "frequencySliceID": 1, + "corrBandwidth": 0, + "integrationTime": 140, + "fspChannelOffset": 0, + "channelAveragingMap": [ + [0, 1], + [744, 1], + [1488, 1], + [2232, 1], + [2976, 1], + [3720, 1], + [4464, 1], + [5208, 1], + [5952, 1], + [6696, 1], + [7440, 1], + [8184, 1], + [8928, 1], + [9672, 1], + [10416, 1], + [11160, 1], + [11904, 1], + [12648, 1], + [13392, 1], + [14136, 1] + ], + "outputHost": [[0, "192.168.0.1"], [8184, "192.168.0.2"]], + "outputMac": [[0, "06-00-00-00-00-01"]], + "outputPort": [[0, 9000, 1], [8184, 9000, 1]] + } + ] +} diff --git a/csp-lmc-mid/tests/unit/midcspsubarray_unit_test.py b/csp-lmc-mid/tests/unit/midcspsubarray_unit_test.py index db56b1d..b920637 100644 --- a/csp-lmc-mid/tests/unit/midcspsubarray_unit_test.py +++ b/csp-lmc-mid/tests/unit/midcspsubarray_unit_test.py @@ -1097,7 +1097,7 @@ def raise_exception(command_name): def load_json_file(file_name): print(file_path) print(os.path.dirname(__file__)) - path= os.path.join(os.path.dirname(__file__), '../acceptance_tests' , file_name) + path= os.path.join(os.path.dirname(__file__), '../test_data' , file_name) with open(path, 'r') as f: configuration_string = f.read().replace("\n", "") return configuration_string diff --git a/csp-lmc-mid/tests/unit/utils.py b/csp-lmc-mid/tests/unit/utils.py index 6d90a73..c65e226 100644 --- a/csp-lmc-mid/tests/unit/utils.py +++ b/csp-lmc-mid/tests/unit/utils.py @@ -33,7 +33,7 @@ class Probe: """ device_attr = self.proxy.read_attribute(self.attr_name) self.current_state = device_attr.value - LOGGER.info("attr_name: {} current_state:{}".format(self.attr_name, self.current_state)) + #LOGGER.info("attr_name: {} current_state:{}".format(self.attr_name, self.current_state)) def is_satisfied(self): """ diff --git a/csp-lmc-mid/tools/adr8_cbf_plot.py b/csp-lmc-mid/tools/adr8_cbf_plot.py new file mode 100644 index 0000000..b130349 --- /dev/null +++ b/csp-lmc-mid/tools/adr8_cbf_plot.py @@ -0,0 +1,138 @@ +from threading import Thread +import tango +import time +import collections +import matplotlib.pyplot as plt +import matplotlib.animation as animation +from matplotlib.widgets import Button +#import struct +from tango import EventType + + +class attributePlot: + def __init__(self, plotLength = 100, device='mid_csp/elt/subarray_01'): + self.plotMaxLength = plotLength + self.data = collections.deque([0] * plotLength, maxlen=plotLength) + self.cbf_data = collections.deque([0] * plotLength, maxlen=plotLength) + self.test_number = 0 + self.previous_test_num = 0 + self.plotTimer = 0 + self.previousTimer = 0 + self.proxy = 0 + self.proxy_cbf = 0 + self.device = device + self.obs_state = 0 + self.cbf_obs_state = 0 + self.anim = None + try: + self.proxy = tango.DeviceProxy("mid_csp/elt/subarray_01") + self.cbf_proxy = tango.DeviceProxy("mid_csp_cbf/sub_elt/subarray_01") + self.proxy.testNumber = 0 + print('Connected to device {}'.format(device)) + except: + print("Failed to connect to device {}".format(device) ) + + def readAttributeStart(self): + if self.proxy: + self.proxy.subscribe_event("obsState", tango.EventType.CHANGE_EVENT, + self.attributes_change_evt_cb, + stateless=False) + self.proxy.subscribe_event("testNumber", tango.EventType.CHANGE_EVENT, + self.attributes_change_evt_cb, + stateless=False) + if self.cbf_proxy: + self.cbf_proxy.subscribe_event("obsState", tango.EventType.CHANGE_EVENT, + self.attributes_change_evt_cb, + stateless=False) + + def getAttributeData(self, frame, lines, cbf_lines, lineValueText, lineLabel, timeText): + currentTimer = time.perf_counter() + self.plotTimer = int((currentTimer - self.previousTimer) * 1000) # the first reading will be erroneous + self.previousTimer = currentTimer + #timeText.set_text('Plot Interval = ' + str(self.plotTimer) + 'ms') + self.data.append(self.obs_state) # we get the latest data point and append it to our array + self.cbf_data.append(self.cbf_obs_state) + lines.set_data(range(self.plotMaxLength), self.data) + cbf_lines.set_data(range(self.plotMaxLength), self.cbf_data) + #lineValueText.set_text('[' + lineLabel + '] = ' + str(self.obs_state)) + if self.test_number != self.previous_test_num: + lineValueText.set_text('[Test number] = ' + str(self.test_number)) + + def attributes_change_evt_cb(self, evt): + dev_name = evt.device.dev_name() + if not evt.err: + try: + if evt.attr_value.name.lower() == "obsstate": + if 'cbf' in dev_name: + self.cbf_obs_state = evt.attr_value.value + self.cbf_data.append(self.cbf_obs_state) + self.cbf_data.append(self.cbf_obs_state) + self.data.append(self.obs_state) + self.data.append(self.obs_state) + else : + self.obs_state = evt.attr_value.value + # we get the latest data point and append it to our array + self.data.append(self.obs_state) + self.data.append(self.obs_state) + self.cbf_data.append(self.cbf_obs_state) + self.cbf_data.append(self.cbf_obs_state) + if evt.attr_value.name.lower() == "testnumber": + self.previous_test_num = self.test_number + self.test_number = evt.attr_value.value + #print("Received event on {}/{}: {}".format(dev_name, + # str(evt.attr_value.name), + # str(evt.attr_value.value))) + except tango.DevFailed as df: + self.logger.error(str(df.args[0].desc)) + except Exception as except_occurred: + self.logger.error(str(except_occurred)) + else: + for item in evt.errors: + if item.reason == "API_EventTimeout": + print("API_EventTimeout") + def on_press(self, event): + if event.key == 'x': + self.anim.event_source.stop() + if event.key == 'z': + self.anim.event_source.start() + if event.key == 'escape': + exit() + +def main(): + maxPlotLength = 200 + s = attributePlot(maxPlotLength, 'mid_csp/elt/subarray_01') # initializes all required variables + s.readAttributeStart() # starts background thread + + # plotting starts below + pltInterval = 300 # Period at which the plot animation updates [ms] + xmin = 0 + xmax = maxPlotLength + ymin = -1 + ymax = 12 + fig = plt.figure("MID CSP Subarray ADR-8 transitions") + fig.set_size_inches(18.5, 8.5) + ax = plt.axes(xlim=(xmin, xmax), ylim=(ymin, ymax )) + plt.grid() + ax.set_title('obsState real-time graph') + ax.set_xlabel("time") + ax.set_ylabel("obsState") + plt.yticks(range(11), ('EMPTY', 'RESOURCING', 'IDLE', 'CONFIGURING', 'READY', 'SCANNING', 'ABORTING', 'ABORTED', 'RESETTING', 'FAULT', 'RESTARTING')) + + lineLabel = 'CSP obsState' + cbflineLabel = 'CBF obsState' + timeText = ax.text(0.50, 0.95, '', transform=ax.transAxes) + lines = ax.plot([], [], label=lineLabel)[0] + lineValueText = ax.text(0.50, 0.90, '', transform=ax.transAxes) + cbf_lines = ax.plot([], [], 'r-', label=cbflineLabel)[0] + fig.canvas.mpl_connect('key_press_event', s.on_press) + #s.anim = animation.FuncAnimation(fig, s.getAttributeData, fargs=(lines, lineValueText, lineLabel, timeText), interval=pltInterval) # fargs has to be a tuple + s.anim = animation.FuncAnimation(fig, s.getAttributeData, fargs=(lines, cbf_lines, lineValueText, lineLabel, ''), interval=pltInterval) # fargs has to be a tuple + plt.legend(loc="upper left") + plt.show() + exit() + + + +if __name__ == '__main__': + main() + diff --git a/csp-lmc-mid/tools/adr8_plot.py b/csp-lmc-mid/tools/adr8_plot.py new file mode 100644 index 0000000..06eed2f --- /dev/null +++ b/csp-lmc-mid/tools/adr8_plot.py @@ -0,0 +1,119 @@ +from threading import Thread +import tango +import time +import collections +import matplotlib.pyplot as plt +import matplotlib.animation as animation +from matplotlib.widgets import Button +#import struct +from tango import EventType + + +class attributePlot: + def __init__(self, plotLength = 100, device='mid_csp/elt/subarray_01'): + self.plotMaxLength = plotLength + self.data = collections.deque([0] * plotLength, maxlen=plotLength) + self.test_number = 0 + self.previous_test_num = 0 + self.plotTimer = 0 + self.previousTimer = 0 + self.proxy = 0 + self.device = device + self.anim = None + try: + self.proxy = tango.DeviceProxy("mid_csp/elt/subarray_01") + self.proxy.testNumber = 0 + print('Connected to device {}'.format(device)) + except: + print("Failed to connect to device {}".format(device) ) + + def readAttributeStart(self): + if self.proxy: + self.proxy.subscribe_event("obsState", tango.EventType.CHANGE_EVENT, + self.attributes_change_evt_cb, + stateless=False) + self.proxy.subscribe_event("testNumber", tango.EventType.CHANGE_EVENT, + self.attributes_change_evt_cb, + stateless=False) + + def getAttributeData(self, frame, lines, lineValueText, lineLabel, timeText): + currentTimer = time.perf_counter() + self.plotTimer = int((currentTimer - self.previousTimer) * 1000) # the first reading will be erroneous + self.previousTimer = currentTimer + #timeText.set_text('Plot Interval = ' + str(self.plotTimer) + 'ms') + self.data.append(self.obs_state) # we get the latest data point and append it to our array + #plt.annotate(test_label, # this is the text + # (x, 5), # this is the point to label + # textcoords="offset points", # how to position the text + # xytext=(0,10), # distance from text to points (x,y) + # ha='center') + lines.set_data(range(self.plotMaxLength), self.data) + #lineValueText.set_text('[' + lineLabel + '] = ' + str(self.obs_state)) + if self.test_number != self.previous_test_num: + lineValueText.set_text('[Test number] = ' + str(self.test_number)) + def attributes_change_evt_cb(self, evt): + dev_name = evt.device.dev_name() + if not evt.err: + try: + if evt.attr_value.name.lower() == "obsstate": + self.obs_state = evt.attr_value.value + self.data.append(self.obs_state) # we get the latest data point and append it to our array + self.data.append(self.obs_state) # we get the latest data point and append it to our array + if evt.attr_value.name.lower() == "testnumber": + self.previous_test_num = self.test_number + self.test_number = evt.attr_value.value + #print("Received event on {}/{}: {}".format(dev_name, + # str(evt.attr_value.name), + # str(evt.attr_value.value))) + except tango.DevFailed as df: + self.logger.error(str(df.args[0].desc)) + except Exception as except_occurred: + self.logger.error(str(except_occurred)) + else: + for item in evt.errors: + if item.reason == "API_EventTimeout": + print("API_EventTimeout") + def on_press(self, event): + if event.key == 'x': + self.anim.event_source.stop() + if event.key == 'z': + self.anim.event_source.start() + if event.key == 'escape': + exit() + +def main(): + maxPlotLength = 200 + s = attributePlot(maxPlotLength, 'mid_csp/elt/subarray_01') # initializes all required variables + s.readAttributeStart() # starts background thread + + # plotting starts below + pltInterval = 100 # Period at which the plot animation updates [ms] + xmin = 0 + xmax = maxPlotLength + ymin = -1 + ymax = 12 + fig = plt.figure("MID CSP Subarray ADR-8 transitions") + fig.set_size_inches(18.5, 8.5) + ax = plt.axes(xlim=(xmin, xmax), ylim=(ymin, ymax )) + plt.grid() + ax.set_title('obsState real-time graph') + ax.set_xlabel("time") + ax.set_ylabel("obsState") + plt.yticks(range(11), ('EMPTY', 'RESOURCING', 'IDLE', 'CONFIGURING', 'READY', 'SCANNING', 'ABORTING', 'ABORTED', 'RESETTING', 'FAULT', 'RESTARTING')) + + lineLabel = 'obsState' + timeText = ax.text(0.50, 0.95, '', transform=ax.transAxes) + lines = ax.plot([], [], label=lineLabel)[0] + lineValueText = ax.text(0.50, 0.90, '', transform=ax.transAxes) + fig.canvas.mpl_connect('key_press_event', s.on_press) + #s.anim = animation.FuncAnimation(fig, s.getAttributeData, fargs=(lines, lineValueText, lineLabel, timeText), interval=pltInterval) # fargs has to be a tuple + s.anim = animation.FuncAnimation(fig, s.getAttributeData, fargs=(lines, lineValueText, lineLabel, ''), interval=pltInterval) # fargs has to be a tuple + plt.legend(loc="upper left") + plt.show() + exit() + + + +if __name__ == '__main__': + main() + -- GitLab From 35576f0283a62fe08c602ea6147f9725797bc645 Mon Sep 17 00:00:00 2001 From: toor Date: Thu, 17 Sep 2020 08:58:13 +0200 Subject: [PATCH 12/43] CT-147: try to fix problem in running test pipeline --- csp-lmc-mid/.gitlab-ci.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index 28cfc4a..9772346 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -103,21 +103,13 @@ integration:csp-lmc-mid: tags: - auto-k8sv2 extends: .test - image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest + image: nexus.engageska-portugal.pt/ska-docker/deploy:0.4.1 script: - - curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.2/bin/linux/amd64/kubectl - - chmod +x ./kubectl - - sudo mv ./kubectl /usr/local/bin/kubectl - - curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 - - chmod 700 get_helm.sh - - ./get_helm.sh - - kubectl get pod --all-namespaces - - kubectl get namespaces - cd $BUILD_PATH - - export KUBE_NAMESPACE="ci-$CI_COMMIT_SHORT_SHA" - make k8s_test + environment: + name: test after_script: - - export KUBE_NAMESPACE="ci-$CI_COMMIT_SHORT_SHA" - cd $BUILD_PATH - pwd - make delete -- GitLab From c949b9fffd0538d92545f182e57d0cf6b0b03af1 Mon Sep 17 00:00:00 2001 From: Matteo Di Carlo Date: Thu, 17 Sep 2020 07:23:27 +0000 Subject: [PATCH 13/43] update tango-base --- csp-lmc-mid/charts/mid-csp/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csp-lmc-mid/charts/mid-csp/Chart.yaml b/csp-lmc-mid/charts/mid-csp/Chart.yaml index 5befbd7..12a2909 100644 --- a/csp-lmc-mid/charts/mid-csp/Chart.yaml +++ b/csp-lmc-mid/charts/mid-csp/Chart.yaml @@ -6,7 +6,7 @@ version: 0.1.0 icon: https://www.skatelescope.org/wp-content/uploads/2016/07/09545_NEW_LOGO_2014.png dependencies: - name: tango-base - version: 0.1.1 + version: 0.1.2 repository: https://gitlab.com/ska-telescope/skampi/-/raw/master/repository condition: tango-base.enabled - name: csp-proto -- GitLab From 31b8542431c4113de75dca4618cf82c0ed6ddf60 Mon Sep 17 00:00:00 2001 From: toor Date: Thu, 17 Sep 2020 10:03:44 +0200 Subject: [PATCH 14/43] CT-147: updated import in unit tests --- .../tests/unit/midcspsubarray_unit_test.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/csp-lmc-mid/tests/unit/midcspsubarray_unit_test.py b/csp-lmc-mid/tests/unit/midcspsubarray_unit_test.py index b920637..8fb9c1a 100644 --- a/csp-lmc-mid/tests/unit/midcspsubarray_unit_test.py +++ b/csp-lmc-mid/tests/unit/midcspsubarray_unit_test.py @@ -15,7 +15,7 @@ from tango import DevState, DevFailed, DeviceProxy import csp_lmc_common import csp_lmc_mid from utils import Probe, Poller -from csp_lmc_common.CspSubarray import CspSubarray +from csp_lmc_common import CspSubarray from csp_lmc_mid.MidCspSubarrayBase import MidCspSubarrayBase file_path = os.path.dirname(os.path.abspath(__file__)) @@ -549,7 +549,7 @@ def test_midcspsubarray_obsstate_AFTER_cbfsubarray_fault_during_configuration(): #cbf_subarray_device_proxy_mock.Configure.side_effect = return_failed with mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.AddReceptorsCommand.do') as mock_do,\ mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.OnCommand.do') as mock_on_do,\ - mock.patch('csp_lmc_common.CspSubarray.CspSubarray._get_expected_delay') as mock_delay_expected,\ + mock.patch('csp_lmc_common.CspSubarray._get_expected_delay') as mock_delay_expected,\ mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.__len__') as mock_len: mock_len.return_value = len(receptor_list) mock_do.return_value = (ResultCode.OK, "AddReceptors OK") @@ -597,7 +597,7 @@ def test_midcspsubarray_obsstate_AFTER_abort_request_during_configuration(): cbf_subarray_device_proxy_mock.Abort.side_effect = return_ok with mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.AddReceptorsCommand.do') as mock_do,\ mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.OnCommand.do') as mock_on_do,\ - mock.patch('csp_lmc_common.CspSubarray.CspSubarray._get_expected_delay') as mock_delay_expected,\ + mock.patch('csp_lmc_common.CspSubarray._get_expected_delay') as mock_delay_expected,\ mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.__len__') as mock_len: mock_len.return_value = len(receptor_list) mock_do.return_value = (ResultCode.OK, "AddReceptors OK") @@ -645,7 +645,7 @@ def test_midcspsubarray_obsstate_WHEN_cbfsubarray_is_in_fault_during_abort_reque #cbf_subarray_device_proxy_mock.Abort.side_effect = return_failed with mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.AddReceptorsCommand.do') as mock_do,\ mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.OnCommand.do') as mock_on_do,\ - mock.patch('csp_lmc_common.CspSubarray.CspSubarray._get_expected_delay') as mock_delay_expected,\ + mock.patch('csp_lmc_common.CspSubarray._get_expected_delay') as mock_delay_expected,\ mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.__len__') as mock_len: mock_len.return_value = len(receptor_list) mock_do.return_value = (ResultCode.OK, "AddReceptors OK") @@ -700,7 +700,7 @@ def test_midcspsubarray_obsstate_WHEN_abort_invoked_in_resetting(): #cbf_subarray_device_proxy_mock.Abort.side_effect = return_failed with mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.AddReceptorsCommand.do') as mock_do,\ mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.OnCommand.do') as mock_on_do,\ - mock.patch('csp_lmc_common.CspSubarray.CspSubarray._get_expected_delay') as mock_delay_expected,\ + mock.patch('csp_lmc_common.CspSubarray._get_expected_delay') as mock_delay_expected,\ mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.__len__') as mock_len: mock_len.return_value = len(receptor_list) mock_do.return_value = (ResultCode.OK, "AddReceptors OK") @@ -751,7 +751,7 @@ def test_midcspsubarray_obsstate_WHEN_restart_invoked_after_cspsubarray_aborted( proxies_to_mock=proxies_to_mock) as tango_context: with mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.AddReceptorsCommand.do') as mock_do,\ mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.OnCommand.do') as mock_on_do,\ - mock.patch('csp_lmc_common.CspSubarray.CspSubarray._get_expected_delay') as mock_delay_expected,\ + mock.patch('csp_lmc_common.CspSubarray._get_expected_delay') as mock_delay_expected,\ mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.__len__') as mock_len: mock_len.return_value = len(receptor_list) mock_do.return_value = (ResultCode.OK, "AddReceptors OK") @@ -829,7 +829,7 @@ def test_midcspsubarray_obsstate_WHEN_cbfsubarray_abort_returns_failed(): cbf_subarray_device_proxy_mock.Abort.side_effect = return_failed with mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.AddReceptorsCommand.do') as mock_do,\ mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.OnCommand.do') as mock_on_do,\ - mock.patch('csp_lmc_common.CspSubarray.CspSubarray._get_expected_delay') as mock_delay_expected,\ + mock.patch('csp_lmc_common.CspSubarray._get_expected_delay') as mock_delay_expected,\ mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.__len__') as mock_len: mock_len.return_value = len(receptor_list) mock_do.return_value = (ResultCode.OK, "AddReceptors OK") @@ -875,7 +875,7 @@ def test_midcspsubarray_obsstate_WHEN_timeout_in_abort_request_during_configurin proxies_to_mock=proxies_to_mock) as tango_context: with mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.AddReceptorsCommand.do') as mock_do,\ mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.OnCommand.do') as mock_on_do,\ - mock.patch('csp_lmc_common.CspSubarray.CspSubarray._get_expected_delay') as mock_delay_expected,\ + mock.patch('csp_lmc_common.CspSubarray._get_expected_delay') as mock_delay_expected,\ mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.__len__') as mock_len: mock_len.return_value = len(receptor_list) mock_do.return_value = (ResultCode.OK, "AddReceptors OK") -- GitLab From 9616977ac4c7206b5ab28660d801026ee552c738 Mon Sep 17 00:00:00 2001 From: toor Date: Thu, 17 Sep 2020 10:22:32 +0200 Subject: [PATCH 15/43] CT-147: modified k8s.mk file to delete the charts repo --- csp-lmc-mid/.make/k8s.mk | 7 +++++++ .../charts/mid-csp/charts/csp-proto-0.5.3.tgz | Bin 10344 -> 0 bytes .../charts/mid-csp/charts/tango-base-0.1.1.tgz | Bin 8849 -> 0 bytes csp-lmc-mid/charts/mid-csp/requirements.lock | 9 --------- csp-lmc-mid/docker/.make/Makefile.mk | 5 ++++- csp-lmc-mid/docker/Dockerfile | 10 ---------- 6 files changed, 11 insertions(+), 20 deletions(-) delete mode 100644 csp-lmc-mid/charts/mid-csp/charts/csp-proto-0.5.3.tgz delete mode 100644 csp-lmc-mid/charts/mid-csp/charts/tango-base-0.1.1.tgz delete mode 100644 csp-lmc-mid/charts/mid-csp/requirements.lock delete mode 100644 csp-lmc-mid/docker/Dockerfile diff --git a/csp-lmc-mid/.make/k8s.mk b/csp-lmc-mid/.make/k8s.mk index 15673e2..52d4501 100644 --- a/csp-lmc-mid/.make/k8s.mk +++ b/csp-lmc-mid/.make/k8s.mk @@ -30,6 +30,13 @@ deploy: namespace mkcerts depends ## deploy the helm chart delete: ## delete the helm chart release @helm uninstall $(HELM_RELEASE) --namespace $(KUBE_NAMESPACE) + # if charts deployed locally, remove the repo charts files + # created in charts/mid-csp/charts directory + @if [ "a"$(CI_JOB_ID) == "a" ]; then \ + find ./charts -type f -name "tango*" -delete; \ + find ./charts -type f -name "csp-proto*" -delete; \ + find ./charts -type f -name "requirements.lock" -delete; \ + fi install: namespace mkcerts ## install the helm chart @helm install $(HELM_RELEASE) charts/$(HELM_CHART)/ \ diff --git a/csp-lmc-mid/charts/mid-csp/charts/csp-proto-0.5.3.tgz b/csp-lmc-mid/charts/mid-csp/charts/csp-proto-0.5.3.tgz deleted file mode 100644 index d1d4bcbed9648603e72a4e5703b208477035e334..0000000000000000000000000000000000000000 GIT binary patch literal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.lock b/csp-lmc-mid/charts/mid-csp/requirements.lock deleted file mode 100644 index 960fbce..0000000 --- a/csp-lmc-mid/charts/mid-csp/requirements.lock +++ /dev/null @@ -1,9 +0,0 @@ -dependencies: -- name: tango-base - repository: https://gitlab.com/ska-telescope/skampi/-/raw/master/repository - version: 0.1.1 -- name: csp-proto - repository: file://../csp-proto - version: 0.5.3 -digest: sha256:f1b7d43a364ae0179be5951171251ee99fac77741e03b381285b28a6cdcb6167 -generated: "2020-09-11T11:08:19.206867376+02:00" diff --git a/csp-lmc-mid/docker/.make/Makefile.mk b/csp-lmc-mid/docker/.make/Makefile.mk index 323b970..2925ad0 100644 --- a/csp-lmc-mid/docker/.make/Makefile.mk +++ b/csp-lmc-mid/docker/.make/Makefile.mk @@ -20,7 +20,7 @@ else NAME=$(PROJECT) endif -RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support +RELEASE_SUPPORT := $(shell cp ../.release . ;dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support ifeq ($(strip $(DOCKER_REGISTRY_HOST)),) DOCKER_REGISTRY_HOST = nexus.engageska-portugal.pt @@ -57,7 +57,10 @@ build: pre-build docker-build post-build ## build the application image pre-build: cp ../.release . + cp ../Dockerfile . post-build: + rm .release + rm Dockerfile pre-push: diff --git a/csp-lmc-mid/docker/Dockerfile b/csp-lmc-mid/docker/Dockerfile deleted file mode 100644 index 2456a5e..0000000 --- a/csp-lmc-mid/docker/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:9.3.2 AS buildenv -FROM nexus.engageska-portugal.pt/ska-docker/ska-python-runtime:9.3.2 AS runtime - -# create ipython profile to so that itango doesn't fail if ipython hasn't run yet -RUN ipython profile create - -ENV PATH=/home/tango/.local/bin:$PATH -RUN python3 -m pip install . --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple - -CMD ["/venv/bin/python","/app/csp_lmc_mid/MidCspMaster.py"] -- GitLab From 8ee60c9819827dc4b5898079af85788d160d5b81 Mon Sep 17 00:00:00 2001 From: toor Date: Thu, 17 Sep 2020 10:43:44 +0200 Subject: [PATCH 16/43] CT-147: tag the image with only the base version. Changed the tag in csp-proto chart values.yaml --- csp-lmc-mid/.make/release.mk | 5 +++++ csp-lmc-mid/charts/csp-proto/values.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/csp-lmc-mid/.make/release.mk b/csp-lmc-mid/.make/release.mk index 1abb8f1..66dbc7b 100644 --- a/csp-lmc-mid/.make/release.mk +++ b/csp-lmc-mid/.make/release.mk @@ -33,6 +33,7 @@ IMAGE=$(DOCKER_REGISTRY_HOST)/$(DOCKER_REGISTRY_USER)/$(NAME) VERSION=$(shell . $(RELEASE_SUPPORT) ; getVersion) TAG=$(shell . $(RELEASE_SUPPORT); getTag) +BASE_RELEASE=$(shell . $(RELEASE_SUPPORT) ;getRelease) SHELL=/bin/bash @@ -59,8 +60,12 @@ docker-build: .release if [ $$DOCKER_MAJOR -eq 1 ] && [ $$DOCKER_MINOR -lt 10 ] ; then \ echo docker tag -f $(IMAGE):$(VERSION) $(IMAGE):latest ;\ docker tag -f $(IMAGE):$(VERSION) $(IMAGE):latest ;\ + echo docker tag $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE) ;\ + docker tag $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE) ;\ else \ echo docker tag $(IMAGE):$(VERSION) $(IMAGE):latest ;\ + echo docker tag $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE) ;\ + docker tag $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE) ;\ docker tag $(IMAGE):$(VERSION) $(IMAGE):latest ; \ fi diff --git a/csp-lmc-mid/charts/csp-proto/values.yaml b/csp-lmc-mid/charts/csp-proto/values.yaml index 0224b03..26ce0e0 100644 --- a/csp-lmc-mid/charts/csp-proto/values.yaml +++ b/csp-lmc-mid/charts/csp-proto/values.yaml @@ -14,7 +14,7 @@ csplmc: image: registry: nexus.engageska-portugal.pt/ska-docker image: mid-csp-lmc - tag: latest + tag: 0.6.9 pullPolicy: IfNotPresent deviceServers: -- GitLab From a0580917c02fc929fc8f4b4725b75f01325dce93 Mon Sep 17 00:00:00 2001 From: toor Date: Thu, 17 Sep 2020 11:09:37 +0200 Subject: [PATCH 17/43] CT-147: commit the mid-csp image before testing. Imaged tagged with base version (x.y.z) and pushed always --- .gitlab-ci.yml | 2 +- csp-lmc-mid/.gitlab-ci.yml | 4 ---- csp-lmc-mid/.make/release.mk | 4 ++-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bebdd60..d6e5125 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,9 +42,9 @@ stages: - publish_common - build - linting + - publish - test - pages - - publish - release .install_pip: &install_pip |- diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index 9772346..2deb066 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -196,9 +196,5 @@ release csp-lmc-mid image: script: - cd $BUILD_PATH - make push - when: manual - only: - refs: - - master variables: BUILD_PATH: csp-lmc-mid diff --git a/csp-lmc-mid/.make/release.mk b/csp-lmc-mid/.make/release.mk index 66dbc7b..87043fc 100644 --- a/csp-lmc-mid/.make/release.mk +++ b/csp-lmc-mid/.make/release.mk @@ -80,8 +80,8 @@ release: check-status check-release build push push: pre-push do-push post-push ## push the image to the Docker registry do-push: -# docker push $(IMAGE):$(VERSION) - docker push $(IMAGE):latest + docker push $(IMAGE):$(BASE_RELEASE) +# docker push $(IMAGE):latest snapshot: build push -- GitLab From 6a99175d4b21854596ea1be57194e94145597470 Mon Sep 17 00:00:00 2001 From: toor Date: Thu, 17 Sep 2020 11:27:08 +0200 Subject: [PATCH 18/43] CT-147: fx releasing of the mid-csp image before testing. --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d6e5125..d1ed969 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,10 +42,10 @@ stages: - publish_common - build - linting - - publish + - release - test + - publish - pages - - release .install_pip: &install_pip |- apt-get -y update && apt-get install -yq curl python3-distutils -- GitLab From 5888bc7ef2ea441cf39a956418dc1039d85d773b Mon Sep 17 00:00:00 2001 From: toor Date: Thu, 17 Sep 2020 11:45:00 +0200 Subject: [PATCH 19/43] CT-147: use tango-builder docker image to push the new image on nexus. --- csp-lmc-mid/.gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index 2deb066..1a8db3d 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -188,9 +188,12 @@ publish:csp-lmc-mid: # Release csp-lmc-mid image on nexus # release csp-lmc-mid image: + stage: release + image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest + before_script: + - docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST tags: - docker-executor - stage: release dependencies: - build:csp-lmc-mid_image script: -- GitLab From 82b777993bd67f733f6c7ccd962a116463a7cf22 Mon Sep 17 00:00:00 2001 From: toor Date: Thu, 17 Sep 2020 12:16:20 +0200 Subject: [PATCH 20/43] CT-147: fix pages stage failure in pipeline execution --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d1ed969..6f11488 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -69,7 +69,7 @@ pages: stage: pages variables: COMMON_PATH: csp-lmc-common/ - MIDCSP_PATH: csp-lmc-mid/docker + MIDCSP_PATH: csp-lmc-mid/ script: - pwd - python3 -m pip install junitparser -- GitLab From b3f6c38a26a595c66b64a71606c3d9f07f413413 Mon Sep 17 00:00:00 2001 From: toor Date: Thu, 17 Sep 2020 14:55:45 +0200 Subject: [PATCH 21/43] CT-147: try to fix issue with pages stage (not working, yet) --- .gitlab-ci.yml | 3 +-- csp-lmc-mid/.gitlab-ci.yml | 15 +++++++++++++++ csp-lmc-mid/setup.cfg | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6f11488..d2ca940 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -80,9 +80,8 @@ pages: # path to all files is relative to the repository # that has been cloned during the build - cp -R $COMMON_PATH/build/ public - - ls -l public - cp -R $MIDCSP_PATH/build/* public - - ls -lR + - ls -lR public - junitparser merge public/reports/csp-lmc-common-unit-tests.xml public/reports/csp-lmc-mid-unit-tests.xml public/reports/unit-tests.xml - ls -lR - junitparser merge public/reports/csp-lmc-common-linting.xml public/reports/csp-lmc-mid-linting.xml public/reports/linting.xml diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index 1a8db3d..d3d5889 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -107,6 +107,7 @@ integration:csp-lmc-mid: script: - cd $BUILD_PATH - make k8s_test + - ls -lR environment: name: test after_script: @@ -184,6 +185,20 @@ publish:csp-lmc-mid: variables: BUILD_PATH: csp-lmc-mid +publish:helm-chart: + stage: publish + tags: + - docker-executor + dependencies: + - integration:csp-lmc-mid + script: + - cd $BUILD_PATH + - make package + variables: + BUILD_PATH: csp-lmc-mid + artifacts: + paths: + - ./$BUILD_PATH/build/ # # Release csp-lmc-mid image on nexus # diff --git a/csp-lmc-mid/setup.cfg b/csp-lmc-mid/setup.cfg index d7e22e1..3708eaa 100644 --- a/csp-lmc-mid/setup.cfg +++ b/csp-lmc-mid/setup.cfg @@ -26,7 +26,7 @@ addopts = --forked --cov-report=term --cov-report=html --cov-report=xml - --junitxml=build/reports/csp-lmc-mid-unit-tests.xml + --junitxml=csp-lmc-mid-unit-tests.xml console_output_style = progress junit_family=legacy filterwarnings = -- GitLab From 631c06c0cfbfc756ac113f14ae7351fe8e12afd8 Mon Sep 17 00:00:00 2001 From: Matteo Di Carlo Date: Thu, 17 Sep 2020 13:33:09 +0000 Subject: [PATCH 22/43] change runner --- csp-lmc-mid/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index 9772346..259acc0 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -101,7 +101,7 @@ build:csp-lmc-mid_image: integration:csp-lmc-mid: tags: - - auto-k8sv2 + - docker-executor extends: .test image: nexus.engageska-portugal.pt/ska-docker/deploy:0.4.1 script: -- GitLab From f02db72efb0d0943c4e7f25e7109b4667cb77c0e Mon Sep 17 00:00:00 2001 From: Matteo Di Carlo Date: Thu, 17 Sep 2020 13:47:46 +0000 Subject: [PATCH 23/43] 4DEBUG test first --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d2ca940..52c4d13 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,6 +36,7 @@ cache: # pages: move the metrics files to the right folder # release release the images for csp-lmc-low and mid (only manual) stages: + - test - build_common - linting_common - test_common @@ -43,7 +44,6 @@ stages: - build - linting - release - - test - publish - pages -- GitLab From 474bcbb591335f7145dccc7c5a6f9807e6d5383d Mon Sep 17 00:00:00 2001 From: Matteo Di Carlo Date: Thu, 17 Sep 2020 13:52:22 +0000 Subject: [PATCH 24/43] 4DEBUG keep namespace --- csp-lmc-mid/.gitlab-ci.yml | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index d866e22..2ae659e 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -107,14 +107,9 @@ integration:csp-lmc-mid: script: - cd $BUILD_PATH - make k8s_test - - ls -lR environment: name: test - after_script: - - cd $BUILD_PATH - - pwd - - make delete - - make delete_namespace + # linting stage # @@ -185,34 +180,21 @@ publish:csp-lmc-mid: variables: BUILD_PATH: csp-lmc-mid -publish:helm-chart: - stage: publish - tags: - - docker-executor - dependencies: - - integration:csp-lmc-mid - script: - - cd $BUILD_PATH - - make package - variables: - BUILD_PATH: csp-lmc-mid - artifacts: - paths: - - ./$BUILD_PATH/build/ # # Release csp-lmc-mid image on nexus # release csp-lmc-mid image: - stage: release - image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest - before_script: - - docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST tags: - docker-executor + stage: release dependencies: - build:csp-lmc-mid_image script: - cd $BUILD_PATH - make push + when: manual + only: + refs: + - master variables: BUILD_PATH: csp-lmc-mid -- GitLab From 2564427bc614de11823291346326a10e103d1f6f Mon Sep 17 00:00:00 2001 From: Matteo Di Carlo Date: Thu, 17 Sep 2020 14:02:12 +0000 Subject: [PATCH 25/43] timeout to 300s --- csp-lmc-mid/.gitlab-ci.yml | 6 +++++- csp-lmc-mid/.make/k8s.mk | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index 2ae659e..259acc0 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -109,7 +109,11 @@ integration:csp-lmc-mid: - make k8s_test environment: name: test - + after_script: + - cd $BUILD_PATH + - pwd + - make delete + - make delete_namespace # linting stage # diff --git a/csp-lmc-mid/.make/k8s.mk b/csp-lmc-mid/.make/k8s.mk index 52d4501..182fc29 100644 --- a/csp-lmc-mid/.make/k8s.mk +++ b/csp-lmc-mid/.make/k8s.mk @@ -175,7 +175,7 @@ wait: @echo "Waiting for device servers to be ready" @date @kubectl -n $(KUBE_NAMESPACE) get pods -l cspServer - @kubectl -n $(KUBE_NAMESPACE) wait --for=condition=ready --timeout=120s -l cspServer pods + @kubectl -n $(KUBE_NAMESPACE) wait --for=condition=ready --timeout=300s -l cspServer pods @date # -- GitLab From 11c734171e917618c82d9e1493889e6df1ce3064 Mon Sep 17 00:00:00 2001 From: Matteo Di Carlo Date: Thu, 17 Sep 2020 14:08:40 +0000 Subject: [PATCH 26/43] wait for job --- csp-lmc-mid/.make/k8s.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/csp-lmc-mid/.make/k8s.mk b/csp-lmc-mid/.make/k8s.mk index 182fc29..c762df8 100644 --- a/csp-lmc-mid/.make/k8s.mk +++ b/csp-lmc-mid/.make/k8s.mk @@ -175,6 +175,7 @@ wait: @echo "Waiting for device servers to be ready" @date @kubectl -n $(KUBE_NAMESPACE) get pods -l cspServer + @jobs=$$(kubectl get job --output=jsonpath={.items..metadata.name} -n $(KUBE_NAMESPACE)); kubectl wait job --for=condition=complete --timeout=300s $$jobs -n $(KUBE_NAMESPACE) @kubectl -n $(KUBE_NAMESPACE) wait --for=condition=ready --timeout=300s -l cspServer pods @date -- GitLab From 1e7832e8803fca9814f060de8e9b0a804ef8a80f Mon Sep 17 00:00:00 2001 From: Matteo Di Carlo Date: Thu, 17 Sep 2020 14:11:54 +0000 Subject: [PATCH 27/43] change default KUBE_NAMESPACE --- csp-lmc-mid/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csp-lmc-mid/Makefile b/csp-lmc-mid/Makefile index 7ba51c4..c72abd7 100644 --- a/csp-lmc-mid/Makefile +++ b/csp-lmc-mid/Makefile @@ -16,7 +16,7 @@ DSCONFIG_JSON_FILE ?= csp-lmc-mid/charts/csp-lmc-mid/data/configuration.json # KUBE_NAMESPACE defines the Kubernetes Namespace that will be deployed to # using Helm. If this does not already exist it will be created -KUBE_NAMESPACE ?= integration +KUBE_NAMESPACE ?= csp-proto # HELM_RELEASE is the release that all Kubernetes resources will be labelled # with -- GitLab From 61d6c8d064286f3ecdaefca1d173d7e39ea49bf0 Mon Sep 17 00:00:00 2001 From: Matteo Di Carlo Date: Thu, 17 Sep 2020 14:21:13 +0000 Subject: [PATCH 28/43] restore stage order --- .gitlab-ci.yml | 2 +- csp-lmc-mid/.gitlab-ci.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52c4d13..d2ca940 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,7 +36,6 @@ cache: # pages: move the metrics files to the right folder # release release the images for csp-lmc-low and mid (only manual) stages: - - test - build_common - linting_common - test_common @@ -44,6 +43,7 @@ stages: - build - linting - release + - test - publish - pages diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index 259acc0..8f9f31b 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -105,11 +105,13 @@ integration:csp-lmc-mid: extends: .test image: nexus.engageska-portugal.pt/ska-docker/deploy:0.4.1 script: + - export KUBE_NAMESPACE="csp-proto-$CI_COMMIT_SHORT_SHA" - cd $BUILD_PATH - make k8s_test environment: name: test after_script: + - export KUBE_NAMESPACE="csp-proto-$CI_COMMIT_SHORT_SHA" - cd $BUILD_PATH - pwd - make delete -- GitLab From 2d95b0dcb85a84ecf7a9b34340c42a71a8a70afd Mon Sep 17 00:00:00 2001 From: toor Date: Thu, 17 Sep 2020 16:39:11 +0200 Subject: [PATCH 29/43] CT-147: Still problem with pages. Removed a test on abort. --- csp-lmc-mid/.gitlab-ci.yml | 1 + csp-lmc-mid/setup.cfg | 2 +- csp-lmc-mid/tests/unit/midcspsubarray_unit_test.py | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index 8f9f31b..75bd46f 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -113,6 +113,7 @@ integration:csp-lmc-mid: after_script: - export KUBE_NAMESPACE="csp-proto-$CI_COMMIT_SHORT_SHA" - cd $BUILD_PATH + - ls -lR - pwd - make delete - make delete_namespace diff --git a/csp-lmc-mid/setup.cfg b/csp-lmc-mid/setup.cfg index 3708eaa..8e3da13 100644 --- a/csp-lmc-mid/setup.cfg +++ b/csp-lmc-mid/setup.cfg @@ -26,7 +26,7 @@ addopts = --forked --cov-report=term --cov-report=html --cov-report=xml - --junitxml=csp-lmc-mid-unit-tests.xml + --junitxml=build/csp-lmc-mid-unit-tests.xml console_output_style = progress junit_family=legacy filterwarnings = diff --git a/csp-lmc-mid/tests/unit/midcspsubarray_unit_test.py b/csp-lmc-mid/tests/unit/midcspsubarray_unit_test.py index 8fb9c1a..5867030 100644 --- a/csp-lmc-mid/tests/unit/midcspsubarray_unit_test.py +++ b/csp-lmc-mid/tests/unit/midcspsubarray_unit_test.py @@ -843,7 +843,6 @@ def test_midcspsubarray_obsstate_WHEN_cbfsubarray_abort_returns_failed(): event_subscription_map[cbf_subarray_state_attr](dummy_event) tango_context.device.Abort() assert tango_context.device.obsState == ObsState.FAULT -''' def test_midcspsubarray_obsstate_WHEN_timeout_in_abort_request_during_configuring(): """ @@ -893,7 +892,7 @@ def test_midcspsubarray_obsstate_WHEN_timeout_in_abort_request_during_configurin prober_obs_state = Probe(tango_context.device, 'timeoutExpiredFlag', True, f"Wrong CspSubarray state") Poller(10, 0.1).check(prober_obs_state) assert tango_context.device.obsState == ObsState.FAULT -''' + def test_midcspsubarray_obsstate_AFTER_configure_WITH_cbf_returning_FAULT(): """ Test the behavior of the MidCspSubarray when the command Configure -- GitLab From 37165d0d86f3d2ebb1c1e49020d35eaf5faef9c4 Mon Sep 17 00:00:00 2001 From: toor Date: Thu, 17 Sep 2020 16:58:54 +0200 Subject: [PATCH 30/43] CT-147: still fixing pages stage in pipeline. --- csp-lmc-mid/setup.cfg | 2 +- csp-lmc-mid/test-harness/Makefile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/csp-lmc-mid/setup.cfg b/csp-lmc-mid/setup.cfg index 8e3da13..d7e22e1 100644 --- a/csp-lmc-mid/setup.cfg +++ b/csp-lmc-mid/setup.cfg @@ -26,7 +26,7 @@ addopts = --forked --cov-report=term --cov-report=html --cov-report=xml - --junitxml=build/csp-lmc-mid-unit-tests.xml + --junitxml=build/reports/csp-lmc-mid-unit-tests.xml console_output_style = progress junit_family=legacy filterwarnings = diff --git a/csp-lmc-mid/test-harness/Makefile b/csp-lmc-mid/test-harness/Makefile index b10e569..60db74e 100644 --- a/csp-lmc-mid/test-harness/Makefile +++ b/csp-lmc-mid/test-harness/Makefile @@ -23,6 +23,7 @@ test: mv /app/integration-test.stdout ./build/csp-lmc-mid-setup-test.stdout; \ mv /app/htmlcov ./build/csp-lmc-mid_htmlcov; \ cp /app/coverage.xml ./build/coverage-csp-lmc-mid.xml; \ + cp /app/build/reports/csp-lmc-mid-unit-tests.xml ./build/reports; \ fi; #cd /build && coverage combine csp-lmc-mid_coverage csp-lmc-common_coverage && coverage xml -- GitLab From a4faa6f1817ec023b0462bdaba40b04d18228a80 Mon Sep 17 00:00:00 2001 From: toor Date: Fri, 18 Sep 2020 10:28:27 +0200 Subject: [PATCH 31/43] CT-147: add publihing of the csp-proto chart. --- csp-lmc-mid/.gitlab-ci.yml | 15 +++++++++++---- csp-lmc-mid/.make/k8s.mk | 5 +++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index 75bd46f..36c4969 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -187,6 +187,17 @@ publish:csp-lmc-mid: variables: BUILD_PATH: csp-lmc-mid +publish_chart: + variables: + CHARTS_TO_PUBLISH: csp-proto + stage: publish + tags: + - docker-executor + image: nexus.engageska-portugal.pt/ska-docker/deploy:0.4.1 + script: + - curl -s https://gitlab.com/ska-telescope/stupid/raw/master/scripts/publish-charts.sh | bash + - cd charts/ && make package + # # Release csp-lmc-mid image on nexus # @@ -199,9 +210,5 @@ release csp-lmc-mid image: script: - cd $BUILD_PATH - make push - when: manual - only: - refs: - - master variables: BUILD_PATH: csp-lmc-mid diff --git a/csp-lmc-mid/.make/k8s.mk b/csp-lmc-mid/.make/k8s.mk index c762df8..6b98f3f 100644 --- a/csp-lmc-mid/.make/k8s.mk +++ b/csp-lmc-mid/.make/k8s.mk @@ -127,6 +127,11 @@ localip: ## set local Minikube IP in /etc/hosts file for Ingress $(INGRESS_HOST echo "/etc/hosts is now: " `grep $(INGRESS_HOST) /etc/hosts` mkcerts: ## Make dummy certificates for $(INGRESS_HOST) and Ingress + @if [ ! -d charts/$(HELM_CHART)/secrets ]; then \ + mkdir -p charts/$(HELM_CHART)/secrets; \ + else \ + echo "Creating secrets directory in $(HELM_CHART)"; \ + fi @if [ ! -f charts/$(HELM_CHART)/secrets/tls.key ]; then \ openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 \ -keyout charts/$(HELM_CHART)/secrets/tls.key \ -- GitLab From 1c9b3b95e0fef4e8efc99ad8c3a76e652e516c81 Mon Sep 17 00:00:00 2001 From: Matteo Di Carlo Date: Fri, 18 Sep 2020 08:30:51 +0000 Subject: [PATCH 32/43] fix kube namespace --- csp-lmc-mid/.gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index 36c4969..360342f 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -105,13 +105,13 @@ integration:csp-lmc-mid: extends: .test image: nexus.engageska-portugal.pt/ska-docker/deploy:0.4.1 script: - - export KUBE_NAMESPACE="csp-proto-$CI_COMMIT_SHORT_SHA" + - export KUBE_NAMESPACE="ci-csp-proto-$CI_COMMIT_SHORT_SHA" - cd $BUILD_PATH - make k8s_test environment: name: test after_script: - - export KUBE_NAMESPACE="csp-proto-$CI_COMMIT_SHORT_SHA" + - export KUBE_NAMESPACE="ci-csp-proto-$CI_COMMIT_SHORT_SHA" - cd $BUILD_PATH - ls -lR - pwd -- GitLab From 8954556532ee1bcb81cf0b4824bc43e5fc843829 Mon Sep 17 00:00:00 2001 From: toor Date: Fri, 18 Sep 2020 11:24:39 +0200 Subject: [PATCH 33/43] CT-147: push the image during the pipeline build stage. Tag the image with the SHA git when on dev branch. --- csp-lmc-mid/.gitlab-ci.yml | 7 ++++++- csp-lmc-mid/.make/release.mk | 8 +++++++- csp-lmc-mid/charts/csp-proto/values.yaml | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index 360342f..c95bc10 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -39,7 +39,7 @@ build:csp-lmc-mid_pkg: only: [master] # -# Build csp-lmc-mid image +# Build and push csp-lmc-mid image # build:csp-lmc-mid_image: image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest @@ -51,6 +51,7 @@ build:csp-lmc-mid_image: script: - cd $BUILD_PATH - make build + - make push variables: BUILD_PATH: csp-lmc-mid @@ -210,5 +211,9 @@ release csp-lmc-mid image: script: - cd $BUILD_PATH - make push + when: manual + only: + refs: + - master variables: BUILD_PATH: csp-lmc-mid diff --git a/csp-lmc-mid/.make/release.mk b/csp-lmc-mid/.make/release.mk index 87043fc..6f76d9b 100644 --- a/csp-lmc-mid/.make/release.mk +++ b/csp-lmc-mid/.make/release.mk @@ -80,7 +80,13 @@ release: check-status check-release build push push: pre-push do-push post-push ## push the image to the Docker registry do-push: - docker push $(IMAGE):$(BASE_RELEASE) + @BRANCH_NAME=`git rev-parse --abbrev-ref HEAD`; \ + echo "--- $$BRANCH_NAME"; \ + if [ $$BRANCH_NAME == "master" ]; then \ + docker push $(IMAGE):$(BASE_RELEASE); \ + else \ + docker push $(IMAGE):$(VERSION); \ + fi # docker push $(IMAGE):latest snapshot: build push diff --git a/csp-lmc-mid/charts/csp-proto/values.yaml b/csp-lmc-mid/charts/csp-proto/values.yaml index 26ce0e0..8fb48f8 100644 --- a/csp-lmc-mid/charts/csp-proto/values.yaml +++ b/csp-lmc-mid/charts/csp-proto/values.yaml @@ -14,7 +14,7 @@ csplmc: image: registry: nexus.engageska-portugal.pt/ska-docker image: mid-csp-lmc - tag: 0.6.9 + tag: 0.6.9-1c9b3b9 pullPolicy: IfNotPresent deviceServers: -- GitLab From 552a5bae8ea0d38e29ed6c2d3649791eb4840ac2 Mon Sep 17 00:00:00 2001 From: toor Date: Fri, 18 Sep 2020 15:33:31 +0200 Subject: [PATCH 34/43] CT-147: tag the image with suffix '-dev' if built from a git branch diffrent from master. --- csp-lmc-mid/.make/release.mk | 6 ++++-- csp-lmc-mid/charts/csp-proto/values.yaml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/csp-lmc-mid/.make/release.mk b/csp-lmc-mid/.make/release.mk index 6f76d9b..f4a37d7 100644 --- a/csp-lmc-mid/.make/release.mk +++ b/csp-lmc-mid/.make/release.mk @@ -81,11 +81,13 @@ push: pre-push do-push post-push ## push the image to the Docker registry do-push: @BRANCH_NAME=`git rev-parse --abbrev-ref HEAD`; \ - echo "--- $$BRANCH_NAME"; \ + echo "Git branch: $$BRANCH_NAME"; \ if [ $$BRANCH_NAME == "master" ]; then \ + echo "Image tag: $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE)" ;\ docker push $(IMAGE):$(BASE_RELEASE); \ else \ - docker push $(IMAGE):$(VERSION); \ + echo "Image tag: $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE)-dev" ;\ + docker tag $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE)-dev ;\ fi # docker push $(IMAGE):latest diff --git a/csp-lmc-mid/charts/csp-proto/values.yaml b/csp-lmc-mid/charts/csp-proto/values.yaml index 8fb48f8..47b4fd9 100644 --- a/csp-lmc-mid/charts/csp-proto/values.yaml +++ b/csp-lmc-mid/charts/csp-proto/values.yaml @@ -14,7 +14,7 @@ csplmc: image: registry: nexus.engageska-portugal.pt/ska-docker image: mid-csp-lmc - tag: 0.6.9-1c9b3b9 + tag: 0.6.9-dev pullPolicy: IfNotPresent deviceServers: -- GitLab From baed07bcd1c50c3c9a7a721cec8bd74d9e0e71f8 Mon Sep 17 00:00:00 2001 From: toor Date: Fri, 18 Sep 2020 16:05:03 +0200 Subject: [PATCH 35/43] CT-147: use CI_COMMIT_REF_NAME variable to get the branch name when the pipeline is running. --- csp-lmc-mid/.make/release.mk | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/csp-lmc-mid/.make/release.mk b/csp-lmc-mid/.make/release.mk index f4a37d7..0480639 100644 --- a/csp-lmc-mid/.make/release.mk +++ b/csp-lmc-mid/.make/release.mk @@ -13,6 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # +ifneq ($(CI_JOB_ID),) +BRANCH_NAME := $(CI_BUILD_REF_NAME) +else +BRANCH_NAME=$(shell git rev-parse --abbrev-ref HEAD) +endif ifeq ($(strip $(PROJECT)),) NAME=$(shell basename $(CURDIR)) else @@ -80,14 +85,13 @@ release: check-status check-release build push push: pre-push do-push post-push ## push the image to the Docker registry do-push: - @BRANCH_NAME=`git rev-parse --abbrev-ref HEAD`; \ - echo "Git branch: $$BRANCH_NAME"; \ - if [ $$BRANCH_NAME == "master" ]; then \ + @echo "Git branch: $(BRANCH_NAME)"; \ + if [ $(BRANCH_NAME) == "master" ]; then \ echo "Image tag: $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE)" ;\ - docker push $(IMAGE):$(BASE_RELEASE); \ + docker tag $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE)-dev ;\ else \ echo "Image tag: $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE)-dev" ;\ - docker tag $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE)-dev ;\ + docker push $(IMAGE):$(BASE_RELEASE); \ fi # docker push $(IMAGE):latest -- GitLab From 4ce49501aafc6da5d2a4a600a40541a5f34fd7b4 Mon Sep 17 00:00:00 2001 From: toor Date: Fri, 18 Sep 2020 16:49:22 +0200 Subject: [PATCH 36/43] CT-147: push the image on nexus after the build job. --- csp-lmc-mid/.make/release.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/csp-lmc-mid/.make/release.mk b/csp-lmc-mid/.make/release.mk index 0480639..3ae995e 100644 --- a/csp-lmc-mid/.make/release.mk +++ b/csp-lmc-mid/.make/release.mk @@ -89,6 +89,7 @@ do-push: if [ $(BRANCH_NAME) == "master" ]; then \ echo "Image tag: $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE)" ;\ docker tag $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE)-dev ;\ + docker push $(IMAGE):$(IMAGE):$(BASE_RELEASE)-dev ;\ else \ echo "Image tag: $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE)-dev" ;\ docker push $(IMAGE):$(BASE_RELEASE); \ -- GitLab From cd67c2c05f5e1db0acdccd954e75e2248ba6dfd5 Mon Sep 17 00:00:00 2001 From: toor Date: Fri, 18 Sep 2020 17:28:22 +0200 Subject: [PATCH 37/43] CT-147: try to fix a (persistent!) typo in image push procedure. --- csp-lmc-mid/.make/release.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/csp-lmc-mid/.make/release.mk b/csp-lmc-mid/.make/release.mk index 3ae995e..cdc58a1 100644 --- a/csp-lmc-mid/.make/release.mk +++ b/csp-lmc-mid/.make/release.mk @@ -88,13 +88,13 @@ do-push: @echo "Git branch: $(BRANCH_NAME)"; \ if [ $(BRANCH_NAME) == "master" ]; then \ echo "Image tag: $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE)" ;\ - docker tag $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE)-dev ;\ - docker push $(IMAGE):$(IMAGE):$(BASE_RELEASE)-dev ;\ + docker tag $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE);\ + docker push $(IMAGE):$(BASE_RELEASE); \ else \ echo "Image tag: $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE)-dev" ;\ - docker push $(IMAGE):$(BASE_RELEASE); \ + docker tag $(IMAGE):$(VERSION) $(IMAGE):$(BASE_RELEASE)-dev ;\ + docker push $(IMAGE):$(BASE_RELEASE)-dev ;\ fi -# docker push $(IMAGE):latest snapshot: build push -- GitLab From a2375d761a99faad1b098a7fee4c8e8fde0aa957 Mon Sep 17 00:00:00 2001 From: toor Date: Fri, 18 Sep 2020 18:54:22 +0200 Subject: [PATCH 38/43] CT-147: fix path to search for helm charts folder. --- csp-lmc-mid/.gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index c95bc10..be3bf4a 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -196,8 +196,12 @@ publish_chart: - docker-executor image: nexus.engageska-portugal.pt/ska-docker/deploy:0.4.1 script: + - cd $BUILD_PATH - curl -s https://gitlab.com/ska-telescope/stupid/raw/master/scripts/publish-charts.sh | bash + - ls - cd charts/ && make package + variables: + BUILD_PATH: csp-lmc-mid # # Release csp-lmc-mid image on nexus -- GitLab From d4d5864f578d14c06f77642a4856b4c7e0dafee3 Mon Sep 17 00:00:00 2001 From: toor Date: Fri, 18 Sep 2020 20:24:58 +0200 Subject: [PATCH 39/43] CT-147: publish chart to work out --- .gitlab-ci.yml | 1 + csp-lmc-mid/.gitlab-ci.yml | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d2ca940..e5dcc47 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,6 +36,7 @@ cache: # pages: move the metrics files to the right folder # release release the images for csp-lmc-low and mid (only manual) stages: + - publish_chart - build_common - linting_common - test_common diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index be3bf4a..0c2cfcf 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -191,15 +191,13 @@ publish:csp-lmc-mid: publish_chart: variables: CHARTS_TO_PUBLISH: csp-proto - stage: publish + stage: publish_chart tags: - docker-executor image: nexus.engageska-portugal.pt/ska-docker/deploy:0.4.1 script: - cd $BUILD_PATH - curl -s https://gitlab.com/ska-telescope/stupid/raw/master/scripts/publish-charts.sh | bash - - ls - - cd charts/ && make package variables: BUILD_PATH: csp-lmc-mid -- GitLab From 74cd05e6788d6fd2f8f0786249dfc2e432b43b05 Mon Sep 17 00:00:00 2001 From: toor Date: Fri, 18 Sep 2020 20:48:00 +0200 Subject: [PATCH 40/43] CT-147: first step to fix csp-proto publishing, --- .gitlab-ci.yml | 1 - csp-lmc-mid/.gitlab-ci.yml | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e5dcc47..d2ca940 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,7 +36,6 @@ cache: # pages: move the metrics files to the right folder # release release the images for csp-lmc-low and mid (only manual) stages: - - publish_chart - build_common - linting_common - test_common diff --git a/csp-lmc-mid/.gitlab-ci.yml b/csp-lmc-mid/.gitlab-ci.yml index 0c2cfcf..11e12e8 100644 --- a/csp-lmc-mid/.gitlab-ci.yml +++ b/csp-lmc-mid/.gitlab-ci.yml @@ -191,10 +191,10 @@ publish:csp-lmc-mid: publish_chart: variables: CHARTS_TO_PUBLISH: csp-proto - stage: publish_chart + stage: publish tags: - docker-executor - image: nexus.engageska-portugal.pt/ska-docker/deploy:0.4.1 + image: nexus.engageska-portugal.pt/ska-docker/deploy:0.4.2 script: - cd $BUILD_PATH - curl -s https://gitlab.com/ska-telescope/stupid/raw/master/scripts/publish-charts.sh | bash -- GitLab From 2914e6ed2cbdbeb74e1f36792b6bfe23dc8c7ab0 Mon Sep 17 00:00:00 2001 From: toor Date: Mon, 21 Sep 2020 11:15:59 +0200 Subject: [PATCH 41/43] CT-147: updated project README.md file. Modified the k8s makefile to fix problem in describe and logs targets. Updated mid-csp helm chart to include values.yaml an template file. --- README.md | 204 ++++++++++++++++-- csp-lmc-mid/.make/k8s.mk | 11 +- csp-lmc-mid/charts/mid-csp/Chart.yaml | 4 +- .../charts/mid-csp/templates/_helpers.tpl | 62 ++++++ csp-lmc-mid/charts/mid-csp/values.yaml | 11 + 5 files changed, 266 insertions(+), 26 deletions(-) create mode 100644 csp-lmc-mid/charts/mid-csp/templates/_helpers.tpl create mode 100644 csp-lmc-mid/charts/mid-csp/values.yaml diff --git a/README.md b/README.md index a0984ee..68d5d11 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ CPS.LMC project * [Repository](#repository) * [CSP.LMC Common Package](#csp-lmc-common) * [Create the CSP.LMC Common Software python package](#python-package) -* [CSP_Mid LMC](#mid-csp-mid-lmc) - * [Running tests](#running-tests) +* [CSP_Mid LMC](#CSP_Mid.LMC) + * [CSP_Mid LMC Deployment in Kubernetes](#Mid-CSP.LMC-Kubernetes-Deployment-via-Helm-Charts) * [CSP_Low LMC](#csp-low-lmc) * [Run in containers](#how-to-run-in-docker-containers) * [Known bugs](#known-bugs) @@ -39,8 +39,10 @@ the same organization: * project source: contains the specific project TANGO Device Class files * pogo: contains the POGO files of the TANGO Device Classes of the project -* docker: containes the `docker`, `docker-compose` and `dsconfig` configuration files as well as the Makefile to generate the docker image and run the tests. * tests: contains the test +* charts: stored the HEML charts to deploy the Mid CSP.LMC system under kubernets environment. +* docker: containes the `docker`, `docker-compose` and `dsconfig` configuration files as well as +the Makefile to generate the docker image and run the tests. To get a local copy of the repository: @@ -52,18 +54,192 @@ git clone https://gitlab.com/ska-telescope/csp-lmc.git * A TANGO development environment properly configured, as described in [SKA developer portal](https://developer.skatelescope.org/en/latest/tools/tango-devenv-setup.html) * [SKA Base classes](https://gitlab.com/ska-telescope/lmc-base-classes) -* -## CSP_Mid.LMC +* access to a K8s/minikube cluster. + +# CSP_Mid.LMC The TANGO devices of the CSP_Mid.LMC prototype run in a containerised environment. Currently only a limitated number of CSP_Mid.LMC and CBF_Mid.LMC devices are run in Docker containers: * the MidCspMaster and MID CbfMaster * the MidCspCapabilityMonitor devices -* two instances of the CSP_Mid and CBF_Mid subarrays +* three instances of the CSP_Mid and CBF_Mid subarrays * four instances of the Very Coarse Channelizer (VCC) devices * four instance of the Frequency Slice Processor (FPS) devices * two instances of the TM TelState Simulator devices +* one instance of the TANGO database + +## Containerised Mid CSP.LMC in Kubernetes + +The Mid CSP.LMC containerised TANGO servers are managed via Kubernetes. +The system is setup so that each k8s Pod has only one Docker container that in turn +runs only one Tango Device Server application.
      +Mid CSP.LMC TANGO Servers rely on two different Docker images: `mid-csplmc` and `mid-cbf-mcs`.
      +The first one runs the CSP.LMC TANGO devices and the sencond those of the Mid CBF.LMC prototype. + +### Mid CSP.LMC Kubernetes Deployment via Helm Charts + +The deployment of the system is handled by the Helm tool, via the Helm Charts, a set of YAML files describing +how the Kubernetes resources are related.
      +The Mid CSP.LMC Helm Charts are stored in the `charts` directory, organized in two sub-folders:
      + +* csp-proto with the Helm chart to deploy only the CSP.LMC devices (MidCspCapabilityMonitor, MidcSpMaster nad MidCspSubarray) +* mid-csp with the Helm chart to deploy the whole Mid CSP.LMC system, including the TANGO Database and the Mid CSF.LMC devices. +In particular, the `mid-csp` chart depends on the CSP.LMC, CBF.LMC and Tango DB charts and these dependecies are + dynamically linked specifying the `dependencies` field in the Chart.yaml.
      + +The `Makefile` in the csp-lmc-mid root directory provides the targets to deploy the system, stop the running services and run +the tests locally, on a k8s/minikube machine. + +To deploy the whole Mid CSP.LMC system run: + +``` bash + make deploy +``` +that installs the mid-csp helm chart specifying `test` as relase name and assigns it to the `csp-proto` namespace. + +Running the command: +```bash +helm list -n csp-proto +``` +an output like the one below is shown: +``` +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +test csp-proto 1 2020-09-21 10:07:19.308839059 +0200 CEST deployed mid-csp-0.1.0 0.6.8 +``` + +To list all the pods and service in the csp-proto namespace, issue the command: + +```bash +kubectl get all -n csp-proto +``` + +that provides the following output lines: + +``` +NAME READY STATUS RESTARTS AGE +pod/databaseds-tango-base-test-0 1/1 Running 0 2m48s +pod/mid-cbf-cbf-proto-cbfmaster-test-0 1/1 Running 0 2m50s +pod/mid-cbf-cbf-proto-cbfsubarray01-test-0 1/1 Running 1 2m50s +pod/mid-cbf-cbf-proto-cbfsubarray02-test-0 1/1 Running 1 2m48s +pod/mid-cbf-cbf-proto-cbfsubarray03-test-0 1/1 Running 1 2m48s +pod/mid-cbf-cbf-proto-fsp01-test-0 1/1 Running 0 2m49s +pod/mid-cbf-cbf-proto-fsp02-test-0 1/1 Running 0 2m49s +pod/mid-cbf-cbf-proto-fsp03-test-0 1/1 Running 0 2m50s +pod/mid-cbf-cbf-proto-fsp04-test-0 1/1 Running 0 2m50s +pod/mid-cbf-cbf-proto-tmcspsubarrayleafnodetest-test-0 1/1 Running 0 2m49s +pod/mid-cbf-cbf-proto-tmcspsubarrayleafnodetest2-test-0 1/1 Running 0 2m48s +pod/mid-cbf-cbf-proto-vcc001-test-0 1/1 Running 3 2m47s +pod/mid-cbf-cbf-proto-vcc002-test-0 1/1 Running 3 2m50s +pod/mid-cbf-cbf-proto-vcc003-test-0 1/1 Running 3 2m50s +pod/mid-cbf-cbf-proto-vcc004-test-0 1/1 Running 3 2m49s +pod/mid-cbf-configurator-cbf-proto-test-m6j2p 0/1 Error 0 2m50s +pod/mid-cbf-configurator-cbf-proto-test-qm8xg 0/1 Completed 0 2m15s +pod/midcsplmc-configurator-csp-proto-test-d7hmp 0/1 Completed 0 2m15s +pod/midcsplmc-configurator-csp-proto-test-qnks4 0/1 Error 0 2m50s +pod/midcsplmc-csp-proto-midcapabilitymonitor-test-0 1/1 Running 3 2m48s +pod/midcsplmc-csp-proto-midcspmaster-test-0 1/1 Running 0 2m50s +pod/midcsplmc-csp-proto-midcspsubarray01-test-0 1/1 Running 1 2m50s +pod/midcsplmc-csp-proto-midcspsubarray02-test-0 1/1 Running 1 2m50s +pod/midcsplmc-csp-proto-midcspsubarray03-test-0 1/1 Running 1 2m50s +pod/tango-base-tangodb-0 + + +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +service/databaseds-tango-base-test NodePort 10.103.37.75 10000:31664/TCP 2m50s +service/mid-cbf-cbf-proto-cbfmaster-test ClusterIP None 1234/TCP 2m50s +service/mid-cbf-cbf-proto-cbfsubarray01-test ClusterIP None 1234/TCP 2m50s +service/mid-cbf-cbf-proto-cbfsubarray02-test ClusterIP None 1234/TCP 2m50s +service/mid-cbf-cbf-proto-cbfsubarray03-test ClusterIP None 1234/TCP 2m50s +service/mid-cbf-cbf-proto-fsp01-test ClusterIP None 1234/TCP 2m50s +service/mid-cbf-cbf-proto-fsp02-test ClusterIP None 1234/TCP 2m50s +service/mid-cbf-cbf-proto-fsp03-test ClusterIP None 1234/TCP 2m50s +service/mid-cbf-cbf-proto-fsp04-test ClusterIP None 1234/TCP 2m50s +service/mid-cbf-cbf-proto-tmcspsubarrayleafnodetest-test ClusterIP None 1234/TCP 2m50s +service/mid-cbf-cbf-proto-tmcspsubarrayleafnodetest2-test ClusterIP None 1234/TCP 2m50s +service/mid-cbf-cbf-proto-vcc001-test ClusterIP None 1234/TCP 2m50s +service/mid-cbf-cbf-proto-vcc002-test ClusterIP None 1234/TCP 2m50s +service/mid-cbf-cbf-proto-vcc003-test ClusterIP None 1234/TCP 2m50s +service/mid-cbf-cbf-proto-vcc004-test ClusterIP None 1234/TCP 2m50s +service/midcsplmc-csp-proto-midcapabilitymonitor-test ClusterIP None 1234/TCP 2m50s +service/midcsplmc-csp-proto-midcspmaster-test ClusterIP None 1234/TCP 2m50s +service/midcsplmc-csp-proto-midcspsubarray01-test ClusterIP None 1234/TCP 2m50s +service/midcsplmc-csp-proto-midcspsubarray02-test ClusterIP None 1234/TCP 2m50s +service/midcsplmc-csp-proto-midcspsubarray03-test ClusterIP None 1234/TCP 2m50s +service/tango-base-tangodb NodePort 10.102.174.225 3306:30633/TCP 2m50s + +NAME READY AGE +statefulset.apps/databaseds-tango-base-test 1/1 2m50s +statefulset.apps/mid-cbf-cbf-proto-cbfmaster-test 1/1 2m50s +statefulset.apps/mid-cbf-cbf-proto-cbfsubarray01-test 1/1 2m50s +statefulset.apps/mid-cbf-cbf-proto-cbfsubarray02-test 1/1 2m50s +statefulset.apps/mid-cbf-cbf-proto-cbfsubarray03-test 1/1 2m50s +statefulset.apps/mid-cbf-cbf-proto-fsp01-test 1/1 2m50s +statefulset.apps/mid-cbf-cbf-proto-fsp02-test 1/1 2m50s +statefulset.apps/mid-cbf-cbf-proto-fsp03-test 1/1 2m50s +statefulset.apps/mid-cbf-cbf-proto-fsp04-test 1/1 2m50s +statefulset.apps/mid-cbf-cbf-proto-tmcspsubarrayleafnodetest-test 1/1 2m50s +statefulset.apps/mid-cbf-cbf-proto-tmcspsubarrayleafnodetest2-test 1/1 2m50s +statefulset.apps/mid-cbf-cbf-proto-vcc001-test 1/1 2m50s +statefulset.apps/mid-cbf-cbf-proto-vcc002-test 1/1 2m50s +statefulset.apps/mid-cbf-cbf-proto-vcc003-test 1/1 2m50s +statefulset.apps/mid-cbf-cbf-proto-vcc004-test 1/1 2m50s +statefulset.apps/midcsplmc-csp-proto-midcapabilitymonitor-test 1/1 2m50s +statefulset.apps/midcsplmc-csp-proto-midcspmaster-test 1/1 2m50s +statefulset.apps/midcsplmc-csp-proto-midcspsubarray01-test 1/1 2m50s +statefulset.apps/midcsplmc-csp-proto-midcspsubarray02-test 1/1 2m50s +statefulset.apps/midcsplmc-csp-proto-midcspsubarray03-test 1/1 2m50s +statefulset.apps/tango-base-tangodb 1/1 2m50s + +NAME COMPLETIONS DURATION AGE +job.batch/mid-cbf-configurator-cbf-proto-test 1/1 61s 2m50s +job.batch/midcsplmc-configurator-csp-proto-test 1/1 59s 2m50s +``` +The helm release can be deleted and the application stopped using the command: +```bash +make delete +``` +that unistalls the `mid-csp` chart and delete the `test` release in the `csp-proto` namespace. + +Other Makefile targets, such as `describe` and `logs`, provide some useful information when the system has been properly deployed. + +## Run integration tests on a local k8s/minikube cluster + +The project includes a set of tests for the `MidCspMaster` and `MidCspSubarray` TANGO Devices +that can be found in the project `tests` folder.
      +To run the tests on the local k8s cluster, issue the command + +
      make k8s_test
      +from the root project directory.
      + +This command first deploys the system and then executes the integration tests. + +After tests end, run the command: + +
      make delete
      + +to uninstall the HELM charts of the `test` release. + +## Gitlab continuos integration tests + +Continuos integration tests in Gitlab rely on the `.gitlab-ci.yml` configuration file that provides al the scripts to build, test and deploy the application.
      +This file has been updated to run test in K8s environment and any reference to the use of `docker-compose` as containers manager, has been removed
      . +A new job has been added in the pipline `publish` stage to release the the `csp-proto` helm chart in the SKA Helm charts repositoryhostes under `nexus`. + +## Docker-compose support + +Support to `docker-compose` has not been completely removed even if all the main operations are +performed in kubernetes environment.
      +Use of `docker-compose` has been maintened only to simplify the development on machines that +are not capable to run minikube in a virtual machine.
      +The docker folder of the project contains all the files required to run the system via the +docker-compose tool. +From the docker folder of the project, one can still: + • build the image running
       make build 
      + • start the system dockers with docker-compose executing + make up + • run the test on the local machine calling: + make test The Docker containers running the CBF_Mid devices are instantiated pulling the `mid-cbf-mcs:test` project image from the [Nexus repository](https://nexus.engageska-portugal.pt).
      The CSP_Mid.LMC project provides a [Makefile](Makefile) to start the system containers and the tests.
      @@ -79,9 +255,6 @@ instances, that is, to run the whole `CSP_Mid.LMC` prototype.>br\> In this way, it's possible to execute some preliminary integration tests, as for example the assignment/release of receptors to a `CSP_Mid Subarray` and its configuration to execute a scan in Imaging mode.
      The `CSP_Mid.LMC` and `Mid-CBF.LMC TANGO` Devices are registered with the same TANGO DB, and its configuration is performed via the `dsconfig` TANGO Device provided by the [dsconfig project](https://gitlab.com/MaxIV-KitsControls/lib-maxiv-dsconfig).
      -This device use a JSON file to configure the TANGO DB.
      -The `CSP_Mid.LMC` and `Mid-CBF.LMC` projects provide its own JSON file: -[midcsplmc\_dsconfig.json](csp-lmc/csp-lmc-mid/csp-lmc-mid/docker/config/midcsplmc_dsconfig.json) and [midcbf\_dsconfig.json](sp-lmc/csp-lmc-mid/csp-lmc-mid/docker/config/midcbf_dsconfig.json) To run the `CSP_Mid.LMC` prototype inside Docker containers,issue the command: @@ -99,11 +272,11 @@ mid-csp-lmc-cbf_dsconfig: the dsconfig container to configure CBF.LMC devi mid-csp-lmc-cbf_dsconfig: the dsconfig container to configure CSP.LMC devices in the TANGO DB mid-csp-lmc-midcspmaster: the CspMaster TANGO device mid-csp-lmc-midcapabilitymonitor: the monitor devices of the CSP_Mid.LMC Capabilities -mid-csp-lmc-midcspsubarray[01-02]: two instances of the CspSubarray TANGO device +mid-csp-lmc-midcspsubarray[01-023: two instances of the CspSubarray TANGO device mid-csp-lmc-rsyslog-csplmc: the rsyslog container for the CSP.LMC devices mid-csp-lmc-rsyslog-cbf : the rsyslog container for the CBF.LMC devices mid-csp-lmc-cbfmaster: the CbfMaster TANGO device -mid-csp-lmc-cbfsubarray[01-02]: two instances of the CbfSubarray TANGO device +mid-csp-lmc-cbfsubarray[01-03]: two instances of the CbfSubarray TANGO device mid-csp-lmc-vcc[001-004]: four instances of the Mid-CBF VCC TANGO device mid-csp-lmc-fsp[01-04]: four instances of the Mid-CBF FSP TANGO device mid-csp-lmc-tmcspsubarrayleafnodetest/2: two instances of the TelState TANGO Device @@ -121,15 +294,6 @@ This means that the TANGO DB running in the container is available on port 10000 Running `jive` on the local host, the `CSP.LMC` and `Mid-CBF.LMC` TANGO Devices registered with the TANGO DB (running in a docker container) can be visualized and explored. -## Running tests - -The project includes a set of tests for the `MidCspMaster` and `MidCspSubarray` TANGO Devices that can be found in the project `tests` folder.
      -To run the test on the local host issue the command - -
      make test
      -from the `docker` project directory.
      -The test are run in docker containers providing the proper environment setup and isolation. - ## Known bugs diff --git a/csp-lmc-mid/.make/k8s.mk b/csp-lmc-mid/.make/k8s.mk index 6b98f3f..f3ce058 100644 --- a/csp-lmc-mid/.make/k8s.mk +++ b/csp-lmc-mid/.make/k8s.mk @@ -53,11 +53,14 @@ show: mkcerts ## show the helm chart --set ingress.hostname=$(INGRESS_HOST) chart_lint: ## lint check the helm chart - @helm lint charts/$(HELM_CHART)/ \ + @for i in `ls charts/`; \ + do echo " char dir$${i}"; \ + helm lint charts/$${i}/ \ --namespace $(KUBE_NAMESPACE) \ --set ingress.hostname=$(INGRESS_HOST) \ --set xauthority="$(XAUTHORITYx)" \ - --set display="$(DISPLAY)" \ + --set display="$(DISPLAY)";\ + done helm_delete: ## delete the helm chart release (with Tiller) @helm delete $(HELM_RELEASE) --purge \ @@ -83,7 +86,7 @@ delete_traefik: ## delete the helm chart for traefik. @param: EXTERNAL_IP rm -rf $$TMP describe: ## describe Pods executed from Helm chart - @for i in `kubectl -n $(KUBE_NAMESPACE) get pods -l app.kubernetes.io/instance=$(HELM_RELEASE) -o=name`; \ + @for i in `kubectl -n $(KUBE_NAMESPACE) get pods -l release=$(HELM_RELEASE) -o=name`; \ do echo "---------------------------------------------------"; \ echo "Describe for $${i}"; \ echo kubectl -n $(KUBE_NAMESPACE) describe $${i}; \ @@ -94,7 +97,7 @@ describe: ## describe Pods executed from Helm chart done logs: ## show Helm chart POD logs - @for i in `kubectl -n $(KUBE_NAMESPACE) get pods -l app.kubernetes.io/instance=$(HELM_RELEASE) -o=name`; \ + @for i in `kubectl -n $(KUBE_NAMESPACE) get pods -l release=$(HELM_RELEASE) -o=name`; \ do \ echo "---------------------------------------------------"; \ echo "Logs for $${i}"; \ diff --git a/csp-lmc-mid/charts/mid-csp/Chart.yaml b/csp-lmc-mid/charts/mid-csp/Chart.yaml index 12a2909..af3fb1f 100644 --- a/csp-lmc-mid/charts/mid-csp/Chart.yaml +++ b/csp-lmc-mid/charts/mid-csp/Chart.yaml @@ -1,5 +1,5 @@ -apiVersion: v1 -appVersion: 0.6.8 +apiVersion: v2 +appVersion: 0.6.9 description: A Helm chart for deploying the whole Mid_CSP prototype on Kubernetes name: mid-csp version: 0.1.0 diff --git a/csp-lmc-mid/charts/mid-csp/templates/_helpers.tpl b/csp-lmc-mid/charts/mid-csp/templates/_helpers.tpl new file mode 100644 index 0000000..bd04ea7 --- /dev/null +++ b/csp-lmc-mid/charts/mid-csp/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "mid-csp.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "mid-csp.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "mid-csp.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "mid-csp.labels" -}} +helm.sh/chart: {{ include "mid-csp.chart" . }} +{{ include "mid-csp.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "mid-csp.selectorLabels" -}} +app.kubernetes.io/name: {{ include "mid-csp.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "mid-csp.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "mid-csp.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/csp-lmc-mid/charts/mid-csp/values.yaml b/csp-lmc-mid/charts/mid-csp/values.yaml new file mode 100644 index 0000000..5048f33 --- /dev/null +++ b/csp-lmc-mid/charts/mid-csp/values.yaml @@ -0,0 +1,11 @@ +# Default values for mid-csp. +csp-proto: + csplmc: + enabled: true +cbf-proto: + midcbfmcs: + enabled: true +tango-base: + tangodb: + enabled: true + use_pv: false -- GitLab From 470de3d20adba77ea43be14d39fd4055e55a598f Mon Sep 17 00:00:00 2001 From: toor Date: Mon, 21 Sep 2020 12:15:26 +0200 Subject: [PATCH 42/43] CT-147: changes in csp-proto chart versioning. Use image version for appVersion field. Use SemVer2 for chart version diffrent from image relase number. --- csp-lmc-mid/charts/csp-proto/Chart.yaml | 4 ++-- csp-lmc-mid/charts/mid-csp/Chart.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/csp-lmc-mid/charts/csp-proto/Chart.yaml b/csp-lmc-mid/charts/csp-proto/Chart.yaml index f022adf..8060134 100644 --- a/csp-lmc-mid/charts/csp-proto/Chart.yaml +++ b/csp-lmc-mid/charts/csp-proto/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 -appVersion: "1.0" +appVersion: "0.6.9" description: A Helm chart for deploying the Mid_CSP.LMC devices on Kubernetes name: csp-proto -version: 0.5.3 +version: 0.1.1 icon: https://www.skatelescope.org/wp-content/uploads/2016/07/09545_NEW_LOGO_2014.png diff --git a/csp-lmc-mid/charts/mid-csp/Chart.yaml b/csp-lmc-mid/charts/mid-csp/Chart.yaml index af3fb1f..4091172 100644 --- a/csp-lmc-mid/charts/mid-csp/Chart.yaml +++ b/csp-lmc-mid/charts/mid-csp/Chart.yaml @@ -10,6 +10,6 @@ dependencies: repository: https://gitlab.com/ska-telescope/skampi/-/raw/master/repository condition: tango-base.enabled - name: csp-proto - version: 0.5.3 + version: 0.1.1 repository: "file://../csp-proto" condition: csp-proto.enabled -- GitLab From 911e81277aac5ad4f62fd640d253522274147538 Mon Sep 17 00:00:00 2001 From: toor Date: Mon, 21 Sep 2020 13:00:58 +0200 Subject: [PATCH 43/43] CT-147: README.md update. --- README.md | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 68d5d11..558cb8e 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ CPS.LMC project * [CSP.LMC Common Package](#csp-lmc-common) * [Create the CSP.LMC Common Software python package](#python-package) * [CSP_Mid LMC](#CSP_Mid.LMC) - * [CSP_Mid LMC Deployment in Kubernetes](#Mid-CSP.LMC-Kubernetes-Deployment-via-Helm-Charts) + * [CSP_Mid LMC Deployment in Kubernetes](#mid-CSP.LMC-Kubernetes-Deployment-via-Helm-Charts) * [CSP_Low LMC](#csp-low-lmc) * [Run in containers](#how-to-run-in-docker-containers) * [Known bugs](#known-bugs) @@ -207,23 +207,27 @@ Other Makefile targets, such as `describe` and `logs`, provide some useful infor The project includes a set of tests for the `MidCspMaster` and `MidCspSubarray` TANGO Devices that can be found in the project `tests` folder.
      -To run the tests on the local k8s cluster, issue the command +To run the tests on the local k8s cluster, issue the command: -
      make k8s_test
      +```bash +make k8s_test +``` from the root project directory.
      This command first deploys the system and then executes the integration tests. After tests end, run the command: -
      make delete
      - +```bash +make delete +``` to uninstall the HELM charts of the `test` release. ## Gitlab continuos integration tests Continuos integration tests in Gitlab rely on the `.gitlab-ci.yml` configuration file that provides al the scripts to build, test and deploy the application.
      -This file has been updated to run test in K8s environment and any reference to the use of `docker-compose` as containers manager, has been removed
      . +This file has been updated to run test in K8s environment and any reference to the use of `docker-compose` as containers manager, +has been removed.
      A new job has been added in the pipline `publish` stage to release the the `csp-proto` helm chart in the SKA Helm charts repositoryhostes under `nexus`. ## Docker-compose support @@ -232,14 +236,12 @@ Support to `docker-compose` has not been completely removed even if all the main performed in kubernetes environment.
      Use of `docker-compose` has been maintened only to simplify the development on machines that are not capable to run minikube in a virtual machine.
      -The docker folder of the project contains all the files required to run the system via the +The `docker` folder of the project contains all the files required to run the system via the docker-compose tool. From the docker folder of the project, one can still: - • build the image running
       make build 
      - • start the system dockers with docker-compose executing - make up - • run the test on the local machine calling: - make test + • build the image running `make build` + • start the system dockers with docker-compose executing `make up` + • run the test on the local machine calling `make test` The Docker containers running the CBF_Mid devices are instantiated pulling the `mid-cbf-mcs:test` project image from the [Nexus repository](https://nexus.engageska-portugal.pt).
      The CSP_Mid.LMC project provides a [Makefile](Makefile) to start the system containers and the tests.
      @@ -251,10 +253,10 @@ The containerised environment relies on three YAML configuration files: Each file includes the stages to run the the `CSP_Mid.LMC TANGO DB`, the `CSP_Mid.LMC` devices and `Mid-CBF.LMC` TANGO Devices inside separate docker containers.
      These YAML files are used by `docker-compose` to run both the CSP_Mid.LMC and CBF.LMC TANGO device -instances, that is, to run the whole `CSP_Mid.LMC` prototype.>br\> +instances, that is, to run the whole `CSP_Mid.LMC` prototype.
      In this way, it's possible to execute some preliminary integration tests, as for example the assignment/release of receptors to a `CSP_Mid Subarray` and its configuration to execute a scan in Imaging mode.
      The `CSP_Mid.LMC` and `Mid-CBF.LMC TANGO` Devices are registered with the same TANGO DB, and its -configuration is performed via the `dsconfig` TANGO Device provided by the [dsconfig project](https://gitlab.com/MaxIV-KitsControls/lib-maxiv-dsconfig).
      +configuration is performed via the `dsconfig` TANGO Device provided by the [dsconfig project](https://gitlab.com/MaxIV-KitsControls/lib-maxiv-dsconfig).
      To run the `CSP_Mid.LMC` prototype inside Docker containers,issue the command: -- GitLab