Skip to content
Snippets Groups Projects
Commit cda83e08 authored by Jan David Mol's avatar Jan David Mol
Browse files

Merge branch 'L2SS-471' into 'master'

L2SS-471: apspu and apsct packaged entrypoints

Closes L2SS-471

See merge request !180
parents f59d5460 411e9a04
No related branches found
No related tags found
1 merge request!180L2SS-471: apspu and apsct packaged entrypoints
...@@ -25,7 +25,7 @@ else ...@@ -25,7 +25,7 @@ else
mkdir -p /tmp/tangostationcontrol 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 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 # 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 fi
/usr/local/bin/wait-for-it.sh "$TANGO_HOST" --timeout=30 --strict -- "$@" /usr/local/bin/wait-for-it.sh "$TANGO_HOST" --timeout=30 --strict -- "$@"
...@@ -32,13 +32,10 @@ services: ...@@ -32,13 +32,10 @@ services:
- ..:/opt/lofar/tango:rw - ..:/opt/lofar/tango:rw
environment: environment:
- TANGO_HOST=${TANGO_HOST} - TANGO_HOST=${TANGO_HOST}
working_dir: /opt/lofar/tango
entrypoint: entrypoint:
- /usr/local/bin/wait-for-it.sh - bin/start-ds.sh
- ${TANGO_HOST}
- --timeout=30
- --strict
- --
# configure CORBA to _listen_ on 0:port, but tell others we're _reachable_ through ${HOSTNAME}:port, since CORBA # 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 # 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-apspu Apsct STAT -v -v -ORBendPoint giop:tcp:0:5709 -ORBendPointPublish giop:tcp:${HOSTNAME}:5709
restart: on-failure restart: on-failure
...@@ -32,13 +32,10 @@ services: ...@@ -32,13 +32,10 @@ services:
- ..:/opt/lofar/tango:rw - ..:/opt/lofar/tango:rw
environment: environment:
- TANGO_HOST=${TANGO_HOST} - TANGO_HOST=${TANGO_HOST}
working_dir: /opt/lofar/tango
entrypoint: entrypoint:
- /usr/local/bin/wait-for-it.sh - bin/start-ds.sh
- ${TANGO_HOST}
- --timeout=30
- --strict
- --
# configure CORBA to _listen_ on 0:port, but tell others we're _reachable_ through ${HOSTNAME}:port, since CORBA # 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 # 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 restart: on-failure
...@@ -31,6 +31,7 @@ services: ...@@ -31,6 +31,7 @@ services:
- ..:/opt/lofar/tango:rw - ..:/opt/lofar/tango:rw
environment: environment:
- TANGO_HOST=${TANGO_HOST} - TANGO_HOST=${TANGO_HOST}
working_dir: /opt/lofar/tango
entrypoint: entrypoint:
- bin/start-ds.sh - bin/start-ds.sh
# configure CORBA to _listen_ on 0:port, but tell others we're _reachable_ through ${HOSTNAME}:port, since CORBA # configure CORBA to _listen_ on 0:port, but tell others we're _reachable_ through ${HOSTNAME}:port, since CORBA
......
...@@ -34,6 +34,8 @@ where=./ ...@@ -34,6 +34,8 @@ where=./
[options.entry_points] [options.entry_points]
console_scripts = console_scripts =
l2ss-apsct = tangostationcontrol.devices.apsct:main
l2ss-apspu = tangostationcontrol.devices.apspu:main
l2ss-boot = tangostationcontrol.devices.boot:main l2ss-boot = tangostationcontrol.devices.boot:main
l2ss-docker-device = tangostationcontrol.devices.docker_device:main l2ss-docker-device = tangostationcontrol.devices.docker_device:main
l2ss-observation = tangostationcontrol.devices.observation:main l2ss-observation = tangostationcontrol.devices.observation:main
...@@ -41,10 +43,10 @@ console_scripts = ...@@ -41,10 +43,10 @@ console_scripts =
l2ss-receiver = tangostationcontrol.devices.recv:main l2ss-receiver = tangostationcontrol.devices.recv:main
l2ss-sdp = tangostationcontrol.devices.sdp.sdp:main l2ss-sdp = tangostationcontrol.devices.sdp.sdp:main
l2ss-sst = tangostationcontrol.devices.sdp.sst: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-reader = tangostationcontrol.statistics_writer.statistics_reader:main
l2ss-statistics-writer = tangostationcontrol.statistics_writer.statistics_writer: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 # The following entry points should eventually be removed / replaced
l2ss-cold-start = tangostationcontrol.toolkit.lts_cold_start:main l2ss-cold-start = tangostationcontrol.toolkit.lts_cold_start:main
......
...@@ -11,31 +11,25 @@ ...@@ -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 # PyTango imports
from tango import DebugIt from tango import DebugIt
from tango.server import run, command from tango.server import run, command
from tango.server import device_property, attribute
from tango import AttrWriteType from tango import AttrWriteType
import numpy import numpy
# Additional import # Additional import
from device_decorators import * from tangostationcontrol.clients.attribute_wrapper import attribute_wrapper
from tangostationcontrol.common.entrypoint import entry
from clients.attribute_wrapper import attribute_wrapper from tangostationcontrol.common.lofar_logging import device_logging_to_python, log_exceptions
from devices.opcua_device import opcua_device from tangostationcontrol.devices.device_decorators import *
from common.lofar_logging import device_logging_to_python, log_exceptions from tangostationcontrol.devices.opcua_device import opcua_device
import logging import logging
logger = logging.getLogger() logger = logging.getLogger()
__all__ = ["APSCT", "main"] __all__ = ["APSCT", "main"]
@device_logging_to_python() @device_logging_to_python()
class APSCT(opcua_device): class APSCT(opcua_device):
# ----------------- # -----------------
...@@ -120,17 +114,10 @@ class APSCT(opcua_device): ...@@ -120,17 +114,10 @@ class APSCT(opcua_device):
""" """
self.opcua_connection.call_method(["APSCT_on"]) self.opcua_connection.call_method(["APSCT_on"])
# ---------- # ----------
# Run server # Run server
# ---------- # ----------
def main(args=None, **kwargs): def main(**kwargs):
"""Main function of the APSCT module.""" """Main function of the ObservationControl module."""
return entry(APSCT, **kwargs)
from common.lofar_logging import configure_logger
configure_logger()
return run((APSCT,), args=args, **kwargs)
if __name__ == '__main__':
main()
...@@ -11,28 +11,20 @@ ...@@ -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 # 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
import numpy import numpy
# Additional import # Additional import
from device_decorators import * from tangostationcontrol.devices.device_decorators import *
from tangostationcontrol.common.entrypoint import entry
from clients.attribute_wrapper import attribute_wrapper from tangostationcontrol.clients.attribute_wrapper import attribute_wrapper
from devices.opcua_device import opcua_device from tangostationcontrol.devices.opcua_device import opcua_device
from common.lofar_logging import device_logging_to_python, log_exceptions from tangostationcontrol.common.lofar_logging import device_logging_to_python, log_exceptions
__all__ = ["APSPU", "main"] __all__ = ["APSPU", "main"]
@device_logging_to_python() @device_logging_to_python()
class APSPU(opcua_device): class APSPU(opcua_device):
# ----------------- # -----------------
...@@ -71,17 +63,10 @@ class APSPU(opcua_device): ...@@ -71,17 +63,10 @@ class APSPU(opcua_device):
# Commands # Commands
# -------- # --------
# ---------- # ----------
# Run server # Run server
# ---------- # ----------
def main(args=None, **kwargs): def main(**kwargs):
"""Main function of the APSPU module.""" """Main function of the ObservationControl module."""
return entry(APSPU, **kwargs)
from common.lofar_logging import configure_logger
configure_logger()
return run((APSPU,), args=args, **kwargs)
if __name__ == '__main__':
main()
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