Skip to content
Snippets Groups Projects
Commit e5cd4efa authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

L2SS-1173: create ec2 device

parent ee829eb4
No related branches found
No related tags found
1 merge request!739Resolve L2SS-1173 "Add ec2 device"
Showing
with 163 additions and 4 deletions
...@@ -96,6 +96,16 @@ ...@@ -96,6 +96,16 @@
} }
} }
}, },
"EC2": {
"STAT": {
"EC2": {
"STAT/EC2/1": {
"properties": {
}
}
}
}
},
"ObservationControl": { "ObservationControl": {
"STAT": { "STAT": {
"ObservationControl": { "ObservationControl": {
......
...@@ -85,6 +85,16 @@ ...@@ -85,6 +85,16 @@
} }
} }
}, },
"EC2": {
"STAT": {
"EC2": {
"STAT/EC2/1": {
"properties": {
}
}
}
}
},
"ObservationControl": { "ObservationControl": {
"STAT": { "STAT": {
"ObservationControl": { "ObservationControl": {
......
# Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: Apache-2.0
#
# Requires:
# - lofar-device-base.yml
#
version: '2.1'
volumes:
iers-data: { }
services:
device-ec2:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-ec2
container_name: device-ec2
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "10"
networks:
- control
ports:
- "5730:5730" # unique port for this DS
- "5830:5830" # ZeroMQ event port
- "5930:5930" # ZeroMQ heartbeat port
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ..:/opt/lofar/tango:rw
environment:
- TANGO_HOST=${TANGO_HOST}
- TANGO_ZMQ_EVENT_PORT=5830
- TANGO_ZMQ_HEARTBEAT_PORT=5930
healthcheck:
test: l2ss-health dserver/ec2/STAT
interval: 1m
timeout: 30s
retries: 3
start_period: 30s
working_dir: /opt/lofar/tango
entrypoint:
- bin/start-ds.sh
# 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
- l2ss-ec2 ec2 STAT -v -ORBendPoint giop:tcp:device-ec2:5730 -ORBendPointPublish giop:tcp:${HOSTNAME}:5730
restart: on-failure
stop_signal: SIGINT # request a graceful shutdown of Tango
stop_grace_period: 2s
...@@ -73,6 +73,7 @@ stationmanager = OptionalDeviceProxy("STAT/StationManager/1") ...@@ -73,6 +73,7 @@ stationmanager = OptionalDeviceProxy("STAT/StationManager/1")
boot = OptionalDeviceProxy("STAT/Boot/1") boot = OptionalDeviceProxy("STAT/Boot/1")
ccd = OptionalDeviceProxy("STAT/CCD/1") ccd = OptionalDeviceProxy("STAT/CCD/1")
ec = OptionalDeviceProxy("STAT/EC/1") ec = OptionalDeviceProxy("STAT/EC/1")
ec2 = OptionalDeviceProxy("STAT/EC2/1")
pcon = OptionalDeviceProxy("STAT/PCON/1") pcon = OptionalDeviceProxy("STAT/PCON/1")
psoc = OptionalDeviceProxy("STAT/PSOC/1") psoc = OptionalDeviceProxy("STAT/PSOC/1")
docker = OptionalDeviceProxy("STAT/Docker/1") docker = OptionalDeviceProxy("STAT/Docker/1")
...@@ -86,6 +87,7 @@ devices = ( ...@@ -86,6 +87,7 @@ devices = (
boot, boot,
ccd, ccd,
ec, ec,
ec2,
pcon, pcon,
psoc, psoc,
docker, docker,
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
}, },
"stat/ec/1": { "stat/ec/1": {
}, },
"stat/ec2/1": {
},
"stat/configuration/1": { "stat/configuration/1": {
}, },
"stat/apspu/*": { "stat/apspu/*": {
......
...@@ -36,6 +36,9 @@ ...@@ -36,6 +36,9 @@
"stat/ec/1": { "stat/ec/1": {
"include": ["*_RW"] "include": ["*_RW"]
}, },
"stat/ec2/1": {
"include": ["*_RW"]
},
"stat/configuration/1": { "stat/configuration/1": {
}, },
"stat/apspu/*": { "stat/apspu/*": {
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
}, },
"stat/ec/1": { "stat/ec/1": {
}, },
"stat/ec2/1": {
},
"stat/configuration/1": { "stat/configuration/1": {
}, },
"stat/apspu/*": { "stat/apspu/*": {
......
...@@ -98,7 +98,7 @@ echo '/usr/local/bin/wait-for-it.sh ${TANGO_HOST} --strict --timeout=300 -- true ...@@ -98,7 +98,7 @@ echo '/usr/local/bin/wait-for-it.sh ${TANGO_HOST} --strict --timeout=300 -- true
# Devices list is used to explitly word split when supplied to commands, must # Devices list is used to explitly word split when supplied to commands, must
# disable shellcheck SC2086 for each case. # disable shellcheck SC2086 for each case.
DEVICES=(device-station-manager device-boot device-aps device-apsct device-ccd device-ec device-apspu device-sdpfirmware device-sdp device-recvh device-recvl device-bst device-sst device-unb2 device-xst device-beamlet device-digitalbeam device-tilebeam device-psoc device-pcon device-antennafield device-temperature-manager device-observation-control device-configuration device-calibration) DEVICES=(device-station-manager device-boot device-aps device-apsct device-ccd device-ec device-ec2 device-apspu device-sdpfirmware device-sdp device-recvh device-recvl device-bst device-sst device-unb2 device-xst device-beamlet device-digitalbeam device-tilebeam device-psoc device-pcon device-antennafield device-temperature-manager device-observation-control device-configuration device-calibration)
SIMULATORS=(sdptr-sim recvh-sim recvl-sim unb2-sim apsct-sim apspu-sim ccd-sim ec-sim) SIMULATORS=(sdptr-sim recvh-sim recvl-sim unb2-sim apsct-sim apspu-sim ccd-sim ec-sim)
......
.. _ec2:
EC2
--------------------
The ``ec2 == DeviceProxy("STAT/EC2/1")`` device controls the Environmental Control (EC) - 2.0 version.
...@@ -33,6 +33,7 @@ Even without having access to any LOFAR2.0 hardware, you can install the full st ...@@ -33,6 +33,7 @@ Even without having access to any LOFAR2.0 hardware, you can install the full st
devices/psoc devices/psoc
devices/ccd devices/ccd
devices/ec devices/ec
devices/ec2
devices/configuration devices/configuration
devices/temperature-manager devices/temperature-manager
devices/configure devices/configure
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
from integration_test.default.devices.base import AbstractTestBases from integration_test.default.devices.base import AbstractTestBases
class TestDevicePCON(AbstractTestBases.TestDeviceBase): class TestDeviceEC(AbstractTestBases.TestDeviceBase):
"""Integration test class for device EC"""
def setUp(self): def setUp(self):
super().setUp("STAT/EC/1") super().setUp("STAT/EC/1")
# Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: Apache-2.0
from integration_test.default.devices.base import AbstractTestBases
class TestDeviceEC2(AbstractTestBases.TestDeviceBase):
"""Integration test class for device EC 2.0"""
def setUp(self):
super().setUp("STAT/EC2/1")
...@@ -36,6 +36,7 @@ console_scripts = ...@@ -36,6 +36,7 @@ console_scripts =
l2ss-apspu = tangostationcontrol.devices.apspu:main l2ss-apspu = tangostationcontrol.devices.apspu:main
l2ss-ccd = tangostationcontrol.devices.ccd:main l2ss-ccd = tangostationcontrol.devices.ccd:main
l2ss-ec = tangostationcontrol.devices.ec:main l2ss-ec = tangostationcontrol.devices.ec:main
l2ss-ec2 = tangostationcontrol.devices.ec2:main
l2ss-psoc = tangostationcontrol.devices.psoc:main l2ss-psoc = tangostationcontrol.devices.psoc:main
l2ss-pcon = tangostationcontrol.devices.pcon:main l2ss-pcon = tangostationcontrol.devices.pcon:main
l2ss-tilebeam = tangostationcontrol.devices.tilebeam:main l2ss-tilebeam = tangostationcontrol.devices.tilebeam:main
......
...@@ -7,11 +7,11 @@ This directory contains the sources for our custom Tango devices. ...@@ -7,11 +7,11 @@ This directory contains the sources for our custom Tango devices.
If a new device is added, it will (likely) need to be referenced in several places. Adjust or add the following files (referenced from the repository root), following the pattern shown by the devices already there: If a new device is added, it will (likely) need to be referenced in several places. Adjust or add the following files (referenced from the repository root), following the pattern shown by the devices already there:
- Adjust `CDB/LOFAR_ConfigDb.json` to create the device in the Tango device database, - Adjust `CDB/LOFAR_ConfigDb.json` to create the device in the Tango device database,
- Add the device hierarchies in `CDB/hierarchies` to define the power, control and clock configuration, - Add the device hierarchies in CDB files (f.e. `CDB/stations/common.json` or `CDB/stations/cs001.json`) to define the power, control and clock configuration in a certain station,
- Adjust `docker-compose/jupyter-lab/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py` to make an alias for it available in Jupyter-Lab, - Adjust `docker-compose/jupyter-lab/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py` to make an alias for it available in Jupyter-Lab,
- Adjust `tangostationcontrol/tangostationcontrol/devices/boot.py` to add the device to the station initialisation sequence, - Adjust `tangostationcontrol/tangostationcontrol/devices/boot.py` to add the device to the station initialisation sequence,
- Adjust `tangostationcontrol/tangostationcontrol/devices/docker.py` to have the device container available as R and RW attributes, - Adjust `tangostationcontrol/tangostationcontrol/devices/docker.py` to have the device container available as R and RW attributes,
- Add to `docker-compose/` to create a YaML file to start the device in a docker container. NOTE: it needs a unique 57xx port assigned (current _unused_ port value: 5730), a unique 58xx port for ZMQ events, and a unique 59xx port for ZMQ heartbeat - Add to `docker-compose/` to create a YaML file to start the device in a docker container. NOTE: it needs a unique 57xx port assigned (current _unused_ port value: 5731), a unique 58xx port for ZMQ events, and a unique 59xx port for ZMQ heartbeat
- Adjust `tangostationcontrol/setup.cfg` to add an entry point for the device in the package installation, - Adjust `tangostationcontrol/setup.cfg` to add an entry point for the device in the package installation,
- Add to `tangostationcontrol/tangostationcontrol/integration_test/default/devices/` to add an integration test, - Add to `tangostationcontrol/tangostationcontrol/integration_test/default/devices/` to add an integration test,
- Adjust `sbin/run_integration_test.sh` to have the device started when running the integration tests, - Adjust `sbin/run_integration_test.sh` to have the device started when running the integration tests,
......
...@@ -77,6 +77,14 @@ class Docker(LOFARDevice): ...@@ -77,6 +77,14 @@ class Docker(LOFARDevice):
datatype=bool, datatype=bool,
access=AttrWriteType.READ_WRITE, access=AttrWriteType.READ_WRITE,
) )
device_ec2_R = AttributeWrapper(
comms_annotation={"container": "device-ec2"}, datatype=bool
)
device_ec2_RW = AttributeWrapper(
comms_annotation={"container": "device-ec2"},
datatype=bool,
access=AttrWriteType.READ_WRITE,
)
# device_docker_RW is not available, as we cannot start our own container` # device_docker_RW is not available, as we cannot start our own container`
device_temperature_manager_R = AttributeWrapper( device_temperature_manager_R = AttributeWrapper(
comms_annotation={"container": "device-temperature-manager"}, datatype=bool comms_annotation={"container": "device-temperature-manager"}, datatype=bool
......
# Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: Apache-2.0
""" EC (Environmental Control) 2.0 Device Server for LOFAR2.0
"""
import logging
# PyTango imports
from tangostationcontrol.common.entrypoint import entry
from tangostationcontrol.common.lofar_logging import device_logging_to_python
from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice
# Additional import
logger = logging.getLogger()
__all__ = ["EC2", "main"]
@device_logging_to_python()
class EC2(OPCUADevice):
"""EC Device Server 2.0 for LOFAR2.0"""
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
# ----------
# Summarising Attributes
# ----------
# --------
# overloaded functions
# --------
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(**kwargs):
"""Main function of the EnvironmentalControl 2.0 module."""
return entry(EC2, **kwargs)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment