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

Merge branch 'master' into L2SS-434-create-sphinx-docs

parents 79d536b0 25b6afd2
Branches
Tags
1 merge request!150L2SS-434: Add sphinx documentation content
if [ ${#} -ne 1 ]; then #!/bin/bash
echo "You must provide a file name for the TANGO_HOST DB dump!"
exit -1
fi
docker exec -it dsconfig python -m dsconfig.dump > ${1} # writes the JSON dump to stdout
docker exec -it dsconfig python -m dsconfig.dump
#!/bin/bash
git submodule update --init
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
ABSOLUTE_PATH=$(realpath $(dirname ${BASH_SOURCE})) ABSOLUTE_PATH=$(realpath $(dirname ${BASH_SOURCE}))
export LOFAR20_DIR=${1:-$(realpath ${ABSOLUTE_PATH}/../..)} export LOFAR20_DIR=${1:-$(realpath ${ABSOLUTE_PATH}/../..)}
if [ ! -f "${LOFAR20_DIR}/.git/hooks/post-checkout" ]; then
alias git="cp ${LOFAR20_DIR}/bin/update_submodules.sh ${LOFAR20_DIR}/.git/hooks/post-checkout; cp ${LOFAR20_DIR}/bin/update_submodules.sh ${LOFAR20_DIR}/.git/hooks/post-merge; unalias git; git"
fi
# This needs to be modified for a development environment. # This needs to be modified for a development environment.
# In case you run multiple Docker networks on the same host in parallel, you need to specify a unique # In case you run multiple Docker networks on the same host in parallel, you need to specify a unique
# network name for each of them. # network name for each of them.
......
...@@ -31,7 +31,6 @@ from clients.docker_client import DockerClient ...@@ -31,7 +31,6 @@ from clients.docker_client import DockerClient
from clients.attribute_wrapper import attribute_wrapper from clients.attribute_wrapper import attribute_wrapper
from devices.hardware_device import hardware_device from devices.hardware_device import hardware_device
from common.lofar_logging import device_logging_to_python, log_exceptions from common.lofar_logging import device_logging_to_python, log_exceptions
from common.lofar_git import get_version
__all__ = ["Docker", "main"] __all__ = ["Docker", "main"]
...@@ -50,7 +49,6 @@ class Docker(hardware_device): ...@@ -50,7 +49,6 @@ class Docker(hardware_device):
# ---------- # ----------
# Attributes # Attributes
# ---------- # ----------
version_R = attribute(dtype=str, access=AttrWriteType.READ, fget=lambda self: get_version())
archiver_maria_db_R = attribute_wrapper(comms_annotation={"container": "archiver-maria-db"}, datatype=numpy.bool_) archiver_maria_db_R = attribute_wrapper(comms_annotation={"container": "archiver-maria-db"}, datatype=numpy.bool_)
archiver_maria_db_RW = attribute_wrapper(comms_annotation={"container": "archiver-maria-db"}, datatype=numpy.bool_, access=AttrWriteType.READ_WRITE) archiver_maria_db_RW = attribute_wrapper(comms_annotation={"container": "archiver-maria-db"}, datatype=numpy.bool_, access=AttrWriteType.READ_WRITE)
databaseds_R = attribute_wrapper(comms_annotation={"container": "databaseds"}, datatype=numpy.bool_) databaseds_R = attribute_wrapper(comms_annotation={"container": "databaseds"}, datatype=numpy.bool_)
......
...@@ -15,11 +15,12 @@ from abc import ABCMeta, abstractmethod ...@@ -15,11 +15,12 @@ from abc import ABCMeta, abstractmethod
# PyTango imports # PyTango imports
from tango.server import Device, command, DeviceMeta, attribute from tango.server import Device, command, DeviceMeta, attribute
from tango import DevState, DebugIt, Attribute, DeviceProxy from tango import DevState, DebugIt, Attribute, DeviceProxy, AttrWriteType
# Additional import # Additional import
from clients.attribute_wrapper import attribute_wrapper from clients.attribute_wrapper import attribute_wrapper
from common.lofar_logging import log_exceptions from common.lofar_logging import log_exceptions
from common.lofar_git import get_version
from devices.abstract_device import AbstractDeviceMetas from devices.abstract_device import AbstractDeviceMetas
from devices.device_decorators import only_in_states, fault_on_error from devices.device_decorators import only_in_states, fault_on_error
...@@ -56,6 +57,8 @@ class hardware_device(Device, metaclass=AbstractDeviceMetas): ...@@ -56,6 +57,8 @@ class hardware_device(Device, metaclass=AbstractDeviceMetas):
The user triggers their transitions by the commands reflecting the target state (Initialise(), On(), Fault()). The user triggers their transitions by the commands reflecting the target state (Initialise(), On(), Fault()).
""" """
version_R = attribute(dtype=str, access=AttrWriteType.READ, fget=lambda self: get_version())
# list of property names too be set first by set_defaults # list of property names too be set first by set_defaults
first_default_settings = [] first_default_settings = []
......
...@@ -29,7 +29,6 @@ from devices.device_decorators import * ...@@ -29,7 +29,6 @@ from devices.device_decorators import *
from clients.opcua_client import OPCUAConnection from clients.opcua_client import OPCUAConnection
from devices.hardware_device import hardware_device from devices.hardware_device import hardware_device
from common.lofar_logging import device_logging_to_python, log_exceptions from common.lofar_logging import device_logging_to_python, log_exceptions
from common.lofar_git import get_version
__all__ = ["opcua_device", "main"] __all__ = ["opcua_device", "main"]
......
...@@ -30,7 +30,6 @@ from device_decorators import * ...@@ -30,7 +30,6 @@ from device_decorators import *
from clients.attribute_wrapper import attribute_wrapper from clients.attribute_wrapper import attribute_wrapper
from devices.opcua_device import opcua_device from devices.opcua_device import opcua_device
from common.lofar_logging import device_logging_to_python, log_exceptions from common.lofar_logging import device_logging_to_python, log_exceptions
from common.lofar_git import get_version
__all__ = ["RECV", "main"] __all__ = ["RECV", "main"]
...@@ -61,7 +60,6 @@ class RECV(opcua_device): ...@@ -61,7 +60,6 @@ class RECV(opcua_device):
# ---------- # ----------
# Attributes # Attributes
# ---------- # ----------
version_R = attribute(dtype=str, access=AttrWriteType.READ, fget=lambda self: get_version())
Ant_mask_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:Ant_mask_RW"], datatype=numpy.bool_, dims=(3, 32), access=AttrWriteType.READ_WRITE) Ant_mask_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:Ant_mask_RW"], datatype=numpy.bool_, dims=(3, 32), access=AttrWriteType.READ_WRITE)
CLK_Enable_PWR_R = attribute_wrapper(comms_annotation=["2:PCC", "2:CLK_Enable_PWR_R"], datatype=numpy.bool_) CLK_Enable_PWR_R = attribute_wrapper(comms_annotation=["2:PCC", "2:CLK_Enable_PWR_R"], datatype=numpy.bool_)
CLK_I2C_STATUS_R = attribute_wrapper(comms_annotation=["2:PCC", "2:CLK_I2C_STATUS_R"], datatype=numpy.int64) CLK_I2C_STATUS_R = attribute_wrapper(comms_annotation=["2:PCC", "2:CLK_I2C_STATUS_R"], datatype=numpy.int64)
......
...@@ -28,7 +28,6 @@ from clients.attribute_wrapper import attribute_wrapper ...@@ -28,7 +28,6 @@ from clients.attribute_wrapper import attribute_wrapper
from devices.opcua_device import opcua_device from devices.opcua_device import opcua_device
from common.lofar_logging import device_logging_to_python, log_exceptions from common.lofar_logging import device_logging_to_python, log_exceptions
from common.lofar_git import get_version
import numpy import numpy
...@@ -78,8 +77,6 @@ class SDP(opcua_device): ...@@ -78,8 +77,6 @@ class SDP(opcua_device):
# Attributes # Attributes
# ---------- # ----------
version_R = attribute(dtype=str, access=AttrWriteType.READ, fget=lambda self: get_version())
FPGA_beamlet_output_enable_R = attribute_wrapper(comms_annotation=["2:FPGA_beamlet_output_enable_R"], datatype=numpy.bool_, dims=(16,)) FPGA_beamlet_output_enable_R = attribute_wrapper(comms_annotation=["2:FPGA_beamlet_output_enable_R"], datatype=numpy.bool_, dims=(16,))
FPGA_beamlet_output_enable_RW = attribute_wrapper(comms_annotation=["2:FPGA_beamlet_output_enable_RW"], datatype=numpy.bool_, dims=(16,), access=AttrWriteType.READ_WRITE) FPGA_beamlet_output_enable_RW = attribute_wrapper(comms_annotation=["2:FPGA_beamlet_output_enable_RW"], datatype=numpy.bool_, dims=(16,), access=AttrWriteType.READ_WRITE)
FPGA_beamlet_output_hdr_eth_destination_mac_R = attribute_wrapper(comms_annotation=["2:FPGA_beamlet_output_hdr_eth_destination_mac_R"], datatype=numpy.str, dims=(16,)) FPGA_beamlet_output_hdr_eth_destination_mac_R = attribute_wrapper(comms_annotation=["2:FPGA_beamlet_output_hdr_eth_destination_mac_R"], datatype=numpy.str, dims=(16,))
......
...@@ -31,7 +31,6 @@ from clients.attribute_wrapper import attribute_wrapper ...@@ -31,7 +31,6 @@ from clients.attribute_wrapper import attribute_wrapper
from devices.opcua_device import opcua_device from devices.opcua_device import opcua_device
from common.lofar_git import get_version
from common.lofar_logging import device_logging_to_python, log_exceptions from common.lofar_logging import device_logging_to_python, log_exceptions
import logging import logging
...@@ -67,8 +66,6 @@ class Statistics(opcua_device, metaclass=ABCMeta): ...@@ -67,8 +66,6 @@ class Statistics(opcua_device, metaclass=ABCMeta):
# Attributes # Attributes
# ---------- # ----------
version_R = attribute(dtype = str, access = AttrWriteType.READ, fget = lambda self: get_version())
# number of UDP packets and bytes that were received # number of UDP packets and bytes that were received
nof_packets_received_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "udp", "parameter": "nof_packets_received"}, datatype=numpy.uint64) nof_packets_received_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "udp", "parameter": "nof_packets_received"}, datatype=numpy.uint64)
nof_bytes_received_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "udp", "parameter": "nof_bytes_received"}, datatype=numpy.uint64) nof_bytes_received_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "udp", "parameter": "nof_bytes_received"}, datatype=numpy.uint64)
......
...@@ -27,7 +27,6 @@ from clients.attribute_wrapper import attribute_wrapper ...@@ -27,7 +27,6 @@ from clients.attribute_wrapper import attribute_wrapper
from devices.opcua_device import opcua_device from devices.opcua_device import opcua_device
from common.lofar_logging import device_logging_to_python, log_exceptions from common.lofar_logging import device_logging_to_python, log_exceptions
from common.lofar_git import get_version
import numpy import numpy
...@@ -49,8 +48,6 @@ class UNB2(opcua_device): ...@@ -49,8 +48,6 @@ class UNB2(opcua_device):
# Attributes # Attributes
# ---------- # ----------
version_R = attribute(dtype=str, access=AttrWriteType.READ, fget=lambda self: get_version())
N_unb = 2 N_unb = 2
N_fpga = 4 N_fpga = 4
N_ddr = 2 N_ddr = 2
......
...@@ -29,7 +29,7 @@ services: ...@@ -29,7 +29,7 @@ services:
volumes: volumes:
- ..:/opt/lofar/tango:rw - ..:/opt/lofar/tango:rw
- /var/run/docker.sock:/var/run/docker.sock:rw # we want to control our sibling containers, NOT do docker-in-docker (dind) - /var/run/docker.sock:/var/run/docker.sock:rw # we want to control our sibling containers, NOT do docker-in-docker (dind)
user: ${CONTAINER_EXECUTION_UID}:${DOCKER_GID} # user that starts this container by definition has access rights to docker user: 1000:${DOCKER_GID} # uid 1000 is the default "tango" user
environment: environment:
- TANGO_HOST=${TANGO_HOST} - TANGO_HOST=${TANGO_HOST}
entrypoint: entrypoint:
......
...@@ -9,7 +9,10 @@ fi ...@@ -9,7 +9,10 @@ fi
# copy file into container to read it from container, as the file's location # copy file into container to read it from container, as the file's location
# in the container won't be the same as on the host. # in the container won't be the same as on the host.
docker cp "${file}" dsconfig:/tmp/dsconfig-load-settings.json docker cp "${file}" dsconfig:/tmp/dsconfig-load-settings.json || exit 1
# write settings # write settings
docker exec -it dsconfig json2tango --write /tmp/dsconfig-load-settings.json docker exec -it dsconfig json2tango --write /tmp/dsconfig-load-settings.json
# somehow json2tango does not return 0 on success
exit 0
#!/bin/bash #!/bin/bash -e
if [ -z "$LOFA20_DIR"]; then if [ -z "$LOFA20_DIR"]; then
# We assume we aren't in the PATH, so we can derive our path. # We assume we aren't in the PATH, so we can derive our path.
...@@ -18,7 +18,7 @@ make start databaseds dsconfig jupyter elk ...@@ -18,7 +18,7 @@ make start databaseds dsconfig jupyter elk
sleep 15 sleep 15
# Update the dsconfig # Update the dsconfig
sbin/update_ConfigDb.sh CDB/integration_ConfigDb.json ${LOFAR20_DIR}/sbin/update_ConfigDb.sh ${LOFAR20_DIR}/CDB/integration_ConfigDb.json
cd "$LOFAR20_DIR/docker-compose" || exit 1 cd "$LOFAR20_DIR/docker-compose" || exit 1
make start sdptr-sim recv-sim unb2-sim make start sdptr-sim recv-sim unb2-sim
......
...@@ -9,7 +9,10 @@ fi ...@@ -9,7 +9,10 @@ fi
# copy file into container to read it from container, as the file's location # copy file into container to read it from container, as the file's location
# in the container won't be the same as on the host. # in the container won't be the same as on the host.
docker cp "${file}" dsconfig:/tmp/dsconfig-update-settings.json docker cp "${file}" dsconfig:/tmp/dsconfig-update-settings.json || exit 1
# update settings # update settings
docker exec -it dsconfig json2tango --write --update /tmp/dsconfig-update-settings.json docker exec -it dsconfig json2tango --write --update /tmp/dsconfig-update-settings.json
# somehow json2tango does not return 0 on success
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment