Skip to content
Snippets Groups Projects
Commit 5b1e86a7 authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

Merge branch 'master' into L2SS-405-archiving-setup-production

parents 529b6687 46298110
No related branches found
No related tags found
1 merge request!265Resolve L2SS-405 "Archiving setup production"
Showing
with 3272 additions and 105 deletions
...@@ -97,6 +97,8 @@ docker_build_image_all: ...@@ -97,6 +97,8 @@ docker_build_image_all:
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh unb2-sim latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh unb2-sim latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-apsct latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-apsct latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-apspu latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-apspu latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-beam latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-beamlet latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-boot latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-boot latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-docker latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-docker latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-observation_control latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-observation_control latest
...@@ -250,6 +252,28 @@ docker_build_image_device_apspu: ...@@ -250,6 +252,28 @@ docker_build_image_device_apspu:
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_beam:
extends: .base_docker_images_except
only:
refs:
- merge_requests
changes:
- docker-compose/device-beam.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-beam $tag
docker_build_image_device_beamlet:
extends: .base_docker_images_except
only:
refs:
- merge_requests
changes:
- docker-compose/device-beamlet.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-beamlet $tag
docker_build_image_device_boot: docker_build_image_device_boot:
extends: .base_docker_images_except extends: .base_docker_images_except
only: only:
......
...@@ -21,6 +21,34 @@ ...@@ -21,6 +21,34 @@
} }
} }
}, },
"Beamlet": {
"STAT": {
"Beamlet": {
"STAT/Beamlet/1": {
"properties": {
"FPGA_beamlet_output_hdr_udp_destination_port_RW_default": [
"10001",
"10001",
"10001",
"10001",
"10001",
"10001",
"10001",
"10001",
"10001",
"10001",
"10001",
"10001",
"10001",
"10001",
"10001",
"10001"
]
}
}
}
}
},
"boot": { "boot": {
"STAT": { "STAT": {
"Boot": { "Boot": {
......
...@@ -51,6 +51,61 @@ ...@@ -51,6 +51,61 @@
} }
} }
}, },
"Beamlet": {
"STAT": {
"Beamlet": {
"STAT/Beamlet/1": {
"properties": {
"OPC_Server_Name": [
"10.99.0.252"
],
"OPC_Server_Port": [
"4840"
],
"OPC_Time_Out": [
"5.0"
],
"FPGA_beamlet_output_hdr_eth_destination_mac_RW_default": [
"0c:c4:7a:c0:30:f1",
"0c:c4:7a:c0:30:f1",
"0c:c4:7a:c0:30:f1",
"0c:c4:7a:c0:30:f1",
"0c:c4:7a:c0:30:f1",
"0c:c4:7a:c0:30:f1",
"0c:c4:7a:c0:30:f1",
"0c:c4:7a:c0:30:f1",
"0c:c4:7a:c0:30:f1",
"0c:c4:7a:c0:30:f1",
"0c:c4:7a:c0:30:f1",
"0c:c4:7a:c0:30:f1",
"0c:c4:7a:c0:30:f1",
"0c:c4:7a:c0:30:f1",
"0c:c4:7a:c0:30:f1",
"0c:c4:7a:c0:30:f1"
],
"FPGA_beamlet_output_hdr_ip_destination_address_RW_default": [
"10.99.250.250",
"10.99.250.250",
"10.99.250.250",
"10.99.250.250",
"10.99.250.250",
"10.99.250.250",
"10.99.250.250",
"10.99.250.250",
"10.99.250.250",
"10.99.250.250",
"10.99.250.250",
"10.99.250.250",
"10.99.250.250",
"10.99.250.250",
"10.99.250.250",
"10.99.250.250"
]
}
}
}
}
},
"RECV": { "RECV": {
"STAT": { "STAT": {
"RECV": { "RECV": {
......
...@@ -13,6 +13,61 @@ ...@@ -13,6 +13,61 @@
} }
} }
}, },
"Beamlet": {
"STAT": {
"Beamlet": {
"STAT/Beamlet/1": {
"properties": {
"OPC_Server_Name": [
"dop369.astron.nl"
],
"OPC_Server_Port": [
"4840"
],
"OPC_Time_Out": [
"5.0"
],
"FPGA_beamlet_output_hdr_eth_destination_mac_RW_default": [
"00:07:43:06:c7:00",
"00:07:43:06:c7:00",
"00:07:43:06:c7:00",
"00:07:43:06:c7:00",
"00:07:43:06:c7:00",
"00:07:43:06:c7:00",
"00:07:43:06:c7:00",
"00:07:43:06:c7:00",
"00:07:43:06:c7:00",
"00:07:43:06:c7:00",
"00:07:43:06:c7:00",
"00:07:43:06:c7:00",
"00:07:43:06:c7:00",
"00:07:43:06:c7:00",
"00:07:43:06:c7:00",
"00:07:43:06:c7:00"
],
"FPGA_beamlet_output_hdr_ip_destination_address_RW_default": [
"192.168.0.254",
"192.168.0.254",
"192.168.0.254",
"192.168.0.254",
"192.168.0.254",
"192.168.0.254",
"192.168.0.254",
"192.168.0.254",
"192.168.0.254",
"192.168.0.254",
"192.168.0.254",
"192.168.0.254",
"192.168.0.254",
"192.168.0.254",
"192.168.0.254",
"192.168.0.254"
]
}
}
}
}
},
"RECV": { "RECV": {
"STAT": { "STAT": {
"RECV": { "RECV": {
......
...@@ -5,103 +5,103 @@ ...@@ -5,103 +5,103 @@
"RECV": { "RECV": {
"STAT/RECV/1": { "STAT/RECV/1": {
"properties": { "properties": {
"HBAT_reference_itrf": [ "HBAT_reference_ETRS": [
"3826577.066", "461022.948", "5064892.786", "3826886.142", "460980.772", "5064665.668",
"3826577.066", "461022.948", "5064892.786", "3826887.237", "460985.643", "5064664.406",
"3826577.066", "461022.948", "5064892.786", "3826889.022", "460974.271", "5064664.094",
"3826577.066", "461022.948", "5064892.786", "3826890.118", "460979.142", "5064662.831",
"3826577.066", "461022.948", "5064892.786", "3826891.214", "460984.012", "5064661.568",
"3826577.066", "461022.948", "5064892.786", "3826892.311", "460988.883", "5064660.305",
"3826577.066", "461022.948", "5064892.786", "3826891.902", "460967.768", "5064662.520",
"3826577.066", "461022.948", "5064892.786", "3826892.999", "460972.640", "5064661.256",
"3826577.066", "461022.948", "5064892.786", "3826894.094", "460977.511", "5064659.994",
"3826577.066", "461022.948", "5064892.786", "3826895.191", "460982.382", "5064658.730",
"3826577.066", "461022.948", "5064892.786", "3826896.287", "460987.252", "5064657.467",
"3826577.066", "461022.948", "5064892.786", "3826897.383", "460992.123", "5064656.204",
"3826577.066", "461022.948", "5064892.786", "3826895.879", "460966.138", "5064659.682",
"3826577.066", "461022.948", "5064892.786", "3826896.974", "460971.009", "5064658.419",
"3826577.066", "461022.948", "5064892.786", "3826898.071", "460975.880", "5064657.156",
"3826577.066", "461022.948", "5064892.786", "3826899.167", "460980.751", "5064655.893",
"3826577.066", "461022.948", "5064892.786", "3826900.263", "460985.622", "5064654.630",
"3826577.066", "461022.948", "5064892.786", "3826901.359", "460990.493", "5064653.367",
"3826577.066", "461022.948", "5064892.786", "3826900.951", "460969.378", "5064655.582",
"3826577.066", "461022.948", "5064892.786", "3826902.048", "460974.250", "5064654.319",
"3826577.066", "461022.948", "5064892.786", "3826903.143", "460979.120", "5064653.056",
"3826577.066", "461022.948", "5064892.786", "3826904.240", "460983.991", "5064651.793",
"3826577.066", "461022.948", "5064892.786", "3826906.024", "460972.619", "5064651.481",
"3826577.066", "461022.948", "5064892.786", "3826907.120", "460977.490", "5064650.218",
"3826577.066", "461022.948", "5064892.786", "3826969.290", "460898.914", "5064610.654",
"3826577.066", "461022.948", "5064892.786", "3826970.386", "460903.785", "5064609.392",
"3826577.066", "461022.948", "5064892.786", "3826972.171", "460892.413", "5064609.080",
"3826577.066", "461022.948", "5064892.786", "3826973.267", "460897.284", "5064607.817",
"3826577.066", "461022.948", "5064892.786", "3826974.363", "460902.154", "5064606.554",
"3826577.066", "461022.948", "5064892.786", "3826975.459", "460907.025", "5064605.291",
"3826577.066", "461022.948", "5064892.786", "3826975.051", "460885.911", "5064607.506",
"3826577.066", "461022.948", "5064892.786", "3826976.147", "460890.782", "5064606.242",
"3826577.066", "461022.948", "5064892.786", "3826977.243", "460895.653", "5064604.980",
"3826577.066", "461022.948", "5064892.786", "3826978.339", "460900.524", "5064603.716",
"3826577.066", "461022.948", "5064892.786", "3826979.436", "460905.394", "5064602.453",
"3826577.066", "461022.948", "5064892.786", "3826980.532", "460910.265", "5064601.190",
"3826577.066", "461022.948", "5064892.786", "3826979.027", "460884.281", "5064604.668",
"3826577.066", "461022.948", "5064892.786", "3826980.123", "460889.152", "5064603.405",
"3826577.066", "461022.948", "5064892.786", "3826981.220", "460894.022", "5064602.142",
"3826577.066", "461022.948", "5064892.786", "3826982.316", "460898.893", "5064600.879",
"3826577.066", "461022.948", "5064892.786", "3826983.412", "460903.764", "5064599.616",
"3826577.066", "461022.948", "5064892.786", "3826984.508", "460908.635", "5064598.353",
"3826577.066", "461022.948", "5064892.786", "3826984.100", "460887.521", "5064600.568",
"3826577.066", "461022.948", "5064892.786", "3826985.196", "460892.392", "5064599.305",
"3826577.066", "461022.948", "5064892.786", "3826986.292", "460897.262", "5064598.042",
"3826577.066", "461022.948", "5064892.786", "3826987.388", "460902.133", "5064596.779",
"3826577.066", "461022.948", "5064892.786", "3826989.173", "460890.761", "5064596.467",
"3826577.066", "461022.948", "5064892.786", "3826990.269", "460895.632", "5064595.204",
"3826577.066", "461022.948", "5064892.786", "3826886.142", "460980.772", "5064665.668",
"3826577.066", "461022.948", "5064892.786", "3826887.237", "460985.643", "5064664.406",
"3826577.066", "461022.948", "5064892.786", "3826889.022", "460974.271", "5064664.094",
"3826577.066", "461022.948", "5064892.786", "3826890.118", "460979.142", "5064662.831",
"3826577.066", "461022.948", "5064892.786", "3826891.214", "460984.012", "5064661.568",
"3826577.066", "461022.948", "5064892.786", "3826892.311", "460988.883", "5064660.305",
"3826577.066", "461022.948", "5064892.786", "3826891.902", "460967.768", "5064662.520",
"3826577.066", "461022.948", "5064892.786", "3826892.999", "460972.640", "5064661.256",
"3826577.066", "461022.948", "5064892.786", "3826894.094", "460977.511", "5064659.994",
"3826577.066", "461022.948", "5064892.786", "3826895.191", "460982.382", "5064658.730",
"3826577.066", "461022.948", "5064892.786", "3826896.287", "460987.252", "5064657.467",
"3826577.066", "461022.948", "5064892.786", "3826897.383", "460992.123", "5064656.204",
"3826577.066", "461022.948", "5064892.786", "3826895.879", "460966.138", "5064659.682",
"3826577.066", "461022.948", "5064892.786", "3826896.974", "460971.009", "5064658.419",
"3826577.066", "461022.948", "5064892.786", "3826898.071", "460975.880", "5064657.156",
"3826577.066", "461022.948", "5064892.786", "3826899.167", "460980.751", "5064655.893",
"3826577.066", "461022.948", "5064892.786", "3826900.263", "460985.622", "5064654.630",
"3826577.066", "461022.948", "5064892.786", "3826901.359", "460990.493", "5064653.367",
"3826577.066", "461022.948", "5064892.786", "3826900.951", "460969.378", "5064655.582",
"3826577.066", "461022.948", "5064892.786", "3826902.048", "460974.250", "5064654.319",
"3826577.066", "461022.948", "5064892.786", "3826903.143", "460979.120", "5064653.056",
"3826577.066", "461022.948", "5064892.786", "3826904.240", "460983.991", "5064651.793",
"3826577.066", "461022.948", "5064892.786", "3826906.024", "460972.619", "5064651.481",
"3826577.066", "461022.948", "5064892.786", "3826907.120", "460977.490", "5064650.218",
"3826577.066", "461022.948", "5064892.786", "3826969.290", "460898.914", "5064610.654",
"3826577.066", "461022.948", "5064892.786", "3826970.386", "460903.785", "5064609.392",
"3826577.066", "461022.948", "5064892.786", "3826972.171", "460892.413", "5064609.080",
"3826577.066", "461022.948", "5064892.786", "3826973.267", "460897.284", "5064607.817",
"3826577.066", "461022.948", "5064892.786", "3826974.363", "460902.154", "5064606.554",
"3826577.066", "461022.948", "5064892.786", "3826975.459", "460907.025", "5064605.291",
"3826577.066", "461022.948", "5064892.786", "3826975.051", "460885.911", "5064607.506",
"3826577.066", "461022.948", "5064892.786", "3826976.147", "460890.782", "5064606.242",
"3826577.066", "461022.948", "5064892.786", "3826977.243", "460895.653", "5064604.980",
"3826577.066", "461022.948", "5064892.786", "3826978.339", "460900.524", "5064603.716",
"3826577.066", "461022.948", "5064892.786", "3826979.436", "460905.394", "5064602.453",
"3826577.066", "461022.948", "5064892.786", "3826980.532", "460910.265", "5064601.190",
"3826577.066", "461022.948", "5064892.786", "3826979.027", "460884.281", "5064604.668",
"3826577.066", "461022.948", "5064892.786", "3826980.123", "460889.152", "5064603.405",
"3826577.066", "461022.948", "5064892.786", "3826981.220", "460894.022", "5064602.142",
"3826577.066", "461022.948", "5064892.786", "3826982.316", "460898.893", "5064600.879",
"3826577.066", "461022.948", "5064892.786", "3826983.412", "460903.764", "5064599.616",
"3826577.066", "461022.948", "5064892.786", "3826984.508", "460908.635", "5064598.353",
"3826577.066", "461022.948", "5064892.786", "3826984.100", "460887.521", "5064600.568",
"3826577.066", "461022.948", "5064892.786", "3826985.196", "460892.392", "5064599.305",
"3826577.066", "461022.948", "5064892.786", "3826986.292", "460897.262", "5064598.042",
"3826577.066", "461022.948", "5064892.786", "3826987.388", "460902.133", "5064596.779",
"3826577.066", "461022.948", "5064892.786", "3826989.173", "460890.761", "5064596.467",
"3826577.066", "461022.948", "5064892.786" "3826990.269", "460895.632", "5064595.204"
], ],
"HBAT_PQR_rotation_angles_deg": [ "HBAT_PQR_rotation_angles_deg": [
"24", "24",
......
...@@ -51,6 +51,61 @@ ...@@ -51,6 +51,61 @@
} }
} }
}, },
"Beamlet": {
"STAT": {
"Beamlet": {
"STAT/Beamlet/1": {
"properties": {
"OPC_Server_Name": [
"sdptr-sim"
],
"OPC_Server_Port": [
"4840"
],
"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",
"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",
"127.0.0.1",
"127.0.0.1",
"127.0.0.1",
"127.0.0.1"
]
}
}
}
}
},
"RECV": { "RECV": {
"STAT": { "STAT": {
"RECV": { "RECV": {
......
...@@ -46,7 +46,7 @@ services: ...@@ -46,7 +46,7 @@ services:
/bin/bash -c " /bin/bash -c "
wait-for-it.sh archiver-timescale:5432 --timeout=30 --strict -- wait-for-it.sh archiver-timescale:5432 --timeout=30 --strict --
wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict -- wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
hdbppcm-srv 02" hdbppcm-srv 01"
logging: logging:
driver: syslog driver: syslog
options: options:
...@@ -74,7 +74,7 @@ services: ...@@ -74,7 +74,7 @@ services:
/bin/bash -c " /bin/bash -c "
wait-for-it.sh archiver-timescale:5432 --timeout=30 --strict -- wait-for-it.sh archiver-timescale:5432 --timeout=30 --strict --
wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict -- wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
hdbppes-srv 02" hdbppes-srv 01"
logging: logging:
driver: syslog driver: syslog
options: options:
......
#
# Docker compose file that launches an interactive iTango session.
#
# Connect to the interactive session with 'docker attach itango'.
# Disconnect with the Docker deattach sequence: <CTRL>+<P> <CTRL>+<Q>
#
# Defines:
# - itango: iTango interactive session
#
# Requires:
# - lofar-device-base.yml
#
version: '2'
services:
device-beamlet:
image: device-beamlet
# build explicitly, as docker-compose does not understand a local image
# being shared among services.
build:
context: ..
dockerfile: docker-compose/lofar-device-base/Dockerfile
args:
SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-beamlet
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "10"
networks:
- control
ports:
- "5712:5712" # unique port for this DS
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ..:/opt/lofar/tango:rw
environment:
- TANGO_HOST=${TANGO_HOST}
working_dir: /opt/lofar/tango
entrypoint:
- bin/start-ds.sh
# configure CORBA to _listen_ on 0:port, but tell others we're _reachable_ through ${HOSTNAME}:port, since CORBA
# can't know about our Docker port forwarding
- l2ss-beamlet Beamlet STAT -v -ORBendPoint giop:tcp:0:5712 -ORBendPointPublish giop:tcp:${HOSTNAME}:5712
restart: unless-stopped
...@@ -8,7 +8,8 @@ xst = DeviceProxy("STAT/XST/1") ...@@ -8,7 +8,8 @@ xst = DeviceProxy("STAT/XST/1")
unb2 = DeviceProxy("STAT/UNB2/1") unb2 = DeviceProxy("STAT/UNB2/1")
boot = DeviceProxy("STAT/Boot/1") boot = DeviceProxy("STAT/Boot/1")
beam = DeviceProxy("STAT/Beam/1") beam = DeviceProxy("STAT/Beam/1")
beamlet = DeviceProxy("STAT/Beamlet/1")
docker = DeviceProxy("STAT/Docker/1") docker = DeviceProxy("STAT/Docker/1")
# Put them in a list in case one wants to iterate # Put them in a list in case one wants to iterate
devices = [apsct, apspu, recv, sdp, sst, xst, unb2, boot, beam, docker] devices = [apsct, apspu, recv, sdp, sst, xst, unb2, boot, beam, beamlet, docker]
FROM timescale/timescaledb:latest-pg12 FROM timescale/timescaledb:latest-pg12
# Set admin role to perform DB creation
COPY resources/01_admin.sh docker-entrypoint-initdb.d/002_admin.sh COPY resources/01_admin.sh docker-entrypoint-initdb.d/002_admin.sh
# Create DB schema (tables, indexes, etc.)
COPY resources/02_hdb_schema.sql docker-entrypoint-initdb.d/003_hdb_schema.sql COPY resources/02_hdb_schema.sql docker-entrypoint-initdb.d/003_hdb_schema.sql
# Create DB roles
COPY resources/03_hdb_roles.sql docker-entrypoint-initdb.d/004_hdb_roles.sql COPY resources/03_hdb_roles.sql docker-entrypoint-initdb.d/004_hdb_roles.sql
COPY resources/04_hdb_ext_aggregates.sql docker-entrypoint-initdb.d/005_hdb_ext_aggregates.sql # Create further roles
COPY resources/05_lofar_func.sh docker-entrypoint-initdb.d/006_lofar_func.sh COPY resources/04_hdb_ext_users.sql docker-entrypoint-initdb.d/005_hdb_ext_users.sql
COPY resources/06_lofar_views.sql docker-entrypoint-initdb.d/007_lofar_views.sql # Add further functions
COPY resources/07_cleanup.sql docker-entrypoint-initdb.d/008_cleanup.sql COPY resources/05_hdb_ext_import.sql docker-entrypoint-initdb.d/006_hdb_ext_import.sql
# Create timescaledb aggregates
COPY resources/06_hdb_ext_aggregates.sql docker-entrypoint-initdb.d/007_hdb_ext_aggregates.sql
COPY resources/07_hdb_ext_arrays_aggregates_helper.sql docker-entrypoint-initdb.d/008_hdb_ext_arrays_aggregates_helper.sql
COPY resources/08_hdb_ext_arrays_aggregates.sql docker-entrypoint-initdb.d/009_hdb_ext_arrays_aggregates.sql
# Add compress policy
COPY resources/09_hdb_ext_compress_policy.sql docker-entrypoint-initdb.d/010_hdb_ext_compress_policy.sql
# Add reorder policy
COPY resources/10_hdb_ext_reorder_policy.sql docker-entrypoint-initdb.d/011_hdb_ext_reorder_policy.sql
# Add LOFAR functions and views
COPY resources/11_lofar_func.sh docker-entrypoint-initdb.d/012_lofar_func.sh
COPY resources/12_lofar_views.sql docker-entrypoint-initdb.d/013_lofar_views.sql
# Cleanup admin role
COPY resources/13_cleanup.sql docker-entrypoint-initdb.d/014_cleanup.sql
-- -----------------------------------------------------------------------------
-- This file is part of the hdbpp-timescale-project
--
-- Copyright (C) : 2014-2019
-- European Synchrotron Radiation Facility
-- BP 220, Grenoble 38043, FRANCE
--
-- libhdb++timescale is free software: you can redistribute it and/or modify
-- it under the terms of the Lesser GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- libhdb++timescale is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser
-- GNU General Public License for more details.
--
-- You should have received a copy of the Lesser GNU General Public License
-- along with libhdb++timescale. If not, see <http://www.gnu.org/licenses/>.
-- -----------------------------------------------------------------------------
\c hdb
-- Some useful users for a basic system
CREATE ROLE hdb_cfg_man WITH LOGIN PASSWORD 'hdbpp';
GRANT readwrite TO hdb_cfg_man;
CREATE ROLE hdb_event_sub WITH LOGIN PASSWORD 'hdbpp';
GRANT readwrite TO hdb_event_sub;
CREATE ROLE hdb_data_reporter WITH LOGIN PASSWORD 'hdbpp';
GRANT readonly TO hdb_data_reporter;
\c hdb
CREATE OR REPLACE FUNCTION expand_name() RETURNS TRIGGER AS $$
DECLARE
len integer;
BEGIN
IF (NEW.cs_name <> '' AND NEW.domain <> '' AND NEW.family <> '' AND NEW.member <> '' AND NEW.name <> '') IS NOT TRUE THEN
len = (SELECT cardinality((SELECT regexp_split_to_array(NEW.att_name, E'/'))));
NEW.name := (SELECT split_part(NEW.att_name, '/', len));
NEW.member := (SELECT split_part(NEW.att_name, '/', len - 1));
NEW.family := (SELECT split_part(NEW.att_name, '/', len - 2));
NEW.domain := (SELECT split_part(NEW.att_name, '/', len - 3));
NEW.cs_name := (SELECT split_part(NEW.att_name, '/', len - 4));
END IF;
RETURN NEW;
END
$$ LANGUAGE plpgsql;
CREATE TRIGGER expand_name_trigger BEFORE INSERT ON att_conf FOR EACH ROW EXECUTE PROCEDURE expand_name();
...@@ -1290,3 +1290,4 @@ GRANT SELECT ON cagg_scalar_devushort_1day TO readonly; ...@@ -1290,3 +1290,4 @@ GRANT SELECT ON cagg_scalar_devushort_1day TO readonly;
-- DROP VIEW cagg_scalar_devushort_1hour CASCADE; -- DROP VIEW cagg_scalar_devushort_1hour CASCADE;
-- DROP VIEW cagg_scalar_devushort_8hour CASCADE; -- DROP VIEW cagg_scalar_devushort_8hour CASCADE;
-- DROP VIEW cagg_scalar_devushort_1day CASCADE; -- DROP VIEW cagg_scalar_devushort_1day CASCADE;
This diff is collapsed.
This diff is collapsed.
-- -----------------------------------------------------------------------------
-- This file is part of the hdbpp-timescale-project
--
-- Copyright (C) : 2014-2019
-- European Synchrotron Radiation Facility
-- BP 220, Grenoble 38043, FRANCE
--
-- libhdb++timescale is free software: you can redistribute it and/or modify
-- it under the terms of the Lesser GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- libhdb++timescale is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser
-- GNU General Public License for more details.
--
-- You should have received a copy of the Lesser GNU General Public License
-- along with libhdb++timescale. If not, see <http://www.gnu.org/licenses/>.
-- -----------------------------------------------------------------------------
\c hdb
-- Compress chunk policy
-- Allow compression on the table
ALTER TABLE att_scalar_devboolean SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_scalar_devdouble SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_scalar_devfloat SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_scalar_devencoded SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_scalar_devenum SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_scalar_devstate SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_scalar_devstring SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_scalar_devuchar SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_scalar_devulong SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_scalar_devulong64 SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_scalar_devlong64 SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_scalar_devlong SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_scalar_devushort SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_scalar_devshort SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_array_devboolean SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_array_devdouble SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_array_devfloat SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_array_devencoded SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_array_devenum SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_array_devstate SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_array_devstring SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_array_devuchar SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_array_devulong SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_array_devulong64 SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_array_devlong64 SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_array_devlong SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_array_devushort SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
ALTER TABLE att_array_devshort SET(timescaledb.compress, timescaledb.compress_segmentby = 'att_conf_id, att_error_desc_id', timescaledb.compress_orderby = 'data_time DESC');
DO $$ BEGIN
IF (SELECT extversion>'2.0.0' FROM pg_extension where extname = 'timescaledb') THEN
-- If using timescaledb v2
PERFORM add_compression_policy('att_scalar_devboolean', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_scalar_devdouble', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_scalar_devfloat', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_scalar_devencoded', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_scalar_devenum', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_scalar_devstate', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_scalar_devstring', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_scalar_devuchar', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_scalar_devulong', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_scalar_devulong64', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_scalar_devlong64', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_scalar_devlong', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_scalar_devushort', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_scalar_devshort', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_array_devboolean', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_array_devdouble', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_array_devfloat', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_array_devencoded', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_array_devenum', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_array_devstate', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_array_devstring', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_array_devuchar', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_array_devulong', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_array_devulong64', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_array_devlong64', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_array_devlong', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_array_devushort', INTERVAL '200d', if_not_exists => true);
PERFORM add_compression_policy('att_array_devshort', INTERVAL '200d', if_not_exists => true);
ELSE
-- If using timescaledb v1.7
PERFORM add_compress_chunks_policy('att_scalar_devboolean', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_scalar_devdouble', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_scalar_devfloat', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_scalar_devencoded', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_scalar_devenum', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_scalar_devstate', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_scalar_devstring', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_scalar_devuchar', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_scalar_devulong', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_scalar_devulong64', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_scalar_devlong64', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_scalar_devlong', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_scalar_devushort', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_scalar_devshort', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_array_devboolean', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_array_devdouble', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_array_devfloat', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_array_devencoded', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_array_devenum', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_array_devstate', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_array_devstring', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_array_devuchar', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_array_devulong', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_array_devulong64', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_array_devlong64', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_array_devlong', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_array_devushort', INTERVAL '200d', if_not_exists => true);
PERFORM add_compress_chunks_policy('att_array_devshort', INTERVAL '200d', if_not_exists => true);
END IF;
END $$;
-- -----------------------------------------------------------------------------
-- This file is part of the hdbpp-timescale-project
--
-- Copyright (C) : 2014-2019
-- European Synchrotron Radiation Facility
-- BP 220, Grenoble 38043, FRANCE
--
-- libhdb++timescale is free software: you can redistribute it and/or modify
-- it under the terms of the Lesser GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- libhdb++timescale is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser
-- GNU General Public License for more details.
--
-- You should have received a copy of the Lesser GNU General Public License
-- along with libhdb++timescale. If not, see <http://www.gnu.org/licenses/>.
-- -----------------------------------------------------------------------------
\c hdb
-- Reorder chunk policy
SELECT add_reorder_policy('att_scalar_devboolean', 'att_scalar_devboolean_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_scalar_devdouble', 'att_scalar_devdouble_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_scalar_devfloat', 'att_scalar_devfloat_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_scalar_devencoded', 'att_scalar_devencoded_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_scalar_devenum', 'att_scalar_devenum_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_scalar_devstate', 'att_scalar_devstate_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_scalar_devstring', 'att_scalar_devstring_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_scalar_devuchar', 'att_scalar_devuchar_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_scalar_devulong', 'att_scalar_devulong_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_scalar_devulong64', 'att_scalar_devulong64_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_scalar_devlong64', 'att_scalar_devlong64_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_scalar_devlong', 'att_scalar_devlong_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_scalar_devushort', 'att_scalar_devushort_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_scalar_devshort', 'att_scalar_devshort_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_array_devboolean', 'att_array_devboolean_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_array_devdouble', 'att_array_devdouble_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_array_devfloat', 'att_array_devfloat_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_array_devencoded', 'att_array_devencoded_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_array_devenum', 'att_array_devenum_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_array_devstate', 'att_array_devstate_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_array_devstring', 'att_array_devstring_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_array_devuchar', 'att_array_devuchar_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_array_devulong', 'att_array_devulong_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_array_devulong64', 'att_array_devulong64_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_array_devlong64', 'att_array_devlong64_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_array_devlong', 'att_array_devlong_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_array_devushort', 'att_array_devushort_att_conf_id_data_time_idx', if_not_exists => true);
SELECT add_reorder_policy('att_array_devshort', 'att_array_devshort_att_conf_id_data_time_idx', if_not_exists => true);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment