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

Merge branch 'master' into L2SS-406-grafana-archiver

parents c61066b9 1be0203e
No related branches found
No related tags found
1 merge request!190Resolve L2SS-406 "Grafana archiver"
Showing
with 1430 additions and 973 deletions
#
# Docker compose file that launches an APSCT simulator
#
# Defines:
# - apsct-sim
#
version: '2'
services:
apsct-sim:
build:
context: pypcc-sim-base
container_name: ${CONTAINER_NAME_PREFIX}apsct-sim
networks:
- control
entrypoint: python3 pypcc2.py --simulator --port 4843 --config APSCTTR
restart: on-failure
#
# Docker compose file that launches an APSPU simulator
#
# Defines:
# - apspu-sim
#
version: '2'
services:
apspu-sim:
build:
context: pypcc-sim-base
container_name: ${CONTAINER_NAME_PREFIX}apspu-sim
networks:
- control
entrypoint: python3 pypcc2.py --simulator --port 4842 --config APSPUTR
restart: on-failure
#
# Docker compose file that launches an interactive iTango session.
#
# Connect to the interactive session with 'docker attach itango'.
# Disconnect with the Docker deattach sequence: <CTRL>+<P> <CTRL>+<Q>
#
# Defines:
# - itango: iTango interactive session
#
# Requires:
# - lofar-device-base.yml
#
version: '2'
services:
device-apsct:
image: device-apsct
# build explicitly, as docker-compose does not understand a local image
# being shared among services.
build:
context: lofar-device-base
args:
SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-apsct
networks:
- control
ports:
- "5709:5709" # unique port for this DS
volumes:
- ..:/opt/lofar/tango:rw
environment:
- TANGO_HOST=${TANGO_HOST}
entrypoint:
- /usr/local/bin/wait-for-it.sh
- ${TANGO_HOST}
- --timeout=30
- --strict
- --
# 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 LTS -v -ORBendPoint giop:tcp:0:5709 -ORBendPointPublish giop:tcp:${HOSTNAME}:5709
restart: on-failure
#
# Docker compose file that launches an interactive iTango session.
#
# Connect to the interactive session with 'docker attach itango'.
# Disconnect with the Docker deattach sequence: <CTRL>+<P> <CTRL>+<Q>
#
# Defines:
# - itango: iTango interactive session
#
# Requires:
# - lofar-device-base.yml
#
version: '2'
services:
device-apspu:
image: device-apspu
# build explicitly, as docker-compose does not understand a local image
# being shared among services.
build:
context: lofar-device-base
args:
SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-apspu
networks:
- control
ports:
- "5710:5710" # unique port for this DS
volumes:
- ..:/opt/lofar/tango:rw
environment:
- TANGO_HOST=${TANGO_HOST}
entrypoint:
- /usr/local/bin/wait-for-it.sh
- ${TANGO_HOST}
- --timeout=30
- --strict
- --
# 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 LTS -v -ORBendPoint giop:tcp:0:5710 -ORBendPointPublish giop:tcp:${HOSTNAME}:5710
restart: on-failure
This diff is collapsed.
This diff is collapsed.
...@@ -679,7 +679,7 @@ ...@@ -679,7 +679,7 @@
}, },
"timepicker": {}, "timepicker": {},
"timezone": "", "timezone": "",
"title": "Version information", "title": "Versions",
"uid": "eR9posS7z", "uid": "eR9posS7z",
"version": 1 "version": 1
} }
# Create shortcuts for our devices # Create shortcuts for our devices
apsct = DeviceProxy("LTS/APSCT/1")
apspu = DeviceProxy("LTS/APSPU/1")
recv = DeviceProxy("LTS/RECV/1") recv = DeviceProxy("LTS/RECV/1")
sdp = DeviceProxy("LTS/SDP/1") sdp = DeviceProxy("LTS/SDP/1")
sst = DeviceProxy("LTS/SST/1") sst = DeviceProxy("LTS/SST/1")
...@@ -8,4 +10,4 @@ boot = DeviceProxy("LTS/Boot/1") ...@@ -8,4 +10,4 @@ boot = DeviceProxy("LTS/Boot/1")
docker = DeviceProxy("LTS/Docker/1") docker = DeviceProxy("LTS/Docker/1")
# Put them in a list in case one wants to iterate # Put them in a list in case one wants to iterate
devices = [recv, sdp, sst, xst, unb2, boot, docker] devices = [apsct, apspu, recv, sdp, sst, xst, unb2, boot, docker]
...@@ -9,12 +9,9 @@ version: '2' ...@@ -9,12 +9,9 @@ version: '2'
services: services:
recv-sim: recv-sim:
build: build:
context: recv-sim context: pypcc-sim-base
container_name: ${CONTAINER_NAME_PREFIX}recv-sim container_name: ${CONTAINER_NAME_PREFIX}recv-sim
networks: networks:
- control - control
volumes: entrypoint: python3 pypcc2.py --simulator --port 4840 --config RECVTR
- ${HOME}:/hosthome restart: on-failure
ports:
- "4843:4843"
restart: unless-stopped
...@@ -13,6 +13,4 @@ services: ...@@ -13,6 +13,4 @@ services:
container_name: ${CONTAINER_NAME_PREFIX}sdptr-sim container_name: ${CONTAINER_NAME_PREFIX}sdptr-sim
networks: networks:
- control - control
ports:
- "4840:4840"
restart: unless-stopped restart: unless-stopped
...@@ -9,12 +9,9 @@ version: '2' ...@@ -9,12 +9,9 @@ version: '2'
services: services:
unb2-sim: unb2-sim:
build: build:
context: unb2-sim context: pypcc-sim-base
container_name: ${CONTAINER_NAME_PREFIX}unb2-sim container_name: ${CONTAINER_NAME_PREFIX}unb2-sim
networks: networks:
- control - control
volumes: entrypoint: python3 pypcc2.py --simulator --port 4841 --config UNB2
- ${HOME}:/hosthome restart: on-failure
ports:
- "4844:4844"
restart: unless-stopped
FROM ubuntu:20.04
COPY requirements.txt /requirements.txt
RUN apt-get update && apt-get install -y python3 python3-pip python3-yaml git && \
pip3 install -r requirements.txt && \
git clone --depth 1 --branch master https://git.astron.nl/lofar2.0/pypcc
WORKDIR /pypcc
CMD ["python3","pypcc2.py","--simulator", "--port=4844", "--config=UNB2"]
#check if this file is necessary
opcua
numpy
recordclass>=0.16,<0.16.1
\ No newline at end of file
Enter your LOFAR2.0 Hardware Configuration Enter your LOFAR2.0 Hardware Configuration
=========================================== ===========================================
The software will need to be told various aspects of your station configuration, for example, the hostnames of the station hardware to control. The following settings are installation specific, and are stored as *properties* in the :ref:`tangodb`. The format used here is ``device.property``: The software will need to be told various aspects of your station configuration, for example, the hostnames of the station hardware to control. The following settings are installation specific, and are stored as *properties* in the :ref:`tangodb`.
Stock configurations are provided for several stations, as well as using simulators to simulate the station's interface (which is the default after bootstrapping a station). These are provided in the ``CDB/stations/`` directory, and can be loaded using for example::
sbin/update_ConfigDb.sh CDB/stations/LTS_ConfigDb.json
The following sections describe the settings that are station dependent, and thus must or can be set.
Mandatory settings Mandatory settings
------------------- -------------------
......
.. _boot:
Boot
====================
The ``boot == DeviceProxy("LTS/Boot/1")`` device is responsible for (re)starting and initialising the other devices. Devices which are not reachable, for example because their docker container is explicitly stopped, are skipped during initialisation. This device provides the following commands:
:initialise_station(): Stop and start the other devices in the correct order, set their default values, and command them to initialise their hardware. This procedure runs asynchronously, causing this command to return immediately. Initialisation is aborted if an error is encountered.
:returns: ``None``
The initialisation process can subsequently be followed through monitoring the following attributes:
:initialising_R: Whether the initialisation procedure is still ongoing.
:type: ``bool``
:initialisation_progress_R: Percentage completeness of the initialisation procedure. Each succesfully configured device increments progress.
:type: ``int``
:initialisation_status_R: A description of what the device is currently trying to do. If an error occurs, this will hint towards the cause.
:type: ``str``
A useful pattern is thus to call ``initialise_station()``, wait for ``initialising_R == False``, and then check whether the initalisation was succesful, if ``initialisation_progress_R == 100``. If a device fails to initialise, most likely the :doc:`../interfaces/logs` will need to be consulted.
...@@ -4,7 +4,7 @@ Device Configuration ...@@ -4,7 +4,7 @@ Device Configuration
The devices receive their configuration from two sources: The devices receive their configuration from two sources:
- The TangoDB database, for static *properties*, - The TangoDB database, for static *properties*,
- Externally, from the user, or a control system, that set *control attributes* (see :doc:`devices` for what to set, and :ref:`attributes` for how to set them). - Externally, from the user, or a control system, that set *control attributes* (see the section for each device for what to set, and :ref:`attributes` for how to set them).
.. _tangodb: .. _tangodb:
......
.. _docker:
Docker
====================
The ``docker == DeviceProxy("LTS/Docker/1")`` device controls the docker containers. It allows starting and stopping them, and querying whether they are running. Each container is represented by two attributes:
:<container>_R: Returns whether the container is running.
:type: ``bool``
:<container>_RW: Set to ``True`` to start the container, and to ``False`` to stop it.
:type: ``bool``
.. warning:: Do *not* stop the ``tango`` container, as doing so cripples the Tango infrastructure, leaving the station inoperable. It is also not wise to stop the ``device_docker`` container, as doing so would render this device unreachable.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment