SIP执行控制配置数据库库。
skasip-config-db的Python项目详细描述
#SKA SDP SIP配置数据库库配置数据库是一个备份
服务,供ska sdp sip执行控制和tango控制组件使用。
有关此库使用的数据模型的说明,请参阅SIP报告的第7.4.4节
和第7.5.6节。
此库为存储在EC配置数据库中的每个数据对象提供模块。它们建立在[python redis api]的一个简单的低级包装之上(https://redis py.readthedocs.io/en/latest/),
>处理数据库连接和python
redis-api的抽象
<<<
>这个库可以用pip和下面的命令安装:
``bash
pip install-u skasip config db-skasip-config-db
>示例用法:
``python
编码:utf-8
“示例用法。”
来自SIP配置数据库调度导入子数组,schedulingblockinstance
from sip_config_db.states import sdp state
from sip_config_db.utils.generate_sbi_config import generate_sbi_config
print(sdp_state.current_state)
subarray=subarray(0)
subarray.activate()
print(subarray.active)
sbi=schedulingblockinstance.from_config(sbi_config)
打印(sbi.id)
`````
如下所述:
\可选的
`--data path=path`参数可用于定义自定义
路径,该路径包含用于初始化数据库的初始sdp服务和工作流集。如果指定“--数据路径”,指定的“路径”< BR/>不存在,在指定的
路径上创建默认数据PAT。一个SBI到数据库。
``bash
>skasip-config-db-add-sbi-sbi[--subarray n][--activate][--help]
`````
`` ` ` ` ` ` `生成一个SBI-json配置
``bash
```bash
>skasip-config-db-sbi-sbi-sbi配置
``````` ` ``bash
指定服务。
``bash
>skasip-config-db-u-update-update-state[---service subsystem.name.version][--help]new-state
````
列出工作流定义
``````
>>
>
>
>
>
运行测试
单元测试自动运行
[sip ci/cd服务](https://travis ci.com/ska sciencedataprocessor/integration prototype)。
也可以使用
根sip中的以下命令手动运行它们:
**注意**:必须首先启动redis db容器,才能通过大多数
这些测试(请参见下文)*
``bash
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--codesyle--docstyle-s-v\
--pylint rcfile=.pylintrc--rootdir=。\
sip/执行控制/配置数据库
```
](https://github.com/joeferner/redis commander)
实例(对调试有用)发出以下命令:
``bash
docker stack deploy-c docker-compose.yml[堆栈名称]
`````
>完成后,可以进行清理。
``bash
``docker stack rm[堆栈名称]
````
(不带docker)带有:
``bash
redis server
```
服务,供ska sdp sip执行控制和tango控制组件使用。
有关此库使用的数据模型的说明,请参阅SIP报告的第7.4.4节
和第7.5.6节。
此库为存储在EC配置数据库中的每个数据对象提供模块。它们建立在[python redis api]的一个简单的低级包装之上(https://redis py.readthedocs.io/en/latest/),
>处理数据库连接和python
redis-api的抽象
<<<
>这个库可以用pip和下面的命令安装:
``bash
pip install-u skasip config db-skasip-config-db
>示例用法:
``python
编码:utf-8
“示例用法。”
来自SIP配置数据库调度导入子数组,schedulingblockinstance
from sip_config_db.states import sdp state
from sip_config_db.utils.generate_sbi_config import generate_sbi_config
subarray=subarray(0)
subarray.activate()
print(subarray.active)
打印(sbi.id)
`````
如下所述:
\可选的
`--data path=path`参数可用于定义自定义
路径,该路径包含用于初始化数据库的初始sdp服务和工作流集。如果指定“--数据路径”,指定的“路径”< BR/>不存在,在指定的
路径上创建默认数据PAT。一个SBI到数据库。
``bash
>skasip-config-db-add-sbi-sbi[--subarray n][--activate][--help]
`````
`` ` ` ` ` ` `生成一个SBI-json配置
``bash
```bash
>skasip-config-db-sbi-sbi-sbi配置
``````` ` ``bash
指定服务。
``bash
>skasip-config-db-u-update-update-state[---service subsystem.name.version][--help]new-state
````
列出工作流定义
``````
>>
>
>
>
>
运行测试
单元测试自动运行
[sip ci/cd服务](https://travis ci.com/ska sciencedataprocessor/integration prototype)。
也可以使用
根sip中的以下命令手动运行它们:
**注意**:必须首先启动redis db容器,才能通过大多数
这些测试(请参见下文)*
``bash
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--codesyle--docstyle-s-v\
--pylint rcfile=.pylintrc--rootdir=。\
sip/执行控制/配置数据库
```
](https://github.com/joeferner/redis commander)
实例(对调试有用)发出以下命令:
``bash
docker stack deploy-c docker-compose.yml[堆栈名称]
`````
>完成后,可以进行清理。
``bash
``docker stack rm[堆栈名称]
````
(不带docker)带有:
``bash
redis server
```