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

Merge branch 'master' into L2SS-769-implement-digital-beam

parents 02d688e1 ffe248d9
No related branches found
No related tags found
1 merge request!317Resolve L2SS-769 "Implement digital beam"
Showing
with 1083 additions and 150 deletions
...@@ -42,17 +42,6 @@ stages: ...@@ -42,17 +42,6 @@ stages:
- . bootstrap/etc/lofar20rc.sh || true - . bootstrap/etc/lofar20rc.sh || true
## Allow docker image script to execute ## Allow docker image script to execute
# - chmod u+x $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh # - chmod u+x $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh
# This suffers from only refs changes not working as expected:
# https://gitlab.com/gitlab-org/gitlab-foss/-/issues/55012
# Therefore we have to add `only: refs: - merge_requests` to all jobs that are
# only supposed to run on merge requests with file changes. However,
# two pipelines will spawn instead of one of which one tagged with 'detached`.
.base_docker_images_except:
extends: .base_docker_images
except:
refs:
- tags
- master
.base_docker_store_images: .base_docker_store_images:
extends: .base_docker_images extends: .base_docker_images
script: script:
...@@ -66,15 +55,17 @@ docker_store_images_master_tag: ...@@ -66,15 +55,17 @@ docker_store_images_master_tag:
- master - master
docker_store_images_changes: docker_store_images_changes:
extends: .base_docker_store_images extends: .base_docker_store_images
only: rules:
refs: # https://stackoverflow.com/questions/68955071/how-to-disable-detached-pipelines-in-gitlab
- merge_requests - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes: when: never
- if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/.env - docker-compose/.env
except: when: always
refs:
- tags
- master
docker_build_image_all: docker_build_image_all:
extends: .base_docker_images extends: .base_docker_images
only: only:
...@@ -110,43 +101,62 @@ docker_build_image_all: ...@@ -110,43 +101,62 @@ docker_build_image_all:
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-sst latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-sst latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-unb2 latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-unb2 latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-xst latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-xst latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-temperature-manager latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh archiver-timescale latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh hdbppts-cm latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh hdbppts-es latest
docker_build_image_elk: docker_build_image_elk:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/elk.yml - docker-compose/elk.yml
- docker-compose/elk/* - docker-compose/elk/*
- docker-compose/elk-configure-host/* - docker-compose/elk-configure-host/*
when: always
script: script:
# 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 elk $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh elk $tag
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh elk-configure-host $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh elk-configure-host $tag
docker_build_image_lofar_device_base: docker_build_image_lofar_device_base:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/lofar-device-base.yml - docker-compose/lofar-device-base.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
when: always
script: script:
# 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 lofar-device-base $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh lofar-device-base $tag
docker_build_image_prometheus: docker_build_image_prometheus:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/prometheus.yml - docker-compose/prometheus.yml
- docker-compose/prometheus/* - docker-compose/prometheus/*
script: script:
# 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 prometheus $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh prometheus $tag
docker_build_image_itango: docker_build_image_itango:
extends: .base_docker_images_except extends: .base_docker_images
only: only:
refs: refs:
- merge_requests - merge_requests
...@@ -157,247 +167,395 @@ docker_build_image_itango: ...@@ -157,247 +167,395 @@ docker_build_image_itango:
# 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 itango $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh itango $tag
docker_build_image_grafana: docker_build_image_grafana:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/grafana.yml - docker-compose/grafana.yml
- docker-compose/grafana/* - docker-compose/grafana/*
script: script:
# 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 grafana $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh grafana $tag
docker_build_image_jupyter: docker_build_image_jupyter:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/jupyter.yml - docker-compose/jupyter.yml
- docker-compose/jupyter/* - docker-compose/jupyter/*
script: script:
# 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 jupyter $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh jupyter $tag
docker_build_image_apsct_sim: docker_build_image_apsct_sim:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/aspct-sim.yml - docker-compose/aspct-sim.yml
- docker-compose/pypcc-sim-base/* - docker-compose/pypcc-sim-base/*
script: script:
# 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 apsct-sim $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh apsct-sim $tag
docker_build_image_apspu_sim: docker_build_image_apspu_sim:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/apspu-sim.yml - docker-compose/apspu-sim.yml
- docker-compose/pypcc-sim-base/* - docker-compose/pypcc-sim-base/*
script: script:
# 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 apspu-sim $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh apspu-sim $tag
docker_build_image_recv_sim: docker_build_image_recv_sim:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/recv-sim.yml - docker-compose/recv-sim.yml
- docker-compose/pypcc-sim-base/* - docker-compose/pypcc-sim-base/*
script: script:
# 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 recv-sim $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh recv-sim $tag
docker_build_image_sdptr_sim: docker_build_image_sdptr_sim:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/sdptr-sim.yml - docker-compose/sdptr-sim.yml
- docker-compose/sdptr-sim/* - docker-compose/sdptr-sim/*
script: script:
# 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 sdptr-sim $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh sdptr-sim $tag
docker_build_image_unb2_sim: docker_build_image_unb2_sim:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/unb2-sim.yml - docker-compose/unb2-sim.yml
- docker-compose/pypcc-sim-base/* - docker-compose/pypcc-sim-base/*
script: script:
# 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 unb2-sim $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh unb2-sim $tag
docker_build_image_device_apsct: docker_build_image_device_apsct:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-aspct.yml - docker-compose/device-aspct.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# 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 device-aspct $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-aspct $tag
docker_build_image_device_apspu: docker_build_image_device_apspu:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-apspu.yml - docker-compose/device-apspu.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# 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 device-apspu $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-apspu $tag
docker_build_image_device_pdu: docker_build_image_device_pdu:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-pdu.yml - docker-compose/device-pdu.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# 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 device-pdu $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-pdu $tag
docker_build_image_device_tilebeam: docker_build_image_device_tilebeam:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-tilebeam.yml - docker-compose/device-tilebeam.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# 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 device-tilebeam $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-tilebeam $tag
docker_build_image_device_beamlet: docker_build_image_device_beamlet:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-beamlet.yml - docker-compose/device-beamlet.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# 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 device-beamlet $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-beamlet $tag
docker_build_image_device_digitalbeam: docker_build_image_device_digitalbeam:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-digitalbeam.yml - docker-compose/device-digitalbeam.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# 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 device-digitalbeam $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-digitalbeam $tag
docker_build_image_device_boot: docker_build_image_device_boot:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-boot.yml - docker-compose/device-boot.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# 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 device-boot $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-boot $tag
docker_build_image_device_docker: docker_build_image_device_docker:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-docker.yml - docker-compose/device-docker.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# 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 device-docker $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-docker $tag
docker_build_image_device_ovservation_control: docker_build_image_device_ovservation_control:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-observation_control.yml - docker-compose/device-observation_control.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# 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 device-observation_control $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-observation_control $tag
docker_build_image_device_antennafield: docker_build_image_device_antennafield:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-antennafield.yml - docker-compose/device-antennafield.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# 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 device-antennafield $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-antennafield $tag
docker_build_image_device_recv: docker_build_image_device_recv:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-recv.yml - docker-compose/device-recv.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# 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 device-recv $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-recv $tag
docker_build_image_device_sdp: docker_build_image_device_sdp:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-sdp.yml - docker-compose/device-sdp.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# 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 device-sdp $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-sdp $tag
docker_build_image_device_sst: docker_build_image_device_sst:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-sst.yml - docker-compose/device-sst.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# 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 device-sst $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-sst $tag
docker_build_image_device_unb2: docker_build_image_device_unb2:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-unb2.yml - docker-compose/device-unb2.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# 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 device-unb2 $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-unb2 $tag
docker_build_image_device_xst: docker_build_image_device_xst:
extends: .base_docker_images_except extends: .base_docker_images
only: rules:
refs: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- merge_requests when: never
changes: - if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-xst.yml - docker-compose/device-xst.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# 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 device-xst $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-xst $tag
docker_build_image_device_temperature_manager:
extends: .base_docker_images
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/device-temperature-manager.yml
- docker-compose/lofar-device-base/*
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 device-temperature-manager $tag
docker_build_image_archiver_timescale:
extends: .base_docker_images
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/archiver-timescale.yml
- docker-compose/timescaledb/*
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 archiver-timescale $tag
docker_build_image_hdbppts_cm:
extends: .base_docker_images
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/archiver-timescale.yml
- docker-compose/tango-archiver-ts/*
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 hdbppts-cm $tag
docker_build_image_hdbppts_es:
extends: .base_docker_images
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_TAG != null'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- changes:
- docker-compose/archiver-timescale.yml
- docker-compose/tango-archiver-ts/*
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 hdbppts-es $tag
newline_at_eof: newline_at_eof:
stage: linting stage: linting
before_script: before_script:
......
[submodule "tangostationcontrol/tangostationcontrol/toolkit/libhdbpp-python"] [submodule "tangostationcontrol/tangostationcontrol/toolkit/libhdbpp-python"]
path = tangostationcontrol/tangostationcontrol/toolkit/libhdbpp-python path = tangostationcontrol/tangostationcontrol/toolkit/libhdbpp-python
url = https://gitlab.com/tango-controls/hdbpp/libhdbpp-python.git url = https://gitlab.com/tango-controls/hdbpp/libhdbpp-python.git
[submodule "docker-compose/alerta-web"]
path = docker-compose/alerta-web
url = https://github.com/jjdmol/alerta-webui
branch = add-isa-18-2-states
{ {
"objects": {
"station": {
"name": [
"DevStation"
],
"number": [
"999"
]
}
},
"servers": { "servers": {
"Docker": { "Docker": {
"STAT": { "STAT": {
...@@ -32,10 +42,18 @@ ...@@ -32,10 +42,18 @@
} }
} }
}, },
"TemperatureManager": {
"STAT": {
"TemperatureManager": {
"STAT/TemperatureManager/1": {}
}
}
},
"TileBeam": { "TileBeam": {
"STAT": { "STAT": {
"TileBeam": { "TileBeam": {
"STAT/TileBeam/1": {} "STAT/TileBeam/1": {
}
} }
} }
}, },
......
{ {
"objects": {
"station": {
"name": [
"DTS"
],
"number": [
"902"
]
}
},
"servers": { "servers": {
"boot": { "boot": {
"STAT": { "STAT": {
......
This diff is collapsed.
{ {
"objects": {
"station": {
"name": [
"LTS"
],
"number": [
"901"
]
}
},
"servers": { "servers": {
"boot": { "boot": {
"STAT": { "STAT": {
......
...@@ -116,6 +116,16 @@ ...@@ -116,6 +116,16 @@
} }
} }
}, },
"TemperatureManager": {
"STAT": {
"TemperatureManager": {
"STAT/TemperatureManager/1": {
"properties": {
}
}
}
}
},
"RECV": { "RECV": {
"STAT": { "STAT": {
"RECV": { "RECV": {
......
#!/bin/bash #!/bin/bash
# writes the JSON dump to stdout, Do not change -i into -it incompatible with gitlab ci! # writes the JSON dump to stdout, Do not change -i into -it incompatible with gitlab ci!
docker exec -i "${CONTAINER_NAME_PREFIX}"dsconfig python -m dsconfig.dump docker exec -i "${CONTAINER_NAME_PREFIX}"dsconfig bash -c '
python -m dsconfig.dump > /tmp/dsconfig-configdb-dump.json
/manage_object_properties.py -r > /tmp/dsconfig-objectdb-dump.json
/merge_json.py /tmp/dsconfig-objectdb-dump.json /tmp/dsconfig-configdb-dump.json'
...@@ -9,6 +9,9 @@ RUN bash -c 'source /venv/bin/activate; pip install /tmp/grafana-plugin' ...@@ -9,6 +9,9 @@ RUN bash -c 'source /venv/bin/activate; pip install /tmp/grafana-plugin'
COPY lofar-plugin /tmp/lofar-plugin COPY lofar-plugin /tmp/lofar-plugin
RUN bash -c 'source /venv/bin/activate; pip install /tmp/lofar-plugin' RUN bash -c 'source /venv/bin/activate; pip install /tmp/lofar-plugin'
COPY lofar-routing-plugin /tmp/lofar-routing-plugin
RUN bash -c 'source /venv/bin/activate; pip install /tmp/lofar-routing-plugin'
COPY alertad.conf /app/alertad.conf COPY alertad.conf /app/alertad.conf
COPY alerta.conf /app/alerta.conf COPY alerta.conf /app/alerta.conf
COPY config.json /web/config.json COPY config.json /web/config.json
import os
DEBUG = True DEBUG = True
SECRET = "T=&7xvF2S&x7w_JAcq$h1x5ocfA)8H2i" SECRET = "T=&7xvF2S&x7w_JAcq$h1x5ocfA)8H2i"
# Allow non-admin views # Allow non-admin views
CUSTOMER_VIEWS = True CUSTOMER_VIEWS = True
# Use more advanced ANSI/ISA 18.2 alarm model,
# which does not auto-close alarms and thus
# allows for tracking alarms that came and went.
ALARM_MODEL = "ISA_18_2"
# Never timeout alerts # Never timeout alerts
ALERT_TIMEOUT = 0 ALERT_TIMEOUT = 0
# Auto unack after a day # Auto unack after a day
ACK_TIMEOUT = 24 * 3600 ACK_TIMEOUT = 24 * 3600
# Auto unshelve after 2 hours # Auto unshelve after 2 hours
SHELVE_TIMEOUT = 2 * 3600 SHELVE_TIMEOUT = 7 * 24 * 3600
# Use custom date formats # Use custom date formats
DATE_FORMAT_MEDIUM_DATE = "dd DD/MM HH:mm" DATE_FORMAT_MEDIUM_DATE = "dd DD/MM HH:mm"
...@@ -17,10 +24,31 @@ DATE_FORMAT_LONG_DATE = "yyyy-MM-DD HH:mm:ss.sss" ...@@ -17,10 +24,31 @@ DATE_FORMAT_LONG_DATE = "yyyy-MM-DD HH:mm:ss.sss"
# Default overview settings # Default overview settings
COLUMNS = ['severity', 'status', 'createTime', 'lastReceiveTime', 'resource', 'grafanaDashboardHtml', 'grafanaPanelHtml', 'event', 'text'] COLUMNS = ['severity', 'status', 'createTime', 'lastReceiveTime', 'resource', 'grafanaDashboardHtml', 'grafanaPanelHtml', 'event', 'text']
DEFAULT_FILTER = {'status': ['open']} DEFAULT_FILTER = {'status': ['UNACK', 'RTNUN']}
SORT_LIST_BY = "createTime" SORT_LIST_BY = "createTime"
AUTO_REFRESH_INTERVAL = 5000 # ms AUTO_REFRESH_INTERVAL = 5000 # ms
COLOR_MAP = {
'severity': {
'Critical': 'red',
'High': 'orange',
'Medium': '#FFF380', # corn yellow
'Low': 'dodgerblue',
'Advisory': 'lightblue',
'OK': '#00CC00', # lime green
'Unknown': 'silver'
},
'text': 'black'
}
# Allow alerta-web to refer to alerta-server for the client
CORS_ORIGINS = [
'http://localhost:8081',
'http://localhost:8082',
os.environ.get("BASE_URL", ""),
os.environ.get("DASHBOARD_URL", ""),
]
# ------------------------------------ # ------------------------------------
# Plugin configuration # Plugin configuration
# ------------------------------------ # ------------------------------------
...@@ -28,7 +56,7 @@ AUTO_REFRESH_INTERVAL = 5000 # ms ...@@ -28,7 +56,7 @@ AUTO_REFRESH_INTERVAL = 5000 # ms
PLUGINS = ['reject', 'blackout', 'acked_by', 'enhance', 'grafana', 'lofar', 'slack'] PLUGINS = ['reject', 'blackout', 'acked_by', 'enhance', 'grafana', 'lofar', 'slack']
# Slack plugin settings, see https://github.com/alerta/alerta-contrib/tree/master/plugins/slack # Slack plugin settings, see https://github.com/alerta/alerta-contrib/tree/master/plugins/slack
import os, json import json
with open("/run/secrets/alerta-secrets") as secrets_file: with open("/run/secrets/alerta-secrets") as secrets_file:
secrets = json.load(secrets_file) secrets = json.load(secrets_file)
......
...@@ -3,6 +3,7 @@ import json ...@@ -3,6 +3,7 @@ import json
import logging import logging
from alerta.plugins import PluginBase from alerta.plugins import PluginBase
import alerta.models.alarms.isa_18_2 as isa_18_2
LOG = logging.getLogger() LOG = logging.getLogger()
...@@ -12,7 +13,34 @@ class EnhanceLOFAR(PluginBase): ...@@ -12,7 +13,34 @@ class EnhanceLOFAR(PluginBase):
Plugin for enhancing alerts with LOFAR-specific information Plugin for enhancing alerts with LOFAR-specific information
""" """
@staticmethod
def _fix_severity(alert):
"""
Force conversion of severity to ISA 18.2 model, to allow Alerta to parse the alert.
For example, the 'prometheus' webhook by default uses the 'warning' severity,
but also users might specify a non-existing severity level.
"""
if alert.severity not in isa_18_2.SEVERITY_MAP:
# Save original severity
alert.attributes['unparsableSeverity'] = alert.severity
translation = {
"normal": isa_18_2.OK,
"ok": isa_18_2.OK,
"cleared": isa_18_2.OK,
"warning": isa_18_2.LOW,
"minor": isa_18_2.MEDIUM,
"major": isa_18_2.HIGH,
"critical": isa_18_2.CRITICAL,
}
alert.severity = translation.get(alert.severity.lower(), isa_18_2.MEDIUM)
def pre_receive(self, alert, **kwargs): def pre_receive(self, alert, **kwargs):
self._fix_severity(alert)
# Parse LOFAR-specific fields # Parse LOFAR-specific fields
for tag in alert.tags: for tag in alert.tags:
try: try:
......
import logging
from alerta.app import alarm_model
from alerta.models.enums import ChangeType
LOG = logging.getLogger('alerta.plugins.routing')
# For a description of this interface,
# see https://docs.alerta.io/gettingstarted/tutorial-3-plugins.html?highlight=rules#step-3-route-alerts-to-plugins
def rules(alert, plugins, config):
if alert.previous_severity is None:
# The alert still has to be parsed, and enriched, before it is
# merged into existing alerts.
return rules_prereceive(alert, plugins, config)
else:
# The alert has been processed. Check to which plugins we
# want to send it.
return rules_postreceive(alert, plugins, config)
def rules_prereceive(alert, plugins, config):
""" Rules to determine which processing filters to use. """
# no filtering
return (plugins.values(), {})
def _is_new_problem(alert) -> bool:
""" Return whether the state change denotes a newly identified issue
on a system that (as far as the operator knew) was fine before.
Returns True when detecting NORM -> UNACK transitions, and False
on any duplicates of this transition.
Note that RTNUN -> UNACK is thus not triggered on. """
if alert.status != 'UNACK':
# Only report problems (not ACKing, SHELVing, etc)
return False
elif alert.last_receive_time != alert.update_time:
# Ignore anything that didn't update the alert,
# to avoid triggering on alerts that repeat
# the current situation
return False
else:
# Only report if the previous status was NORM, to avoid
# triggering on (f.e.) RTNUN -> UNACK transitions.
for h in alert.history: # is sorted new -> old
if h.status == alert.status:
# ignore any update that didn't change the status
continue
return h.status == "NORM"
# ... or if there was no previous status (a brand new alert)
return True
def rules_postreceive(alert, plugins, config):
""" Rules to determine which emission methods to use. """
# decide whether to notify the user on slack
send_to_slack = _is_new_problem(alert)
LOG.debug(f"Sending alert {alert.event} with status {alert.status} and severity {alert.previous_severity} => {alert.severity} to slack? {send_to_slack}")
# filter the plugin list based on these decisions
use_plugins = []
for name, plugin in plugins.items():
if name == 'slack' and not send_to_slack:
pass
else:
use_plugins.append(plugin)
return (use_plugins, {})
from setuptools import setup, find_packages
version = '1.0.0'
setup(
name="alerta-routing",
version=version,
description='Alerta plugin to configure LOFAR custom alert routing',
url='https://git.astron.nl/lofar2.0/tango',
license='Apache License 2.0',
author='Jan David Mol',
author_email='mol@astron.nl',
packages=find_packages(),
py_modules=['routing'],
include_package_data=True,
zip_safe=True,
entry_points={
'alerta.routing': [
'rules = routing:rules'
]
},
python_requires='>=3.5'
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment