SKA Telescope Dish LMC
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 five crucial components, namely DishMaster/DishManager, Dish Structure (DS) Manager, Dish Logger, SPF Controller Simulator, and SPFRx Controller Simulator, which are all Tango devices.Importantly, each of these devices is located in its own distinct repository.
Repositories containing the components of Dish LMC
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:
omniORB [http://omniorb.sourceforge.net/]
zmq (>=4.*) [http://zeromq.org/]
cppzmq [https://github.com/zeromq/cppzmq]
Tango Control System (>=9) [http://www.tango-controls.org/]: NB: Enable APPENDERS_HAVE_LEVEL_THRESHOLD in compilation
PyTango (>=9.2.5) [https://pytango.readthedocs.io/en/stable/]: NB: Need Tango enum types
yat (Rev>=29577) [http://svn.code.sf.net/p/tango-cs/code/share/yat/trunk]
yat4tango (Rev>=29574) [http://svn.code.sf.net/p/tango-cs/code/share/yat4tango/trunk]: NB: Enable _USING_TANGO_8_OR_ABOVE_ flag in compilation
libhdb++ [https://github.com/tango-controls-hdbpp/libhdbpp.git]
libhdb++-mysql [https://github.com/tango-controls-hdbpp/libhdbpp-mysql.git]
log4cxx [https://logging.apache.org/log4cxx/]
boost [http://www.boost.org/]
pugixml (>=1.8) [http://pugixml.org/]: NB: Enable PUGIXML_HAS_LONG_LONG flag in compilation
cmake (>=2.8) [https://cmake.org]
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:
Doxygen [http://www.doxygen.org/]
Sphinx [http://sphinx-doc.org/] + Breathe [http://breathe.readthedocs.org/]
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!
- Create the build and install directories: $BUILD_DIR, $INSTALL_DIR
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.
Deployment
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.2 -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. |
{001}, {001, 002} |
global.minikube |
Set to true when deploying to minikube |
true, false |
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-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 |
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
CI/CD 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.