Skip to content
Snippets Groups Projects
Commit 49c178c4 authored by Hannes Feldt's avatar Hannes Feldt
Browse files

Merge branch 'master' into L2SS-1341-migrate_tango2nomad

parents 03087c43 0da37e29
No related branches found
No related tags found
4 merge requests!751Resolve L2SS-1340 "Deploy monitoring to nomad",!750Resolve L2SS-1341 "Migrate tango2nomad",!749Resolve L2SS-1342 "Migrate jupyter",!710L2SS-1341: Migrate tango to nomad
Showing with 65 additions and 28 deletions
...@@ -115,7 +115,6 @@ docker_build_image: ...@@ -115,7 +115,6 @@ docker_build_image:
parallel: parallel:
matrix: matrix:
- IMAGE: - IMAGE:
- lofar-device-base
- ec-sim - ec-sim
- http-json-schemas - http-json-schemas
- prometheus - prometheus
...@@ -137,6 +136,15 @@ docker_build_image: ...@@ -137,6 +136,15 @@ docker_build_image:
# Do not remove 'bash' or statement will be ignored by primitive docker shell # Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh $IMAGE $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh $IMAGE $tag
docker_build_image_device_base:
extends: .base_docker_images
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH) || $CI_COMMIT_TAG
script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh lofar-device-base $tag
newline_at_eof: newline_at_eof:
stage: linting stage: linting
before_script: before_script:
......
# Jupyter & enhancements
ipython >=7.27.0,!=7.28.0 # BSD ipython >=7.27.0,!=7.28.0 # BSD
jupyter jupyter
jupyterlab >=3,<4 # until https://github.com/jupyterlab/jupyterlab-git/issues/1245 jupyterlab >=3,<4 # until https://github.com/jupyterlab/jupyterlab-git/issues/1245
...@@ -5,26 +6,32 @@ jupyterlab_h5web[full] # MIT ...@@ -5,26 +6,32 @@ jupyterlab_h5web[full] # MIT
jupyterlab-git jupyterlab-git
jupyterlab-skip-traceback jupyterlab-skip-traceback
ipykernel ipykernel
jupyter_bokeh
matplotlib
jupyterplot
nbconvert nbconvert
notebook-as-pdf notebook-as-pdf
PyPDF2==2.12.1 # until https://github.com/betatim/notebook-as-pdf/issues/40 hits a notebook-as-pdf release PyPDF2==2.12.1 # until https://github.com/betatim/notebook-as-pdf/issues/40 hits a notebook-as-pdf release
python-logstash-async
PyMySQL[rsa] # low-level access to station components
psycopg2-binary >= 2.9.2 #LGPL opcua
asyncua >= 0.9.90 # LGPLv3
pyvisa pyvisa
pyvisa-py pyvisa-py
opcua
# antenna locations
lofarantpos >= 0.5.0 # Apache 2 lofarantpos >= 0.5.0 # Apache 2
python-geohash >= 0.8.5 # Apache 2 / MIT python-geohash >= 0.8.5 # Apache 2 / MIT
asyncua >= 0.9.90 # LGPLv3 etrs-itrs@git+https://github.com/brentjens/etrs-itrs # Apache 2
numpy # plotting
scipy matplotlib
jupyter_bokeh
jupyterplot
pabeam@git+https://git.astron.nl/mevius/grate # Apache2 # useful LOFAR software
pabeam@git+https://git.astron.nl/mevius/pabeam # Apache2
lofar-station-client@git+https://git.astron.nl/lofar2.0/lofar-station-client # Apache2 lofar-station-client@git+https://git.astron.nl/lofar2.0/lofar-station-client # Apache2
attributewrapper@git+https://git.astron.nl/lofar2.0/attributewrapper # Apache2 attributewrapper@git+https://git.astron.nl/lofar2.0/attributewrapper # Apache2
etrs-itrs@git+https://github.com/brentjens/etrs-itrs # Apache 2
# user packages
numpy
scipy
astropy
...@@ -45,7 +45,7 @@ function integration_test { ...@@ -45,7 +45,7 @@ function integration_test {
} }
# list of arguments expected in the input # list of arguments expected in the input
optstring_long="help,no-build,preserve,save-logs" optstring_long="help,no-build,skip-tests,preserve,save-logs"
optstring="hnb" optstring="hnb"
options=$(getopt -l ${optstring_long} -o ${optstring} -- "$@") options=$(getopt -l ${optstring_long} -o ${optstring} -- "$@")
...@@ -63,6 +63,10 @@ while true; do ...@@ -63,6 +63,10 @@ while true; do
export no_build=1 export no_build=1
export NO_BASE=${no_build} export NO_BASE=${no_build}
;; ;;
--skip-tests)
echo "Only setup and configure environment don't run any tests"
export no_tests=1
;;
--) --)
shift shift
break;; break;;
...@@ -209,6 +213,10 @@ make start "${DEVICES[@]}" ...@@ -209,6 +213,10 @@ make start "${DEVICES[@]}"
# Wait for devices to restart # Wait for devices to restart
make await "${DEVICES[@]}" make await "${DEVICES[@]}"
if [ -n "${no_tests}" ]; then
exit 0
fi
# Start the integration test # Start the integration test
cd "$LOFAR20_DIR/docker-compose" || exit 1 cd "$LOFAR20_DIR/docker-compose" || exit 1
make up integration-test make up integration-test
......
...@@ -153,16 +153,17 @@ class TestCalibrationDevice(AbstractTestBases.TestDeviceBase): ...@@ -153,16 +153,17 @@ class TestCalibrationDevice(AbstractTestBases.TestDeviceBase):
[[1, x + DEFAULT_N_HBA_TILES] for x in range(0, DEFAULT_N_HBA_TILES)] [[1, x + DEFAULT_N_HBA_TILES] for x in range(0, DEFAULT_N_HBA_TILES)]
).flatten(), ).flatten(),
# [1, 48, 1, 49, x ... 1, 95] # [1, 48, 1, 49, x ... 1, 95]
"Frequency_Band_RW_default": ["HBA_110_190"] * (DEFAULT_N_HBA_TILES * 2),
} }
self.antennafield_proxy = self.setup_proxy("STAT/AntennaField/LBA") self.antennafield_proxy = self.setup_proxy("STAT/AntennaField/HBA0")
self.antennafield_proxy.put_property(calibration_properties) self.antennafield_proxy.put_property(calibration_properties)
self.antennafield_proxy.boot() self.antennafield_proxy.boot()
self.proxy.boot() self.proxy.boot()
# calibrate # calibrate
self.proxy.calibrate_recv("STAT/AntennaField/LBA") self.proxy.calibrate_recv("STAT/AntennaField/HBA0")
# check the results # check the results
rcu_attenuator_db_pwr = self.antennafield_proxy.RCU_attenuator_dB_RW[:, 0] rcu_attenuator_db_pwr = self.antennafield_proxy.RCU_attenuator_dB_RW[:, 0]
...@@ -213,6 +214,7 @@ class TestCalibrationDevice(AbstractTestBases.TestDeviceBase): ...@@ -213,6 +214,7 @@ class TestCalibrationDevice(AbstractTestBases.TestDeviceBase):
[[1, x + DEFAULT_N_HBA_TILES] for x in range(0, DEFAULT_N_HBA_TILES)] [[1, x + DEFAULT_N_HBA_TILES] for x in range(0, DEFAULT_N_HBA_TILES)]
).flatten(), ).flatten(),
# [1, 48, 1, 49, x ... 1, 95] # [1, 48, 1, 49, x ... 1, 95]
"Frequency_Band_RW_default": ["HBA_110_190"] * (DEFAULT_N_HBA_TILES * 2),
} }
self.antennafield_proxy = self.setup_proxy("STAT/AntennaField/HBA0") self.antennafield_proxy = self.setup_proxy("STAT/AntennaField/HBA0")
......
...@@ -260,7 +260,10 @@ class AntennaMapper: ...@@ -260,7 +260,10 @@ class AntennaMapper:
) in enumerate(zip(power_mapping, control_mapping)): ) in enumerate(zip(power_mapping, control_mapping)):
if antenna_type == "LBA" and pwr_attribute: if antenna_type == "LBA" and pwr_attribute:
if dev_power > 0 and dev_control > 0: if dev_power > 0 and dev_control > 0:
mapped_values[dev_power] = set_values[idx] mapped_values[dev_power - 1, dev_input_power] = set_values[idx]
mapped_values[dev_control - 1, dev_input_control] = set_values[
idx
]
else: else:
if dev_power > 0: if dev_power > 0:
mapped_values[dev_power - 1, dev_input_power] = set_values[idx][ mapped_values[dev_power - 1, dev_input_power] = set_values[idx][
......
...@@ -41,9 +41,6 @@ class PowerHierarchyDevice(AbstractHierarchyDevice): ...@@ -41,9 +41,6 @@ class PowerHierarchyDevice(AbstractHierarchyDevice):
def _boot_device(self, device: DeviceProxy): def _boot_device(self, device: DeviceProxy):
"""Default sequence of device booting operations""" """Default sequence of device booting operations"""
if device.state() == DevState.ON:
logger.info(f"Booting {device}: Succesful: It's already ON?")
return
logger.info(f"Booting {device}: off()") logger.info(f"Booting {device}: off()")
device.off() device.off()
......
...@@ -100,7 +100,7 @@ class RECVDevice(OPCUADevice): ...@@ -100,7 +100,7 @@ class RECVDevice(OPCUADevice):
doc="Maximum amount of time to wait after turning RCU(s) on or off", doc="Maximum amount of time to wait after turning RCU(s) on or off",
dtype="DevFloat", dtype="DevFloat",
mandatory=False, mandatory=False,
default_value=30.0, default_value=60.0,
) )
RCU_DTH_On_Off_timeout = device_property( RCU_DTH_On_Off_timeout = device_property(
...@@ -388,10 +388,10 @@ class RECVDevice(OPCUADevice): ...@@ -388,10 +388,10 @@ class RECVDevice(OPCUADevice):
self.RCU_on() self.RCU_on()
self.wait_attribute("RECVTR_translator_busy_R", False, self.RCU_On_Off_timeout) self.wait_attribute("RECVTR_translator_busy_R", False, self.RCU_On_Off_timeout)
self.RCU_DTH_off()
self.wait_attribute( # NB: Powering on RCUs causes DTH to be turned off, which is what we want
"RECVTR_translator_busy_R", False, self.RCU_DTH_On_Off_timeout # to create a steady baseline after powerup. This is done by RECVTR
) # even if the RCUs are already powered on.
def _power_hardware_off(self): def _power_hardware_off(self):
"""Turns off the RCUs.""" """Turns off the RCUs."""
......
...@@ -162,7 +162,7 @@ class BST(Statistics): ...@@ -162,7 +162,7 @@ class BST(Statistics):
comms_id=StatisticsClient, comms_id=StatisticsClient,
comms_annotation={"type": "statistics", "parameter": "bst_timestamps"}, comms_annotation={"type": "statistics", "parameter": "bst_timestamps"},
dims=(N_pn,), dims=(N_pn,),
datatype=numpy.float32, datatype=numpy.uint64,
) )
# reported integration interval # reported integration interval
# from each FPGA in the latest BSTs # from each FPGA in the latest BSTs
......
...@@ -296,12 +296,12 @@ class SDPFirmware(OPCUADevice): ...@@ -296,12 +296,12 @@ class SDPFirmware(OPCUADevice):
def _power_hardware_on(self): def _power_hardware_on(self):
"""Boot the SDP Firmware user image""" """Boot the SDP Firmware user image"""
self._boot_to_image(0) self._boot_to_image(1)
def _power_hardware_off(self): def _power_hardware_off(self):
"""Use the SDP Firmware factory image""" """Use the SDP Firmware factory image"""
self._boot_to_image(1) self._boot_to_image(0)
# -------- # --------
# Commands # Commands
......
...@@ -195,6 +195,9 @@ class StationManager(LOFARDevice): ...@@ -195,6 +195,9 @@ class StationManager(LOFARDevice):
Switch the station into OFF state. Switch the station into OFF state.
It can only be executed from state HIBERNATE. It can only be executed from state HIBERNATE.
""" """
if self.station_state == StationState.OFF:
return
if not self._is_transition_allowed(StationState.OFF): if not self._is_transition_allowed(StationState.OFF):
raise Exception(f"Station did not transition to {StationState.OFF.name}") raise Exception(f"Station did not transition to {StationState.OFF.name}")
...@@ -214,6 +217,9 @@ class StationManager(LOFARDevice): ...@@ -214,6 +217,9 @@ class StationManager(LOFARDevice):
Switch the station into HIBERNATE state. Switch the station into HIBERNATE state.
It can only be executed from either state OFF or STANDBY. It can only be executed from either state OFF or STANDBY.
""" """
if self.station_state == StationState.HIBERNATE:
return
if not self._is_transition_allowed(StationState.HIBERNATE): if not self._is_transition_allowed(StationState.HIBERNATE):
raise Exception( raise Exception(
f"Station did not transition to {StationState.HIBERNATE.name}" f"Station did not transition to {StationState.HIBERNATE.name}"
...@@ -247,6 +253,9 @@ class StationManager(LOFARDevice): ...@@ -247,6 +253,9 @@ class StationManager(LOFARDevice):
Switch the station into STANDBY state. Switch the station into STANDBY state.
It can only be executed from either state HIBERNATE or ON. It can only be executed from either state HIBERNATE or ON.
""" """
if self.station_state == StationState.STANDBY:
return
if not self._is_transition_allowed(StationState.STANDBY): if not self._is_transition_allowed(StationState.STANDBY):
raise Exception( raise Exception(
f"Station did not transition to {StationState.STANDBY.name}" f"Station did not transition to {StationState.STANDBY.name}"
...@@ -278,6 +287,9 @@ class StationManager(LOFARDevice): ...@@ -278,6 +287,9 @@ class StationManager(LOFARDevice):
Switch the station into ON state. Switch the station into ON state.
It can only be executed from state STANDBY. It can only be executed from state STANDBY.
""" """
if self.station_state == StationState.ON:
return
if not self._is_transition_allowed(StationState.ON): if not self._is_transition_allowed(StationState.ON):
raise Exception(f"Station did not transition to {StationState.ON.name}") raise Exception(f"Station did not transition to {StationState.ON.name}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment