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

Merge branch 'master' into L2SS-1030

parents f4866624 f3d1efdc
Branches
Tags
1 merge request!468Resolve L2SS-1030 "Create configuration device"
...@@ -38,6 +38,12 @@ services: ...@@ -38,6 +38,12 @@ services:
- TANGO_HOST=${TANGO_HOST} - TANGO_HOST=${TANGO_HOST}
- TANGO_ZMQ_EVENT_PORT=5811 - TANGO_ZMQ_EVENT_PORT=5811
- TANGO_ZMQ_HEARTBEAT_PORT=5911 - TANGO_ZMQ_HEARTBEAT_PORT=5911
healthcheck:
test: l2ss-health STAT/TileBeam/1
interval: 1m
timeout: 30s
retries: 3
start_period: 30s
working_dir: /opt/lofar/tango working_dir: /opt/lofar/tango
entrypoint: entrypoint:
- bin/start-ds.sh - bin/start-ds.sh
......
...@@ -42,6 +42,12 @@ services: ...@@ -42,6 +42,12 @@ services:
- TANGO_HOST=${TANGO_HOST} - TANGO_HOST=${TANGO_HOST}
- TANGO_ZMQ_EVENT_PORT=5804 - TANGO_ZMQ_EVENT_PORT=5804
- TANGO_ZMQ_HEARTBEAT_PORT=5904 - TANGO_ZMQ_HEARTBEAT_PORT=5904
healthcheck:
test: l2ss-health STAT/UNB2/1
interval: 1m
timeout: 30s
retries: 3
start_period: 30s
working_dir: /opt/lofar/tango working_dir: /opt/lofar/tango
entrypoint: entrypoint:
- bin/start-ds.sh - bin/start-ds.sh
......
...@@ -45,6 +45,12 @@ services: ...@@ -45,6 +45,12 @@ services:
- TANGO_HOST=${TANGO_HOST} - TANGO_HOST=${TANGO_HOST}
- TANGO_ZMQ_EVENT_PORT=5806 - TANGO_ZMQ_EVENT_PORT=5806
- TANGO_ZMQ_HEARTBEAT_PORT=5906 - TANGO_ZMQ_HEARTBEAT_PORT=5906
healthcheck:
test: l2ss-health STAT/XST/1
interval: 1m
timeout: 30s
retries: 3
start_period: 30s
working_dir: /opt/lofar/tango working_dir: /opt/lofar/tango
entrypoint: entrypoint:
- bin/start-ds.sh - bin/start-ds.sh
......
...@@ -7,6 +7,7 @@ RUN sudo apt-get install -y g++ gcc && sudo apt-get clean ...@@ -7,6 +7,7 @@ RUN sudo apt-get install -y g++ gcc && sudo apt-get clean
RUN sudo apt-get install -y shellcheck graphviz && sudo apt-get clean RUN sudo apt-get install -y shellcheck graphviz && sudo apt-get clean
RUN sudo apt-get install -y python3-dev libboost-python-dev pkg-config && sudo apt-get clean RUN sudo apt-get install -y python3-dev libboost-python-dev pkg-config && sudo apt-get clean
RUN sudo apt-get install -y rsync && sudo apt-get clean RUN sudo apt-get install -y rsync && sudo apt-get clean
RUN sudo apt-get install -y netcat && sudo apt-get clean
COPY lofar-device-base/lofar-requirements.txt /lofar-requirements.txt COPY lofar-device-base/lofar-requirements.txt /lofar-requirements.txt
......
...@@ -18,6 +18,12 @@ services: ...@@ -18,6 +18,12 @@ services:
options: options:
max-size: "100m" max-size: "100m"
max-file: "10" max-file: "10"
healthcheck:
test: python -c "import socket; s = socket.socket(); s.settimeout(10); s.connect(('$HOSTNAME', 1514));"
interval: 1m
timeout: 30s
retries: 3
start_period: 30s
networks: networks:
- control - control
ports: ports:
......
...@@ -31,9 +31,9 @@ function integration_test { ...@@ -31,9 +31,9 @@ function integration_test {
# shellcheck disable=SC2145 # shellcheck disable=SC2145
echo "make restart ${restarts[@]} ..." echo "make restart ${restarts[@]} ..."
make restart "${restarts[@]}" make restart "${restarts[@]}"
make await "${restarts[@]}"
fi fi
#TODO(L2SS-988): Use healthcheck to wait for containers to become ready
sleep 30
echo "make integration ${1} ..." echo "make integration ${1} ..."
make integration "${1}" make integration "${1}"
} }
...@@ -76,6 +76,8 @@ sleep 1 # dsconfig container must be up and running... ...@@ -76,6 +76,8 @@ sleep 1 # dsconfig container must be up and running...
# shellcheck disable=SC2016 # shellcheck disable=SC2016
echo '/usr/local/bin/wait-for-it.sh ${TANGO_HOST} --strict --timeout=300 -- true' | make run dsconfig bash - echo '/usr/local/bin/wait-for-it.sh ${TANGO_HOST} --strict --timeout=300 -- true' | make run dsconfig bash -
# Devices list is used to explitly word split when supplied to commands, must
# disable shellcheck SC2086 for each case.
DEVICES="device-boot device-apsct device-ccd device-apspu device-sdp device-recv 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 device-observation-control device-configuration" DEVICES="device-boot device-apsct device-ccd device-apspu device-sdp device-recv 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 device-observation-control device-configuration"
SIMULATORS="sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim ccd-sim" SIMULATORS="sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim ccd-sim"
...@@ -108,10 +110,6 @@ integration_test dummy ...@@ -108,10 +110,6 @@ integration_test dummy
# make start elk # L2SS-970: elk temporarily disabled # make start elk # L2SS-970: elk temporarily disabled
make start logstash make start logstash
# Give elk time to start
# TODO(L2SS-988): Use a nicer more reliable mechanism
sleep 10
# Update the dsconfig # Update the dsconfig
# Do not remove `bash`, otherwise statement ignored by gitlab ci shell! # Do not remove `bash`, otherwise statement ignored by gitlab ci shell!
bash "${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${LOFAR20_DIR}"/CDB/LOFAR_ConfigDb.json bash "${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${LOFAR20_DIR}"/CDB/LOFAR_ConfigDb.json
...@@ -132,9 +130,9 @@ make start $DEVICES ...@@ -132,9 +130,9 @@ make start $DEVICES
# Archive devices: archive-timescale first # Archive devices: archive-timescale first
make start archiver-timescale make start archiver-timescale
# Give devices time to restart # Wait for archiver and devices to restart
# TODO(L2SS-988): Use a nicer more reliable mechanism # shellcheck disable=SC2086
sleep 70 make await archiver-timescale $DEVICES
# Give archiver-timescale time to start # Give archiver-timescale time to start
# shellcheck disable=SC2016 # shellcheck disable=SC2016
......
0.3.1 0.4.0
...@@ -64,6 +64,7 @@ console_scripts = ...@@ -64,6 +64,7 @@ console_scripts =
l2ss-parse-statistics-packet = tangostationcontrol.statistics.packet:main l2ss-parse-statistics-packet = tangostationcontrol.statistics.packet:main
l2ss-random-data = tangostationcontrol.test.devices.random_data:main l2ss-random-data = tangostationcontrol.test.devices.random_data:main
l2ss-version = tangostationcontrol:print_version l2ss-version = tangostationcontrol:print_version
l2ss-health = tangostationcontrol.common.health:main
[options.package_data] [options.package_data]
* = *.json, *.mib * = *.json, *.mib
# -*- coding: utf-8 -*-
#
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
import sys import sys
from tango.server import run from tango.server import run
......
# -*- coding: utf-8 -*-
#
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
import sys
from tango import DeviceProxy
def main(*args, **kwargs):
"""Main function health check"""
# Remove first argument as it is the filename
args = sys.argv[1:]
try:
DeviceProxy(args[0]).ping()
return 0
except BaseException:
return 1
...@@ -82,7 +82,7 @@ class TestStatisticsWriterSST(BaseIntegrationTestCase): ...@@ -82,7 +82,7 @@ class TestStatisticsWriterSST(BaseIntegrationTestCase):
'2021-09-20T12:17:40.000+00:00' '2021-09-20T12:17:40.000+00:00'
) )
self.assertIsNotNone(stat) self.assertIsNotNone(stat)
self.assertEqual("0.3.1", stat.station_version_id) self.assertEqual("0.4.0", stat.station_version_id)
self.assertEqual("0.1", stat.writer_version_id) self.assertEqual("0.1", stat.writer_version_id)
def test_insert_tango_SST_statistics(self): def test_insert_tango_SST_statistics(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment