This device provides master control and rolled-up monitoring of dish. When commanded, it propagates the associated command to the relevant subservient devices and updates its related attributes based on the aggregation of progress reported by those devices.
The system used for development needs to have Python 3 and pip
installed.
- Clone the repo
git clone --recursive [email protected]:ska-telescope/ska-mid-dish-manager.git
- Install poetry
pip install poetry
Install the dependencies and the package.
poetry install
- Run the tests
make python-test
- Lint
make python-lint
- Deploy the ska-tango-operator to manage pods and their configurations.
$ helm repo add k8s-helm-repository https://artefact.skao.int/repository/helm-internal
$ kubectl create namespace ska-tango-operator-system
$ helm upgrade --install to k8s-helm-repository/ska-tango-operator -n ska-tango-operator-system
- Deploy the chart with simulator devices
kubectl create namespace dish-manager
$ helm upgrade --install dev charts/ska-mid-dish-manager -n dish-manager \
--set global.minikube=true \
--set global.operator=true \
--set global.dishes="{001,002}" \ # number of instances to deploy; if not specified defaults to 001
--set ska-mid-dish-simulators.enabled=true \
--set ska-mid-dish-simulators.dsOpcuaSimulator.enabled=true \
--set ska-mid-dish-simulators.deviceServers.spfdevice.enabled=true \
--set ska-mid-dish-simulators.deviceServers.spfrxdevice.enabled=true \
--set ska-mid-dish-ds-manager.enabled=true
ska-tango-base
is not deployed by default, to deploy it add the --set
below:
--set ska-tango-base.enabled=true
- Deploy the chart, but replace the dishmanager pod with a development pod for testing DishManager
$ helm upgrade --install dev charts/ska-mid-dish-manager -n dish-manager \
--set global.minikube=true \
--set global.operator=true \
--set global.dishes={001,002} \ # number of instances to deploy; if not specified defaults to 001
--set dev_pod.enabled=true \ # enable devpod for development
--set deviceServers.dishmanager.enabled=false \ # disable dishmanager to use devpod
--set ska-mid-dish-simulators.enabled=true \
--set ska-mid-dish-simulators.dsOpcuaSimulator.enabled=true \
--set ska-mid-dish-simulators.deviceServers.spfdevice.enabled=true \
--set ska-mid-dish-simulators.deviceServers.spfrxdevice.enabled=true \
--set ska-mid-dish-ds-manager.enabled=true
- Then start DishManager in the commandline
/usr/bin/python3 /app/src/ska_mid_dish_manager/devices/DishManagerDS.py 01
For dish mananager example usage, consult the user guide in the docs.
The documentation for this project can be found in the docs folder. To generate the docs locally,
run the command below and browse the docs from docs/build/html/index.html
.
make docs-build html
Use the code below to generate the mode transition graph:
from ska_mid_dish_manager.models.dish_mode_model import DishModeModel
from matplotlib import pyplot as plt
import networkx as nx
model = DishModeModel()
# create a matplotlib axis object
ax = plt.subplot(121)
# draw the transitions
nx.draw(model.dishmode_graph, ax=axis, with_labels=True, font_weight='bold')
plt.show()