Skip to main content

SIP Execution Control Configuration Database library.

Project description

SIP Configuration Service


The Configuration Database is a backing service for use by SKA SIP Execution Control (EC) and Tango Control components. This package contains a library providing specialised functions for interfacing with data objects in the EC Configuration Database.

For a description of the Data Model used by this library see Sections 7.4.4 and 7.5.6 of the SIP Report.

This library provides modules for each of the data objects stored within the EC configuration database. These are built on top of a simple low-level wrapper to the Python Redis API, which handles connections to the database and abstraction from the Python Redis API.


This library can be installed using pip with the following command:

pip install -U skasip-config-db


Example usage:

import sip_config_db as db

sdp_state = db.SDPState()

subarray = db.Subarray(0)

sbi_config = db.generate_sbi_config(register_workflows=True)
sbi = db.SchedulingBlockInstance.from_config(sbi_config)

Utility Scripts

The package installs a number of utility scripts, described below:

Initialise the database.

skasip_config_db_init [--data-path=PATH]

Can be used to initialise the configuration database. The optional --data-path=PATH argument, can be used to defined a custom path containing the initial set of SDP services and workflows used to initialise the database. If specifying --data-path, and the specified PATH does not exist a copy of the default data pat will be created at the specified path.

Register workflows

Register workflows from the specified workflow path.

skasip_config_db_register_workflows [workflow path]

Add an SBI to the database

Adds an SBI to the database.

skasip_config_db_add_sbi [--subarray N] [--activate] [--help]

Generate an SBI JSON configuration

Generate an SBI JSON configuration.


Update the current state

Updates the current state of SDP or a specified service.

skasip_config_db_update_state [--service SUBSYSTEM.NAME.VERSION] [--help] new_state

List workflow definitions

List known workflow definitions.


Running tests

Unit tests are run automatically the SIP CI/CD service. It is also possible to run them manually with the following commands from the root SIP:

Note: a Redis db container must be started first in order for most of these tests to pass (See below)

virtualenv -p python3 venv
source venv/bin/activate
pip install -r testing_requirements.txt
pip install -r sip/execution_control/configuration_db/requirements.txt
python3 -m pytest --pylint --codestyle --docstyle -s -v \
    --pylint-rcfile=.pylintrc --rootdir=. \

Starting Configuration Database Redis containers.

To start Docker containers for a Redis Db instance (with a persistent volume) as well as a Redis Commander instance (useful for debugging) issue the following command:

docker stack deploy -c docker-compose.yml [stack name]

Once finished, to clean up.

docker stack rm [stack name]

It is also possible to run redis server natively (without Docker) with:


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for skasip-config-db, version 1.1.1
Filename, size File type Python version Upload date Hashes
Filename, size skasip_config_db-1.1.1-py3-none-any.whl (49.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size skasip_config_db-1.1.1.tar.gz (25.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page