SIP Execution Control Configuration Database library.
Project description
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
It can also be installed from a local copy of the code using:
pip install sip/execution_control/configuration/db
Utility Scripts
To set initial data into the configuration database run the following command:
skasip_config_db_init [data_path]
To add an SBI to the database
skasip_config_db_add_sbi [--subarray N] [--activate] [--help]
To update the state of a service or the state of sdp:
skasip_config_db_update_state [--service SUBSYSTEM.NAME.VERSION] [--help] new_state
Running tests
While unit tests are run automatically the SIP CI/CD service, it is possible to run them manually with the following command from the root sip code folder using the following commands:
Note: a Redis db container must be started first in order for most of these tests to pass
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
Quickstart
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-compose up -d
This will deploy the containers to the local Docker installation. If wanting to deploy to Docker Swarm instead use the following command:
docker stack deploy -c docker-compose.yml [stack name]
Once finished, to stop this service and remove its running containers, if
started using docker-compose
(with the local Docker engine) issue the
command:
docker-compose rm -s -f
or if using Docker Swarm mode:
docker stack rm [stack name]
It is also possible to run redis server natively (without Docker). This is useful for development and debugging.
Start redis server
redis-server
Note - It requires redis to be installed and all python packages in the requirements.txt file
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for skasip_config_db-1.0.15-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f1215b12f1859a9bce4d3e52accfd3d2c19eb238c4979a768fb1b704a5aecdd |
|
MD5 | 6a0c4983f04a544a984b712d84927eb0 |
|
BLAKE2b-256 | c9b8f1ee03ee3e439f3ac155ba796209a3caf8ee9d991d8f23e50dd39af37b54 |