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

Merge branch 'master' into L2SS-770-fix-pyflakes-linting-errors

parents 4210a31e 30cd1018
No related branches found
No related tags found
1 merge request!318Resolve L2SS-770 "Fix pyflakes linting errors"
Showing
with 209 additions and 5 deletions
......@@ -101,6 +101,11 @@ docker_build_image_all:
- 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-unb2 latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-xst latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-temperature-manager latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh archiver-timescale latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh hdbppts-cm latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh hdbppts-es latest
docker_build_image_elk:
extends: .base_docker_images
rules:
......@@ -491,6 +496,66 @@ docker_build_image_device_xst:
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-xst $tag
docker_build_image_device_temperature_manager:
extends: .base_docker_images
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-temperature-manager.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-temperature-manager $tag
docker_build_image_archiver_timescale:
extends: .base_docker_images
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/archiver-timescale.yml
- docker-compose/timescaledb/*
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 archiver-timescale $tag
docker_build_image_hdbppts_cm:
extends: .base_docker_images
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/archiver-timescale.yml
- docker-compose/tango-archiver-ts/*
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 hdbppts-cm $tag
docker_build_image_hdbppts_es:
extends: .base_docker_images
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/archiver-timescale.yml
- docker-compose/tango-archiver-ts/*
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 hdbppts-es $tag
newline_at_eof:
stage: linting
before_script:
......
......@@ -42,6 +42,13 @@
}
}
},
"TemperatureManager": {
"STAT": {
"TemperatureManager": {
"STAT/TemperatureManager/1": {}
}
}
},
"TileBeam": {
"STAT": {
"TileBeam": {
......
......@@ -116,6 +116,16 @@
}
}
},
"TemperatureManager": {
"STAT": {
"TemperatureManager": {
"STAT/TemperatureManager/1": {
"properties": {
}
}
}
}
},
"RECV": {
"STAT": {
"RECV": {
......
#
# Requires:
# - lofar-device-base.yml
#
version: '2'
volumes:
iers-data: {}
services:
device-temperature-manager:
image: device-temperature-manager
# 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-temperature-manager
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "10"
networks:
- control
ports:
- "5716:5716" # unique port for this DS
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ..:/opt/lofar/tango:rw
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-temperature-manager TemperatureManager STAT -v -ORBendPoint giop:tcp:0:5716 -ORBendPointPublish giop:tcp:${HOSTNAME}:5716
restart: unless-stopped
......@@ -13,6 +13,7 @@ beamlet = DeviceProxy("STAT/Beamlet/1")
digitalbeam = DeviceProxy("STAT/DigitalBeam/1")
antennafield = DeviceProxy("STAT/AntennaField/1")
docker = DeviceProxy("STAT/Docker/1")
temperaturemanager = DeviceProxy("STAT/TemperatureManager/1")
# Put them in a list in case one wants to iterate
devices = [apsct, apspu, recv, sdp, sst, xst, unb2, boot, tilebeam, beamlet, digitalbeam, antennafield, docker]
devices = [apsct, apspu, recv, sdp, sst, xst, unb2, boot, tilebeam, beamlet, digitalbeam, antennafield, temperaturemanager, docker]
......@@ -64,13 +64,12 @@ class ArchiverPolicy(object):
return sorted(list(attributes))
class CustomCollector(object):
def __init__(self, station, config, proxy_timeout=250):
def __init__(self, config, station, proxy_timeout=250):
self.station = station
self.policy = ArchiverPolicy(config)
self.proxy_timeout = proxy_timeout
@staticmethod
def _to_metric(dev, attr_info, x, y, idx, value):
def _to_metric(self, dev, attr_info, x, y, idx, value):
""" Convert the given values to a (labels, value) pair, used to construct a Metric. """
if attr_info.data_type in [ArgType.DevShort, ArgType.DevLong, ArgType.DevUShort, ArgType.DevULong, ArgType.DevLong64, ArgType.DevULong64, ArgType.DevInt, ArgType.DevFloat, ArgType.DevDouble]:
......
......@@ -20,7 +20,7 @@ sleep 1 # dsconfig container must be up and running...
# shellcheck disable=SC2016
echo '/usr/local/bin/wait-for-it.sh ${TANGO_HOST} --strict --timeout=300 -- true' | make run dsconfig bash -
DEVICES="device-boot device-apsct device-apspu device-sdp device-recv device-sst device-unb2 device-xst device-beamlet device-digitalbeam device-tilebeam device-pdu device-antennafield"
DEVICES="device-boot device-apsct device-apspu device-sdp device-recv device-sst device-unb2 device-xst device-beamlet device-digitalbeam device-tilebeam device-pdu device-antennafield device-temperature-manager"
SIMULATORS="sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim"
# Build only the required images, please do not build everything that makes CI
......
temperature-manager
====================
``temperature_manager == DeviceProxy("STAT/TemperatureManager/1")``
......@@ -29,6 +29,7 @@ Even without having access to any LOFAR2.0 hardware, you can install the full st
devices/recv
devices/sdp
devices/sst-xst
devices/temperature-manager
devices/configure
configure_station
alerting
......
......@@ -51,6 +51,7 @@ console_scripts =
l2ss-statistics-writer = tangostationcontrol.statistics_writer.statistics_writer:main
l2ss-unb2 = tangostationcontrol.devices.unb2:main
l2ss-xst = tangostationcontrol.devices.sdp.xst:main
l2ss-temperature-manager = tangostationcontrol.devices.temperature_manager:main
# The following entry points should eventually be removed / replaced
l2ss-cold-start = tangostationcontrol.toolkit.lts_cold_start:main
......
......@@ -244,6 +244,7 @@ class Boot(lofar_device):
"STAT/Beamlet/1",
"STAT/TileBeam/1", # Accesses RECV and Beamlet
"STAT/DigitalBeam/1",
"STAT/TemperatureManager/1",
"STAT/AntennaField/1",
],
)
......
# -*- coding: utf-8 -*-
#
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
""" overtemperature managing 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__ = ["TemperatureManager", "main"]
@device_logging_to_python()
class TemperatureManager(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 temperature manager module."""
return entry(TemperatureManager, **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 TestTemperatureManager(AbstractTestBases.TestDeviceBase):
def setUp(self):
"""Intentionally recreate the device object in each test"""
super().setUp("STAT/TemperatureManager/1")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment