SKA Telescope Dish LMC

Dish LMC diagram Documentation Status

Dish LMC Software Overview

Dish LMC is the monitoring and control (M&C) system for the SKA MID Dish of the Square Kilometer Array (SKA).

It is built using Python and utilizes the Tango Controls toolkit. The system consists of three main components, namely:

To aid in testing we also have our own simulators.

Dish LMC Device context

The main entrypoint for TMC to control and monitor a dish is the DishManager device.

Devices

Repository layouts

Devices for full deployment

CI/CD

Devices for CI/CD

CI/CD

Additional deployments

Additional deployments can be found here: Deployments

Deployment without Taranta Dashboard

Using the makefile

$ make tangodb-stage
$ make lmc-stage

Using the helm commands

Firstly, release ska-tango-base independently from the dish-lmc devices by running these two commands.

$ helm repo add ska-helm-internal https://artefact.skao.int/repository/helm-internal
$ helm upgrade --install dev-tangodb ska-helm-internal/ska-tango-base --version 0.4.6 -n ska-dish-lmc

Then, release dish-lmc. With ska-tango-base being disabled as to not conflict with the ska-tango-base released previously.

$ helm upgrade --install dev . -n ska-dish-lmc \
--set "global.dishes={001}" \
--set "global.minikube=true" \
--set "ska-mid-dish-manager.ska-mid-dish-simulators.enabled=true" \
--set "ska-mid-dish-manager.ska-mid-dish-simulators.deviceServers.spfdevice.enabled=true" \
--set "ska-mid-dish-manager.ska-mid-dish-simulators.deviceServers.spfrxdevice.enabled=true" \
--set "ska-mid-dish-manager.ska-mid-dish-simulators.ska-tango-base.enabled=false"

Deployment with Taranta Dashboard

Release dish-lmc, enabling taranta and ska-tango-base while disabling the ska-mid-dish-simulators ska-tango-base dependency. It is done this way in order to resolve a conflict with taranta.

$ helm upgrade --install dev . -n ska-dish-lmc \
--set "global.dishes={001}" \
--set "global.minikube=true" \
--set "ska-mid-dish-manager.ska-mid-dish-simulators.enabled=true" \
--set "ska-mid-dish-manager.ska-mid-dish-simulators.deviceServers.spfdevice.enabled=true" \
--set "ska-mid-dish-manager.ska-mid-dish-simulators.deviceServers.spfrxdevice.enabled=true" \
--set "ska-mid-dish-manager.ska-mid-dish-simulators.ska-tango-base.enabled=false" \
--set "ska-dish-lmc.taranta.enabled=true" \
--set "ska-tango-base.enabled=true"

–set flag options

Option

Description

Example values

global.dishes

Determine the number of sets of DISH.LMC devices.

Note: The values determine the dish IDs

{001}, {001, 002}

global.minikube

Set to true when deploying to minikube

true, false

ska-mid-dish-manager.dishmanager.<device>.fqdn

Full path

tango://127.0.0.1:45678/foo/bar/1#dbase=no

ska-mid-dish-manager.dishmanager.<device>.family_name

The middle value in the tango triplet

Note: The device name has to conform to ADR-32 e.g. ska001/spf/simulator

spf, spfrx

ska-mid-dish-manager.dishmanager.<device>.member_name

The last value in the tango triplet

Note: The device name has to conform to ADR-32 e.g. ska001/spf/controller

simulator, controller

ska-mid-dish-manager.ska-mid-dish-simulators.enabled

Enable or disable the device simulators chart

true, false

ska-mid-dish-manager.ska-mid-dish-simulators.deviceServers.spfdevice.enabled

Enable or disable the SPF device simulator

true, false

ska-mid-dish-manager.ska-mid-dish-simulators.deviceServers.spfrxdevice.enabled

Enable or disable the SPFRx device simulator

true, false

ska-mid-dish-manager.ska-mid-dish-simulators.ska-tango-base.enabled

Enable or disable the ska-tango-base dependency within the ska-mid-dish-simulators dependency of ska-mid-dish-manager

true, false

ska-dish-lmc.taranta.enabled

Enable or disable the dependencies required for deploying the taranta dashboard

true, false

ska-tango-base.enabled

Enable or disable the ska-tango-base dependency

true, false

MID PSI Deployment

Deployment using Dish LMC pipeline jobs

The following manual jobs, found in the ‘deploy-to-mid-psi’ stage of the gitlab ci pipeline, can be used to deploy and manage the Dish LMC software in the MID PSI cluster.

deploy-to-mid-psi jobs

Job

Description

mid-psi-create-dish-lmc-namespace

Creates the namespace used by the rest of the jobs

mid-psi-deploy-dish-lmc-tangodb

Deploys the tango database

mid-psi-deploy-dish-lmc-devices

Deploys the Dish LMC devices (excluding the SPFRx Simulator)

mid-psi-deploy-taranta

Deploys Taranta pods

mid-psi-teardown-taranta

Deletes Taranta deployment

mid-psi-teardown-dish-lmc-devices

Deletes the Dish LMC devices deployment

mid-psi-teardown-dish-lmc-tangodb

Deletes tango database deployment

mid-psi-smoke-test

Verify that LMC devices and the tango db are available

mid-psi-integration-test

Run the set of MID PSI integration tests

mid-psi-gather-deployment-data

Gathers info about pods and containers running in the namespace

mid-psi-delete-dish-lmc-namespace

Deletes the namespace created by the mid-psi-create-dish-lmc-namespace job

mid-psi-output-logs

Acquire & output dish logger logs from the Dish LMC deployment in MID PSI cluster

ITF Deployment

Deployment using Dish LMC pipeline jobs

The following manual jobs, found in the ‘deploy-lmc-to-itf-spf’ stage of the gitlab ci pipeline, can be used to deploy and manage the Dish LMC software in the ITF cluster.

deploy-lmc-to-itf-spf jobs

Job

Description

itf-create-dish-lmc-namespace

Creates the namespace used by the rest of the jobs

itf-deploy-dish-lmc-tangodb

Deploys the tango database

itf-deploy-dish-lmc-devices

Deploys the Dish LMC devices (excluding the SPF Simulator)

itf-teardown-dish-lmc-devices

Deletes the Dish LMC devices deployment

itf-teardown-dish-lmc-tangodb

Deletes tango database deployment

itf-smoke-test

Verify that LMC devices and the tango db are available

itf-integration-test

Run the set of ITF integration tests

itf-gather-deployment-data

Gathers info about pods and containers running in the namespace

itf-delete-dish-lmc-namespace

Deletes the namespace created by the itf-create-dish-lmc-namespace job

Pytest

Device FQDN arguments

The following arguments can be used with the pytest command to set the tango device FQDNs for the subservient devices.

<i>Note: These can be added to the PYTHON_VARS_AFTER_PYTEST variable in the makefile to set the FQDNs during pipeline runs.<i> | Device | Flag | |--------|————-| | Dish Manager | –dish-manager-fqdn | | Dish Structure | –dish-structure-fqdn | | SPF | –spf-fqdn | | SPFRx | –spfrx-fqdn |

Example

$ pytest -m "acceptance" tests/ --dish-structure-fqdn=some/test/fqdn

Status

Previously

The software is curently being evaluated against the expected behaviour in the ICD against AA0.5. BDD tests covering basic SPFRx control have been added to perform this evaluation. A decision will be made about the current state of the project afterwards. The options available will be either to start over with a new implementation in Python or fix the current implementation to conform the SKA standards, expected behaviour as documented in the ICD and finally, add unit tests across the various modules.

Currently

The BDD tests written in tests/acceptance covering SP-2334 proved that the DishLMC implementation is diverged from the ICD. Due to the C++ skills gap in maintaining the project, KAROO team has moved to implement DishManager (known here as DishMaster) in Python leveraging the asynchronous command execution in the base device provisioned in ska-tango-base. DishMaster will be swopped with DishManager to test DishLMC. The docs have been updated to point to DishManager.

Installation

The software was tested on the following OS:

  • Ubuntu 14.04, 16.04

  • Centos 7

Due to problems encountered in Centos with the Tango archiver it is recommended to use Ubuntu.

Pre-requisites

Install the project dependencies:

Make sure you have set the following environment variables to the external library installation dirs

  • OMNIORB_ROOT

  • ZMQ_ROOT

  • CPPZMQ_ROOT

  • TANGO_ROOT

  • YAT_ROOT

  • YAT4TANGO_ROOT

  • JSONCPP_ROOT

  • LOG4CXX_ROOT

  • BOOST_ROOT

  • PUGIXML_ROOT

Add also the following paths to the PKG_CONFIG_PATH environment var:

  • $TANGO_ROOT/lib/pkgconfig

  • $OMNIORB_ROOT/lib/pkgconfig

  • $ZMQ_ROOT/lib/pkgconfig

  • $LOG4CXX_ROOT/lib/pkgconfig

  • $PUGIXML_ROOT/lib/pkgconfig

To generate the documentation you must install:

Build and install

The project makes use of the cmake build system. To build and install the project follow these steps:

  • Clone this repository into your local $SOURCE_DIR
    git clone git@gitlab.com:ska-telescope/templates/dsh-lmc-prototype.git $SOURCE_DIR

  • Synchronize cmake modules in $SOURCE_DIR
    git submodule sync
    git submodule update --init

  • Create the build and install directories: $BUILD_DIR, $INSTALL_DIR

    NB: Don’t build the project in the same source directory! Keep build and install files separated!

  • In the build directory:
    cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DENABLE_TEST=ON $SOURCE_DIR
    make
    make install

If external libraries are correctly installed and configured cmake should find all needed include dirs and libraries used to build the project.
NB: With recent BOOST versions FindBoost.cmake was observed to fail.
If the project build and install step are performed successfully the following directories are generated in your installation directory:

  • include: headers files

  • lib: shared libraries

  • bin: binary files (e.g. device servers)

Documentation generation

To generate the documentation enter the build directory and type:

  • make doc

  • make install (to install doc files in the install directory share/docs)

NB: make doc is using python3. This was observed to work for the Doxygen part but fails on generating the documentation for python devices if pytango is linked with libboost-python (created with python2). Solved by compiled doc with libboost-python (created with python3) and pytango (>=9.3.1)

Configuration

LMC Tango devices can be registered and configured in the TangoDB manually (e.g. using Jive) or programmatically using a configuration script (provided in the script directory) and a configuration file (an example is provided in the config directory). Automated configuration is based on the Ansible roles provided in this repository. Please ensure that:

  • You have Ansible installed

  • You have pytango installed

  • You have set the following environment variables in your system: MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, TANGO_HOST

To run LMC configuration from a configuration file config.json do:

  • configure_lmc.sh --config=config.json

This configuration script registers the LMC devices in the TangoDB (assuming running in locahost) and sets configuration options (device properties, forwarded device properties) according to the settings given in the configuration file. Default values are used for options which are not present in the configuration file.

CI/CD deployment

cicd-deployment

Tango Device Servers documentation

These are all the Tango Device Servers currently included in the project:

These devices allow to test main dish control monitoring and control functionalities using master device. Other devices forming part of the Dish Control system (e.g. alarm system or archiver) will be uploaded in the repository in the future.

Logging

Device: DishLogger

Testing

Testing

Modules

Modules

Indices and tables