Skip to content
Snippets Groups Projects
Commit dc8f31ca authored by Corné Lukken's avatar Corné Lukken Committed by Jan David Mol
Browse files

L2SS-680: Add empty PDU device

parent e21958f4
No related branches found
No related tags found
1 merge request!291L2SS-680: Add empty PDU device
Showing with 152 additions and 2 deletions
...@@ -103,6 +103,7 @@ docker_build_image_all: ...@@ -103,6 +103,7 @@ docker_build_image_all:
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-boot latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-boot latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-docker latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-docker latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-observation_control latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-observation_control latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-pdu latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-recv latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-recv latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-sdp latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-sdp latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-sst latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-sst latest
...@@ -253,6 +254,17 @@ docker_build_image_device_apspu: ...@@ -253,6 +254,17 @@ docker_build_image_device_apspu:
script: script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell # Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-apspu $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-apspu $tag
docker_build_image_device_pdu:
extends: .base_docker_images_except
only:
refs:
- merge_requests
changes:
- docker-compose/device-pdu.yml
- docker-compose/lofar-device-base/*
script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-pdu $tag
docker_build_image_device_tilebeam: docker_build_image_device_tilebeam:
extends: .base_docker_images_except extends: .base_docker_images_except
only: only:
......
...@@ -14,6 +14,13 @@ ...@@ -14,6 +14,13 @@
} }
} }
}, },
"PDU": {
"STAT": {
"PDU": {
"STAT/PDU/1": {}
}
}
},
"TileBeam": { "TileBeam": {
"STAT": { "STAT": {
"TileBeam": { "TileBeam": {
......
#
# Requires:
# - lofar-device-base.yml
#
version: '2'
volumes:
iers-data: {}
services:
device-pdu:
image: device-pdu
# build explicitly, as docker-compose does not understand a local image
# being shared among services.
build:
context: ..
dockerfile: docker-compose/lofar-device-base/Dockerfile
args:
SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-pdu
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "10"
networks:
- control
ports:
- "5714:5714" # unique port for this DS
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ..:/opt/lofar/tango:rw
- iers-data:/opt/IERS
environment:
- TANGO_HOST=${TANGO_HOST}
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-pdu PDU STAT -v -ORBendPoint giop:tcp:0:5714 -ORBendPointPublish giop:tcp:${HOSTNAME}:5714
restart: unless-stopped
...@@ -8,6 +8,7 @@ xst = DeviceProxy("STAT/XST/1") ...@@ -8,6 +8,7 @@ xst = DeviceProxy("STAT/XST/1")
unb2 = DeviceProxy("STAT/UNB2/1") unb2 = DeviceProxy("STAT/UNB2/1")
boot = DeviceProxy("STAT/Boot/1") boot = DeviceProxy("STAT/Boot/1")
tilebeam = DeviceProxy("STAT/TileBeam/1") tilebeam = DeviceProxy("STAT/TileBeam/1")
pdu = DeviceProxy("STAT/PDU/1")
beamlet = DeviceProxy("STAT/Beamlet/1") beamlet = DeviceProxy("STAT/Beamlet/1")
digitalbeam = DeviceProxy("STAT/DigitalBeam/1") digitalbeam = DeviceProxy("STAT/DigitalBeam/1")
docker = DeviceProxy("STAT/Docker/1") docker = DeviceProxy("STAT/Docker/1")
......
...@@ -26,9 +26,11 @@ SIMULATORS="sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim" ...@@ -26,9 +26,11 @@ SIMULATORS="sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim"
# Build only the required images, please do not build everything that makes CI # Build only the required images, please do not build everything that makes CI
# take really long to finish, especially grafana / jupyter / prometheus. # take really long to finish, especially grafana / jupyter / prometheus.
# jupyter is physically large > 2.5gb and overlayfs is really slow. # jupyter is physically large > 2.5gb and overlayfs is really slow.
# shellcheck disable=SC2086 # shellcheck disable=SC2086
make build $DEVICES $SIMULATORS make build $DEVICES $SIMULATORS
make build elk integration-test make build elk integration-test
make build archiver-timescale hdbppts-cm hdbppts-es make build archiver-timescale hdbppts-cm hdbppts-es
# Start and stop sequence # Start and stop sequence
......
.. _pdu:
PDU
====================
The ``pdu == DeviceProxy("STAT/PDU/1")`` device controls the Power Distribution
Unit (PDU)
...@@ -24,6 +24,7 @@ Even without having access to any LOFAR2.0 hardware, you can install the full st ...@@ -24,6 +24,7 @@ Even without having access to any LOFAR2.0 hardware, you can install the full st
devices/digitalbeam devices/digitalbeam
devices/boot devices/boot
devices/docker devices/docker
devices/pdu
devices/recv devices/recv
devices/sdp devices/sdp
devices/sst-xst devices/sst-xst
......
...@@ -35,6 +35,7 @@ where=./ ...@@ -35,6 +35,7 @@ where=./
console_scripts = console_scripts =
l2ss-apsct = tangostationcontrol.devices.apsct:main l2ss-apsct = tangostationcontrol.devices.apsct:main
l2ss-apspu = tangostationcontrol.devices.apspu:main l2ss-apspu = tangostationcontrol.devices.apspu:main
l2ss-pdu = tangostationcontrol.devices.pdu:main
l2ss-tilebeam = tangostationcontrol.devices.tilebeam:main l2ss-tilebeam = tangostationcontrol.devices.tilebeam:main
l2ss-beamlet = tangostationcontrol.devices.sdp.beamlet:main l2ss-beamlet = tangostationcontrol.devices.sdp.beamlet:main
l2ss-digitalbeam = tangostationcontrol.devices.sdp.digitalbeam:main l2ss-digitalbeam = tangostationcontrol.devices.sdp.digitalbeam:main
......
...@@ -10,10 +10,11 @@ If a new device is added, it will (likely) need to be referenced in several plac ...@@ -10,10 +10,11 @@ If a new device is added, it will (likely) need to be referenced in several plac
- Adjust `docker-compose/jupyter/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py` to make an alias for it available in Jupyter, - Adjust `docker-compose/jupyter/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py` to make an alias for it available in Jupyter,
- 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,
- 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, - 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: 5715
- 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,
- Adjust `.gitlab-ci.yml` to add the device to the `docker_build_image_all` step and to create a `docker_build_image_device_XXX` step, - Adjust `.gitlab-ci.yml` to add the device to the `docker_build_image_all` step and to create a `docker_build_image_device_XXX` step,
- Add to `docs/source/devices/` to mention the device in the end-user documentation. - Add to `tangostationcontrol/docs/source/devices/` to mention the device in the end-user documentation.
- Adjust `docs/source/index.rst` to include the newly created file in `docs/source/devices/`. - Adjust `tangostationcontrol/docs/source/index.rst` to include the newly created file in `docs/source/devices/`.
...@@ -233,6 +233,7 @@ class Boot(lofar_device): ...@@ -233,6 +233,7 @@ class Boot(lofar_device):
dtype='DevVarStringArray', dtype='DevVarStringArray',
mandatory=False, mandatory=False,
default_value=["STAT/Docker/1", # Docker controls the device containers, so it goes before anything else default_value=["STAT/Docker/1", # Docker controls the device containers, so it goes before anything else
"STAT/PDU/1", # PDU boot early to detect power delivery failure as fast as possible
"STAT/APSPU/1", # APS Power Units control other hardware we want to initialise "STAT/APSPU/1", # APS Power Units control other hardware we want to initialise
"STAT/APSCT/1", "STAT/APSCT/1",
"STAT/RECV/1", # RCUs are input for SDP, so initialise them first "STAT/RECV/1", # RCUs are input for SDP, so initialise them first
......
# -*- coding: utf-8 -*-
#
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
""" PDU Device Server for LOFAR2.0
"""
# Additional import
from tangostationcontrol.common.entrypoint import entry
from tangostationcontrol.devices.lofar_device import lofar_device
from tangostationcontrol.common.lofar_logging import device_logging_to_python, log_exceptions
import logging
logger = logging.getLogger()
__all__ = ["PDU", "main"]
@device_logging_to_python()
class PDU(lofar_device):
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
# --------
# overloaded functions
# --------
def init_device(self):
super().init_device()
@log_exceptions()
def configure_for_initialise(self):
super().configure_for_initialise()
@log_exceptions()
def configure_for_on(self):
super().configure_for_on()
@log_exceptions()
def configure_for_off(self):
super().configure_for_off()
# ----------
# Run server
# ----------
def main(**kwargs):
"""Main function of the PDU module."""
return entry(PDU, **kwargs)
# -*- coding: utf-8 -*-
#
# This file is part of the LOFAR 2.0 Station Software
#
#
#
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
from .base import AbstractTestBases
class TestDevicePDU(AbstractTestBases.TestDeviceBase):
def setUp(self):
"""Intentionally recreate the device object in each test"""
super().setUp("STAT/PDU/1")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment