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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file skasip_config_db-1.0.15.tar.gz.

File metadata

  • Download URL: skasip_config_db-1.0.15.tar.gz
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for skasip_config_db-1.0.15.tar.gz
Algorithm Hash digest
SHA256 a8fed343c906b9052dc026df956d244b3f9292c51d09540f2847efc6ef16d648
MD5 1e6f22761a78fecfafdc96cd78d838f4
BLAKE2b-256 c916d6fdddb64e66d70083e9055ff4fad3ce8ef7c1c49428d703a4c71357232c

See more details on using hashes here.

File details

Details for the file skasip_config_db-1.0.15-py3-none-any.whl.

File metadata

  • Download URL: skasip_config_db-1.0.15-py3-none-any.whl
  • Upload date:
  • Size: 58.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for skasip_config_db-1.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 9f1215b12f1859a9bce4d3e52accfd3d2c19eb238c4979a768fb1b704a5aecdd
MD5 6a0c4983f04a544a984b712d84927eb0
BLAKE2b-256 c9b8f1ee03ee3e439f3ac155ba796209a3caf8ee9d991d8f23e50dd39af37b54

See more details on using hashes here.

Supported by

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