Skip to main content

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


Download files

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

Source Distribution

skasip_config_db-1.0.15.tar.gz (30.8 kB view hashes)

Uploaded Source

Built Distribution

skasip_config_db-1.0.15-py3-none-any.whl (58.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page