Getting started#

This page contains instructions for software developers who want to get started with usage and development of the SubarrayNode.

Introduction#

The SubarrayNode manages the lifecycle and control of a SKA subarray. It exposes a TANGO device API that implements commands, attributes and properties required by the TMC architecture to allocate and manage resources, execute observation commands, coordinate with other Telescope Management Components (for example CSP/MCCS), and report health and observation state. The SN contains both common core logic and telescope specific variants (Low and Mid) and is responsible for resource assignment, command execution orchestration, state transition policies, and integrations with external services.

Background#

Detailed information on how the SKA Software development community works is available at the SKA software developer portal. There you will find guidelines, policies, standards and a range of other documentation.

Set up your development environment#

This project uses Kubernetes for development and testing so that the build environment, test environment and test results are reproducible and independent of host environment. The project exposes a Makefile UI (run make help for a list of targets).

Note: minikube installation steps have been removed from this guide. Use your preferred Kubernetes environment (kind, k9s, a cloud cluster, or a developer-provided cluster). The important requirement is a working cluster and kubectl configured to access it.

How to Use#

Clone this repo:

git clone --recurse-submodules https://gitlab.com/ska-telescope/ska-tmc-subarraynode.git
cd ska-tmc-subarraynode

If you cloned without submodules, initialise them with:

git submodule update --init --recursive

Install dependencies:

$ apt update
$ sudo apt install cmake cppzmq-dev build-essential git libjpeg-dev python3
$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -
$ source $HOME/.poetry/env
Please note that:
  • the recommended way to get the framework is compiling it (instructions can be found here);

Activate the poetry environment:

$ eval $(poetry env activate)

Install python requirements for linting and unit testing:

$ poetry install

Alternate way to install and activate poetry: Follow the steps till installation of dependencies. Then run below command:

$ virtualenv cn_venv
$ source cn_venv/bin/activate
$ make requirements

Makefile targets#

This repository contains a Makefile which acts as a UI for building container images, testing images, and for launching interactive developer environments.

Common make targets#

  • Formatting and Linting: run Python formaters and linters and checks for respective issues

    Example:

    $ make python-format
    [...]
    --------------------------------------------------------------------
    Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
    

    and to lint code:

    $ make python-lint
    [...]
    --------------------------------------------------------------------
    Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
    
  • Unit tests: run the Python unit test suite

    $ make python-test

    or the alias:

    $ make unit-test

    Example:

    $ make python-test
    PyTango 10.3.0 (10, 3, 0)
    PyTango compiled with:
        Python   : 3.10.20
        Numpy    : 2.2.6
        Tango    : 10.3.2
        pybind11 : 3.0.4
    PyTango runtime is:
        Python   : 3.10.12
        Numpy    : 1.26.4
        Tango    : 10.3.2
    
    PyTango running on:
    uname_result(system='Linux', node='test-runner-test', release='5.15.0-185-generic', version='#195-Ubuntu SMP Fri Jun 19 17:11:50 UTC 2026', machine='x86_64')
    ============================= test session starts ==============================
    platform linux -- Python 3.10.12, pytest-7.4.4, pluggy-1.6.0 -- /usr/bin/python3
    [....]
    
    --------------------------------- JSON report ----------------------------------
    report saved to: build/report.json
    ================================ tests coverage ================================
    _______________ coverage: platform linux, python 3.10.12-final-0 _______________
    ========= 77 passed, 827 deselected, 2 warnings in 1315.67s (0:21:55) ==========
    
  • Documentation / RTD generation: build the Sphinx documentation (ReadTheDocs style)

    $ make -C docs html

    Optionally regenerate API docs before building:

    $ make -C docs generate-api-doc

  • Kubernetes tests: run the k8s test runner inside the target cluster

    Build the container image:

    $ make oci-image-build

    Install the umbrella chart:

    $ make k8s-install-chart

    Warning

    k8s-test runs tests inside a Kubernetes cluster and may require significant local resources, image registry access, and cluster credentials. Running these targets on a developer laptop may be slow or require extra configuration; prefer CI or a dedicated test cluster for full k8s tests.

    Test the deployment with relevant tests:

    $ make k8s-wait && make k8s-test

    Note

    It is possible to install and test the subarraynode both in Mid and Low by passing the variable TELESCOPE (SKA-mid or SKA-low):

    $ make k8s-install-chart TELESCOPE=SKA-low
    $ make k8s-wait TELESCOPE=SKA-low
    $ make k8s-test TELESCOPE=SKA-low
    
    Uninstall the chart:

    $ make k8s-uninstall-chart

For developer practices and coding guidelines see the SKA developer portal and the project developer guide: