Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • lofar2.0/tango
  • mckenna/tango
2 results
Show changes
Commits on Source (18)
......@@ -162,6 +162,7 @@ Next change the version in the following places:
# Release Notes
* 0.39.11 Install recent versions of tangostationcontrol and lofar_station_client in Jupyter
* 0.39.10 Use ITRF2014 and extrapolate to current half year by default
* 0.39.9 Minor speedup in observation start (do not wait for metadata to propagate)
* 0.39.8 Allow station manager to use configurable state transition timeouts.
......
......@@ -17,7 +17,7 @@ RUN mamba install --yes 'jupyterlab-git>=0.50.0' && \
RUN jupyter server extension enable --py jupyterlab_git
COPY requirements.txt ./
RUN pip install --break-system-packages -r requirements.txt
RUN pip install --break-system-packages -r requirements.txt --extra-index-url=https://git.astron.nl/api/v4/projects/395/packages/pypi/simple
RUN rm requirements.txt
USER root
......
......@@ -5,12 +5,12 @@ notebook-as-pdf
PyPDF2==2.12.1 # until https://github.com/betatim/notebook-as-pdf/issues/40 hits a notebook-as-pdf release
jupyterlab-git >= 0.50.0 # BSD-3
# high-level access to station components
lofar-station-client[tango]
--extra-index-url https://git.astron.nl/api/v4/projects/395/packages/pypi/simple
tangostationcontrol
# high-level access to station components.
# NB: tangostationcontrol will also install lofar-station-client. The latter
# is omitted here to avoid pip getting confused.
tangostationcontrol >= 0.39
--extra-index-url https://git.astron.nl/api/v4/projects/71/packages/pypi/simple
PyTango # should also come with lofar-station-client
PyTango
# low-level access to station components
opcua
......
......@@ -63,7 +63,7 @@ COPY tmp/requirements.txt /tangostationcontrol-requirements.txt
RUN echo "TANGO_STATION_CONTROL: ${TANGO_STATION_CONTROL}"
RUN if [ -z $TANGO_STATION_CONTROL ]; then \
echo "Installing requirements only"; \
sudo pip3 install -r /tangostationcontrol-requirements.txt; \
sudo pip3 install -r /tangostationcontrol-requirements.txt --extra-index-url=https://git.astron.nl/api/v4/projects/395/packages/pypi/simple; \
fi
# This COPY typically triggers a new build instead of pulling from cache.
......@@ -72,7 +72,7 @@ RUN if [ -z $TANGO_STATION_CONTROL ]; then \
COPY tmp/*.whl /
RUN if [ $TANGO_STATION_CONTROL ]; then \
echo "Installing prebuild Station Control wheel"; \
sudo pip3 install /*.whl; \
sudo pip3 install /*.whl --extra-index-url=https://git.astron.nl/api/v4/projects/395/packages/pypi/simple; \
fi
# install and use ephimerides and geodetic ("measures") tables for casacore.
......
......@@ -24,10 +24,6 @@ job "device-servers" {
tags = ["scrape"]
name = "sync-iers"
port = "metrics"
meta {
metrics_path = "/"
}
}
volume "IERS" {
......
0.39.10
0.39.11
......@@ -2,7 +2,7 @@
# order of appearance. Changing the order has an impact on the overall
# integration process, which may cause wedges in the gate later.
lofar-station-client@git+https://git.astron.nl/lofar2.0/lofar-station-client # Apache 2
lofar-station-client[tango] >= 0.19.0 # Apache 2
PyTango>=9.5.1 # LGPL v3
pyzmq>=24 # LGPL + BSD
numpy>=1.21.6 # BSD3
......
......@@ -20,10 +20,12 @@ from inspect import isawaitable
import numpy
from attribute_wrapper.attribute_wrapper import AttributeWrapper
from prometheus_client import generate_latest
from tango import (
AttReqType,
AttrDataFormat,
Attribute,
AutoTangoAllowThreads,
DeviceProxy,
DevFailed,
DevState,
......@@ -229,7 +231,8 @@ class AttributePoller:
"uptime_R",
"access_count_R",
"available_in_power_state_R",
"tracemalloc_R",
"ds_prometheus_metrics_R",
"ds_tracemalloc_R",
]
)
class LOFARDevice(Device):
......@@ -316,6 +319,14 @@ class LOFARDevice(Device):
polling_period=DEFAULT_POLLING_PERIOD_MS,
)
@attribute(
dtype=(str,),
max_dim_x=10240,
doc="Prometheus metrics as they are currently exposed on this DeviceServer.",
)
def ds_prometheus_metrics_R(self):
return numpy.array(generate_latest().decode().split("\n"), dtype=str)
# Only return the top N tracemalloc statistics
TOPN_TRACEMALLOC_STATISTICS = 16
......@@ -324,7 +335,7 @@ class LOFARDevice(Device):
max_dim_x=TOPN_TRACEMALLOC_STATISTICS,
doc="Python source-code lines that allocated the most memory",
)
def tracemalloc_R(self):
def ds_tracemalloc_R(self):
import tracemalloc
# start tracing in case we didn't
......@@ -475,7 +486,11 @@ class LOFARDevice(Device):
future = self.event_loop_thread.run_coroutine_threadsafe(
self.attribute_poller.poll()
)
_ = future.result()
with AutoTangoAllowThreads(self):
# release lock to allow event_loop to use this device
# to read attributes
_ = future.result()
@command(dtype_in=str, dtype_out=bool)
def is_attribute_polled_by_lofardevice(self, attr_name: str) -> bool:
......@@ -866,8 +881,8 @@ class LOFARDevice(Device):
@command()
@debugit()
@log_exceptions()
def restart_device_server(self):
"""Restart the device server. Needed to reload casacore, and maybe for nasty bugs."""
def ds_restart_device_server(self):
"""Restart the device server. Needed to reload casacore, and maybe for nasty bugs. This function does not return."""
logger.warning("Restarting Device Server")
restart_python()
......
......@@ -109,7 +109,7 @@ class RECVDevice(OPCUADevice):
doc="Maximum amount of time to wait after turning RCU(s) on or off",
dtype="DevFloat",
mandatory=False,
default_value=60.0,
default_value=120.0,
)
RCU_DTH_On_Off_timeout = device_property(
......@@ -406,7 +406,10 @@ class RECVDevice(OPCUADevice):
# even if the RCUs are already powered on.
self.RCU_DTH_setup()
self.wait_attribute("RECVTR_translator_busy_R", False, self.RCU_On_Off_timeout)
# Let dithering be configured in the background since other setup
# does not depend on it.
# (do not wait for RECVTR_translator_busy_R == False)
def _power_hardware_off(self):
"""Turns off the RCUs."""
......
......@@ -14,6 +14,7 @@ from tango.server import command, attribute, device_property
from tangostationcontrol.observation.observation_controller import ObservationController
from tangostationcontrol.common.asyncio import PeriodicTask
from tangostationcontrol.common.constants import DEFAULT_POLLING_PERIOD_MS
from tangostationcontrol.common.device_decorators import DurationMetric
from tangostationcontrol.common.lofar_logging import (
device_logging_to_python,
log_exceptions,
......@@ -190,6 +191,7 @@ class ObservationControl(LOFARDevice):
@only_when_on()
@debugit()
@log_exceptions()
@DurationMetric()
def add_observation(self, parameters: DevString = None):
"""Add an observation. Start/stop it at the specified start/stop times."""
......
......@@ -33,7 +33,7 @@ class OffState(StationState):
target_state = StationStateEnum.HIBERNATE
try:
await self._transition(
target_state, self._power_hierarchy.off_to_hibernate, timeout=1
target_state, self._power_hierarchy.off_to_hibernate, timeout=timeout
)
logger.error(self._power_hierarchy.off_to_hibernate)
except DevFailed as exc:
......
......@@ -11,8 +11,12 @@ package = wheel
wheel_build_env = .pkg
; Python and tox variables are used to access modules and binaries instead of
; directly. This makes the setup robust for using sitepackages=True.
;
; Also provide pip index location for:
; - lofar-station-client
setenv =
PYTHONWARNINGS=default::DeprecationWarning
PYTHONWARNINGS=default::DeprecationWarning
PIP_EXTRA_INDEX_URL=https://git.astron.nl/api/v4/projects/395/packages/pypi/simple
; Share the same envdir with as many jobs as possible due to extensive time it
; takes to compile the pytango wheel, in addition to its large install size.
; should the environment change (such as the Python version) the environment
......@@ -39,6 +43,7 @@ passenv =
setenv =
VIRTUAL_ENV={envdir}
TESTS_DIR=./integration_test/{env:TEST_MODULE:default}
PIP_EXTRA_INDEX_URL=https://git.astron.nl/api/v4/projects/395/packages/pypi/simple
commands =
echo "Integration test directory configured for{env:TESTS_DIR} ({env:TEST_MODULE:default})"
{envpython} -m pytest --version
......@@ -53,6 +58,7 @@ runner = ignore_env_name_mismatch
envdir = {toxworkdir}/coverage
setenv =
VIRTUAL_ENV={envdir}
PIP_EXTRA_INDEX_URL=https://git.astron.nl/api/v4/projects/395/packages/pypi/simple
commands =
{envpython} -m pytest --version
{envpython} -m coverage --version
......