Skip to content
Snippets Groups Projects
Commit 56fc56f7 authored by Corné Lukken's avatar Corné Lukken Committed by Hannes Feldt
Browse files

L2SS-1740: Tie Stingray to lofar-station-client for this patch

parent 76c9efd0
No related branches found
No related tags found
1 merge request!6L2SS-1740: Tie Stingray to lofar-station-client for this patch
ARG BUILD_ENV=no_copy
FROM python:3.12 AS build_no_copy
ADD ../../requirements.txt .
COPY ../.. /work
RUN rm -r /work/dist | true
......
......@@ -36,7 +36,8 @@ job "statistics" {
resources {
cpu = 10
memory = 1024
memory = 512
memory_max = 4096
}
template {
......@@ -65,6 +66,38 @@ EOF
}
}
}
group "stingray-metadata" {
count = 1
network {
mode = "bridge"
}
task "stingray-metadata" {
driver = "docker"
config {
image = "git.astron.nl:5000/lofar2.0/stingray/stingray:[[$.image_tag]]"
entrypoint = [
"l2ss-stingray-record",
"zmq+tcp://device-metadata.service.consul:6001/metadata?content-type=application%2Fjson",
"s3://statistics/[[$.station]]/metadata"
]
}
env {
MINIO_ROOT_USER = "[[$.object_storage.user.name]]"
MINIO_ROOT_PASSWORD = "[[$.object_storage.user.name]]"
}
resources {
cpu = 10
memory = 512
}
}
}
[[ range $af, $fields := $.stingray ]]
group "stingray-[[ $af ]]" {
......
# Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
# Copyright (C) 2024 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: Apache-2.0
""" Stingray recorder application """
......@@ -9,7 +9,7 @@ import logging
import os
from urllib.parse import urlparse
from lofar_station_client.statistics.receiver import create
from lofar_station_client.statistics import receivers
from logfmter import Logfmter
from minio import Minio
......@@ -67,9 +67,8 @@ def main():
storage = Storage(args.target.netloc, args.target.path, minio_client)
with storage:
for packet in create(args.source):
for packet in receivers.create(args.source):
data = dict(packet)
data["payload"] = packet.payload().tolist()
storage.write_line(json.dumps(data, default=str))
logger.info("End of packet stream. Shutting down.")
......
importlib-metadata>=0.12, <5.0;python_version<"3.8"
numpy
minio~=7.1.17
lofar-station-client>=0.18.3 # Apache 2
lofar-station-client>=0.18.7 # Apache 2
setuptools~=68.2.0
logfmter # MIT
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