Skip to content
Snippets Groups Projects
Commit e1374df9 authored by Jasper Annyas's avatar Jasper Annyas
Browse files

L2SS-379:Added small review changes and notebook

parent 0c12e90b
No related branches found
No related tags found
1 merge request!125L2SS-379: Add a device to monitor/manage the docker containers.
...@@ -68,8 +68,8 @@ class Docker(hardware_device): ...@@ -68,8 +68,8 @@ class Docker(hardware_device):
archiver_maria_db_RW = attribute_wrapper(comms_annotation={"container": "archiver-maria-db"}, datatype=numpy.bool_, access=AttrWriteType.READ_WRITE) archiver_maria_db_RW = attribute_wrapper(comms_annotation={"container": "archiver-maria-db"}, datatype=numpy.bool_, access=AttrWriteType.READ_WRITE)
databaseds_R = attribute_wrapper(comms_annotation={"container": "databaseds"}, datatype=numpy.bool_) databaseds_R = attribute_wrapper(comms_annotation={"container": "databaseds"}, datatype=numpy.bool_)
databaseds_RW = attribute_wrapper(comms_annotation={"container": "databaseds"}, datatype=numpy.bool_, access=AttrWriteType.READ_WRITE) databaseds_RW = attribute_wrapper(comms_annotation={"container": "databaseds"}, datatype=numpy.bool_, access=AttrWriteType.READ_WRITE)
device_pcc_R = attribute_wrapper(comms_annotation={"container": "device-pcc"}, datatype=numpy.bool_) device_recv_R = attribute_wrapper(comms_annotation={"container": "device-recv"}, datatype=numpy.bool_)
device_pcc_RW = attribute_wrapper(comms_annotation={"container": "device-pcc"}, datatype=numpy.bool_, access=AttrWriteType.READ_WRITE) device_recv_RW = attribute_wrapper(comms_annotation={"container": "device-recv"}, datatype=numpy.bool_, access=AttrWriteType.READ_WRITE)
device_sdp_R = attribute_wrapper(comms_annotation={"container": "device-sdp"}, datatype=numpy.bool_) device_sdp_R = attribute_wrapper(comms_annotation={"container": "device-sdp"}, datatype=numpy.bool_)
device_sdp_RW = attribute_wrapper(comms_annotation={"container": "device-sdp"}, datatype=numpy.bool_, access=AttrWriteType.READ_WRITE) device_sdp_RW = attribute_wrapper(comms_annotation={"container": "device-sdp"}, datatype=numpy.bool_, access=AttrWriteType.READ_WRITE)
device_sst_R = attribute_wrapper(comms_annotation={"container": "device-sst"}, datatype=numpy.bool_) device_sst_R = attribute_wrapper(comms_annotation={"container": "device-sst"}, datatype=numpy.bool_)
......
...@@ -25,7 +25,7 @@ services: ...@@ -25,7 +25,7 @@ services:
networks: networks:
- control - control
ports: ports:
- "5707:5707" # unique port for this DS - "5705:5705" # unique port for this DS
volumes: volumes:
- ${TANGO_LOFAR_CONTAINER_MOUNT} - ${TANGO_LOFAR_CONTAINER_MOUNT}
- /var/run/docker.sock:/var/run/docker.sock:rw # we want to control our sibling containers, NOT do docker-in-docker (dind) - /var/run/docker.sock:/var/run/docker.sock:rw # we want to control our sibling containers, NOT do docker-in-docker (dind)
...@@ -40,5 +40,5 @@ services: ...@@ -40,5 +40,5 @@ services:
- -- - --
# configure CORBA to _listen_ on 0:port, but tell others we're _reachable_ through ${HOSTNAME}:port, since CORBA # configure CORBA to _listen_ on 0:port, but tell others we're _reachable_ through ${HOSTNAME}:port, since CORBA
# can't know about our Docker port forwarding # can't know about our Docker port forwarding
- python3 -u ${TANGO_LOFAR_CONTAINER_DIR}/devices/devices/docker_device.py LTS -v -ORBendPoint giop:tcp:0:5707 -ORBendPointPublish giop:tcp:${HOSTNAME}:5707 - python3 -u ${TANGO_LOFAR_CONTAINER_DIR}/devices/devices/docker_device.py LTS -v -ORBendPoint giop:tcp:0:5705 -ORBendPointPublish giop:tcp:${HOSTNAME}:5705
restart: on-failure restart: on-failure
%% Cell type:code id:waiting-chance tags:
``` python
import time
```
%% Cell type:code id:moving-alexandria tags:
``` python
d=DeviceProxy("LTS/Docker/1")
```
%% Cell type:code id:ranking-aluminum tags:
``` python
state = str(d.state())
if state == "OFF" or state == "FAULT":
d.initialise()
time.sleep(1)
state = str(d.state())
if state == "STANDBY":
d.on()
state = str(d.state())
if state == "ON":
print("Device is now in on state")
else:
print("warning, expected device to be in on state, is: ", state)
```
%% Output
Device is now in on state
%% Cell type:code id:0caa8146 tags:
``` python
attr_names = d.get_attribute_list()
for i in attr_names:
exec("value = print(i, d.{})".format(i))
```
%% Output
version_R *L2SS-379-docker-device [0c12e90b1c311df82edf9ebd0b0e9a3a530f0a81]
archiver_maria_db_R True
archiver_maria_db_RW False
databaseds_R True
databaseds_RW False
device_recv_R False
device_recv_RW False
device_sdp_R True
device_sdp_RW False
device_sst_R True
device_sst_RW False
device_xst_R False
device_xst_RW False
device_unb2_R True
device_unb2_RW False
device_docker_R True
dsconfig_R True
dsconfig_RW False
elk_R True
elk_RW False
grafana_R True
grafana_RW False
hdbpp_cm_R True
hdbpp_cm_RW False
hdbpp_es_R True
hdbpp_es_RW False
itango_R True
itango_RW False
jupyter_R True
jupyter_RW False
prometheus_R True
prometheus_RW False
tangodb_R True
tangodb_RW False
tango_prometheus_exporter_R False
tango_prometheus_exporter_RW False
tango_rest_R True
tango_rest_RW False
State <function __get_command_func.<locals>.f at 0x7f84a8b4fb70>
Status <function __get_command_func.<locals>.f at 0x7f84a8b4fb70>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment