Skip to main content

SIP Configuration Service

Introduction

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.

Installation

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

pip install -U skasip-config-db

Usage

Example usage:

import sip_config_db as db

sdp_state = db.SDPState()
print(sdp_state.current_state)

subarray = db.Subarray(0)
subarray.activate()
print(subarray.active)

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

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.

skasip_config_db_sbi_json

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.

skasip_config_db_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=. \
    sip/execution_control/configuration_db

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:

redis-server

Release files for skasip-config-db 1.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skasip-config-db 1.1.6
File Size Uploaded
skasip_config_db-1.1.6.tar.gz 26.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for skasip-config-db 1.1.6
File Interpreter ABI Platform
skasip_config_db-1.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 77.2 kB

Release files / skasip_config_db-1.1.6.tar.gz

Download URL skasip_config_db-1.1.6.tar.gz
Size 26.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7bffef90f7beef41f053b9dee0c7855003ad8bb8060e590ed3d3d937baf2e3c0
BLAKE2b-256 checksum
How to use checksums
645d1b0d2e029eb448327e33e76486cd5f1b18b7b59f650de129945af9fa470c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

Release files / skasip_config_db-1.1.6-py3-none-any.whl

Download URL skasip_config_db-1.1.6-py3-none-any.whl
Size 51.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06c48fe7ff524b63bc05056885c93727faf0996d519b263589005967396eaf31
BLAKE2b-256 checksum
How to use checksums
b05ad30e30529cc0e4d7a38858b9314dc0671b59788f3cae84a1c7a090bb7f1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

Release history Release notifications | RSS feed

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

This release

1.1.6 This release

2 release files

1.1.5

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.24

2 release files

1.0.23

2 release files

1.0.22

2 release files

1.0.21

2 release files

1.0.20

2 release files

1.0.19

2 release files

1.0.18

2 release files

1.0.17

2 release files

1.0.15

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page