diff --git a/.deploy.gitlab-ci.yml b/.deploy.gitlab-ci.yml deleted file mode 100644 index f7e7e367893b8f8f12423ef9e87b820c2c1c021b..0000000000000000000000000000000000000000 --- a/.deploy.gitlab-ci.yml +++ /dev/null @@ -1,97 +0,0 @@ -variables: - STATION: "LOFAR station to deploy on" - -stages: - - render - - deploy - -# NB: Due to a levant bug, we need to render and use nomad to deploy -# see https://github.com/hashicorp/levant/issues/550 - -# To deploy manually, get the env.yaml and the .levant.nomad file, -# and run docker run --rm -i --net=host -v /path/to/env.yaml:/env.yaml:ro hashicorp/levant deploy --var-file=/env.yaml /dev/stdin < /path/to/file.levant.nomad - -.components: - parallel: - matrix: - - COMPONENT: - - mesh-gateway - - monitoring - - logging - - tango - - object-storage - - object-replication - - sdptr - - device-server - - dsconfig - - ec-sim - - jupyter - - snmp-exporter - - landing-page - - rpc-server - -render_levant: - extends: .components - stage: render - image: - name: hashicorp/levant - entrypoint: [ "" ] - script: - - | - if [ "${STATION}" == "dts-lab" ]; then - # dts-lab test station - REGION="global" - EXTRA_VARFILES="-var-file=infra/env/cs.yaml" - elif [ "${STATION::2}" == "rs" ]; then - # remote station - REGION="lofar-${STATION}" - EXTRA_VARFILES="-var-file=infra/env/rs.yaml" - else - # core station - REGION="lofar-${STATION}" - EXTRA_VARFILES="-var-file=infra/env/cs.yaml" - fi - - levant render \ - -var-file=infra/env/common.yaml ${EXTRA_VARFILES} \ - -var image_tag="${CI_COMMIT_REF_SLUG}" \ - -var region="${REGION}" \ - -var station="${STATION}" \ - infra/jobs/station/${COMPONENT}.levant.nomad > ${STATION}-${COMPONENT}.nomad - - # make sure all variables are filled in, - # see also https://github.com/hashicorp/levant/pull/308 - ! fgrep "<no value>" ${STATION}-${COMPONENT}.nomad - artifacts: - paths: - - ${STATION}-${COMPONENT}.nomad - -deploy_nomad: - extends: .components - stage: deploy - # gitlab evaluates parallel.matrix after needs/dependencies, - # so we cannot use $COMPONENT in the dependencies. - # we depend on all render_levant jobs instead. - needs: - - render_levant - dependencies: - - render_levant - image: - name: hashicorp/nomad - entrypoint: [ "" ] - environment: - name: $STATION - script: - - | - if [ "${STATION}" == "dts-lab" ]; then - NOMAD_HOST="dts-lab.lofar.net" - else - NOMAD_HOST="monitor.control.lofar" - fi - - nomad job run -address="http://${NOMAD_HOST}:4646" ${STATION}-${COMPONENT}.nomad - -workflow: - name: 'deploy on $STATION' - rules: - - when: always diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5b3c88ad59044b3946d901fce0e3848d1528daa1..e127a8345e2449388b2195e6888133f01aa7fb62 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,6 +12,7 @@ default: stages: - prepare - lint + - render - test - package - images @@ -55,22 +56,182 @@ run_shellcheck: - shellcheck --version - shellcheck **/*.sh -run_CDB_correctness: +.components: + variables: + LOFAR1_STATIONS: cs002 cs003 cs004 cs005 cs006 cs007 cs011 cs013 cs017 cs021 cs024 cs026 cs028 cs030 cs031 cs101 cs103 cs201 cs301 cs302 cs401 cs501 rs106 rs205 rs208 rs210 rs305 rs306 rs310 rs406 rs407 rs409 rs503 rs508 rs509 + LOFAR2_STATIONS: cs001 cs032 rs307 + COMPONENTS: mesh-gateway monitoring logging tango object-storage object-replication sdptr device-server dsconfig ec-sim jupyter snmp-exporter landing-page rpc-server + +# Generate the station-specific TangoDB configuration based on LOFAR1 information. +# Run manually to bootstrap CDB/stations/$station.json for stations +# converted from LOFAR1 to LOFAR2. +render_CDB_stations_from_lofar1: + extends: .components + stage: render needs: - - trigger_prepare + - trigger_prepare + when: manual + script: + - | + python -m pip install . + + mkdir -p generated/CDB/stations + + for STATION in ${LOFAR1_STATIONS} ${LOFAR2_STATIONS}; do + echo "Generating CDB for ${STATION}" + l2ss-generate-cdb-from-lofar1 -s ${STATION} -C > generated/CDB/stations/${STATION}.json + done + artifacts: + expire_in: 4 weeks + expose_as: 'stations cdb configs' + name: lofar1-cdb + paths: + - generated/CDB/stations/ + +# Generate the ILT configurations for each station. +render_CDB_environment_ilt: + extends: .components + stage: render + needs: + - trigger_prepare + when: manual + before_script: + - sudo apt install -y jq + script: + - | + python -m pip install . + + # fetch IPs from netbox (netbox.astron.nl) + curl -X GET -k 'https://10.87.2.131/api/ipam/ip-addresses/?dns_name__isw=lcu-&limit=100' -H 'Accept: application/json' -H "Authorization: Token ${NETBOX_TOKEN}" > netbox.json + + mkdir -p generated/CDB/environments + + for STATION in ${LOFAR2_STATIONS}; do + LCU_IP=`jq < netbox.json '.results[] | select(.dns_name == "lcu-'${STATION}'.data.lofar.eu") | .address | split("/") | .[0]' -r` + + echo "Generating CDB for ${STATION} using LCU IP ${LCU_IP}" + l2ss-generate-cdb-datastreams -s ${STATION} -l ${LCU_IP} > generated/CDB/environments/${STATION}-ilt.json + done + artifacts: + expire_in: 4 weeks + expose_as: 'environments cdb configs' + name: environments-cdb + paths: + - generated/CDB/environments/ + +# Collect full TangoDB configuration files, to provide a full +# configuration of each station. This combines all the relevant +# CDB files for a station into one, providing a full configuration. +render_CDB: + extends: .components + stage: render + needs: + - trigger_prepare + script: + - | + python -m pip install . + + mkdir -p generated/CDB/deploy + + cd CDB/ + + for STATION in ${LOFAR2_STATIONS}; do + if [ "${STATION}" == "dts-lab" ]; then + # dts-lab test station + FILES="base/common.json base/l0.json base/l1.json base/h0.json base/lba.json base/hba-remote.json stations/dts-lab.json" + elif [ "${STATION::2}" == "rs" ]; then + # remote station + FILES="base/common.json base/l0.json base/l1.json base/h0.json base/lba.json base/hba-remote.json base/rs.json stations/${STATION}.json environments/${STATION}-ilt.json" + else + # core station + FILES="base/common.json base/l0.json base/l1.json base/h0.json base/lba.json base/hba-core.json base/cs.json stations/${STATION}.json environments/${STATION}-ilt.json" + fi + + echo "Generating CDB for ${STATION} from ${FILES}" + l2ss-merge-cdb ${FILES} > ${CI_PROJECT_DIR}/generated/CDB/deploy/${STATION}.json + done + artifacts: + expire_in: 4 weeks + expose_as: 'deployment cdb configs' + name: deploy-cdb + paths: + - generated/CDB/deploy/ + +# Collect services from this repo, to deploy as Nomad jobs on a station +render_levant: + extends: .components + stage: render + needs: [] + image: + name: hashicorp/levant + entrypoint: [ "" ] + # override default before_script, job won't have Python available + before_script: + - uname + script: + - | + mkdir jobs + + for STATION in ${STATIONS}; do + if [ "${STATION}" == "dts-lab" ]; then + # dts-lab test station + REGION="global" + EXTRA_VARFILES="-var-file=infra/env/cs.yaml" + elif [ "${STATION::2}" == "rs" ]; then + # remote station + REGION="lofar-${STATION}" + EXTRA_VARFILES="-var-file=infra/env/rs.yaml" + else + # core station + REGION="lofar-${STATION}" + EXTRA_VARFILES="-var-file=infra/env/cs.yaml" + fi + + mkdir jobs/${STATION} + + for COMPONENT in ${COMPONENTS}; do + echo "Rendering station ${STATION} component ${COMPONENT}" + levant render \ + -var-file=infra/env/common.yaml ${EXTRA_VARFILES} \ + -var image_tag="${CI_COMMIT_REF_SLUG}" \ + -var region="${REGION}" \ + -var station="${STATION}" \ + infra/jobs/station/${COMPONENT}.levant.nomad > jobs/${STATION}/${COMPONENT}.nomad + + # make sure all variables are filled in, + # see also https://github.com/hashicorp/levant/pull/308 + ! fgrep "<no value>" jobs/${STATION}/${COMPONENT}.nomad + done + done + artifacts: + expire_in: 4 weeks + expose_as: 'nomad jobs' + name: nomad-jobs + paths: + - jobs/ + +test_CDB_correctness: + needs: + - render_CDB stage: test script: - - cd $CI_PROJECT_DIR/CDB/stations - | - for hierarchy in Power Control - do - # test environments - python $CI_PROJECT_DIR/tangostationcontrol/toolkit/analyse_dsconfig_hierarchies.py -H ${hierarchy} -a -t common.json l0.json l1.json lba.json h0.json hba_core.json cs.json cs001.json testenv_cs001.json - # production environments - python $CI_PROJECT_DIR/tangostationcontrol/toolkit/analyse_dsconfig_hierarchies.py -H ${hierarchy} -a -t common.json l0.json l1.json lba.json h0.json hba_core.json cs.json cs001.json - python $CI_PROJECT_DIR/tangostationcontrol/toolkit/analyse_dsconfig_hierarchies.py -H ${hierarchy} -a -t common.json l0.json l1.json lba.json h0.json hba_core.json cs.json cs032.json - python $CI_PROJECT_DIR/tangostationcontrol/toolkit/analyse_dsconfig_hierarchies.py -H ${hierarchy} -a -t common.json l0.json l1.json lba.json h0.json hba_remote.json rs.json rs307.json - python $CI_PROJECT_DIR/tangostationcontrol/toolkit/analyse_dsconfig_hierarchies.py -H ${hierarchy} -a -t common.json l0.json l1.json lba.json h0.json hba_core.json DTS.json + python -m pip install . + + # production environments + for hierarchy in Power Control; do + for STATION_CDB in generated/CDB/deploy/*; do + echo "Testing CDB file ${STATION_CDB}" + + l2ss-analyse-dsconfig-hierarchies -H ${hierarchy} -a -t ${STATION_CDB} + done + done + + # test environments + cd $CI_PROJECT_DIR/CDB/ + for hierarchy in Power Control; do + l2ss-analyse-dsconfig-hierarchies -H ${hierarchy} -a -t base/common.json base/l0.json base/l1.json base/h0.json base/lba.json base/hba-core.json base/cs.json stations/cs001.json test/testenv-cs001.json + l2ss-analyse-dsconfig-hierarchies -H ${hierarchy} -a -t base/common.json base/l0.json base/l1.json base/h0.json base/lba.json base/hba-remote.json base/rs.json stations/rs307.json test/testenv-rs307.json done sast: @@ -154,7 +315,7 @@ sphinx_documentation: script: - tox -e docs - # See docker-compose/README.md for docker image behavior and explanation +# See docker-compose/README.md for docker image behavior and explanation .base_docker_images: stage: images image: docker:latest @@ -213,7 +374,7 @@ docker_store_images_changes: - docker-compose/.env # Build and push custom images on merge request if relevant files changed -docker_build_image: +docker_build: extends: .base_docker_images parallel: matrix: @@ -237,7 +398,7 @@ docker_build_image: paths: - docker/snmp-exporter/snmp.yml -docker_build_image_device_base: +docker_build_device_base: extends: .base_docker_images rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" @@ -254,7 +415,7 @@ docker_build_image_device_base: image: docker:latest needs: - run_unit_tests - - docker_build_image_device_base + - docker_build_device_base tags: - integration_tests variables: @@ -314,7 +475,7 @@ run_multi_project_integration_test: allow_failure: true stage: integration needs: - - docker_build_image_device_base + - docker_build_device_base variables: TANGO_DEFAULT_BRANCH: $CI_DEFAULT_BRANCH TANGO_CURRENT_BRANCH: $CI_COMMIT_BRANCH @@ -361,24 +522,43 @@ release_job: tag_name: '$CI_COMMIT_TAG' description: '$CI_COMMIT_TAG - $CI_COMMIT_TAG_MESSAGE' -deploy: +deploy_nomad: + extends: .components stage: deploy rules: - if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH) || $CI_COMMIT_TAG when: manual needs: - - docker_build_image - - docker_build_image_device_base - variables: - PARENT_PIPELINE_ID: $CI_PIPELINE_ID - trigger: - include: .deploy.gitlab-ci.yml - forward: - pipeline_variables: true + - docker_build + - docker_build_device_base + - render_levant + dependencies: + - render_levant parallel: matrix: - STATION: - cs001 - cs032 - rs307 - - dts-lab + image: + name: hashicorp/nomad + entrypoint: [ "" ] + environment: + name: $STATION + # override default before_script, job won't have Python available + before_script: + - uname + script: + - | + if [ "${STATION}" == "dts-lab" ]; then + # dts-lab test station + HOSTNAME="dts-lab.lofar.net" + else + # core/remote station + HOSTNAME="monitor.control.lofar" + fi + + for COMPONENT in ${COMPONENTS}; do + echo "Running station ${STATION} component ${COMPONENT}" + nomad job run -address="http://${HOSTNAME}:4646" jobs/${STATION}/${COMPONENT}.nomad + done diff --git a/CDB/README.md b/CDB/README.md index 443481c68c853634b107a2c73f696fcc6ab7420b..6ca5fdf43342eb15501aac2b18e5b139522d7c29 100644 --- a/CDB/README.md +++ b/CDB/README.md @@ -1,21 +1,90 @@ -## Tango Configuration Database files +## Station configurations -The ConfigDb.json files in this directory are used to populate the Tango configuration Database for various scenarios. -To load a configuration file, use +The Tango Database requires a configuration that defines the devices that exist, and their +settings. The CDB files contain these settings, in JSON format. -```bash -../sbin/dsconfig.sh --update file.json -``` -Or feed the configuration file to the ``dsconfig`` batch job through the Nomad console at -http://localhost:4646/ui/jobs/dsconfig@default/dispatch. +The ``base/`` directory contains the Tango generic configurations stations. +The ``stations/`` directory contains the Tango base configurations for each station. +The ``test/`` directory contains the Tango configurations for test suites. -The tool ``tangostationcontrol.toolkit.analyse_dsconfig_hierarchies`` is provided to check the consistency of -hierarchies defined between the devices in a set of configuration files. +### Uploading configuration to a station -## Station configurations +The station configuration files can be installed in several ways. By default, these methods +update the existing configuration on a station. That is, it adds settings (and devices), but +does not remove any existing ones that are not mentioned in the file. -The ``stations/`` directory contains the Tango base configurations for each station. +* Feed it as payload to the `dsconfig` Nomad job running on the station (http://localhost:4646/ui/jobs/dsconfig@default/dispatch), +* Use the `sbin/dsconfig.sh --update file.json`, +* Write them to the `STAT/Configuration/1` device, f.e. in Jupyter, use the `configuration.update_station_configuration()` command. + +### Configuration files + +The configuration for a station has common and station-specific parts. It constructed by combining generic and +specific files for each station. These files are meant to be processed in-order, as some contain settings that +override settings from more generic files. Their file format is described at https://gitlab.com/MaxIV/lib-maxiv-dsconfig#json-format + +The *render_CDB* GitLab job combines all of these files, resulting in a complete configuration for each station. + +The `base/` directory contains the Tango base configurations for each station, providing these +common subsets: + +- common.json: Base settings common to all stations, +- l0.json: Devices in subrack L0, +- l1.json: Devices in subrack L1, +- h0.json: Devices in subrack H0, +- lba.json: Devices needed for the LBA field, +- hba-core.json: Devices needed for the HBA fields in core stations, +- hba-remote.json: Devices needed for the HBA field in remote stations, +- cs.json: Common config for core (CSxxx) stations, +- rs.json: Common config for remote (RSxxx) stations. + +The `stations/` directory contains station-specific files, f.e.: + +- cs001.json: Specifications specific to CS001. +- rs307.json: Specifications specific to RS307. + +The *render_CDB_station_from_lofar1* GitLab job uses the `l2ss-generate-cdb-from-lofar1` command to generate these +files from their older LOFAR1 configuration. To convert a LOFAR1 station, use the resulting file from that job, +make any LOFAR2-specific adjustments if needed, and check it in in this directory. + +The `environments/` directory contains settings that embed a station into a production environment, detailing +f.e. the source and destination addresses of the data streams. F.e.: + +- cs001-ilt.json: Specifications specific to CS001 in ILT mode. +- rs307-ilt.json: Specifications specific to RS307 in ILT mode. + +The *render_CDB_environments* GitLab job generates these files based on NetBox. + +#### Examples + +The *render_CDB* GitLab job combines all applicable CDB files for each station. F.e., the following stations need +the following configurations applied. The mentioned files are present in their respective directories: + +- CS001: common.json + l0.json + l1.json + h0.json + lba.json + hba_core.json + cs.json + cs001.json + cs001-ilt.json +- RS307: common.json + l0.json + l1.json + h0.json + lba.json + hba_remote.json + rs.json + rs307.json + rs307-ilt.json + +In the integration test environment, the `infra/dev/tango/tango.hcl` file defines similar rendering. + +### Tools + +The following tools can be useful to work with the CDB JSON files. + +#### Merging CDB JSON files + +The `l2ss-merge-cdb` tool in this repository allows one to merge several JSON files into a single file. For any setting that is repeated in multiple +JSON files, the last one is used. + +#### Slice settings from CDB JSON files + +To extract a single setting from a JSON file, use the following command: + +```sh +# Select "Statistics_Client_Hostname" property from input.json +cat input.json | + jq --stream 'select ((.[0]|length < 5) or .[0][6] == "Statistics_Client_Hostname")' | + jq 'fromstream(0|truncate_stream(inputs))' +``` -## Integration configurations +#### Consistency check -The ``integrations/`` directory contains the Tango configuration deltas for the integration test suites. +The tool ``l2ss-analyse-dsconfig-hierarchies`` is provided to check the consistency of hierarchies defined between the devices in a set of configuration files. diff --git a/CDB/stations/common.json b/CDB/base/common.json similarity index 100% rename from CDB/stations/common.json rename to CDB/base/common.json diff --git a/CDB/stations/cs.json b/CDB/base/cs.json similarity index 100% rename from CDB/stations/cs.json rename to CDB/base/cs.json diff --git a/CDB/stations/h0.json b/CDB/base/h0.json similarity index 100% rename from CDB/stations/h0.json rename to CDB/base/h0.json diff --git a/CDB/stations/hba_core.json b/CDB/base/hba-core.json similarity index 100% rename from CDB/stations/hba_core.json rename to CDB/base/hba-core.json diff --git a/CDB/stations/hba_remote.json b/CDB/base/hba-remote.json similarity index 100% rename from CDB/stations/hba_remote.json rename to CDB/base/hba-remote.json diff --git a/CDB/stations/l0.json b/CDB/base/l0.json similarity index 100% rename from CDB/stations/l0.json rename to CDB/base/l0.json diff --git a/CDB/stations/l1.json b/CDB/base/l1.json similarity index 100% rename from CDB/stations/l1.json rename to CDB/base/l1.json diff --git a/CDB/stations/lba.json b/CDB/base/lba.json similarity index 100% rename from CDB/stations/lba.json rename to CDB/base/lba.json diff --git a/CDB/stations/rs.json b/CDB/base/rs.json similarity index 100% rename from CDB/stations/rs.json rename to CDB/base/rs.json diff --git a/CDB/environments/cs001-ilt.json b/CDB/environments/cs001-ilt.json new file mode 100644 index 0000000000000000000000000000000000000000..b44457c7d36f7027e0432e3032aa50584a68685f --- /dev/null +++ b/CDB/environments/cs001-ilt.json @@ -0,0 +1,238 @@ +{ + "servers": { + "Beamlet": { + "STAT": { + "Beamlet": { + "STAT/Beamlet/LBA": { + "properties": { + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + "00:22:86:08:00:00", + "00:22:86:08:00:01", + "00:22:86:08:00:02", + "00:22:86:08:00:03", + "00:22:86:08:01:00", + "00:22:86:08:01:01", + "00:22:86:08:01:02", + "00:22:86:08:01:03", + "00:22:86:08:02:00", + "00:22:86:08:02:01", + "00:22:86:08:02:02", + "00:22:86:08:02:03", + "00:22:86:08:03:00", + "00:22:86:08:03:01", + "00:22:86:08:03:02", + "00:22:86:08:03:03" + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1" + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + "53248", + "53249", + "53250", + "53251", + "53252", + "53253", + "53254", + "53255", + "53256", + "53257", + "53258", + "53259", + "53260", + "53261", + "53262", + "53263" + ], + "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ + "e4:43:4b:3d:89:82", + "e4:43:4b:3d:89:82", + "e4:43:4b:3d:89:82", + "e4:43:4b:3d:89:82" + ], + "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ + "10.168.160.2", + "10.168.160.2", + "10.168.160.2", + "10.168.160.2" + ], + "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ + "10010", + "10011", + "10012", + "10013" + ] + } + }, + "STAT/Beamlet/HBA0": { + "properties": { + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + "00:22:86:08:00:00", + "00:22:86:08:00:01", + "00:22:86:08:00:02", + "00:22:86:08:00:03", + "00:22:86:08:01:00", + "00:22:86:08:01:01", + "00:22:86:08:01:02", + "00:22:86:08:01:03", + "00:22:86:08:02:00", + "00:22:86:08:02:01", + "00:22:86:08:02:02", + "00:22:86:08:02:03", + "00:22:86:08:03:00", + "00:22:86:08:03:01", + "00:22:86:08:03:02", + "00:22:86:08:03:03" + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1" + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + "53248", + "53249", + "53250", + "53251", + "53252", + "53253", + "53254", + "53255", + "53256", + "53257", + "53258", + "53259", + "53260", + "53261", + "53262", + "53263" + ], + "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ + "e4:43:4b:3d:89:82", + "e4:43:4b:3d:89:82", + "e4:43:4b:3d:89:82", + "e4:43:4b:3d:89:82" + ], + "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ + "10.168.160.2", + "10.168.160.2", + "10.168.160.2", + "10.168.160.2" + ], + "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ + "20010", + "20011", + "20012", + "20013" + ] + } + }, + "STAT/Beamlet/HBA1": { + "properties": { + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + "00:22:86:08:00:00", + "00:22:86:08:00:01", + "00:22:86:08:00:02", + "00:22:86:08:00:03", + "00:22:86:08:01:00", + "00:22:86:08:01:01", + "00:22:86:08:01:02", + "00:22:86:08:01:03", + "00:22:86:08:02:00", + "00:22:86:08:02:01", + "00:22:86:08:02:02", + "00:22:86:08:02:03", + "00:22:86:08:03:00", + "00:22:86:08:03:01", + "00:22:86:08:03:02", + "00:22:86:08:03:03" + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1" + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + "53248", + "53249", + "53250", + "53251", + "53252", + "53253", + "53254", + "53255", + "53256", + "53257", + "53258", + "53259", + "53260", + "53261", + "53262", + "53263" + ], + "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ + "e4:43:4b:3d:89:82", + "e4:43:4b:3d:89:82", + "e4:43:4b:3d:89:82", + "e4:43:4b:3d:89:82" + ], + "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ + "10.168.160.2", + "10.168.160.2", + "10.168.160.2", + "10.168.160.2" + ], + "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ + "20016", + "20017", + "20018", + "20019" + ] + } + } + } + } + } + } +} diff --git a/CDB/environments/cs032-ilt.json b/CDB/environments/cs032-ilt.json new file mode 100644 index 0000000000000000000000000000000000000000..fed8aae19bf66468233b22741c335df0b09d9b63 --- /dev/null +++ b/CDB/environments/cs032-ilt.json @@ -0,0 +1,238 @@ +{ + "servers": { + "Beamlet": { + "STAT": { + "Beamlet": { + "STAT/Beamlet/LBA": { + "properties": { + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + "00:22:86:08:00:00", + "00:22:86:08:00:01", + "00:22:86:08:00:02", + "00:22:86:08:00:03", + "00:22:86:08:01:00", + "00:22:86:08:01:01", + "00:22:86:08:01:02", + "00:22:86:08:01:03", + "00:22:86:08:02:00", + "00:22:86:08:02:01", + "00:22:86:08:02:02", + "00:22:86:08:02:03", + "00:22:86:08:03:00", + "00:22:86:08:03:01", + "00:22:86:08:03:02", + "00:22:86:08:03:03" + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1" + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + "53248", + "53249", + "53250", + "53251", + "53252", + "53253", + "53254", + "53255", + "53256", + "53257", + "53258", + "53259", + "53260", + "53261", + "53262", + "53263" + ], + "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ + "e4:43:4b:3d:86:e2", + "e4:43:4b:3d:86:e2", + "e4:43:4b:3d:86:e2", + "e4:43:4b:3d:86:e2" + ], + "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ + "10.168.162.2", + "10.168.162.2", + "10.168.162.2", + "10.168.162.2" + ], + "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ + "10320", + "10321", + "10322", + "10323" + ] + } + }, + "STAT/Beamlet/HBA0": { + "properties": { + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + "00:22:86:08:00:00", + "00:22:86:08:00:01", + "00:22:86:08:00:02", + "00:22:86:08:00:03", + "00:22:86:08:01:00", + "00:22:86:08:01:01", + "00:22:86:08:01:02", + "00:22:86:08:01:03", + "00:22:86:08:02:00", + "00:22:86:08:02:01", + "00:22:86:08:02:02", + "00:22:86:08:02:03", + "00:22:86:08:03:00", + "00:22:86:08:03:01", + "00:22:86:08:03:02", + "00:22:86:08:03:03" + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1" + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + "53248", + "53249", + "53250", + "53251", + "53252", + "53253", + "53254", + "53255", + "53256", + "53257", + "53258", + "53259", + "53260", + "53261", + "53262", + "53263" + ], + "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ + "e4:43:4b:3d:86:e2", + "e4:43:4b:3d:86:e2", + "e4:43:4b:3d:86:e2", + "e4:43:4b:3d:86:e2" + ], + "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ + "10.168.162.2", + "10.168.162.2", + "10.168.162.2", + "10.168.162.2" + ], + "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ + "20320", + "20321", + "20322", + "20323" + ] + } + }, + "STAT/Beamlet/HBA1": { + "properties": { + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + "00:22:86:08:00:00", + "00:22:86:08:00:01", + "00:22:86:08:00:02", + "00:22:86:08:00:03", + "00:22:86:08:01:00", + "00:22:86:08:01:01", + "00:22:86:08:01:02", + "00:22:86:08:01:03", + "00:22:86:08:02:00", + "00:22:86:08:02:01", + "00:22:86:08:02:02", + "00:22:86:08:02:03", + "00:22:86:08:03:00", + "00:22:86:08:03:01", + "00:22:86:08:03:02", + "00:22:86:08:03:03" + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1" + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + "53248", + "53249", + "53250", + "53251", + "53252", + "53253", + "53254", + "53255", + "53256", + "53257", + "53258", + "53259", + "53260", + "53261", + "53262", + "53263" + ], + "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ + "e4:43:4b:3d:86:e2", + "e4:43:4b:3d:86:e2", + "e4:43:4b:3d:86:e2", + "e4:43:4b:3d:86:e2" + ], + "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ + "10.168.162.2", + "10.168.162.2", + "10.168.162.2", + "10.168.162.2" + ], + "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ + "20326", + "20327", + "20328", + "20329" + ] + } + } + } + } + } + } +} diff --git a/CDB/environments/rs307-ilt.json b/CDB/environments/rs307-ilt.json new file mode 100644 index 0000000000000000000000000000000000000000..2fe7e7f4075a203eb50599aff2c2d8109025ffe3 --- /dev/null +++ b/CDB/environments/rs307-ilt.json @@ -0,0 +1,162 @@ +{ + "servers": { + "Beamlet": { + "STAT": { + "Beamlet": { + "STAT/Beamlet/LBA": { + "properties": { + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + "00:22:86:08:00:00", + "00:22:86:08:00:01", + "00:22:86:08:00:02", + "00:22:86:08:00:03", + "00:22:86:08:01:00", + "00:22:86:08:01:01", + "00:22:86:08:01:02", + "00:22:86:08:01:03", + "00:22:86:08:02:00", + "00:22:86:08:02:01", + "00:22:86:08:02:02", + "00:22:86:08:02:03", + "00:22:86:08:03:00", + "00:22:86:08:03:01", + "00:22:86:08:03:02", + "00:22:86:08:03:03" + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1" + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + "53248", + "53249", + "53250", + "53251", + "53252", + "53253", + "53254", + "53255", + "53256", + "53257", + "53258", + "53259", + "53260", + "53261", + "53262", + "53263" + ], + "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ + "e4:43:4b:3e:5e:92", + "e4:43:4b:3e:5e:92", + "e4:43:4b:3e:5e:92", + "e4:43:4b:3e:5e:92" + ], + "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ + "10.168.161.2", + "10.168.161.2", + "10.168.161.2", + "10.168.161.2" + ], + "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ + "13070", + "13071", + "13072", + "13073" + ] + } + }, + "STAT/Beamlet/HBA": { + "properties": { + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + "00:22:86:08:00:00", + "00:22:86:08:00:01", + "00:22:86:08:00:02", + "00:22:86:08:00:03", + "00:22:86:08:01:00", + "00:22:86:08:01:01", + "00:22:86:08:01:02", + "00:22:86:08:01:03", + "00:22:86:08:02:00", + "00:22:86:08:02:01", + "00:22:86:08:02:02", + "00:22:86:08:02:03", + "00:22:86:08:03:00", + "00:22:86:08:03:01", + "00:22:86:08:03:02", + "00:22:86:08:03:03" + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1" + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + "53248", + "53249", + "53250", + "53251", + "53252", + "53253", + "53254", + "53255", + "53256", + "53257", + "53258", + "53259", + "53260", + "53261", + "53262", + "53263" + ], + "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ + "e4:43:4b:3e:5e:92", + "e4:43:4b:3e:5e:92", + "e4:43:4b:3e:5e:92", + "e4:43:4b:3e:5e:92" + ], + "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ + "10.168.161.2", + "10.168.161.2", + "10.168.161.2", + "10.168.161.2" + ], + "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ + "23070", + "23071", + "23072", + "23073" + ] + } + } + } + } + } + } +} diff --git a/CDB/stations/README.md b/CDB/stations/README.md deleted file mode 100644 index 8031f99746fd52a4b34eacbc652946c0be74fb04..0000000000000000000000000000000000000000 --- a/CDB/stations/README.md +++ /dev/null @@ -1,23 +0,0 @@ -## Station configurations - -This directory contains the Tango base configurations for each station, using common subsets: - -- common.json: Settings common to all stations, -- l0.json: Devices representing rack L0, -- l1.json: Devices representing rack L1, -- h0.json: Devices representing rack H0, -- lba.json: Devices needed for the LBA antenna field, -- hba_core.json: Devices needed for the HBA antenna field in core station configuration. -- hba_remote.json: Devices needed for the HBA antenna field in remote station configuration. -- cs.json: Common config for core stations. -- rs.json: Common config for remote stations. - -The following stations need the following configurations applied: - -- CS001: common.json + l0.json + l1.json + h0.json + lba.json + hba_core.json + cs.json + cs001.json -- RS307: common.json + l0.json + l1.json + h0.json + lba.json + hba_remote.json + rs.json + rs307.json - -## Adding a station - -Use the `generate-cdb-from-lofar1.py` script from the `tangostationcontrol.toolkit` module to -generate station-specific CDB files like cs001.json. diff --git a/CDB/stations/cs001.json b/CDB/stations/cs001.json index c1ec8a9df2a3c50c06f82a4bb1f82747cbc06f80..1bec1f2baf061e9fa4286d92117280be1535f941 100644 --- a/CDB/stations/cs001.json +++ b/CDB/stations/cs001.json @@ -16,240 +16,6 @@ } } }, - "Beamlet": { - "STAT": { - "Beamlet": { - "STAT/Beamlet/LBA": { - "properties": { - "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ - "00:22:86:08:00:00", - "00:22:86:08:00:01", - "00:22:86:08:00:02", - "00:22:86:08:00:03", - "00:22:86:08:01:00", - "00:22:86:08:01:01", - "00:22:86:08:01:02", - "00:22:86:08:01:03", - "00:22:86:08:02:00", - "00:22:86:08:02:01", - "00:22:86:08:02:02", - "00:22:86:08:02:03", - "00:22:86:08:03:00", - "00:22:86:08:03:01", - "00:22:86:08:03:02", - "00:22:86:08:03:03" - ], - "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1" - ], - "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ - "53248", - "53249", - "53250", - "53251", - "53252", - "53253", - "53254", - "53255", - "53256", - "53257", - "53258", - "53259", - "53260", - "53261", - "53262", - "53263" - ], - "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ - "e4:43:4b:3d:89:82", - "e4:43:4b:3d:89:82", - "e4:43:4b:3d:89:82", - "e4:43:4b:3d:89:82" - ], - "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ - "10.168.160.2", - "10.168.160.2", - "10.168.160.2", - "10.168.160.2" - ], - "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ - "10010", - "10011", - "10012", - "10013" - ] - } - }, - "STAT/Beamlet/HBA0": { - "properties": { - "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ - "00:22:86:08:00:00", - "00:22:86:08:00:01", - "00:22:86:08:00:02", - "00:22:86:08:00:03", - "00:22:86:08:01:00", - "00:22:86:08:01:01", - "00:22:86:08:01:02", - "00:22:86:08:01:03", - "00:22:86:08:02:00", - "00:22:86:08:02:01", - "00:22:86:08:02:02", - "00:22:86:08:02:03", - "00:22:86:08:03:00", - "00:22:86:08:03:01", - "00:22:86:08:03:02", - "00:22:86:08:03:03" - ], - "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1" - ], - "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ - "53248", - "53249", - "53250", - "53251", - "53252", - "53253", - "53254", - "53255", - "53256", - "53257", - "53258", - "53259", - "53260", - "53261", - "53262", - "53263" - ], - "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ - "e4:43:4b:3d:89:82", - "e4:43:4b:3d:89:82", - "e4:43:4b:3d:89:82", - "e4:43:4b:3d:89:82" - ], - "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ - "10.168.160.2", - "10.168.160.2", - "10.168.160.2", - "10.168.160.2" - ], - "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ - "20010", - "20011", - "20012", - "20013" - ] - } - }, - "STAT/Beamlet/HBA1": { - "properties": { - "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ - "00:22:86:08:00:00", - "00:22:86:08:00:01", - "00:22:86:08:00:02", - "00:22:86:08:00:03", - "00:22:86:08:01:00", - "00:22:86:08:01:01", - "00:22:86:08:01:02", - "00:22:86:08:01:03", - "00:22:86:08:02:00", - "00:22:86:08:02:01", - "00:22:86:08:02:02", - "00:22:86:08:02:03", - "00:22:86:08:03:00", - "00:22:86:08:03:01", - "00:22:86:08:03:02", - "00:22:86:08:03:03" - ], - "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1" - ], - "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ - "53248", - "53249", - "53250", - "53251", - "53252", - "53253", - "53254", - "53255", - "53256", - "53257", - "53258", - "53259", - "53260", - "53261", - "53262", - "53263" - ], - "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ - "e4:43:4b:3d:89:82", - "e4:43:4b:3d:89:82", - "e4:43:4b:3d:89:82", - "e4:43:4b:3d:89:82" - ], - "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ - "10.168.160.2", - "10.168.160.2", - "10.168.160.2", - "10.168.160.2" - ], - "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ - "20016", - "20017", - "20018", - "20019" - ] - } - } - } - } - }, "AFL": { "STAT": { "AFL": { diff --git a/CDB/stations/cs032.json b/CDB/stations/cs032.json index a27ce1bc8eee9d798acc6e3cf8138a3a4a57ab09..e0352fbc4dab355c5bca8ffdbda4d734f0db398e 100644 --- a/CDB/stations/cs032.json +++ b/CDB/stations/cs032.json @@ -16,240 +16,6 @@ } } }, - "Beamlet": { - "STAT": { - "Beamlet": { - "STAT/Beamlet/LBA": { - "properties": { - "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ - "00:22:86:08:00:00", - "00:22:86:08:00:01", - "00:22:86:08:00:02", - "00:22:86:08:00:03", - "00:22:86:08:01:00", - "00:22:86:08:01:01", - "00:22:86:08:01:02", - "00:22:86:08:01:03", - "00:22:86:08:02:00", - "00:22:86:08:02:01", - "00:22:86:08:02:02", - "00:22:86:08:02:03", - "00:22:86:08:03:00", - "00:22:86:08:03:01", - "00:22:86:08:03:02", - "00:22:86:08:03:03" - ], - "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1" - ], - "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ - "53248", - "53249", - "53250", - "53251", - "53252", - "53253", - "53254", - "53255", - "53256", - "53257", - "53258", - "53259", - "53260", - "53261", - "53262", - "53263" - ], - "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ - "e4:43:4b:3d:86:e2", - "e4:43:4b:3d:86:e2", - "e4:43:4b:3d:86:e2", - "e4:43:4b:3d:86:e2" - ], - "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ - "10.168.162.2", - "10.168.162.2", - "10.168.162.2", - "10.168.162.2" - ], - "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ - "10320", - "10321", - "10322", - "10323" - ] - } - }, - "STAT/Beamlet/HBA0": { - "properties": { - "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ - "00:22:86:08:00:00", - "00:22:86:08:00:01", - "00:22:86:08:00:02", - "00:22:86:08:00:03", - "00:22:86:08:01:00", - "00:22:86:08:01:01", - "00:22:86:08:01:02", - "00:22:86:08:01:03", - "00:22:86:08:02:00", - "00:22:86:08:02:01", - "00:22:86:08:02:02", - "00:22:86:08:02:03", - "00:22:86:08:03:00", - "00:22:86:08:03:01", - "00:22:86:08:03:02", - "00:22:86:08:03:03" - ], - "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1" - ], - "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ - "53248", - "53249", - "53250", - "53251", - "53252", - "53253", - "53254", - "53255", - "53256", - "53257", - "53258", - "53259", - "53260", - "53261", - "53262", - "53263" - ], - "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ - "e4:43:4b:3d:86:e2", - "e4:43:4b:3d:86:e2", - "e4:43:4b:3d:86:e2", - "e4:43:4b:3d:86:e2" - ], - "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ - "10.168.162.2", - "10.168.162.2", - "10.168.162.2", - "10.168.162.2" - ], - "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ - "20320", - "20321", - "20322", - "20323" - ] - } - }, - "STAT/Beamlet/HBA1": { - "properties": { - "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ - "00:22:86:08:00:00", - "00:22:86:08:00:01", - "00:22:86:08:00:02", - "00:22:86:08:00:03", - "00:22:86:08:01:00", - "00:22:86:08:01:01", - "00:22:86:08:01:02", - "00:22:86:08:01:03", - "00:22:86:08:02:00", - "00:22:86:08:02:01", - "00:22:86:08:02:02", - "00:22:86:08:02:03", - "00:22:86:08:03:00", - "00:22:86:08:03:01", - "00:22:86:08:03:02", - "00:22:86:08:03:03" - ], - "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1" - ], - "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ - "53248", - "53249", - "53250", - "53251", - "53252", - "53253", - "53254", - "53255", - "53256", - "53257", - "53258", - "53259", - "53260", - "53261", - "53262", - "53263" - ], - "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ - "e4:43:4b:3d:86:e2", - "e4:43:4b:3d:86:e2", - "e4:43:4b:3d:86:e2", - "e4:43:4b:3d:86:e2" - ], - "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ - "10.168.162.2", - "10.168.162.2", - "10.168.162.2", - "10.168.162.2" - ], - "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ - "20326", - "20327", - "20328", - "20329" - ] - } - } - } - } - }, "AFL": { "STAT": { "AFL": { diff --git a/CDB/stations/DTS.json b/CDB/stations/dts-lab.json similarity index 100% rename from CDB/stations/DTS.json rename to CDB/stations/dts-lab.json diff --git a/CDB/stations/rs307.json b/CDB/stations/rs307.json index 2bd14cd534bf7320c7ffd2139637a7924642b2cd..2919883aa599326763ba0ff9bc9bd8d2fb0db8ed 100644 --- a/CDB/stations/rs307.json +++ b/CDB/stations/rs307.json @@ -16,164 +16,6 @@ } } }, - "Beamlet": { - "STAT": { - "Beamlet": { - "STAT/Beamlet/LBA": { - "properties": { - "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ - "00:22:86:08:00:00", - "00:22:86:08:00:01", - "00:22:86:08:00:02", - "00:22:86:08:00:03", - "00:22:86:08:01:00", - "00:22:86:08:01:01", - "00:22:86:08:01:02", - "00:22:86:08:01:03", - "00:22:86:08:02:00", - "00:22:86:08:02:01", - "00:22:86:08:02:02", - "00:22:86:08:02:03", - "00:22:86:08:03:00", - "00:22:86:08:03:01", - "00:22:86:08:03:02", - "00:22:86:08:03:03" - ], - "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1" - ], - "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ - "53248", - "53249", - "53250", - "53251", - "53252", - "53253", - "53254", - "53255", - "53256", - "53257", - "53258", - "53259", - "53260", - "53261", - "53262", - "53263" - ], - "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ - "e4:43:4b:3e:5e:92", - "e4:43:4b:3e:5e:92", - "e4:43:4b:3e:5e:92", - "e4:43:4b:3e:5e:92" - ], - "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ - "10.168.161.2", - "10.168.161.2", - "10.168.161.2", - "10.168.161.2" - ], - "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ - "13070", - "13071", - "13072", - "13073" - ] - } - }, - "STAT/Beamlet/HBA": { - "properties": { - "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ - "00:22:86:08:00:00", - "00:22:86:08:00:01", - "00:22:86:08:00:02", - "00:22:86:08:00:03", - "00:22:86:08:01:00", - "00:22:86:08:01:01", - "00:22:86:08:01:02", - "00:22:86:08:01:03", - "00:22:86:08:02:00", - "00:22:86:08:02:01", - "00:22:86:08:02:02", - "00:22:86:08:02:03", - "00:22:86:08:03:00", - "00:22:86:08:03:01", - "00:22:86:08:03:02", - "00:22:86:08:03:03" - ], - "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1", - "10.175.1.1" - ], - "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ - "53248", - "53249", - "53250", - "53251", - "53252", - "53253", - "53254", - "53255", - "53256", - "53257", - "53258", - "53259", - "53260", - "53261", - "53262", - "53263" - ], - "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ - "e4:43:4b:3e:5e:92", - "e4:43:4b:3e:5e:92", - "e4:43:4b:3e:5e:92", - "e4:43:4b:3e:5e:92" - ], - "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ - "10.168.161.2", - "10.168.161.2", - "10.168.161.2", - "10.168.161.2" - ], - "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ - "23070", - "23071", - "23072", - "23073" - ] - } - } - } - } - }, "AFL": { "STAT": { "AFL": { diff --git a/CDB/integrations/digitalbeam_cluster_ConfigDb.json b/CDB/test/digitalbeam_performance.json similarity index 100% rename from CDB/integrations/digitalbeam_cluster_ConfigDb.json rename to CDB/test/digitalbeam_performance.json diff --git a/CDB/stations/simulators_ConfigDb.json b/CDB/test/simulators.json similarity index 100% rename from CDB/stations/simulators_ConfigDb.json rename to CDB/test/simulators.json diff --git a/CDB/stations/testenv_cs001.json b/CDB/test/testenv-cs001.json similarity index 81% rename from CDB/stations/testenv_cs001.json rename to CDB/test/testenv-cs001.json index 8d03aefa4b7c571a1fb10eb835993c382125ad15..e4c5948673ca148e66984890ed798522eaee6a82 100644 --- a/CDB/stations/testenv_cs001.json +++ b/CDB/test/testenv-cs001.json @@ -161,41 +161,77 @@ "OPC_Time_Out": [ "5.0" ], - "FPGA_beamlet_output_hdr_eth_destination_mac_RW_default": [ - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + "00:22:86:08:00:00", + "00:22:86:08:00:01", + "00:22:86:08:00:02", + "00:22:86:08:00:03", + "00:22:86:08:01:00", + "00:22:86:08:01:01", + "00:22:86:08:01:02", + "00:22:86:08:01:03", + "00:22:86:08:02:00", + "00:22:86:08:02:01", + "00:22:86:08:02:02", + "00:22:86:08:02:03", + "00:22:86:08:03:00", + "00:22:86:08:03:01", + "00:22:86:08:03:02", + "00:22:86:08:03:03" + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1" + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + "53248", + "53249", + "53250", + "53251", + "53252", + "53253", + "53254", + "53255", + "53256", + "53257", + "53258", + "53259", + "53260", + "53261", + "53262", + "53263" + ], + "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ "01:23:45:67:89:AB", "01:23:45:67:89:AB", "01:23:45:67:89:AB", "01:23:45:67:89:AB" ], - "FPGA_beamlet_output_hdr_ip_destination_address_RW_default": [ - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", + "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ "127.0.0.1", "127.0.0.1", "127.0.0.1", "127.0.0.1" + ], + "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ + "10010", + "10011", + "10012", + "10013" ] } }, @@ -210,41 +246,77 @@ "OPC_Time_Out": [ "5.0" ], - "FPGA_beamlet_output_hdr_eth_destination_mac_RW_default": [ - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + "00:22:86:08:00:00", + "00:22:86:08:00:01", + "00:22:86:08:00:02", + "00:22:86:08:00:03", + "00:22:86:08:01:00", + "00:22:86:08:01:01", + "00:22:86:08:01:02", + "00:22:86:08:01:03", + "00:22:86:08:02:00", + "00:22:86:08:02:01", + "00:22:86:08:02:02", + "00:22:86:08:02:03", + "00:22:86:08:03:00", + "00:22:86:08:03:01", + "00:22:86:08:03:02", + "00:22:86:08:03:03" + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1" + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + "53248", + "53249", + "53250", + "53251", + "53252", + "53253", + "53254", + "53255", + "53256", + "53257", + "53258", + "53259", + "53260", + "53261", + "53262", + "53263" + ], + "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ "01:23:45:67:89:AB", "01:23:45:67:89:AB", "01:23:45:67:89:AB", "01:23:45:67:89:AB" ], - "FPGA_beamlet_output_hdr_ip_destination_address_RW_default": [ - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", + "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ "127.0.0.1", "127.0.0.1", "127.0.0.1", "127.0.0.1" + ], + "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ + "10010", + "10011", + "10012", + "10013" ] } }, @@ -259,41 +331,77 @@ "OPC_Time_Out": [ "5.0" ], - "FPGA_beamlet_output_hdr_eth_destination_mac_RW_default": [ - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + "00:22:86:08:00:00", + "00:22:86:08:00:01", + "00:22:86:08:00:02", + "00:22:86:08:00:03", + "00:22:86:08:01:00", + "00:22:86:08:01:01", + "00:22:86:08:01:02", + "00:22:86:08:01:03", + "00:22:86:08:02:00", + "00:22:86:08:02:01", + "00:22:86:08:02:02", + "00:22:86:08:02:03", + "00:22:86:08:03:00", + "00:22:86:08:03:01", + "00:22:86:08:03:02", + "00:22:86:08:03:03" + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1" + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + "53248", + "53249", + "53250", + "53251", + "53252", + "53253", + "53254", + "53255", + "53256", + "53257", + "53258", + "53259", + "53260", + "53261", + "53262", + "53263" + ], + "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ "01:23:45:67:89:AB", "01:23:45:67:89:AB", "01:23:45:67:89:AB", "01:23:45:67:89:AB" ], - "FPGA_beamlet_output_hdr_ip_destination_address_RW_default": [ - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", + "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ "127.0.0.1", "127.0.0.1", "127.0.0.1", "127.0.0.1" + ], + "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ + "10010", + "10011", + "10012", + "10013" ] } } diff --git a/CDB/stations/testenv_rs307.json b/CDB/test/testenv-rs307.json similarity index 83% rename from CDB/stations/testenv_rs307.json rename to CDB/test/testenv-rs307.json index 2568c950f47227c118a8925880ab492dea8ab67f..013ca5945d871c06030a2c8fc124c0dc04218db5 100644 --- a/CDB/stations/testenv_rs307.json +++ b/CDB/test/testenv-rs307.json @@ -161,41 +161,77 @@ "OPC_Time_Out": [ "5.0" ], - "FPGA_beamlet_output_hdr_eth_destination_mac_RW_default": [ - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + "00:22:86:08:00:00", + "00:22:86:08:00:01", + "00:22:86:08:00:02", + "00:22:86:08:00:03", + "00:22:86:08:01:00", + "00:22:86:08:01:01", + "00:22:86:08:01:02", + "00:22:86:08:01:03", + "00:22:86:08:02:00", + "00:22:86:08:02:01", + "00:22:86:08:02:02", + "00:22:86:08:02:03", + "00:22:86:08:03:00", + "00:22:86:08:03:01", + "00:22:86:08:03:02", + "00:22:86:08:03:03" + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1" + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + "53248", + "53249", + "53250", + "53251", + "53252", + "53253", + "53254", + "53255", + "53256", + "53257", + "53258", + "53259", + "53260", + "53261", + "53262", + "53263" + ], + "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ "01:23:45:67:89:AB", "01:23:45:67:89:AB", "01:23:45:67:89:AB", "01:23:45:67:89:AB" ], - "FPGA_beamlet_output_hdr_ip_destination_address_RW_default": [ - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", + "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ "127.0.0.1", "127.0.0.1", "127.0.0.1", "127.0.0.1" + ], + "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ + "10010", + "10011", + "10012", + "10013" ] } }, @@ -210,41 +246,77 @@ "OPC_Time_Out": [ "5.0" ], - "FPGA_beamlet_output_hdr_eth_destination_mac_RW_default": [ - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", - "01:23:45:67:89:AB", + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + "00:22:86:08:00:00", + "00:22:86:08:00:01", + "00:22:86:08:00:02", + "00:22:86:08:00:03", + "00:22:86:08:01:00", + "00:22:86:08:01:01", + "00:22:86:08:01:02", + "00:22:86:08:01:03", + "00:22:86:08:02:00", + "00:22:86:08:02:01", + "00:22:86:08:02:02", + "00:22:86:08:02:03", + "00:22:86:08:03:00", + "00:22:86:08:03:01", + "00:22:86:08:03:02", + "00:22:86:08:03:03" + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1", + "10.175.1.1" + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + "53248", + "53249", + "53250", + "53251", + "53252", + "53253", + "53254", + "53255", + "53256", + "53257", + "53258", + "53259", + "53260", + "53261", + "53262", + "53263" + ], + "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ "01:23:45:67:89:AB", "01:23:45:67:89:AB", "01:23:45:67:89:AB", "01:23:45:67:89:AB" ], - "FPGA_beamlet_output_hdr_ip_destination_address_RW_default": [ - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", - "127.0.0.1", + "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ "127.0.0.1", "127.0.0.1", "127.0.0.1", "127.0.0.1" + ], + "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ + "10010", + "10011", + "10012", + "10013" ] } } @@ -277,37 +349,11 @@ } } }, - "TemperatureManager": { + "ProtectionControl": { "STAT": { - "TemperatureManager": { - "STAT/TemperatureManager/1": { + "ProtectionControl": { + "STAT/ProtectionControl/1": { "properties": { - "Alarm_Error_List": [ - "APSCT, APSCT_TEMP_error_R", - "APSPU, APSPU_TEMP_error_R", - "UNB2, UNB2_TEMP_error_R", - "RECVH, RECV_TEMP_error_R", - "RECVL, RECV_TEMP_error_R" - ], - "Shutdown_Device_List": [ - "STAT/SDPFirmware/LBA", - "STAT/SDPFirmware/HBA", - "STAT/SDP/LBA", - "STAT/SDP/HBA", - "STAT/UNB2/L0", - "STAT/UNB2/L1", - "STAT/UNB2/H0", - "STAT/RECVH/H0", - "STAT/RECVL/L0", - "STAT/RECVL/L1", - "STAT/APSCT/L0", - "STAT/APSCT/L1", - "STAT/APSCT/H0", - "STAT/CCD/1", - "STAT/APSPU/L0", - "STAT/APSPU/L1", - "STAT/APSPU/H0" - ] } } } @@ -326,19 +372,6 @@ } } }, - "PSOC": { - "STAT": { - "PSOC": { - "STAT/PSOC/1": { - "properties": { - "SNMP_use_simulators": [ - "True" - ] - } - } - } - } - }, "RECVH": { "STAT": { "RECVH": { diff --git a/CDB/integrations/tilebeam_cluster_ConfigDb.json b/CDB/test/tilebeam_performance.json similarity index 100% rename from CDB/integrations/tilebeam_cluster_ConfigDb.json rename to CDB/test/tilebeam_performance.json diff --git a/README.md b/README.md index ae70cd452fc0dd313280166c67044c120f107077..55cdd9c7e98e325b7a3a343f0dde1751c688a0ab 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ Next change the version in the following places: through [https://git.astron.nl/lofar2.0/tango/-/tags](Deploy Tags) # Release Notes - +* 0.50.1 Generate and combine CDB files for all stations in Gitlab CI/CD * 0.50.0 Add pqr to etrs rotation matrix to metadata * 0.49.0 Add Station service to control station state to gRPC server * 0.48.2 rename antennafield_id diff --git a/infra/README.md b/infra/README.md index 63e9dbc54e1e4dddc88711cc53eb3bdc38b04e0f..e33b8c945a6657489abd68ebe757c923a5c76ff5 100644 --- a/infra/README.md +++ b/infra/README.md @@ -12,13 +12,10 @@ To rollout a new station, you will need: 2. Jumbo frames enabled 3. Connected to LOFAR network & VLAN 4. Connected to station network & VLAN -3. Netapp information: - 1. IP address of the LCU - 2. IP address of IPMI - 3. IP addresses of the Uniboards (of all racks) - 4. MAC addresses of the Uniboards (of all racks) - 5. IP address of White Rabbit switch - 6. IP address(es) of the PCONs +3. NetBox information: + 1. IP address of IPMI + 2. IP address of White Rabbit switch + 3. IP address(es) of the PCONs ### Preparation @@ -26,9 +23,11 @@ Before the LCU gets into the field, you want to configure some things: #### Create configuration files +To create the files based on their old LOFAR1 configuration: + 1. Create CDB files: - 1. Generate the station-specific config from LOFAR1 using `generate_cdb_from_lofar1.py -s CS123` [Script location](../tangostationcontrol/toolkit/generate_cdb_from_lofar1.py). - 2. Make any adjustments needed, and add the file as `cs123.json` to [CDB/stations/](../CDB/stations/). + 1. Run the `render_CDB_stations_from_lofar1` GitLab job and extract `generated/CDB/stations/cs123.json`, + 2. Make any adjustments needed, and add the file to [CDB/stations/](../CDB/stations/). 2. Create Calibration tables: 1. Generate them from LOFAR1 using `generate_caltable_from_lofar1.py -s CS123`. [Script location](../tangostationcontrol/toolkit/generate_caltable_from_lofar1.py). 2. Go to http://filefish.lofar.net/ (credentials: minioadmin/minioadmin). @@ -50,13 +49,17 @@ Before the LCU gets into the field, you want to configure some things: 1. Set its IP address, 4. Deploy the OS, see [here](station/README.md). 5. Deploy the software stack: - 1. Activate the ["Deploy" step](../.gitlab-ci.yml) in the Gitlab CI/CD for the pipeline of the version tag you want to deploy. - 2. Wait for the deployment to finish in Nomad, either by: + 1. Activate the ["deploy" step](../.gitlab-ci.yml) in the Gitlab CI/CD for the pipeline of the version tag you want to deploy, + 2. Acticate the *deploy_nomad_station* step in the stingray repository at https://git.astron.nl/lofar2.0/stingray/, + 3. Acticate the *deploy_nomad_station* step in the opah repository at https://git.astron.nl/lofar2.0/opah/, + 4. Wait for the deployment to finish in Nomad, either by: 1. Going to http://cs123c.control.lofar:4646/ui/jobs, or 2. Going to http://monitor.control.lofar:4646/ui/jobs and select the station under "Region" in the top left. 6. Load the CDB files: - 1. Go to http://cs123c.control.lofar:4646/ui/jobs/dsconfig - 2. Dispatch jobs for each CDB file, see [here](../CDB/stations/README.md), cut into pieces of max 16 KByte. + 1. Go to the ["render_CDB" step](../.gitlab-ci.yml) in the Gitlab CI/CD for the pipeline of the version tag you want to deploy. + 2. Obtain its artifacts and obtain the URL to `generated/CDB/deploy/cs123.json`, + 1. Go to http://cs123c.control.lofar:4646/ui/jobs/dsconfig, + 2. Dispatch a job for the URL to the CDB file, 3. Wait until all jobs finished. It is normal for jobs to fail before succeeding, as `dsconfig` can return 1 despite being succesful. 7. Restart the Device Servers: 1. Go to http://cs123c.control.lofar:4646/ui/jobs/device-servers diff --git a/infra/dev/tango/tango.hcl b/infra/dev/tango/tango.hcl index f89b1b5871375d9d7ad9a1fbc96b1226871e2ce2..7f3a610d9c6777286807653d601f158ae2a27dce 100644 --- a/infra/dev/tango/tango.hcl +++ b/infra/dev/tango/tango.hcl @@ -85,6 +85,7 @@ resource "exec" "dsconfig" { environment = { DNS="192.168.76.1" DOCKER_HOST=docker_host() + LOFAR20_DIR="." TANGO_HOST="tango.service.consul:10000" TAG=variable.image_tag STATION_TYPE=variable.station_type @@ -104,23 +105,23 @@ resource "exec" "dsconfig" { echo "Docker host is $DOCKER_HOST" echo "Tango host within docker network is $TANGO_HOST" - bash sbin/dsconfig.sh --load CDB/stations/common.json - bash sbin/dsconfig.sh --update CDB/stations/l0.json - bash sbin/dsconfig.sh --update CDB/stations/l1.json - bash sbin/dsconfig.sh --update CDB/stations/lba.json - bash sbin/dsconfig.sh --update CDB/stations/h0.json + bash sbin/dsconfig.sh --load CDB/base/common.json + bash sbin/dsconfig.sh --update CDB/base/l0.json + bash sbin/dsconfig.sh --update CDB/base/l1.json + bash sbin/dsconfig.sh --update CDB/base/lba.json + bash sbin/dsconfig.sh --update CDB/base/h0.json if [ "$STATION_TYPE" = "rs" ]; then echo "Configuring dsconfig for remote station" - bash sbin/dsconfig.sh --update CDB/stations/hba_remote.json - bash sbin/dsconfig.sh --update CDB/stations/rs.json + bash sbin/dsconfig.sh --update CDB/base/hba-remote.json + bash sbin/dsconfig.sh --update CDB/base/rs.json bash sbin/dsconfig.sh --update CDB/stations/rs307.json - bash sbin/dsconfig.sh --update CDB/stations/testenv_rs307.json + bash sbin/dsconfig.sh --update CDB/test/testenv-rs307.json else echo "Configuring dsconfig for core station" - bash sbin/dsconfig.sh --update CDB/stations/hba_core.json - bash sbin/dsconfig.sh --update CDB/stations/cs.json + bash sbin/dsconfig.sh --update CDB/base/hba-core.json + bash sbin/dsconfig.sh --update CDB/base/cs.json bash sbin/dsconfig.sh --update CDB/stations/cs001.json - bash sbin/dsconfig.sh --update CDB/stations/testenv_cs001.json + bash sbin/dsconfig.sh --update CDB/test/testenv-cs001.json fi EOF } diff --git a/infra/jobs/station/dsconfig.levant.nomad b/infra/jobs/station/dsconfig.levant.nomad index f7cbbcd919dc7fa785e3bc92f9843b71179945ab..238c94be72cf6b272d2a3ec2f3f50ec5a23eb53f 100644 --- a/infra/jobs/station/dsconfig.levant.nomad +++ b/infra/jobs/station/dsconfig.levant.nomad @@ -1,6 +1,7 @@ job "dsconfig" { parameterized { - payload = "required" + payload = "forbidden" + meta_required = ["cdb_json_url"] } region = "[[.region]]" @@ -17,6 +18,12 @@ job "dsconfig" { task "dsconfig" { driver = "docker" + artifact { + source = "${NOMAD_META_cdb_json_url}" + destination = "local/dsconfig-update-settings.json" + mode = "file" + } + config { image = "[[ .registry.astron.url ]]/dsconfig:[[ .image_tag ]]" mount { @@ -33,9 +40,6 @@ job "dsconfig" { } - dispatch_payload { - file = "dsconfig-update-settings.json" - } template { data = <<EOH #!/bin/bash diff --git a/sbin/install-hooks/submodule-and-lfs.sh b/sbin/install-hooks/submodule-and-lfs.sh index 7b7e90dba74a47137f574b0db631339d1e8856b2..db6437d034ee76a20a5f4a35bd694f13a489793c 100644 --- a/sbin/install-hooks/submodule-and-lfs.sh +++ b/sbin/install-hooks/submodule-and-lfs.sh @@ -9,5 +9,6 @@ if [ ! -f "setup.sh" ]; then exit 1 fi -mkdir -p .git/hooks/ -cp bin/hooks/* .git/hooks/ +HOOKS_DIR=`git rev-parse --git-path hooks` +mkdir -p ${HOOKS_DIR} +cp bin/hooks/* ${HOOKS_DIR}/ diff --git a/sbin/run_integration_test.sh b/sbin/run_integration_test.sh index 72077cfb6aac66c661c4148090a470e0fc2f9eda..06ff520d8962c253a03230c7fcae0b7b3a990abe 100755 --- a/sbin/run_integration_test.sh +++ b/sbin/run_integration_test.sh @@ -359,8 +359,8 @@ fi if [ "$STATION_TYPE" = "cs" ]; then echo "Running integration tests for core station" integration_test default - integration_test tilebeam_performance "device-sdpfirmware device-sdp device-recvh device-recvl device-tilebeam device-afh device-afl" "${LOFAR20_DIR}/CDB/integrations/tilebeam_cluster_ConfigDb.json" - integration_test digitalbeam_performance "device-sdpfirmware device-sdp device-recvh device-recvl device-digitalbeam device-beamlet device-afh device-afl" "${LOFAR20_DIR}/CDB/integrations/digitalbeam_cluster_ConfigDb.json" + integration_test tilebeam_performance "device-sdpfirmware device-sdp device-recvh device-recvl device-tilebeam device-afh device-afl" "${LOFAR20_DIR}/CDB/test/tilebeam_performance.json" + integration_test digitalbeam_performance "device-sdpfirmware device-sdp device-recvh device-recvl device-digitalbeam device-beamlet device-afh device-afl" "${LOFAR20_DIR}/CDB/test/digitalbeam_performance.json" integration_test configuration "device-configuration" else echo "Running integration tests for remote station" diff --git a/setup.cfg b/setup.cfg index fb1f8d4fca0b1bea0297f2e59304aab2b144853a..556bce9919d7df4476618f8a906a83385b727dbe 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,7 +29,10 @@ console_scripts = l2ss-rpc-server = tangostationcontrol.rpc.server:main l2ss-generate-cdb-from-lofar1 = tangostationcontrol.toolkit.generate_cdb_from_lofar1:main - l2ss-generate-caltable-from-lofar1 = tangostationcontrol.toolkit.generat_caltable_from_lofar1:main + l2ss-generate-caltable-from-lofar1 = tangostationcontrol.toolkit.generate_caltable_from_lofar1:main + + l2ss-generate-cdb-datastreams = tangostationcontrol.toolkit.generate_cdb_datastreams:main + l2ss-merge-cdb = tangostationcontrol.toolkit.merge_cdb:main [options.package_data] * = *.json, *.mib diff --git a/tangostationcontrol/VERSION b/tangostationcontrol/VERSION index 564edf82ddf5e65634652b7d549378b914a10538..a3968efc373766b47a69b6bab5bb4d8210ea0773 100644 --- a/tangostationcontrol/VERSION +++ b/tangostationcontrol/VERSION @@ -1 +1 @@ -0.50.0 +0.50.1 diff --git a/tangostationcontrol/toolkit/_cdb.py b/tangostationcontrol/toolkit/_cdb.py new file mode 100755 index 0000000000000000000000000000000000000000..d2e4f8ff4b5117e19f771c0c3e48863fb24b1a08 --- /dev/null +++ b/tangostationcontrol/toolkit/_cdb.py @@ -0,0 +1,112 @@ +#! /usr/bin/env python3 +# Copyright (C) 2025 ASTRON (Netherlands Institute for Radio Astronomy) +# SPDX-License-Identifier: Apache-2.0 + +from typing import Dict, List + +import mergedeep + + +class CDB(dict): + """CDB file as a dict.""" + + def __init__(self): + self["servers"] = {} + + def add_device_properties( + self, domain: str, family: str, member: str, properties: Dict[str, List[str]] + ): + dserver = family + klass = family + + mergedeep.merge( + self["servers"], + { + dserver: { + domain: { + klass: { + f"{domain}/{family}/{member}": {"properties": properties} + } + } + } + }, + ) + + @staticmethod + def elements_per_line(property_name: str) -> int: + """Number of elements of a list to print on each line for a given property.""" + + if property_name.startswith("FPGA_"): + return 1 + if property_name.endswith("_ETRS") or property_name.endswith("_ITRF"): + return 3 + if property_name.endswith("_matrix"): + return 3 + return 6 + + def __str__(self) -> str: + tabsize = 2 + + def to_str(x, indent=0, name=None): + if isinstance(x, dict): + return dict_to_str(x, indent) + if isinstance(x, list): + return list_to_str(x, indent, name) + return f'"{x}"' + + def dict_to_str(dct, indent=0): + lines = [ + f'"{k}": {to_str(v, indent + tabsize, k)},' for k, v in dct.items() + ] + # strip comma of last line with content + lines[-1] = lines[-1][:-1] + + # return properly indented + return "\n".join( + ["{"] + + [" " * (indent + tabsize) + line for line in lines] + + [" " * indent + "}"] + ) + + def list_to_str(lst, indent=0, name=None): + elements = [f'"{e}",' for e in lst] + # strip comma of last element with content + elements[-1] = elements[-1][:-1] + + # group elements per 6 on a line + lines = [] + nr_per_line = self.elements_per_line(name) + for line_nr in range((len(elements) + nr_per_line - 1) // nr_per_line): + lines.append( + " ".join( + [ + f"{e:8}" + for e in elements[ + line_nr * nr_per_line : (line_nr + 1) * nr_per_line + ] + ] + ) + ) + + # return properly indented + return "\n".join( + ["["] + + [" " * (indent + tabsize) + line for line in lines] + + [" " * indent + "]"] + ) + + return dict_to_str(self) + + +def merge(source: dict, destination: dict) -> dict: + """Merge source into destination.""" + + for key, value in source.items(): + if isinstance(value, dict): + # get node or create one + node = destination.setdefault(key, {}) + merge(value, node) + else: + destination[key] = value + + return destination diff --git a/tangostationcontrol/toolkit/analyse_dsconfig_hierarchies.py b/tangostationcontrol/toolkit/analyse_dsconfig_hierarchies.py index 9843a57c01088e72ae6c5a43673975618bec851f..721fd58ae130e8c128bb3422867c1c7941949209 100644 --- a/tangostationcontrol/toolkit/analyse_dsconfig_hierarchies.py +++ b/tangostationcontrol/toolkit/analyse_dsconfig_hierarchies.py @@ -4,19 +4,7 @@ This program allows the analysis of CDB JSON files that serve as input to dsconf import json - -def merge(source: dict, destination: dict) -> dict: - """Merge source into destination.""" - - for key, value in source.items(): - if isinstance(value, dict): - # get node or create one - node = destination.setdefault(key, {}) - merge(value, node) - else: - destination[key] = value - - return destination +from tangostationcontrol.toolkit._cdb import merge class DsConfigAnalysis: diff --git a/tangostationcontrol/toolkit/generate_caltable_from_lofar1.py b/tangostationcontrol/toolkit/generate_caltable_from_lofar1.py index 473b4e2bc2cea6562d0ec73df69b0f2b273166f9..fa58d936821bccd2778698fd0a4fce723487250c 100755 --- a/tangostationcontrol/toolkit/generate_caltable_from_lofar1.py +++ b/tangostationcontrol/toolkit/generate_caltable_from_lofar1.py @@ -81,12 +81,12 @@ class LOFAR2CalTables: calvalues_y = lofar1_caltable_data[:, antenna_nr * 2 + 1] # validate - assert len(calvalues_x) == 512, ( - "Expected calibration values for 512 subbands" - ) - assert len(calvalues_y) == 512, ( - "Expected calibration values for 512 subbands" - ) + assert ( + len(calvalues_x) == 512 + ), "Expected calibration values for 512 subbands" + assert ( + len(calvalues_y) == 512 + ), "Expected calibration values for 512 subbands" # write to LOFAR2 table.antennas[f"{antenna_name_prefix}{antenna_nr:02}"] = ( diff --git a/tangostationcontrol/toolkit/generate_cdb_datastreams.py b/tangostationcontrol/toolkit/generate_cdb_datastreams.py new file mode 100755 index 0000000000000000000000000000000000000000..8c13d9215dacd184cbd2c514c03df82fdc2490e1 --- /dev/null +++ b/tangostationcontrol/toolkit/generate_cdb_datastreams.py @@ -0,0 +1,167 @@ +#! /usr/bin/env python3 +# Copyright (C) 2025 ASTRON (Netherlands Institute for Radio Astronomy) +# SPDX-License-Identifier: Apache-2.0 + +from ipaddress import IPv4Address +from typing import Dict, List + +from tangostationcontrol.toolkit._cdb import CDB + +N_pol = 2 + + +class StationData: + def __init__(self, station, lcu_ip: IPv4Address, resolver=None): + self.station = station + self.lcu_ip = lcu_ip + + @property + def station_nr(self) -> int: + return int(self.station[2:]) + + @property + def antenna_fields(self) -> list[str]: + raise NotImplementedError + + @property + def station_8bit_id(self) -> str: + """Unique 8-bit identifier for the station.""" + + arm = self.station_nr // 100 # max: 6 + station_in_arm = self.station_nr % 100 # max: 32 + + station_id = arm * 33 + station_in_arm + + return station_id + + def _fpga_source_mac(self, antenna_field: str, fpga_nr: int): + antenna_field_idx = self.antenna_fields.index(antenna_field) + + # generate a unique MAC address per station and FPGA, + # using the 00:22:86 prefix, see https://maclookup.app/vendors/astron + return f"00:22:86:{self.station_8bit_id:02x}:{antenna_field_idx:02x}:{fpga_nr // 4:01}{fpga_nr % 4:01}" + + def _fpga_source_ip(self, antenna_field: str, fpga_nr: int): + raise NotImplementedError + + def properties_Beamlet(self, antenna_field: str) -> Dict[str, List[str]]: + return { + "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ + self._fpga_source_mac(antenna_field, n) for n in range(16) + ], + "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ + self._fpga_source_ip(antenna_field, n) for n in range(16) + ], + "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ + 50000 + n for n in range(16) + ], + # "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ + # ], + # "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ + # ], + # "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ + # ], + } + + def CDB(self) -> CDB: + cdb = CDB() + return cdb + + +class CSStationData(StationData): + @property + def antenna_fields(self) -> list[str]: + return ["LBA", "HBA0", "HBA1"] + + def _fpga_source_ip(self, antenna_field: str, fpga_nr: int): + # defined as per IP plan + match antenna_field: + case "LBA": + return self.lcu_ip + 5 + case "HBA0": + return self.lcu_ip + 6 + case "HBA1": + return self.lcu_ip + 7 + + raise ValueError(f"Unknown antenna field: {antenna_field}") + + def CDB(self) -> CDB: + cdb = super().CDB() + cdb.add_device_properties( + "STAT", "Beamlet", "LBA", self.properties_Beamlet("LBA") + ) + cdb.add_device_properties( + "STAT", "Beamlet", "HBA0", self.properties_Beamlet("HBA0") + ) + cdb.add_device_properties( + "STAT", "Beamlet", "HBA1", self.properties_Beamlet("HBA1") + ) + return cdb + + +class RSStationData(StationData): + @property + def antenna_fields(self) -> list[str]: + return ["LBA", "HBA"] + + def _fpga_source_ip(self, antenna_field: str, fpga_nr: int): + # defined as per IP plan + match antenna_field: + case "LBA": + return self.lcu_ip + 5 + case "HBA": + return self.lcu_ip + 6 + + raise ValueError(f"Unknown antenna field: {antenna_field}") + + def CDB(self) -> CDB: + cdb = super().CDB() + cdb.add_device_properties( + "STAT", "Beamlet", "LBA", self.properties_Beamlet("LBA") + ) + cdb.add_device_properties( + "STAT", "Beamlet", "HBA", self.properties_Beamlet("HBA") + ) + return cdb + + +def StationDataFactory(station, *args, **kwargs) -> StationData: + station_type = station[:2].upper() + + if station_type == "CS": + return CSStationData(station, *args, **kwargs) + if station_type == "RS": + return RSStationData(station, *args, **kwargs) + + raise ValueError(station) + + +def main(**kwargs): + import argparse + + parser = argparse.ArgumentParser( + description="Generate CDB files for the data stream configuration of specific stations." + ) + parser.add_argument( + "-s", + "--station", + type=str, + required=True, + help="Print information for this station", + ) + parser.add_argument( + "-l", + "--lcu-ip", + type=IPv4Address, + required=True, + help="LCU IP for this station", + ) + + args = parser.parse_args() + + station_data = StationDataFactory(args.station, args.lcu_ip) + print(str(station_data.CDB())) + + +if __name__ == "__main__": + main() diff --git a/tangostationcontrol/toolkit/generate_cdb_from_lofar1.py b/tangostationcontrol/toolkit/generate_cdb_from_lofar1.py index 7020b7d247c4f439f1590fda2758d6d1a82bb8f3..b95cd03b723bb13049ab40f6bf18044967ca64b5 100755 --- a/tangostationcontrol/toolkit/generate_cdb_from_lofar1.py +++ b/tangostationcontrol/toolkit/generate_cdb_from_lofar1.py @@ -9,112 +9,19 @@ from tangostationcontrol.toolkit.lofar1.etrs import ETRS, PQRToETRS from tangostationcontrol.toolkit.lofar1.antenna_cables import AntennaCables from tangostationcontrol.toolkit.lofar1.cobalt import ( COBALTPhaseCenters, - COBALTStationStreams, ) - -import mergedeep +from tangostationcontrol.toolkit._cdb import CDB N_pol = 2 -class CDB(dict): - """CDB file as a dict.""" - - def __init__(self): - self["servers"] = {} - - def add_device_properties( - self, domain: str, family: str, member: str, properties: Dict[str, List[str]] - ): - dserver = family - klass = family - - mergedeep.merge( - self["servers"], - { - dserver: { - domain: { - klass: { - f"{domain}/{family}/{member}": {"properties": properties} - } - } - } - }, - ) - - @staticmethod - def elements_per_line(property_name: str) -> int: - """Number of elements of a list to print on each line for a given property.""" - - if property_name.startswith("FPGA_"): - return 1 - if property_name.endswith("_ETRS") or property_name.endswith("_ITRF"): - return 3 - if property_name.endswith("_matrix"): - return 3 - return 6 - - def __str__(self) -> str: - tabsize = 2 - - def to_str(x, indent=0, name=None): - if isinstance(x, dict): - return dict_to_str(x, indent) - if isinstance(x, list): - return list_to_str(x, indent, name) - return f'"{x}"' - - def dict_to_str(dct, indent=0): - lines = [ - f'"{k}": {to_str(v, indent + tabsize, k)},' for k, v in dct.items() - ] - # strip comma of last line with content - lines[-1] = lines[-1][:-1] - - # return properly indented - return "\n".join( - ["{"] - + [" " * (indent + tabsize) + line for line in lines] - + [" " * indent + "}"] - ) - - def list_to_str(lst, indent=0, name=None): - elements = [f'"{e}",' for e in lst] - # strip comma of last element with content - elements[-1] = elements[-1][:-1] - - # group elements per 6 on a line - lines = [] - nr_per_line = self.elements_per_line(name) - for line_nr in range((len(elements) + nr_per_line - 1) // nr_per_line): - lines.append( - " ".join( - [ - f"{e:8}" - for e in elements[ - line_nr * nr_per_line : (line_nr + 1) * nr_per_line - ] - ] - ) - ) - - # return properly indented - return "\n".join( - ["["] - + [" " * (indent + tabsize) + line for line in lines] - + [" " * indent + "]"] - ) - - return dict_to_str(self) - - class StationData: def __init__(self, station, resolver=None): self.station = station + self.etrs = ETRS(station) self.hba_rotations = HBARotations() self.cobalt_phasecenters = COBALTPhaseCenters() - self.cobalt_station_streams = COBALTStationStreams(resolver) self.antenna_cables = AntennaCables(station) self.pqr_to_etrs = PQRToETRS() @@ -122,6 +29,17 @@ class StationData: def station_nr(self) -> int: return int(self.station[2:]) + @property + def station_8bit_id(self) -> str: + """Unique 8-bit identifier for the station.""" + + arm = self.station_nr // 100 # max: 6 + station_in_arm = self.station_nr % 100 # max: 32 + + station_id = arm * 33 + station_in_arm + + return station_id + def hba_rotation(self, antenna_field: str) -> float: raise NotImplementedError @@ -172,31 +90,6 @@ class StationData: ), } - def properties_Beamlet(self, antenna_field: str) -> Dict[str, List[str]]: - cobalt_destinations = self.cobalt_station_streams[ - f"{self.station.upper()}{antenna_field}" - ] - return { - "FPGA_beamlet_output_hdr_eth_source_mac_RW_default": [ - f"00:22:86:08:{n // 4:02}:{n % 4:02}" for n in range(16) - ], - "FPGA_beamlet_output_hdr_ip_source_address_RW_default": [ - "10.175.1.1" for n in range(16) - ], - "FPGA_beamlet_output_hdr_udp_source_port_RW_default": [ - 53248 + n for n in range(16) - ], - "FPGA_beamlet_output_multiple_hdr_eth_destination_mac_RW_default_shorthand": [ - dest["MAC"] for dest in cobalt_destinations - ], - "FPGA_beamlet_output_multiple_hdr_ip_destination_address_RW_default_shorthand": [ - dest["IP"] for dest in cobalt_destinations - ], - "FPGA_beamlet_output_multiple_hdr_udp_destination_port_RW_default_shorthand": [ - dest["port"] for dest in cobalt_destinations - ], - } - def CDB(self) -> CDB: cdb = CDB() cdb.add_device_properties( @@ -225,15 +118,6 @@ class CSStationData(StationData): def CDB(self) -> CDB: cdb = super().CDB() - cdb.add_device_properties( - "STAT", "Beamlet", "LBA", self.properties_Beamlet("LBA") - ) - cdb.add_device_properties( - "STAT", "Beamlet", "HBA0", self.properties_Beamlet("HBA0") - ) - cdb.add_device_properties( - "STAT", "Beamlet", "HBA1", self.properties_Beamlet("HBA1") - ) cdb.add_device_properties("STAT", "AFL", "LBA", self.properties_AFL(96)) cdb.add_device_properties( "STAT", "AFH", "HBA0", self.properties_AFH("HBA0", 0, 24) @@ -260,12 +144,6 @@ class RSStationData(StationData): def CDB(self) -> CDB: cdb = super().CDB() - cdb.add_device_properties( - "STAT", "Beamlet", "LBA", self.properties_Beamlet("LBA") - ) - cdb.add_device_properties( - "STAT", "Beamlet", "HBA", self.properties_Beamlet("HBA") - ) cdb.add_device_properties("STAT", "AFL", "LBA", self.properties_AFL(96)) cdb.add_device_properties( "STAT", "AFH", "HBA", self.properties_AFH("HBA", 0, 48) @@ -273,13 +151,13 @@ class RSStationData(StationData): return cdb -def StationDataFactory(station) -> StationData: +def StationDataFactory(station, *args, **kwargs) -> StationData: station_type = station[:2].upper() if station_type == "CS": - return CSStationData(station) + return CSStationData(station, *args, **kwargs) if station_type == "RS": - return RSStationData(station) + return RSStationData(station, *args, **kwargs) raise ValueError(station) @@ -301,12 +179,6 @@ def main(**kwargs): parser.add_argument( "-C", "--cdb", action="store_true", default=False, help="Print the CDB file" ) - parser.add_argument( - "--cobalt-station-streams", - action="store_true", - default=False, - help="Print the COBALTStationStreams dict", - ) parser.add_argument( "--cobalt-phase-centers", action="store_true", @@ -341,9 +213,6 @@ def main(**kwargs): station_data = StationDataFactory(args.station) print(str(station_data.CDB())) - if args.cobalt_station_streams: - pprint(COBALTStationStreams()) - if args.cobalt_phase_centers: pprint(COBALTPhaseCenters()) diff --git a/tangostationcontrol/toolkit/lofar1/etrs.py b/tangostationcontrol/toolkit/lofar1/etrs.py index 6aa844658602004223f407d0ad33e8ee43e3e161..fb13de40029f8cfb5694d39fba9ac1fd9f57a338 100644 --- a/tangostationcontrol/toolkit/lofar1/etrs.py +++ b/tangostationcontrol/toolkit/lofar1/etrs.py @@ -38,6 +38,9 @@ class ETRS(dict): etrs_csv = csv.reader((line.decode() for line in self.raw)) for row in list(etrs_csv)[1:]: + if not row: + continue + # antenna, etrs-x, etrs-y, etrs-z, p, q, r, rcu-x, rcu-y antenna, etrs_x, etrs_y, etrs_z = row[:4] self[antenna] = [etrs_x, etrs_y, etrs_z] diff --git a/tangostationcontrol/toolkit/merge_cdb.py b/tangostationcontrol/toolkit/merge_cdb.py new file mode 100644 index 0000000000000000000000000000000000000000..a27a53ee8fe4e71290c232f923a2ebb36aca4201 --- /dev/null +++ b/tangostationcontrol/toolkit/merge_cdb.py @@ -0,0 +1,43 @@ +#! /usr/bin/env python3 +# Copyright (C) 2025 ASTRON (Netherlands Institute for Radio Astronomy) +# SPDX-License-Identifier: Apache-2.0 + +""" +This program allows merging CDB JSON files that serve as input to dsconfig. +""" + +import json + +from tangostationcontrol.toolkit._cdb import merge + + +def merge_files(filenames: list[str]) -> dict: + result_dict = {} + for fname in filenames: + with open(fname) as fp: + cdb_dict = json.load(fp) + + merge(cdb_dict, result_dict) + + return result_dict + + +def main(**kwargs): + import argparse + + parser = argparse.ArgumentParser( + description="Merge multiple CDB JSON files and output the result. Provide any number of JSON files in the order they will be applied." + ) + parser.add_argument("json", nargs="+") + + args = parser.parse_args() + + # load and merge dicts + cdb_dict = merge_files(args.json) + + # print result + print(json.dumps(cdb_dict, indent=4)) + + +if __name__ == "__main__": + main()