SKA CSP LMC Common

This project is developing the common package used by the Local Monitoring and Control prototype for Central Signal Procesing (CSP.LMC) of the Square Kilometer Array. This package is used for both prototypes developed for Mid and Low telescopes.

Table of contents

Documentation

Documentation Status

The documentation for this project, including the package description, Architecture description and the API modules can be found at SKA developer portal:

CSP.LMC common documentation

Repository organization

The repository has the following organization:

  • src: the folder with all the project source code

  • pogo: contains the POGO files of the TANGO Devices of the project

  • tests: contains the tests; there are unit tests for the code, and bdd tests to be run with simulated sub-system devices.

  • charts: stored the HELM charts to deploy the CSP.LMC common simulated system under kubernets environment.

  • docs: contains all the files to generate the documentation for the project.

Deployment in Kubernetes

In the following there are the instructions to deploy the CSP.LMC Common simulated system. This system uses simulated devices for the CSP sub-systems (CBF, PSS and PST) in order to test the Common functionalities in a TANGO environment.

In order to locally deploy and test the project, Minikube has to be installed. ska-cicd-deploy-minikube provides all the instructions to setup a minikube machine running in a virtual environment. The instructions are very detailed and cover many frequent issues. You can check the deployment with a make vars. Be aware of heavy HW requirements: 4 cores or more, and more than 8GB ram.

Following a short installation procedure:

git clone git@gitlab.com:ska-telescope/sdi/deploy-minikube.git
cd deploy-minikube

to use Pod driver:

make all

to use Docker driver:

make all DRIVER=docker

To check that the minikube environment is up and runing, issue the command

minikube status

the output should be:

minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

After having a Minikube running, the ska-csp-lmc-common has to be installed. To do that, issue the command:

$ git clone git@gitlab.com:ska-telescope/ska-csp-lmc-common.git
$ cd ska-csp-lmc-common
$ git submodule update --init --recursive

to deploy the Mid CSP devices in a k8s environment, without a GUI support, issue the command:

make k8s-install-chart

The last command uses the values file values-default.yaml. The output of the command should be something like the following one:

k8s-dep-update: updating dependencies
+++ Updating common-csp-umbrella chart +++
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /home/gianluca/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /home/gianluca/.kube/config
Getting updates for unmanaged Helm repositories...
...Successfully got an update from the "https://artefact.skao.int/repository/helm-internal" chart repository
...Successfully got an update from the "https://artefact.skao.int/repository/helm-internal" chart repository
...Successfully got an update from the "https://artefact.skao.int/repository/helm-internal" chart repository
...Successfully got an update from the "https://artefact.skao.int/repository/helm-internal" chart repository
Saving 8 charts
Downloading ska-tango-base from repo https://artefact.skao.int/repository/helm-internal
Downloading ska-webjive from repo https://artefact.skao.int/repository/helm-internal
Downloading ska-webjive-auth from repo https://artefact.skao.int/repository/helm-internal
Downloading ska-dashboard-repo from repo https://artefact.skao.int/repository/helm-internal
Deleting outdated charts
Name:         sim-csp
Labels:       kubernetes.io/metadata.name=sim-csp
Annotations:  <none>
Status:       Active

No resource quota.

No LimitRange resource.
install-chart: install charts/common-csp-umbrella/ release: test in Namespace: sim-csp with params: --set global.minikube=true  --set global.tango_host=tango-databaseds:10000 --set ska-tango-base.display=192.168.49.1:0 --set ska-tango-base.xauthority=/run/user/1000/gdm/Xauthority --set ska-tango-base.jive.enabled=false --set sim-cbf.simcsp.image.tag=0.11.6-dirty --set sim-pss.simcsp.image.tag=0.11.6-dirty --set sim-pst.simcsp.image.tag=0.11.6-dirty --set ska-csp-lmc-common.cspcommon.image.tag=0.11.6-dirty 
helm upgrade --install test \
--set global.minikube=true  --set global.tango_host=tango-databaseds:10000 --set ska-tango-base.display=192.168.49.1:0 --set ska-tango-base.xauthority=/run/user/1000/gdm/Xauthority --set ska-tango-base.jive.enabled=false --set sim-cbf.simcsp.image.tag=0.11.6-dirty --set sim-pss.simcsp.image.tag=0.11.6-dirty --set sim-pst.simcsp.image.tag=0.11.6-dirty --set ska-csp-lmc-common.cspcommon.image.tag=0.11.6-dirty  \
charts/common-csp-umbrella/ --namespace sim-csp
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /home/gianluca/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /home/gianluca/.kube/config
Release "test" does not exist. Installing it now.
NAME: test
LAST DEPLOYED: Wed May  4 12:41:28 2022
NAMESPACE: sim-csp
STATUS: deployed
REVISION: 1
TEST SUITE: None

The CSP simulated system is deployed in the namespace sim-csp. To monitor the deployment progres and wait its completion, issue the command:

make k8s-watch

A successful deployment will show all the pods running as in the follwing:

Every 2,0s: kubectl get all,pv,pvc,ingress -n sim-csp                               marotta: Wed May  4 15:44:06 2022

NAME                                READY   STATUS    RESTARTS   AGE
pod/commoncontroller-controller-0   1/1     Running   0          2m45s
pod/commonsubarray-subarray1-0      1/1     Running   0          2m38s
pod/commonsubarray-subarray2-0      1/1     Running   0          2m43s
pod/commonsubarray-subarray3-0      1/1     Running   0          2m47s
pod/simcbfcontroller-controller-0   1/1     Running   0          2m38s
pod/simcbfsubarray-subarray1-0      1/1     Running   0          2m53s
pod/simcbfsubarray-subarray2-0      1/1     Running   0          2m48s
pod/simcbfsubarray-subarray3-0      1/1     Running   0          2m53s
pod/simpsscontroller-controller-0   1/1     Running   0          2m53s
pod/simpsssubarray-subarray1-0      1/1     Running   0          2m49s
pod/simpsssubarray-subarray2-0      1/1     Running   0          2m28s
pod/simpsssubarray-subarray3-0      1/1     Running   0          2m37s
pod/simpstbeam-beam1-0              1/1     Running   0          2m45s
pod/simpstbeam-beam2-0              1/1     Running   0          2m52s
pod/simpstbeam-beam3-0              1/1     Running   0          2m28s
pod/simpstcontroller-controller-0   1/1     Running   0          2m38s
pod/ska-tango-base-tangodb-0        1/1     Running   0          2m27s
pod/tango-databaseds-0              1/1     Running   0          2m27s
pod/tangotest-test-0                1/1     Running   0          2m27s

When all the pods (Low CSP, CBF and Taranta) are in running, you can access the system via itango shell. This can be done from any pod running, using:

kubectl exec -it  <podname>  -n sim-csp -- itango3

then create a proxy to CSP.LMC devices using, for example:

csp_controller = Device("common-csp/control/0")
csp_subarray01 = Device("common-csp/subarray/01")
...

When the proxy is created, it is possible to send commands and access attributes using a simple Python sintax. In the following there are some examples:

csp_controller.<command_name>(<command_argument>)

print(csp_subarray01.<attribute_name>)

csp_controller.<attribute_name> = <attribute_value>

To uninstall the system:

make k8s-uninstall-chart

Tests

In this project integration tests with simulated subsystem are provided. To run them, after deploying the system (see section above), send the command:

make k8s-test

Known bugs

Troubleshooting

License

See the LICENSE file for details.