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

Merge branch 'master' into L2SS-429-timescaledb-container

parents fed1b7da 5f401cd6
No related branches found
No related tags found
1 merge request!177Resolve L2SS-429 "Timescaledb container"
Showing
with 42 additions and 73 deletions
{
"servers": {
"docker_device": {
"Docker": {
"STAT": {
"Docker": {
"STAT/Docker/1": {}
......@@ -14,7 +14,7 @@
}
}
},
"observation_control": {
"ObservationControl": {
"STAT": {
"ObservationControl": {
"STAT/ObservationControl/1": {}
......
......@@ -28,7 +28,7 @@
"apspu-sim"
],
"OPC_Server_Port": [
"4843"
"4842"
],
"OPC_Time_Out": [
"5.0"
......
......@@ -25,7 +25,7 @@ else
mkdir -p /tmp/tangostationcontrol
python3 setup.py build --build-base /tmp/tangostationcontrol egg_info --egg-base /tmp/tangostationcontrol bdist_wheel --dist-dir /tmp/tangostationcontrol || exit 1
# shellcheck disable=SC2012
sudo pip install "$(ls -Art /tmp/tangostationcontrol/*.whl | tail -n 1)"
sudo pip install --force-reinstall "$(ls -Art /tmp/tangostationcontrol/*.whl | tail -n 1)"
fi
/usr/local/bin/wait-for-it.sh "$TANGO_HOST" --timeout=30 --strict -- "$@"
......@@ -32,13 +32,10 @@ services:
- ..:/opt/lofar/tango:rw
environment:
- TANGO_HOST=${TANGO_HOST}
working_dir: /opt/lofar/tango
entrypoint:
- /usr/local/bin/wait-for-it.sh
- ${TANGO_HOST}
- --timeout=30
- --strict
- --
- 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
- python3 -u /opt/lofar/tango/devices/devices/apsct.py STAT -v -ORBendPoint giop:tcp:0:5709 -ORBendPointPublish giop:tcp:${HOSTNAME}:5709
- l2ss-apsct Apsct STAT -v -v -ORBendPoint giop:tcp:0:5709 -ORBendPointPublish giop:tcp:${HOSTNAME}:5709
restart: on-failure
......@@ -32,13 +32,10 @@ services:
- ..:/opt/lofar/tango:rw
environment:
- TANGO_HOST=${TANGO_HOST}
working_dir: /opt/lofar/tango
entrypoint:
- /usr/local/bin/wait-for-it.sh
- ${TANGO_HOST}
- --timeout=30
- --strict
- --
- 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
- python3 -u /opt/lofar/tango/devices/devices/apspu.py STAT -v -ORBendPoint giop:tcp:0:5710 -ORBendPointPublish giop:tcp:${HOSTNAME}:5710
- l2ss-apspu Apspu STAT -v -ORBendPoint giop:tcp:0:5710 -ORBendPointPublish giop:tcp:${HOSTNAME}:5710
restart: on-failure
......@@ -31,6 +31,7 @@ services:
- ..:/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
......
......@@ -34,6 +34,8 @@ where=./
[options.entry_points]
console_scripts =
l2ss-apsct = tangostationcontrol.devices.apsct:main
l2ss-apspu = tangostationcontrol.devices.apspu:main
l2ss-boot = tangostationcontrol.devices.boot:main
l2ss-docker-device = tangostationcontrol.devices.docker_device:main
l2ss-observation = tangostationcontrol.devices.observation:main
......@@ -41,10 +43,10 @@ console_scripts =
l2ss-receiver = tangostationcontrol.devices.recv:main
l2ss-sdp = tangostationcontrol.devices.sdp.sdp:main
l2ss-sst = tangostationcontrol.devices.sdp.sst:main
l2ss-unb2 = tangostationcontrol.devices.unb2:main
l2ss-xst = tangostationcontrol.devices.sdp.xst:main
l2ss-statistics-reader = tangostationcontrol.statistics_writer.statistics_reader:main
l2ss-statistics-writer = tangostationcontrol.statistics_writer.statistics_writer:main
l2ss-unb2 = tangostationcontrol.devices.unb2:main
l2ss-xst = tangostationcontrol.devices.sdp.xst:main
# The following entry points should eventually be removed / replaced
l2ss-cold-start = tangostationcontrol.toolkit.lts_cold_start:main
......
......@@ -150,7 +150,7 @@ def configure_logger(logger: logging.Logger=None, log_extra=None, debug=False):
from logstash_async.handler import AsynchronousLogstashHandler, LogstashFormatter
# log to the tcp_input of logstash in our ELK stack
handler = AsynchronousLogstashHandler("elk", 5959, database_path='pending_log_messages.db')
handler = AsynchronousLogstashHandler("elk", 5959, database_path='/tmp/lofar_pending_log_messages.db')
# configure log messages
formatter = LogstashFormatter(extra=log_extra, tags=["python", "lofar"])
......
......@@ -11,31 +11,25 @@
"""
# TODO(Corne): Remove sys.path.append hack once packaging is in place!
import os, sys
currentdir = os.path.dirname(os.path.realpath(__file__))
parentdir = os.path.dirname(currentdir)
sys.path.append(parentdir)
# PyTango imports
from tango import DebugIt
from tango.server import run, command
from tango.server import device_property, attribute
from tango import AttrWriteType
from tango import AttrWriteType, DevState
import numpy
# Additional import
from device_decorators import *
from clients.attribute_wrapper import attribute_wrapper
from devices.opcua_device import opcua_device
from common.lofar_logging import device_logging_to_python, log_exceptions
from tangostationcontrol.clients.attribute_wrapper import attribute_wrapper
from tangostationcontrol.common.entrypoint import entry
from tangostationcontrol.common.lofar_logging import device_logging_to_python, log_exceptions
from tangostationcontrol.devices.device_decorators import *
from tangostationcontrol.devices.opcua_device import opcua_device
import logging
logger = logging.getLogger()
__all__ = ["APSCT", "main"]
@device_logging_to_python()
class APSCT(opcua_device):
# -----------------
......@@ -120,17 +114,10 @@ class APSCT(opcua_device):
"""
self.opcua_connection.call_method(["APSCT_on"])
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
"""Main function of the APSCT module."""
from common.lofar_logging import configure_logger
configure_logger()
return run((APSCT,), args=args, **kwargs)
if __name__ == '__main__':
main()
def main(**kwargs):
"""Main function of the ObservationControl module."""
return entry(APSCT, **kwargs)
......@@ -11,28 +11,20 @@
"""
# TODO(Corne): Remove sys.path.append hack once packaging is in place!
import os, sys
currentdir = os.path.dirname(os.path.realpath(__file__))
parentdir = os.path.dirname(currentdir)
sys.path.append(parentdir)
# PyTango imports
from tango import DebugIt
from tango.server import run, command
from tango.server import device_property, attribute
from tango import AttrWriteType
import numpy
# Additional import
from device_decorators import *
from clients.attribute_wrapper import attribute_wrapper
from devices.opcua_device import opcua_device
from common.lofar_logging import device_logging_to_python, log_exceptions
from tangostationcontrol.devices.device_decorators import *
from tangostationcontrol.common.entrypoint import entry
from tangostationcontrol.clients.attribute_wrapper import attribute_wrapper
from tangostationcontrol.devices.opcua_device import opcua_device
from tangostationcontrol.common.lofar_logging import device_logging_to_python, log_exceptions
__all__ = ["APSPU", "main"]
@device_logging_to_python()
class APSPU(opcua_device):
# -----------------
......@@ -71,17 +63,10 @@ class APSPU(opcua_device):
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
"""Main function of the APSPU module."""
from common.lofar_logging import configure_logger
configure_logger()
return run((APSPU,), args=args, **kwargs)
if __name__ == '__main__':
main()
def main(**kwargs):
"""Main function of the ObservationControl module."""
return entry(APSPU, **kwargs)
......@@ -21,9 +21,9 @@ from tango import AttrWriteType, DeviceProxy, DevState
# Additional import
import numpy
from device_decorators import *
from tangostationcontrol.devices.device_decorators import *
from tangostationcontrol.common.entry import entry
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
......
......@@ -19,7 +19,7 @@ import numpy
import asyncio
# Additional import
from device_decorators import *
from tangostationcontrol.devices.device_decorators import *
# Additional import
from tangostationcontrol.common.entrypoint import entry
......
......@@ -15,7 +15,7 @@
from tango import DebugIt
from tango.server import run, command
from tango.server import device_property, attribute
from tango import AttrWriteType
from tango import AttrWriteType, DevState
import numpy
# Additional import
......
......@@ -14,7 +14,7 @@
# PyTango imports
from tango.server import run, command
from tango.server import device_property, attribute
from tango import AttrWriteType, DebugIt
from tango import AttrWriteType, DebugIt, DevState
# Additional import
from tangostationcontrol.common.entrypoint import entry
......
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