diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9fb1a150fb4643b4c2fdbd5be58a9c60c60b6dbc..bf921d2157291092cfca16bd6c86b638fa7a5736 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -376,6 +376,7 @@ deploy_nomad: - cs001 - dts-lab COMPONENT: + - mesh-gateway - monitoring - logging - tango @@ -385,7 +386,6 @@ deploy_nomad: - dsconfig - ec-sim - jupyter - - nomad-client - snmp-exporter - landing-page environment: diff --git a/CDB/integrations/digitalbeam_cluster_ConfigDb.json b/CDB/integrations/digitalbeam_cluster_ConfigDb.json index 5066d35f0bec32f286d49e1db5aad3d646b1420e..6f2984cc3a094f3217c1223107a8af5e5f98ba42 100644 --- a/CDB/integrations/digitalbeam_cluster_ConfigDb.json +++ b/CDB/integrations/digitalbeam_cluster_ConfigDb.json @@ -1326,7 +1326,7 @@ "recvh-sim.service.consul" ], "OPC_Server_Port": [ - "4844" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -1345,7 +1345,7 @@ "recvl-sim.service.consul" ], "OPC_Server_Port": [ - "4845" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -1358,7 +1358,7 @@ "recvl-sim.service.consul" ], "OPC_Server_Port": [ - "4845" + "4840" ], "OPC_Time_Out": [ "5.0" diff --git a/CDB/integrations/tilebeam_cluster_ConfigDb.json b/CDB/integrations/tilebeam_cluster_ConfigDb.json index 19e6d9cc657bb7b3b0cfdefb894dce9d5c9bbd82..30edd07d1e6e3094f0b3daa3ed858f3cb14d1b11 100644 --- a/CDB/integrations/tilebeam_cluster_ConfigDb.json +++ b/CDB/integrations/tilebeam_cluster_ConfigDb.json @@ -485,7 +485,7 @@ "recvh-sim.service.consul" ], "OPC_Server_Port": [ - "4844" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -498,7 +498,7 @@ "recvh-sim.service.consul" ], "OPC_Server_Port": [ - "4844" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -511,7 +511,7 @@ "recvh-sim.service.consul" ], "OPC_Server_Port": [ - "4844" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -524,7 +524,7 @@ "recvh-sim.service.consul" ], "OPC_Server_Port": [ - "4844" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -543,7 +543,7 @@ "recvl-sim.service.consul" ], "OPC_Server_Port": [ - "4845" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -556,7 +556,7 @@ "recvl-sim.service.consul" ], "OPC_Server_Port": [ - "4845" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -569,7 +569,7 @@ "recvl-sim.service.consul" ], "OPC_Server_Port": [ - "4845" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -582,7 +582,7 @@ "recvl-sim.service.consul" ], "OPC_Server_Port": [ - "4845" + "4840" ], "OPC_Time_Out": [ "5.0" diff --git a/CDB/stations/DTS.json b/CDB/stations/DTS.json index 0442ff1c4439bcf7fcad6fe5a115edb5e327f563..ee7eece402ee9595e6cbb850139b3d052b4a79c6 100644 --- a/CDB/stations/DTS.json +++ b/CDB/stations/DTS.json @@ -82,7 +82,7 @@ "ec-sim.service.consul" ], "OPC_Server_Port": [ - "4850" + "4840" ] } } @@ -1333,384 +1333,6 @@ } } } - }, - "BST": { - "STAT": { - "BST": { - "STAT/BST/LBA": { - "properties": { - "FPGA_bst_offload_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_bst_offload_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" - ] - } - }, - "STAT/BST/HBA0": { - "properties": { - "FPGA_bst_offload_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_bst_offload_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" - ] - } - }, - "STAT/BST/HBA1": { - "properties": { - "FPGA_bst_offload_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_bst_offload_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" - ] - } - } - } - } - }, - "SST": { - "STAT": { - "SST": { - "STAT/SST/LBA": { - "properties": { - "FPGA_sst_offload_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_sst_offload_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" - ] - } - }, - "STAT/SST/HBA0": { - "properties": { - "FPGA_sst_offload_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_bst_offload_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" - ] - } - }, - "STAT/SST/HBA1": { - "properties": { - "FPGA_sst_offload_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_sst_offload_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" - ] - } - } - } - } - }, - "XST": { - "STAT": { - "XST": { - "STAT/XST/LBA": { - "properties": { - "FPGA_xst_offload_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_xst_offload_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" - ] - } - }, - "STAT/XST/HBA0": { - "properties": { - "FPGA_xst_offload_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_xst_offload_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" - ] - } - }, - "STAT/XST/HBA1": { - "properties": { - "FPGA_xst_offload_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_xst_offload_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" - ] - } - } - } - } } } } diff --git a/CDB/stations/cs001.json b/CDB/stations/cs001.json index 794ac8270abd83404023f8e55baaaf7ac8731d4d..ae27889a11168296a955cc206a31c8e4834f6a8b 100644 --- a/CDB/stations/cs001.json +++ b/CDB/stations/cs001.json @@ -1327,222 +1327,6 @@ } } } - }, - "BST": { - "STAT": { - "BST": { - "STAT/BST/LBA": { - "properties": { - "FPGA_bst_offload_hdr_eth_destination_mac_RW_default": [ - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2" - ] - } - }, - "STAT/BST/HBA0": { - "properties": { - "FPGA_bst_offload_hdr_eth_destination_mac_RW_default": [ - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2" - ] - } - }, - "STAT/BST/HBA1": { - "properties": { - "FPGA_bst_offload_hdr_eth_destination_mac_RW_default": [ - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2" - ] - } - } - } - } - }, - "SST": { - "STAT": { - "SST": { - "STAT/SST/LBA": { - "properties": { - "FPGA_sst_offload_hdr_eth_destination_mac_RW_default": [ - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2" - ] - } - }, - "STAT/SST/HBA0": { - "properties": { - "FPGA_sst_offload_hdr_eth_destination_mac_RW_default": [ - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2" - ] - } - }, - "STAT/SST/HBA1": { - "properties": { - "FPGA_sst_offload_hdr_eth_destination_mac_RW_default": [ - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2" - ] - } - } - } - } - }, - "XST": { - "STAT": { - "XST": { - "STAT/XST/LBA": { - "properties": { - "FPGA_xst_offload_hdr_eth_destination_mac_RW_default": [ - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2" - ] - } - }, - "STAT/XST/HBA0": { - "properties": { - "FPGA_xst_offload_hdr_eth_destination_mac_RW_default": [ - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2" - ] - } - }, - "STAT/XST/HBA1": { - "properties": { - "FPGA_xst_offload_hdr_eth_destination_mac_RW_default": [ - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2", - "7c:c2:55:70:c5:d2" - ] - } - } - } - } } } } diff --git a/CDB/stations/hba_core.json b/CDB/stations/hba_core.json index 4e9dc79ce8686be6218214b657fc9b4f9cec3786..d40db7babb83500aee5b85d750a5a23d9233bd56 100644 --- a/CDB/stations/hba_core.json +++ b/CDB/stations/hba_core.json @@ -46,7 +46,7 @@ "sdptr-hba0.service.consul" ], "OPC_Server_Port": [ - "4842" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -98,7 +98,7 @@ "sdptr-hba1.service.consul" ], "OPC_Server_Port": [ - "4844" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -268,7 +268,7 @@ "sdptr-hba0.service.consul" ], "OPC_Server_Port": [ - "4842" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -294,7 +294,7 @@ "sdptr-hba1.service.consul" ], "OPC_Server_Port": [ - "4844" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -315,7 +315,7 @@ "sdptr-hba0.service.consul" ], "OPC_Server_Port": [ - "4842" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -438,7 +438,7 @@ "sdptr-hba1.service.consul" ], "OPC_Server_Port": [ - "4844" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -571,47 +571,11 @@ "sdptr-hba0.service.consul" ], "OPC_Server_Port": [ - "4842" + "4840" ], "OPC_Time_Out": [ "5.0" ], - "FPGA_bst_offload_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" - ], - "FPGA_bst_offload_hdr_udp_destination_port_RW_default": [ - "5013", - "5013", - "5013", - "5013", - "5013", - "5013", - "5013", - "5013", - "5013", - "5013", - "5013", - "5013", - "5013", - "5013", - "5013", - "5013" - ], "FPGA_bst_offload_enable_RW_default": [ "False", "False", @@ -644,47 +608,11 @@ "sdptr-hba1.service.consul" ], "OPC_Server_Port": [ - "4844" + "4840" ], "OPC_Time_Out": [ "5.0" ], - "FPGA_bst_offload_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" - ], - "FPGA_bst_offload_hdr_udp_destination_port_RW_default": [ - "5023", - "5023", - "5023", - "5023", - "5023", - "5023", - "5023", - "5023", - "5023", - "5023", - "5023", - "5023", - "5023", - "5023", - "5023", - "5023" - ], "FPGA_bst_offload_enable_RW_default": [ "False", "False", @@ -723,46 +651,10 @@ "sdptr-hba0.service.consul" ], "OPC_Server_Port": [ - "4842" + "4840" ], "OPC_Time_Out": [ "5.0" - ], - "FPGA_sst_offload_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" - ], - "FPGA_sst_offload_hdr_udp_destination_port_RW_default": [ - "5011", - "5011", - "5011", - "5011", - "5011", - "5011", - "5011", - "5011", - "5011", - "5011", - "5011", - "5011", - "5011", - "5011", - "5011", - "5011" ] } }, @@ -778,64 +670,10 @@ "sdptr-hba1.service.consul" ], "OPC_Server_Port": [ - "4844" + "4840" ], "OPC_Time_Out": [ "5.0" - ], - "FPGA_sst_offload_hdr_eth_destination_mac_RW_default": [ - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56" - ], - "FPGA_sst_offload_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" - ], - "FPGA_sst_offload_hdr_udp_destination_port_RW_default": [ - "5021", - "5021", - "5021", - "5021", - "5021", - "5021", - "5021", - "5021", - "5021", - "5021", - "5021", - "5021", - "5021", - "5021", - "5021", - "5021" ] } } @@ -857,65 +695,11 @@ "sdptr-hba0.service.consul" ], "OPC_Server_Port": [ - "4842" + "4840" ], "OPC_Time_Out": [ "5.0" ], - "FPGA_xst_offload_hdr_eth_destination_mac_RW_default": [ - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56" - ], - "FPGA_xst_offload_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" - ], - "FPGA_xst_offload_hdr_udp_destination_port_RW_default": [ - "5012", - "5012", - "5012", - "5012", - "5012", - "5012", - "5012", - "5012", - "5012", - "5012", - "5012", - "5012", - "5012", - "5012", - "5012", - "5012" - ], "FPGA_xst_ring_nof_transport_hops_RW_default": [ "2", "2", @@ -948,65 +732,11 @@ "sdptr-hba1.service.consul" ], "OPC_Server_Port": [ - "4844" + "4840" ], "OPC_Time_Out": [ "5.0" ], - "FPGA_xst_offload_hdr_eth_destination_mac_RW_default": [ - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56" - ], - "FPGA_xst_offload_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" - ], - "FPGA_xst_offload_hdr_udp_destination_port_RW_default": [ - "5022", - "5022", - "5022", - "5022", - "5022", - "5022", - "5022", - "5022", - "5022", - "5022", - "5022", - "5022", - "5022", - "5022", - "5022", - "5022" - ], "FPGA_xst_ring_nof_transport_hops_RW_default": [ "2", "2", diff --git a/CDB/stations/lba.json b/CDB/stations/lba.json index 0d739b06beb509b8795bc189c9da760815a5b021..a6800d582a77fa337f3d3528699d664fb84902c7 100644 --- a/CDB/stations/lba.json +++ b/CDB/stations/lba.json @@ -369,60 +369,6 @@ "OPC_Time_Out": [ "5.0" ], - "FPGA_bst_offload_hdr_eth_destination_mac_RW_default": [ - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56" - ], - "FPGA_bst_offload_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" - ], - "FPGA_bst_offload_hdr_udp_destination_port_RW_default": [ - "5003", - "5003", - "5003", - "5003", - "5003", - "5003", - "5003", - "5003", - "5003", - "5003", - "5003", - "5003", - "5003", - "5003", - "5003", - "5003" - ], "FPGA_bst_offload_enable_RW_default": [ "False", "False", @@ -465,60 +411,6 @@ ], "OPC_Time_Out": [ "5.0" - ], - "FPGA_sst_offload_hdr_eth_destination_mac_RW_default": [ - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56", - "52:54:00:12:34:56" - ], - "FPGA_sst_offload_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" - ], - "FPGA_sst_offload_hdr_udp_destination_port_RW_default": [ - "5001", - "5001", - "5001", - "5001", - "5001", - "5001", - "5001", - "5001", - "5001", - "5001", - "5001", - "5001", - "5001", - "5001", - "5001", - "5001" ] } } @@ -545,42 +437,6 @@ "OPC_Time_Out": [ "5.0" ], - "FPGA_xst_offload_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" - ], - "FPGA_xst_offload_hdr_udp_destination_port_RW_default": [ - "5002", - "5002", - "5002", - "5002", - "5002", - "5002", - "5002", - "5002", - "5002", - "5002", - "5002", - "5002", - "5002", - "5002", - "5002", - "5002" - ], "FPGA_xst_ring_nof_transport_hops_RW_default": [ "8", "8", diff --git a/CDB/stations/simulators_ConfigDb.json b/CDB/stations/simulators_ConfigDb.json index 8203da6e416008607dff873544688c0b4970cbe7..4e15d32ed3933c0d868549f2fd5ecf70474199b3 100644 --- a/CDB/stations/simulators_ConfigDb.json +++ b/CDB/stations/simulators_ConfigDb.json @@ -9,7 +9,7 @@ "apsct-sim.service.consul" ], "OPC_Server_Port": [ - "4846" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -28,7 +28,7 @@ "ccd-sim.service.consul" ], "OPC_Server_Port": [ - "4843" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -47,7 +47,7 @@ "ec-sim.service.consul" ], "OPC_Server_Port": [ - "4850" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -73,7 +73,7 @@ "apspu-sim.service.consul" ], "OPC_Server_Port": [ - "4842" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -193,7 +193,7 @@ "recvh-sim.service.consul" ], "OPC_Server_Port": [ - "4844" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -212,7 +212,7 @@ "recvl-sim.service.consul" ], "OPC_Server_Port": [ - "4845" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -434,7 +434,7 @@ "unb2-sim.service.consul" ], "OPC_Server_Port": [ - "4841" + "4840" ], "OPC_Time_Out": [ "5.0" diff --git a/CDB/stations/testenv_cs001.json b/CDB/stations/testenv_cs001.json index 98b3cd0dd32e3782fae0e873a1660221bce52c93..0d1e9da9f15fdd81c4b5132416bd4e7d09c86cf5 100644 --- a/CDB/stations/testenv_cs001.json +++ b/CDB/stations/testenv_cs001.json @@ -9,7 +9,7 @@ "apsct-sim.service.consul" ], "OPC_Server_Port": [ - "4846" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -25,7 +25,7 @@ "apsct-sim.service.consul" ], "OPC_Server_Port": [ - "4846" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -41,7 +41,7 @@ "apsct-sim.service.consul" ], "OPC_Server_Port": [ - "4846" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -63,7 +63,7 @@ "ccd-sim.service.consul" ], "OPC_Server_Port": [ - "4843" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -85,7 +85,7 @@ "ec-sim.service.consul" ], "OPC_Server_Port": [ - "4850" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -111,7 +111,7 @@ "apspu-sim.service.consul" ], "OPC_Server_Port": [ - "4842" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -124,7 +124,7 @@ "apspu-sim.service.consul" ], "OPC_Server_Port": [ - "4842" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -137,7 +137,7 @@ "apspu-sim.service.consul" ], "OPC_Server_Port": [ - "4842" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -415,7 +415,7 @@ "recvh-sim.service.consul" ], "OPC_Server_Port": [ - "4844" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -440,7 +440,7 @@ "recvl-sim.service.consul" ], "OPC_Server_Port": [ - "4845" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -459,7 +459,7 @@ "recvl-sim.service.consul" ], "OPC_Server_Port": [ - "4845" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -1042,7 +1042,7 @@ "unb2-sim.service.consul" ], "OPC_Server_Port": [ - "4841" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -1058,7 +1058,7 @@ "unb2-sim.service.consul" ], "OPC_Server_Port": [ - "4841" + "4840" ], "OPC_Time_Out": [ "5.0" @@ -1074,7 +1074,7 @@ "unb2-sim.service.consul" ], "OPC_Server_Port": [ - "4841" + "4840" ], "OPC_Time_Out": [ "5.0" diff --git a/README.md b/README.md index 4f9e81803d4ab40bfec51880b224d0ac24e94d3d..2e60a8107492b57a2ec4b858a161e3a8da1b5b04 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,7 @@ Next change the version in the following places: # Release Notes +* 0.33.0 Run containers with dedicated ethernet devices (ovs/macvlan) * 0.32.7 Fix for antennafield.Frequency_Band_RW Fix for Calibration device polling State attributes * 0.32.6 Fixes after reinstall on fresh L2TS LCU diff --git a/infra/dev/nomad/config/cni/station-control.conflist b/infra/dev/nomad/config/cni/station-control.conflist index 376e6dea18c19ceffa4f47113f08b5a28c3be222..e9ed728b8a6899f87d62ca2f01a1d39c54a6af5a 100644 --- a/infra/dev/nomad/config/cni/station-control.conflist +++ b/infra/dev/nomad/config/cni/station-control.conflist @@ -1,27 +1,23 @@ { "cniVersion": "0.4.0", - "name": "station-control", + "name": "station", "plugins": [ - { - "type": "bridge", - "bridge": "br9000", - "isDefaultGateway": true, - "forceAddress": false, - "ipMasq": true, - "ipam": { - "type": "host-local", - "subnet": "172.31.0.0/16" - } - }, - { - "type": "firewall", - "backend": "iptables", - "iptablesAdminChainName": "CNI-BR9000" - }, - { - "type": "portmap", - "capabilities": { "portMappings": true }, - "snat": true - } + { + "type": "macvlan", + "master": "eth0", + "isDefaultGateway": true, + "forceAddress": false, + "ipMasq": true, + "ipam": { + "type": "host-local", + "subnet": "192.168.72.0/22", + "rangeStart": "192.168.73.1", + "rangeEnd": "192.168.75.254", + "gateway": "192.168.72.1", + "routes": [ + { "dst": "0.0.0.0/0" } + ] + } + } ] } diff --git a/infra/dev/nomad/config/nomad/client.hcl b/infra/dev/nomad/config/nomad/client.hcl index a1f5d1f5676e5b55da6848919b7327f9f06dbb7a..ffe3a599c676643eb97d979d5424bbf85be64c22 100644 --- a/infra/dev/nomad/config/nomad/client.hcl +++ b/infra/dev/nomad/config/nomad/client.hcl @@ -63,7 +63,6 @@ consul { auto_advertise = true server_auto_join = true client_auto_join = true - checks_use_advertise = true } advertise { diff --git a/infra/dev/nomad/config/nomad/consul.hcl b/infra/dev/nomad/config/nomad/consul.hcl index 512ae3b7188bf969d7e1541f2836da3fc3e7628d..5691997e9aeff271f17cde90732d0e188dbfb39c 100644 --- a/infra/dev/nomad/config/nomad/consul.hcl +++ b/infra/dev/nomad/config/nomad/consul.hcl @@ -16,6 +16,6 @@ connect { enabled = true } -retry_join = ["192.168.123.100"] +retry_join = ["192.168.76.1"] skip_leave_on_interrupt = true leave_on_terminate = false diff --git a/infra/dev/nomad/config/resolv.conf b/infra/dev/nomad/config/resolv.conf index 470de50cb48599adad4afb79d81ce11fdf38c265..e09eb37b8a4fa7d2005a08ae62f5587c5104dd21 100644 --- a/infra/dev/nomad/config/resolv.conf +++ b/infra/dev/nomad/config/resolv.conf @@ -1 +1 @@ -nameserver 192.168.123.100 +nameserver 192.168.76.1 diff --git a/infra/dev/nomad/nomad.hcl b/infra/dev/nomad/nomad.hcl index 5b20b3a9db95812170ee038af85aa8d068f12590..45035bfee700ff95d4f68385bceaa97268953abf 100644 --- a/infra/dev/nomad/nomad.hcl +++ b/infra/dev/nomad/nomad.hcl @@ -1,7 +1,6 @@ resource "network" "station" { - subnet = "192.168.123.0/24" + subnet = "192.168.72.0/21" } - resource "template" "consul_config" { source = <<-EOF @@ -45,7 +44,7 @@ resource "container" "consul" { depends_on = ["resource.template.consul_config"] network { id = resource.network.station.meta.id - ip_address = "192.168.123.100" + ip_address = "192.168.76.1" } image { @@ -93,6 +92,7 @@ resource "nomad_cluster" "station" { network { id = resource.network.station.meta.id + #ip_address = "192.168.76.250" } environment = { NO_PROXY = "astron.nl,control.lofar,10.0.0.0/8" @@ -121,12 +121,36 @@ resource "nomad_cluster" "station" { } } +resource "exec" "host_macvlan" { + depends_on = ["resource.nomad_cluster.station"] + environment = { + DOCKER_HOST=docker_host() + } + timeout = "300s" + script = <<-EOF + #!/bin/bash + + # inspired by https://blog.oddbit.com/post/2018-03-12-using-docker-macvlan-networks/ + for container in $(docker ps --format '{{.Names}}' | grep '.client.station.nomad.nomad-cluster.local.jmpd.in'); do + # get the last octet of the current IP of the nomad client + n=$(docker exec "$container" ip -o addr show dev eth0 | grep -v inet6 | awk '{print $4}' | sed -e 's/192.168.72.\([0-9]\{1,\}\)\/21/\1/') + # add 100 to the octet to hopefully get another unique IP in the docker network + new_ip="192.168.72.$((n+100))/21" + # attach the nomad client to the network in macvlan mode and route traffic to the container over this interface + docker exec "$container" ip link add stationnet-shim link eth0 type macvlan mode bridge + docker exec "$container" ip addr add "$new_ip" dev stationnet-shim + docker exec "$container" ip link set stationnet-shim up + docker exec "$container" ip route add 192.168.72.0/22 dev stationnet-shim + done + EOF +} + resource "exec" "enable_oversubscription" { depends_on = ["resource.nomad_cluster.station"] environment = { NOMAD_ADDR="http://${resource.nomad_cluster.station.external_ip}:${resource.nomad_cluster.station.api_port}" } - timeout = "3000s" + timeout = "300s" script = <<-EOF #!/bin/bash data=$(wget -qO- $NOMAD_ADDR/v1/operator/scheduler/configuration | \ diff --git a/infra/dev/tango/tango.hcl b/infra/dev/tango/tango.hcl index 5c5416bfdc93ecf3faf9df1d7e12a0c6d1e80858..bd0dae52e3489bae1a9c0f51cd0b8b6229d88598 100644 --- a/infra/dev/tango/tango.hcl +++ b/infra/dev/tango/tango.hcl @@ -4,7 +4,7 @@ resource "nomad_job" "tango" { paths = ["../jobs/station/tango.nomad"] health_check { - timeout = "1000s" + timeout = "300s" jobs = ["tango"] } } @@ -15,20 +15,20 @@ resource "nomad_job" "object-storage" { paths = ["../jobs/station/object-storage.nomad"] health_check { - timeout = "1000s" + timeout = "300s" jobs = ["object-storage"] } } resource "exec" "init-object-storage" { depends_on = ["resource.nomad_job.object-storage"] - timeout = "1800s" + timeout = "300s" environment = { DOCKER_HOST=docker_host() } script = <<-EOF #!/bin/bash - docker run --rm --network="station" --dns="192.168.123.100" busybox \ + docker run --rm --network="station" --dns="192.168.76.1" busybox \ sh -c "echo -n 'Waiting for s3 service to become available ..' until nc -z -w 1 s3.service.consul 9000; do sleep 2 @@ -37,15 +37,15 @@ resource "exec" "init-object-storage" { echo '. [ok]' " - docker run --rm -i --network="station" --dns="192.168.123.100" busybox \ + docker run --rm -i --network="station" --dns="192.168.76.1" busybox \ sh -c "while true; do wget -T 15 -c http://s3.service.consul:9000/minio/v2/metrics/cluster && break sleep 2 done" - docker run --rm -i --network="station" --dns="192.168.123.100" --entrypoint bash \ + docker run --rm -i --network="station" --dns="192.168.76.1" --entrypoint bash \ -v "${variable.lofar20_dir}/infra/dev/seed-data":/opt/seed-data \ - minio/mc:RELEASE.2023-10-14T01-57-03Z \ + minio/mc \ -c "mc alias set object-storage http://s3.service.consul:9000 minioadmin minioadmin echo 'Initialising caltables' mc mb object-storage/caltables @@ -64,7 +64,7 @@ resource "nomad_job" "simulators" { paths = ["../jobs/station/simulators.nomad"] health_check { - timeout = "1000s" + timeout = "300s" jobs = ["simulators"] } } @@ -75,7 +75,7 @@ resource "nomad_job" "ec-sim" { paths = ["../jobs/station/ec-sim.nomad"] health_check { - timeout = "1000s" + timeout = "300s" jobs = ["ec-sim"] } } @@ -83,16 +83,16 @@ resource "nomad_job" "ec-sim" { resource "exec" "dsconfig" { depends_on = ["resource.nomad_job.tango"] environment = { - DNS="192.168.123.100" + DNS="192.168.76.1" DOCKER_HOST=docker_host() TANGO_HOST="tango.service.consul:10000" TAG=variable.image_tag } working_directory = "${variable.lofar20_dir}" - timeout = "3000s" + timeout = "300s" script = <<-EOF #!/bin/bash - docker run --rm --network="station" --dns="192.168.123.100" busybox \ + docker run --rm --network="station" --dns="192.168.76.1" busybox \ sh -c "echo -n 'Waiting for tango service to become available ..' until nc -z -w 1 tango.service.consul 10000; do sleep 2 diff --git a/infra/env.yaml b/infra/env.yaml index e3a78aa15106ab33b55093966f7bca212d56ae60..cc89d31beaae407ef1c679cedbc16238cd3314ae 100644 --- a/infra/env.yaml +++ b/infra/env.yaml @@ -39,84 +39,54 @@ pypcc: simulators: pypcc: unb2: - port: 4841 config: UNB2TR apspu: - port: 4842 config: APSPUTR ccd: - port: 4843 config: CCDTR recvh: - port: 4844 config: RECVTR_HB,PPS recvl: - port: 4845 config: RECVTR_LB,PPS apsct: - port: 4846 config: APSCTTR sdptr: version: latest instances: lba: - port: 4840 first_gn: 0 fpgas: 16 hba0: - port: 4842 first_gn: 16 fpgas: 4 hba1: - port: 4844 first_gn: 20 fpgas: 4 devices: - - class: AFH - - class: AFL - - class: APS - - class: APSCT - - class: APSPU - - class: Beamlet - - class: BST - ports: - lba_in: 5003 - hba0_in: 5013 - hba1_in: 5023 - lba_out: 5103 - hba0_out: 5113 - hba1_out: 5123 - - class: Calibration - - class: CCD - - class: Configuration - - class: DigitalBeam - - class: EC - - class: ObservationControl - - class: PCON - - class: PSOC - - class: RECVH - - class: RECVL - - class: SDP - - class: SDPFirmware - - class: SST - ports: - lba_in: 5001 - hba0_in: 5011 - hba1_in: 5021 - lba_out: 5101 - hba0_out: 5111 - hba1_out: 5121 - - class: StationManager - - class: TemperatureManager - - class: TileBeam - - class: UNB2 - - class: XST - ports: - lba_in: 5002 - hba0_in: 5012 - hba1_in: 5022 - lba_out: 5102 - hba0_out: 5112 - hba1_out: 5122 + - AFH + - AFL + - APS + - APSCT + - APSPU + - Beamlet + - BST + - Calibration + - CCD + - Configuration + - DigitalBeam + - EC + - ObservationControl + - PCON + - PSOC + - RECVH + - RECVL + - SDP + - SDPFirmware + - SST + - StationManager + - TemperatureManager + - TileBeam + - UNB2 + - XST diff --git a/infra/jobs/station/device-server.levant.nomad b/infra/jobs/station/device-server.levant.nomad index 04cbace925d871c36582b3201c6c3323255e3912..1ff31a5fd21c9d2562cbb0da8e9ef892f752354d 100644 --- a/infra/jobs/station/device-server.levant.nomad +++ b/infra/jobs/station/device-server.levant.nomad @@ -23,8 +23,9 @@ job "device-servers" { service { tags = ["scrape"] name = "sync-iers" + port = "metrics" + meta { - metrics_address = "${NOMAD_ADDR_metrics}" metrics_path = "/" } } @@ -58,35 +59,13 @@ job "device-servers" { } } - [[ range $device := $.devices ]] - [[ with $device ]] - [[ $class := .class ]] - [[ $name := .class | toLower ]] + [[ range $class := $.devices ]] + [[ $name := $class | toLower ]] group "device-[[ $name ]]" { count = 1 network { - mode = "cni/station-control" - port "device_server" { - host_network = "station" - } - port "zmq_event" { - host_network = "station" - } - port "zmq_heartbeat" { - host_network = "station" - } - port "metrics" { - to = "8000" - host_network = "station" - } - - [[ range $port_name, $port := .ports]] - port "[[ $port_name ]]" { - static = "[[ $port ]]" - host_network = "station" - } - [[ end ]] + mode = "cni/station" } volume "IERS" { @@ -97,19 +76,22 @@ job "device-servers" { service { tags = ["scrape"] - name = "device-[[ $name ]]-metrics" - port = "metrics" + name = "device-[[ $name ]]" + port = "9999" + address_mode = "alloc" + meta { - metrics_address = "${NOMAD_ADDR_metrics}" + metrics_address = "device-[[ $name ]].service.consul:8000" metrics_path = "/" } + check { - type = "http" - name = "device-[[ $name ]]-metrics-health" - path = "/" + type = "tcp" interval = "20s" - timeout = "10s" + timeout = "5s" + port= "9999" + address_mode="alloc" } } @@ -124,46 +106,20 @@ job "device-servers" { config { image = "[[ $.registry.astron.url ]]/lofar-device-base:[[ $.image_tag ]]" - ports = [ - [[ range $port_name, $port := .ports]] - "[[ $port_name ]]", - [[ end ]] - - "device_server", - "zmq_event", - "zmq_heartbeat", - "metrics" - ] - - entrypoint = [ - "l2ss-ds", - "[[ $class ]]", - "STAT", - "-v", - "-ORBendPoint", - "giop:tcp:0:${NOMAD_PORT_device_server}", - "-ORBendPointPublish", - "giop:tcp:device-[[ $name ]].service.consul:${NOMAD_PORT_device_server}" - ] + entrypoint = [""] + command = "/bin/bash" + # The address we listen on (ORBendPoint) is also published for others to connect to for ZMQ + # event subscriptions. As such, we should not advertise "0" or anything that for other containers + # will resolve to their local host. + args = ["-c", "l2ss-ds [[ $class ]] STAT -v -ORBendPoint giop:tcp:$HOSTNAME:9999 -ORBendPointPublish giop:tcp:device-[[ $name ]].service.consul:9999"] } env { TANGO_HOST = "tango.service.consul:10000" - TANGO_ZMQ_EVENT_PORT = "${NOMAD_PORT_zmq_event}" - TANGO_ZMQ_HEARTBEAT_PORT = "${NOMAD_PORT_zmq_heartbeat}" - MINIO_ROOT_USER = "minioadmin" - MINIO_ROOT_PASSWORD = "minioadmin" - } - - service { - name = "device-[[ $name ]]" - port = "device_server" - - check { - type = "tcp" - interval = "20s" - timeout = "5s" - } + TANGO_ZMQ_EVENT_PORT = "4505" + TANGO_ZMQ_HEARTBEAT_PORT = "4506" + MINIO_ROOT_USER = "minioadmin" + MINIO_ROOT_PASSWORD = "minioadmin" } resources { @@ -173,5 +129,4 @@ job "device-servers" { } } [[ end ]] - [[ end ]] } diff --git a/infra/jobs/station/ec-sim.levant.nomad b/infra/jobs/station/ec-sim.levant.nomad index eb08142ad95923b63e6171dcdb7271158da3c14c..641ccac6c490320b449b0ce7fb75f02a83dec905 100644 --- a/infra/jobs/station/ec-sim.levant.nomad +++ b/infra/jobs/station/ec-sim.levant.nomad @@ -6,17 +6,13 @@ job "ec-sim" { count = 1 network { - mode = "bridge" - port "opcua" { - static = 4850 - to = 4840 - host_network = "station" - } + mode = "cni/station" } service { name = "ec-sim" - port = "opcua" + port = "4840" + address_mode="alloc" } task "sim" { @@ -24,7 +20,6 @@ job "ec-sim" { config { image = "[[.registry.astron.url]]/ec-sim:latest" - ports = ["opcua"] } resources { cpu = 100 diff --git a/infra/jobs/station/jupyter.levant.nomad b/infra/jobs/station/jupyter.levant.nomad index 279fa9861ac2761d5704e3c567fe114d960d3bc5..19b91aebb475e6fd39ac58ed22c95bc351384191 100644 --- a/infra/jobs/station/jupyter.levant.nomad +++ b/infra/jobs/station/jupyter.levant.nomad @@ -6,11 +6,7 @@ job "jupyter" { count = 1 network { - mode = "bridge" - port "jupyter" { - to = 8888 - host_network = "station" - } + mode = "cni/station" } volume "notebooks" { @@ -21,8 +17,9 @@ job "jupyter" { service { name = "jupyter" - port = "jupyter" + port = "8888" task = "jupyter" + address_mode="alloc" } task "jupyter-lab" { @@ -36,7 +33,6 @@ job "jupyter" { config { image = "[[.registry.astron.url]]/jupyter-lab:[[.image_tag]]" - ports = ["jupyter"] mount { type = "bind" source = "local/jupyter_notebook_config.py" diff --git a/infra/jobs/station/landing-page.levant.nomad b/infra/jobs/station/landing-page.levant.nomad index 7244678e467ffaab2a0e19fae0f670e43efd907a..1944b344d2ff0ddfd4b1460cedaaa2dd1b840d88 100644 --- a/infra/jobs/station/landing-page.levant.nomad +++ b/infra/jobs/station/landing-page.levant.nomad @@ -7,10 +7,14 @@ job "landing-page" { network { mode = "bridge" - port "minio" { + port "minio_console" { static = 9001 host_network = "external" } + port "minio" { + static = 9000 + host_network = "external" + } port "http" { static = 80 host_network = "external" @@ -38,17 +42,21 @@ job "landing-page" { template { destination = "conf.d/load-balancer.conf" data = <<EOF +{{- if service "grafana" -}} upstream grafana-backend { {{- range service "grafana" -}} server {{ .Address }}:{{ .Port }}; {{- end }} } +{{- end }} +{{- if service "jupyter" -}} upstream jupyter-backend { {{- range service "jupyter" -}} server {{ .Address }}:{{ .Port }}; {{- end }} } +{{- end }} EOF } @@ -59,7 +67,7 @@ EOF config { image = "haproxy:alpine" - ports = ["minio"] + ports = ["minio","minio_console"] mount { type = "bind" source = "haproxy/" @@ -74,19 +82,28 @@ EOF resolvers consul accepted_payload_size 8192 hold valid 5s + nameserver consul 10.99.250.250:8600 -frontend http +frontend minio_console bind *:9001 bind :::9001 mode tcp + default_backend b_minio_console +frontend minio + bind *:9000 + bind :::9000 + mode tcp default_backend b_minio backend b_minio mode tcp balance roundrobin - {{ range service "s3-console" }} - server minio {{ .Address }}:{{ .Port }} - {{ end }} + server-template minio 1 _s3._tcp.service.consul resolvers consul resolve-opts allow-dup-ip resolve-prefer ipv4 + +backend b_minio_console + mode tcp + balance roundrobin + server-template minio 1 _s3-console._tcp.service.consul resolvers consul resolve-opts allow-dup-ip resolve-prefer ipv4 EOF } diff --git a/infra/jobs/station/logging.levant.nomad b/infra/jobs/station/logging.levant.nomad index a42490a4a7a03e4a90f27e17fc5e017c2be8ef14..d4289a21a2cbe7549e9479c6603415070486e554 100644 --- a/infra/jobs/station/logging.levant.nomad +++ b/infra/jobs/station/logging.levant.nomad @@ -56,8 +56,8 @@ job "log-scraping" { } # resource limits are a good idea because you don't want your log collection to consume all resources available resources { - cpu = 50 - memory = 256 + cpu = 512 + memory = 1024 } # template with Vector's configuration template { @@ -100,10 +100,10 @@ healthchecks.require_healthy = true .level = downcase!(.level || "info") # add nomad info - .nomad.job = .label."com.hashicorp.nomad.job_name" - .nomad.task = .label."com.hashicorp.nomad.task_name" - .nomad.group = .label."com.hashicorp.nomad.task_group_name" - .nomad.namespace = .label."com.hashicorp.nomad.namespace" + .nomad.job = .label."com.hashicorp.nomad.job_name" || "" + .nomad.task = .label."com.hashicorp.nomad.task_name" || "" + .nomad.group = .label."com.hashicorp.nomad.task_group_name" || "" + .nomad.namespace = .label."com.hashicorp.nomad.namespace" || "" # delete labels that vary too much or are duplicates del(.label) @@ -117,6 +117,14 @@ healthchecks.require_healthy = true del(.host) ''' +[sinks.console] + # useful for debugging loki and/or grafana, + # since without them it is harder to see logs + # of for example crashing containers + type = "console" + inputs = [ "nomad-flags" ] + encoding.codec = "logfmt" + buffer.when_full = "drop_newest" [sinks.loki] type = "loki" inputs = [ "nomad-flags" ] diff --git a/infra/jobs/station/mesh-gateway.levant.nomad b/infra/jobs/station/mesh-gateway.levant.nomad new file mode 100644 index 0000000000000000000000000000000000000000..72dcdf20fbe96a7ba26158157218e50cfcffd391 --- /dev/null +++ b/infra/jobs/station/mesh-gateway.levant.nomad @@ -0,0 +1,49 @@ +job "mesh-gateway" { + datacenters = ["stat"] + type = "service" + group "mesh" { + network { + mode = "bridge" + + port "mesh_wan" { + static = "9100" + host_network = "external" + } + } + + service { + name = "mesh-gateway" + port = "mesh_wan" + + meta { + consul-wan-federation = "1" + } + + check { + type = "tcp" + interval = "10s" + timeout = "2s" + + success_before_passing = "3" + failures_before_critical = "3" + } + + connect { + gateway { + mesh { + } + + proxy { + } + } + + sidecar_task { + resources { + cpu = 35 + memory = 128 + } + } + } + } + } +} diff --git a/infra/jobs/station/monitoring.levant.nomad b/infra/jobs/station/monitoring.levant.nomad index bad360f5e1a714902a9be98efc586b920b091ce1..0904e47a031fc3fa402ab901b5f641ad4f2c7000 100644 --- a/infra/jobs/station/monitoring.levant.nomad +++ b/infra/jobs/station/monitoring.levant.nomad @@ -6,11 +6,7 @@ job "monitoring" { count = 1 network { - mode = "bridge" - port "postgres" { - static = 5432 - host_network = "station" - } + mode = "cni/station" } volume "postgresql" { @@ -21,8 +17,9 @@ job "monitoring" { service { name = "postgres" - port = "postgres" + port = "5432" task = "postgres" + address_mode = "alloc" } @@ -37,7 +34,6 @@ job "monitoring" { config { image = "[[.registry.astron.url]]/postgres:[[.monitoring.db.version]]" - ports = ["postgres"] } env { @@ -55,18 +51,18 @@ job "monitoring" { group "grafana" { network { - mode = "bridge" - port "http" { - to = 3000 - host_network = "station" - } + mode = "cni/station" } service { tags = ["haproxy", "scrape"] name = "grafana" - port = "http" + port = "3000" + address_mode = "alloc" + meta { + metrics_path = "/grafana/metrics" + } } task "wait-for-db" { @@ -98,7 +94,6 @@ postgres.service.consul:5432:grafana:postgres:password driver = "docker" config { image = "[[.registry.astron.url]]/grafana:[[.image_tag]]" - ports = ["http"] mount { type = "bind" source = "local/datasource-prometheus.yaml" @@ -173,13 +168,7 @@ postgres.service.consul:5432:grafana:postgres:password group "prometheus" { network { - mode = "bridge" - - port "prometheus" { - static = 9090 - to = 9090 - host_network = "station" - } + mode = "cni/station" } volume "prometheus" { @@ -191,16 +180,18 @@ postgres.service.consul:5432:grafana:postgres:password service { tags = ["haproxy", "scrape"] name = "prometheus" - port = "prometheus" + port = "9090" + address_mode = "alloc" check { type = "http" name = "prometheus_health" - port = "prometheus" + port = "9090" path = "/-/healthy" interval = "20s" timeout = "30s" + address_mode = "alloc" } } @@ -215,7 +206,6 @@ postgres.service.consul:5432:grafana:postgres:password config { image = "[[.registry.astron.url]]/prometheus:[[.monitoring.prometheus.version]]" - ports = ["prometheus"] args = [ "--config.file=/local/prometheus.yaml", "--web.enable-remote-write-receiver", @@ -243,19 +233,16 @@ postgres.service.consul:5432:grafana:postgres:password metrics_path: '/v1/agent/metrics' params: format: ['prometheus'] - consul_sd_configs: - - server: 'consul.service.consul:8500' - services: ['consul'] + static_configs: + - targets: ['consul.service.consul:8500'] relabel_configs: - target_label: host replacement: localhost - - source_labels: [__meta_consul_service] - target_label: instance # avoid a dynamic ip:port or hostname - job_name: 'nomad_metrics' consul_sd_configs: - server: 'consul.service.consul:8500' - services: ['nomad-client', 'nomad'] + services: ['nomad'] relabel_configs: - source_labels: ['__meta_consul_tags'] regex: '(.*)http(.*)' @@ -327,14 +314,7 @@ postgres.service.consul:5432:grafana:postgres:password size = 101 } network { - mode = "bridge" - - port "loki" { - to = 3100 - # should be activated when fully replaces docker-compose setup - static = 3100 - host_network = "station" - } + mode = "cni/station" } volume "loki" { @@ -346,7 +326,7 @@ postgres.service.consul:5432:grafana:postgres:password service { tags = ["haproxy", "scrape"] name = "loki" - port = "loki" + port = "3100" address_mode = "alloc" } @@ -362,7 +342,48 @@ postgres.service.consul:5432:grafana:postgres:password config { image = "[[.registry.astron.url]]/loki:[[.monitoring.loki.version]]" - ports = ["prometheus"] + args = [ + "-config.file=/local/config.file" + ] + } + + template { + data = <<EOH + auth_enabled: false + + server: + http_listen_port: 3100 + + common: + path_prefix: /loki + storage: + filesystem: + chunks_directory: /loki/chunks + rules_directory: /loki/rules + replication_factor: 1 + ring: + kvstore: + store: inmemory + + schema_config: + configs: + - from: 2020-10-24 + store: boltdb-shipper + object_store: filesystem + schema: v11 + index: + prefix: index_ + period: 24h + + ruler: + alertmanager_url: http://localhost:9093 + + analytics: + reporting_enabled: false + EOH + change_mode = "signal" + change_signal = "SIGHUP" + destination = "local/config.file" } resources { diff --git a/infra/jobs/station/nomad-client.levant.nomad b/infra/jobs/station/nomad-client.levant.nomad deleted file mode 100644 index ce879576bcb5608635a02d54b81856e0b1055501..0000000000000000000000000000000000000000 --- a/infra/jobs/station/nomad-client.levant.nomad +++ /dev/null @@ -1,439 +0,0 @@ -job "nomad-client" { - datacenters = ["stat"] - type = "service" - - group "qemu-vm" { - count = 1 - - volume "images" { - type = "host" - read_only = false - source = "images" - } - - network { - port "http" {} - } - - task "imds" { - lifecycle { - hook = "prestart" - sidecar = true - } - - driver = "exec" - - config { - command = "python3" - args = [ - "-m", "http.server", "${NOMAD_PORT_http}", - "--directory", "local/" - ] - } - template { - data = <<EOH -instance-id: ${NOMAD_SHORT_ALLOC_ID} -local-hostname: ${NOMAD_SHORT_ALLOC_ID}-client - EOH - - destination = "local/meta-data" - } - template { - data = <<EOH -#cloud-config -password: password -chpasswd: - expire: False -ssh_authorized_keys: - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPuqXIY4ATAkSfk3+nKIoyvFh/AUbhASgKTqUM0SfXvg root@cs001c - -bootcmd: - - mkdir /localdata - - DEBIAN_FRONTEND=noninteractive apt-get -yq update - - DEBIAN_FRONTEND=noninteractive apt-get -yq install gnupg nftables - -mounts: - - [ vdb, /localdata ] - - [ vdc, /var/lib/docker ] - -runcmd: - - [systemctl, restart, systemd-resolved] - - curl -L -o cni-plugins.tgz "https://github.com/containernetworking/plugins/releases/download/v1.3.0/cni-plugins-linux-$( [ $(uname -m) = aarch64 ] && echo arm64 || echo amd64)"-v1.3.0.tgz - - mkdir -p /opt/cni/bin - - tar -C /opt/cni/bin -xzf cni-plugins.tgz - - mkdir -p /localdata/nomad/data - - mkdir -p /localdata/volumes/monitoring-postgresql-data - - mkdir -p /localdata/volumes/monitoring-prometheus-data - - mkdir -p /localdata/volumes/monitoring-loki-data - - mkdir -p /localdata/volumes/tango-database - - mkdir -p /localdata/volumes/object-storage-data - - mkdir -p /localdata/volumes/IERS-data - - chmod 0777 /localdata/volumes/* - - [systemctl, enable, consul.service] - - [systemctl, start, consul.service] - - [systemctl, enable, nomad.service] - - [systemctl, start, nomad.service] - - [systemctl, enable, docker.service] - - [systemctl, start, docker.service] - - [systemctl, start, nftables.service] - - netplan apply - - nft -f /etc/nftables.conf - - sysctl -p - -package_update: true -package_upgrade: true -packages: - - docker.io - - nomad - - curl - - consul - -write_files: -#- content: | -# network: -# version: 2 -# renderer: networkd -# ethernets: -# all-en: -# match: -# name: "en*" -# mtu: 9000 -# path: /etc/netplan/01-netcfg.yaml -# defer: true - -- content: | - #!/usr/sbin/nft -f - flush ruleset - - table inet filter { - chain CNI-BR9000 { - type filter hook input priority 0; - ip daddr 172.31.0.0/16 accept - } - } - path: /etc/nftables.conf - -- content: | - fs.inotify.max_user_instances=256 - net.core.rmem_max=16777216 - path: /etc/sysctl.conf - -- content: | - { - "cniVersion": "0.4.0", - "name": "station-control", - "plugins": [ - { - "type": "bridge", - "bridge": "br9000", - "isDefaultGateway": true, - "forceAddress": false, - "ipMasq": true, - "hairpinMode": true, - "mtu": 9000, - "ipam": { - "type": "host-local", - "subnet": "172.31.0.0/16" - } - }, - { - "type": "firewall", - "backend": "iptables", - "iptablesAdminChainName": "CNI-BR9000" - }, - { - "type": "portmap", - "capabilities": { "portMappings": true }, - "snat": true - } - ] - } - path: /opt/cni/config/station-control.conflist - defer: true - -- content: | - bind_addr = "0.0.0.0" - name = "{{ env "NOMAD_SHORT_ALLOC_ID" }}-client" - region = "{{ env "node.region" }}" - data_dir = "/localdata/nomad/data" - datacenter = "stat" - - client { - enabled = true - servers = ["{{ env "attr.unique.network.ip-address" }}"] - cni_path = "/opt/cni/bin" - - host_network "external" { - interface = "eno1" - } - host_network "default" { - cidr = "10.99.0.0/16" - } - host_network "station" { - cidr = "10.99.0.0/16" - } - host_network "local" { - interface = "lo" - } - - host_volume "docker-sock-ro" { - path = "/var/run/docker.sock" - read_only = true - } - - host_volume "monitoring-postgresql-data" { - path = "/localdata/volumes/monitoring-postgresql-data" - } - - host_volume "monitoring-loki-data" { - path = "/localdata/volumes/monitoring-loki-data" - } - - host_volume "monitoring-prometheus-data" { - path = "/localdata/volumes/monitoring-prometheus-data" - } - - host_volume "tango-database" { - path = "/localdata/volumes/tango-database" - } - - host_volume "object-storage-data" { - path = "/localdata/volumes/object-storage-data" - } - - host_volume "IERS" { - path = "/localdata/volumes/IERS-data" - } - - host_volume "jupyter-notebooks" { - path = "/localdata/volumes/jupyter-notebooks" - } - - options = { - "driver.allowlist" = "docker,exec" - } - } - - consul { - address = "localhost:8500" - server_service_name = "nomad" - client_service_name = "nomad-client" - auto_advertise = true - server_auto_join = true - client_auto_join = true - } - - telemetry { - collection_interval = "1s" - disable_hostname = true - prometheus_metrics = true - publish_allocation_metrics = true - publish_node_metrics = true - } - - plugin "docker" { - config { - volumes { - enabled = true - } - allow_caps = ["all"] - extra_labels = ["job_name", "job_id", "task_group_name", "task_name", "namespace", "node_name", "node_id"] - } - } - path: /etc/nomad.d/nomad.hcl - defer: true -- content: | - datacenter = "{{ env "attr.consul.datacenter" }}" - data_dir = "/opt/consul" - bind_addr = "{{"{{"}} GetInterfaceIP \"ens3\" {{"}}"}}" - encrypt = "{{ with nomadVar "nomad/jobs/nomad-client/qemu-vm/imds" }}{{ .consul_encrypt }}{{ end }}" - retry_join = ["10.99.250.250"] - server = false - ports { - grpc = 8502 - } - path: /etc/consul.d/consul.hcl - defer: true - -apt: - preserve_source_list: true - sources: - hashicorp: - source: 'deb https://apt.releases.hashicorp.com $RELEASE main' - key: | - -----BEGIN PGP PUBLIC KEY BLOCK----- - - mQINBGO9u+MBEADmE9i8rpt8xhRqxbzlBG06z3qe+e1DI+SyjscyVVRcGDrEfo+J - W5UWw0+afey7HFkaKqKqOHVVGSjmh6HO3MskxcpRm/pxRzfni/OcBBuJU2DcGXnG - nuRZ+ltqBncOuONi6Wf00McTWviLKHRrP6oWwWww7sYF/RbZp5xGmMJ2vnsNhtp3 - 8LIMOmY2xv9LeKMh++WcxQDpIeRohmSJyknbjJ0MNlhnezTIPajrs1laLh/IVKVz - 7/Z73UWX+rWI/5g+6yBSEtj368N7iyq+hUvQ/bL00eyg1Gs8nE1xiCmRHdNjMBLX - lHi0V9fYgg3KVGo6Hi/Is2gUtmip4ZPnThVmB5fD5LzS7Y5joYVjHpwUtMD0V3s1 - HiHAUbTH+OY2JqxZDO9iW8Gl0rCLkfaFDBS2EVLPjo/kq9Sn7vfp2WHffWs1fzeB - HI6iUl2AjCCotK61nyMR33rNuNcbPbp+17NkDEy80YPDRbABdgb+hQe0o8htEB2t - CDA3Ev9t2g9IC3VD/jgncCRnPtKP3vhEhlhMo3fUCnJI7XETgbuGntLRHhmGJpTj - ydudopoMWZAU/H9KxJvwlVXiNoBYFvdoxhV7/N+OBQDLMevB8XtPXNQ8ZOEHl22G - hbL8I1c2SqjEPCa27OIccXwNY+s0A41BseBr44dmu9GoQVhI7TsetpR+qwARAQAB - tFFIYXNoaUNvcnAgU2VjdXJpdHkgKEhhc2hpQ29ycCBQYWNrYWdlIFNpZ25pbmcp - IDxzZWN1cml0eStwYWNrYWdpbmdAaGFzaGljb3JwLmNvbT6JAlQEEwEIAD4CGwMF - CwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQR5iuxlTlwVQoyOQu6qFvy8piHnAQUC - Y728PQUJCWYB2gAKCRCqFvy8piHnAd16EADeBtTgkdVEvct40TH/9HKkR/Lc/ohM - rer6FFHdKmceJ6Ma8/Qm4nCO5C7c4+EPjsUXdhK5w8DSdC5VbKLJDY1EnDlmU5B1 - wSFkGoYKoB8lUn30E77E33MTu2kfrSuF605vetq269CyBwIJV7oNN6311dW8iQ6z - IytTtlJbVr4YZ7Vst40/uR4myumk9bVBGEd6JhFAPmr/um+BZFhRf9/8xtOryOyB - GF2d+bc9IoAugpxwv0IowHEqkI4RpK2U9hvxG80sTOcmerOuFbmNyPwnEgtJ6CM1 - bc8WAmObJiQcRSLbcgF+a7+2wqrUbCqRE7QoS2wjd1HpUVPmSdJN925c2uaua2A4 - QCbTEg8kV2HiP0HGXypVNhZJt5ouo0YgR6BSbMlsMHniDQaSIP1LgmEz5xD4UAxO - Y/GRR3LWojGzVzBb0T98jpDgPtOu/NpKx3jhSpE2U9h/VRDiL/Pf7gvEIxPUTKuV - 5D8VqAiXovlk4wSH13Q05d9dIAjuinSlxb4DVr8IL0lmx9DyHehticmJVooHDyJl - HoA2q2tFnlBBAFbN92662q8Pqi9HbljVRTD1vUjof6ohaoM+5K1C043dmcwZZMTc - 7gV1rbCuxh69rILpjwM1stqgI1ONUIkurKVGZHM6N2AatNKqtBRdGEroQo1aL4+4 - u+DKFrMxOqa5b7kCDQRjvbwTARAA0ut7iKLj9sOcp5kRG/5V+T0Ak2k2GSus7w8e - kFh468SVCNUgLJpLzc5hBiXACQX6PEnyhLZa8RAG+ehBfPt03GbxW6cK9nx7HRFQ - GA79H5B4AP3XdEdT1gIL2eaHdQot0mpF2b07GNfADgj99MhpxMCtTdVbBqHY8YEQ - Uq7+E9UCNNs45w5ddq07EDk+o6C3xdJ42fvS2x44uNH6Z6sdApPXLrybeun74C1Z - Oo4Ypre4+xkcw2q2WIhy0Qzeuw+9tn4CYjrhw/+fvvPGUAhtYlFGF6bSebmyua8Q - MTKhwqHqwJxpjftM3ARdgFkhlH1H+PcmpnVutgTNKGcy+9b/lu/Rjq/47JZ+5VkK - ZtYT/zO1oW5zRklHvB6R/OcSlXGdC0mfReIBcNvuNlLhNcBA9frNdOk3hpJgYDzg - f8Ykkc+4z8SZ9gA3g0JmDHY1X3SnSadSPyMas3zH5W+16rq9E+MZztR0RWwmpDtg - Ff1XGMmvc+FVEB8dRLKFWSt/E1eIhsK2CRnaR8uotKW/A/gosao0E3mnIygcyLB4 - fnOM3mnTF3CcRumxJvnTEmSDcoKSOpv0xbFgQkRAnVSn/gHkcbVw/ZnvZbXvvseh - 7dstp2ljCs0queKU+Zo22TCzZqXX/AINs/j9Ll67NyIJev445l3+0TWB0kego5Fi - UVuSWkMAEQEAAYkEcgQYAQgAJhYhBHmK7GVOXBVCjI5C7qoW/LymIecBBQJjvbwT - AhsCBQkJZgGAAkAJEKoW/LymIecBwXQgBBkBCAAdFiEE6wr14plJaVlvmYc+cG5m - g2nAhekFAmO9vBMACgkQcG5mg2nAhenPURAAimI0EBZbqpyHpwpbeYq3Pygg1bdo - IlBQUVoutaN1lR7kqGXwYH+BP6G40x79LwVy/fWV8gO7cDX6D1yeKLNbhnJHPBus - FJDmzDPbjTlyWlDqJoWMiPqfAOc1A1cHodsUJDUlA01j1rPTho0S9iALX5R50Wa9 - sIenpfe7RVunDwW5gw6y8me7ncl5trD0LM2HURw6nYnLrxePiTAF1MF90jrAhJDV - +krYqd6IFq5RHKveRtCuTvpL7DlgVCtntmbXLbVC/Fbv6w1xY3A7rXko/03nswAi - AXHKMP14UutVEcLYDBXbDrvgpb2p2ZUJnujs6cNyx9cOPeuxnke8+ACWvpnWxwjL - M5u8OckiqzRRobNxQZ1vLxzdovYTwTlUAG7QjIXVvOk9VNp/ERhh0eviZK+1/ezk - Z8nnPjx+elThQ+r16EM7hD0RDXtOR1VZ0R3OL64AlZYDZz1jEA3lrGhvbjSIfBQk - T6mxKUsCy3YbElcOyuohmPRgT1iVDIZ/1iPL0Q0HGm4+EsWCdH6fAPB7TlHD8z2D - 7JCFLihFDWs5lrZyuWMO9nryZiVjJrOLPcStgJYVd/MhRHR4hC6g09bgo25RMJ6f - gyzL4vlEB7aSUih7yjgL9s5DKXP2J71dAhIlF8nnM403R2xEeHyivnyeR/9Ifn7M - PJvUMUuoG+ZANSMkrw//XA31o//TVk9WsLD1Edxt5XZCoR+fS+Vz8ScLwP1d/vQE - OW/EWzeMRG15C0td1lfHvwPKvf2MN+WLenp9TGZ7A1kEHIpjKvY51AIkX2kW5QLu - Y3LBb+HGiZ6j7AaU4uYR3kS1+L79v4kyvhhBOgx/8V+b3+2pQIsVOp79ySGvVwpL - FJ2QUgO15hnlQJrFLRYa0PISKrSWf35KXAy04mjqCYqIGkLsz2qQCY2lGcD5k05z - bBC4TvxwVxv0ftl2C5Bd0ydl/2YM7GfLrmZmTijK067t4OO+2SROT2oYPDsMtZ6S - E8vUXvoGpQ8tf5Nkrn2t0zDG3UDtgZY5UVYnZI+xT7WHsCz//8fY3QMvPXAuc33T - vVdiSfP0aBnZXj6oGs/4Vl1Dmm62XLr13+SMoepMWg2Vt7C8jqKOmhFmSOWyOmRH - UZJR7nKvTpFnL8atSyFDa4o1bk2U3alOscWS8u8xJ/iMcoONEBhItft6olpMVdzP - CTrnCAqMjTSPlQU/9EGtp21KQBed2KdAsJBYuPgwaQeyNIvQEOXmINavl58VD72Y - 2T4TFEY8dUiExAYpSodbwBL2fr8DJxOX68WH6e3fF7HwX8LRBjZq0XUwh0KxgHN+ - b9gGXBvgWnJr4NSQGGPiSQVNNHt2ZcBAClYhm+9eC5/VwB+Etg4+1wDmggztiqE= - =FdUF - -----END PGP PUBLIC KEY BLOCK----- - EOH - - destination = "local/user-data" - } - template { - data = <<EOH - - EOH - - destination = "local/vendor-data" - } - - - # artifact { - # source = "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2" - # destination = "alloc/data" - # } - } - - task "prepare-image" { - - driver = "exec" - lifecycle { - hook = "prestart" - } - - config { - command = "/bin/bash" - args = ["local/run.sh"] - } - - template { - data = <<EOH - #!/bin/bash - qemu-img resize local/disk-{{ env "NOMAD_SHORT_ALLOC_ID" }}.qcow2 +10G - mv local/disk-{{ env "NOMAD_SHORT_ALLOC_ID" }}.qcow2 images/disk-{{ env "NOMAD_SHORT_ALLOC_ID" }}.qcow2 - EOH - destination = "local/run.sh" - } - - volume_mount { - volume = "images" - destination = "images" - propagation_mode = "host-to-task" - } - - artifact { - source = "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2" - mode = "file" - destination = "local/disk-${NOMAD_SHORT_ALLOC_ID}.qcow2" - } - } - - task "debian" { - - driver = "qemu" - - config { - image_path = "/opt/nomad/images/disk-${NOMAD_SHORT_ALLOC_ID}.qcow2" - #image_path = "/opt/images/debian-12-genericcloud-amd64.qcow2" - drive_interface = "virtio" - graceful_shutdown = true - accelerator = "kvm" - args = [ - "-nographic", - #"-snapshot", - #"-drive", "file=debian-12-genericcloud-amd64.qcow2,if=virtio", - "-net", "nic,model=virtio,macaddr=52:54:00:12:34:56", - "-net", "tap,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown", - "-drive", "file=/dev/vg0/station_data,format=raw,if=virtio", - "-drive", "file=/dev/vg0/docker,format=raw,if=virtio", - #"-hdb", "fat:./local/imds", - "-smbios", - "type=1,serial=ds=nocloud-net;i=${NOMAD_SHORT_ALLOC_ID};h=${NOMAD_SHORT_ALLOC_ID}-client;s=http://${NOMAD_ADDR_http}/", - "-cpu", "host", - "-smp", "4", - #"-serial", "telnet:localhost:4321,server,nowait" - "-overcommit", "mem-lock=on", - "-overcommit", "cpu-pm=on", - #"-chardev", "socket,id=char0,path=/tmp/vhostqemu", - #"-device", "vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=docker_volumes", - #"-object", "memory-backend-file,id=mem,size=60000,mem-path=/dev/shm,share=on", - #"-numa", "node,memdev=mem" - - ] - } - - resources { - memory = 60000 - cpu = 13000 - } - } - task "cleanup-image" { - lifecycle { - hook = "poststop" - } - - driver = "exec" - - config { - command = "rm" - args = ["images/disk-${NOMAD_SHORT_ALLOC_ID}.qcow2"] - } - - volume_mount { - volume = "images" - destination = "images" - propagation_mode = "host-to-task" - } - } - } -} diff --git a/infra/jobs/station/object-storage.levant.nomad b/infra/jobs/station/object-storage.levant.nomad index c97cfb916f6e099daaf5bec3eb952cda88e1be3f..55900a27979835e3f4659b3f874d8f655ffedfaa 100644 --- a/infra/jobs/station/object-storage.levant.nomad +++ b/infra/jobs/station/object-storage.levant.nomad @@ -6,19 +6,7 @@ job "object-storage" { count = 1 network { - mode = "bridge" - port "s3" { - static = 9000 - host_network = "station" - } - port "console" { - static = 9001 - host_network = "station" - } - port "metrics" { - to = 9598 - host_network = "station" - } + mode = "cni/station" } volume "minio" { @@ -30,17 +18,19 @@ job "object-storage" { service { tags = ["scrape"] name = "s3" - port = "s3" + port = "9000" task = "minio" + address_mode="alloc" meta { - metrics_address = "${NOMAD_ADDR_metrics}" + metrics_address = "s3.service.consul:9598" } } service { name = "s3-console" - port = "console" + port = "9001" task = "minio" + address_mode="alloc" } task "minio" { @@ -54,7 +44,6 @@ job "object-storage" { config { image = "minio/minio:[[.object_storage.minio.version]]" - ports = ["s3", "console"] command = "server" args = ["--console-address", ":9001", "/data"] } @@ -80,7 +69,6 @@ job "object-storage" { driver = "docker" config { image = "timberio/vector:0.32.1.custom.989ad14-distroless-static" - ports = ["metrics"] } lifecycle { sidecar = true diff --git a/infra/jobs/station/sdptr.levant.nomad b/infra/jobs/station/sdptr.levant.nomad index 3bc6e4ce2d0660b481467d0796d22d70a58ea7b1..28341708e2222ee7b46e84f2f1a87ba824ceab89 100644 --- a/infra/jobs/station/sdptr.levant.nomad +++ b/infra/jobs/station/sdptr.levant.nomad @@ -6,17 +6,13 @@ job "sdptr" { group "[[ $name ]]" { count = 1 network { - mode = "bridge" - port "sdptr" { - static = [[ $tr.port ]] - to = [[ $tr.port ]] - #host_network = "station" - } + mode = "cni/station" } service { name = "sdptr-[[ $name ]]" - port = "sdptr" + port = "4840" + address_mode = "alloc" } task "translator" { @@ -24,10 +20,9 @@ job "sdptr" { config { image = "git.astron.nl:5000/lofar2.0/sdptr:[[ $.sdptr.version ]]" - ports = ["sdptr"] command = "/usr/local/bin/sdptr-[[ $name ]]" args = [ - "--port", "[[ $tr.port ]]", + "--port", "4840", "--first_gn", "[[ $tr.first_gn ]]", "--fpgas", "[[ $tr.fpgas ]]", "--nodaemon" ] diff --git a/infra/jobs/station/server-monitoring.levant.nomad b/infra/jobs/station/server-monitoring.levant.nomad index 4c862d3b02fb3f64bcd0246a4ca43cfc223e4467..aa5aee3913346cf2b5c994f0164eafabb5946def 100644 --- a/infra/jobs/station/server-monitoring.levant.nomad +++ b/infra/jobs/station/server-monitoring.levant.nomad @@ -8,7 +8,6 @@ job "server-monitoring" { network { mode = "host" port "http" { - static = 9100 to = 9100 } } @@ -59,7 +58,7 @@ job "server-monitoring" { count = 1 network { - mode = "cni/stationnet" + mode = "cni/station" } service { diff --git a/infra/jobs/station/simulators.levant.nomad b/infra/jobs/station/simulators.levant.nomad index b2228effffb9ecac288ecc181efb01da6cbd30fd..ee0385b974987f5300b3a523f46b5e74ebff673c 100644 --- a/infra/jobs/station/simulators.levant.nomad +++ b/infra/jobs/station/simulators.levant.nomad @@ -7,17 +7,13 @@ job "simulators" { count = 1 network { - mode = "bridge" - port "opcua" { - static = [[ $tr.port ]] - to = [[ $tr.port ]] - host_network = "station" - } + mode = "cni/station" } service { name = "[[ $name ]]-sim" - port = "opcua" + port = "4840" + address_mode="alloc" } task "sim" { @@ -25,8 +21,7 @@ job "simulators" { config { image = "git.astron.nl:5000/lofar2.0/pypcc:[[ $.pypcc.version ]]" - ports = ["opcua"] - entrypoint = ["hwtr", "--simulator", "--port", "[[ $tr.port ]]", "--config", "[[ $tr.config ]]"] + entrypoint = ["hwtr", "--simulator", "--port", "4840", "--config", "[[ $tr.config ]]"] } resources { cpu = 100 @@ -41,16 +36,13 @@ job "simulators" { count = 1 network { - mode = "bridge" - port "opcua" { - static = 4840 - to = 4840 - } + mode = "cni/station" } service { name = "sdptr-sim" - port = "opcua" + port = "4840" + address_mode = "alloc" } task "sim" { @@ -58,8 +50,7 @@ job "simulators" { config { image = "git.astron.nl:5000/lofar2.0/sdptr:[[ $.sdptr.version ]]" - ports = ["opcua"] - entrypoint = ["/usr/local/bin/sdptr", "--ip_prefix=127.0.", "--nodaemon"] + entrypoint = ["/usr/local/bin/sdptr", "--port", "4840", "--nodaemon"] } resources { cpu = 100 diff --git a/infra/jobs/station/snmp-exporter.levant.nomad b/infra/jobs/station/snmp-exporter.levant.nomad index 1ead7227b68cae76da50d4e297e172c7285f1ac1..735754721d88794c2a133e9f1df5ffa7ae50405b 100644 --- a/infra/jobs/station/snmp-exporter.levant.nomad +++ b/infra/jobs/station/snmp-exporter.levant.nomad @@ -6,28 +6,20 @@ job "snmp-exporter" { count = 1 network { - mode = "bridge" - port "http" { - static = 9116 - to = 9116 - host_network = "station" - } + mode = "cni/station" } service { tags = ["scrape"] name = "snmp-exporter" task = "snmp-exporter" - port = "http" + port = "9116" + address_mode = "alloc" meta { - metrics_address = "${NOMAD_ADDR_http}" + metrics_address = "snmp-exporter.service.consul:9116" metrics_path = "/metrics" } - - connect { - sidecar_service {} - } } task "snmp-exporter" { diff --git a/infra/jobs/station/tango.levant.nomad b/infra/jobs/station/tango.levant.nomad index 51344784a8a34806da6e015229030db3f3fdec73..98cf97cbcd3f8f6bded5a8ec5e235b4809fc89bc 100644 --- a/infra/jobs/station/tango.levant.nomad +++ b/infra/jobs/station/tango.levant.nomad @@ -13,13 +13,7 @@ job "tango" { } network { - mode = "bridge" - port "mysql" { - # should be migrated to port 3000 when fully replaces docker-compose setup - static = 3306 - to = 3306 - host_network = "station" - } + mode = "cni/station" } volume "database" { @@ -30,12 +24,14 @@ job "tango" { service { name = "tangodb" - port = "mysql" - + port = "3306" + address_mode="alloc" check { type = "tcp" interval = "10s" timeout = "2s" + address_mode="alloc" + port = "3306" } } @@ -50,7 +46,6 @@ job "tango" { config { image = "[[.registry.astron.url]]/tango-db:[[.tango.db.version]]" - ports = ["mysql"] } env { @@ -78,22 +73,20 @@ job "tango" { } network { - mode = "bridge" - port "tango" { - static = 10000 - to = 10000 - host_network = "station" - } + mode = "cni/station" } service { name = "tango" - port = "tango" + port = "10000" + address_mode="alloc" check { type = "tcp" interval = "10s" timeout = "20s" + port = "10000" + address_mode="alloc" } } @@ -128,7 +121,6 @@ EOH config { image = "[[.registry.astron.url]]/tango-databaseds:[[.tango.databaseds.version]]" - ports = ["tango"] entrypoint = [ "/usr/local/bin/DataBaseds", "2", diff --git a/infra/station/cni/nftables.conf.j2 b/infra/station/cni/nftables.conf.j2 index 12a2926cd05101511b839c93d71e019423c78b90..c225e786230d88cab4ac213a95e1b848f69d51ef 100644 --- a/infra/station/cni/nftables.conf.j2 +++ b/infra/station/cni/nftables.conf.j2 @@ -2,39 +2,13 @@ flush ruleset -table inet filter { - chain input { - type filter hook input priority filter; - } - chain forward { - type filter hook forward priority filter; - } - chain output { - type filter hook output priority filter; - } - chain CNI-BR9000 { - type filter hook input priority 0; - ip daddr 172.31.0.0/16 accept +table ip ovs_nat { + chain prerouting { + type nat hook prerouting priority filter; policy accept; } -} -table ip nat { chain postrouting { type nat hook postrouting priority srcnat; policy accept; - ip saddr 10.99.0.0/16 oif "{{ eth_ext }}" masquerade - } - - chain prerouting { - type nat hook prerouting priority dstnat; policy accept; - #ip daddr 10.99.250.250 udp dport 53 dnat to 10.99.250.250:8600 - #ip daddr 10.99.250.250 tcp dport 53 dnat to 10.99.250.250:8600 - #tcp dport 4840 dnat to 10.99.250.1 - #tcp dport 4842 dnat to 10.99.250.1 - #tcp dport 4844 dnat to 10.99.250.1 + oifname "{{ eth_ext }}" masquerade } -# chain output { -# type nat hook output priority filter; -# iifname "lo" udp dport 53 redirect to :8600 -# iifname "lo" tcp dport 53 redirect to :8600 -# } } diff --git a/infra/station/cni/station-control.conflist b/infra/station/cni/station-control.conflist deleted file mode 100644 index 680bb7957ecdd61aad3517cfea1d244eb9298a11..0000000000000000000000000000000000000000 --- a/infra/station/cni/station-control.conflist +++ /dev/null @@ -1,29 +0,0 @@ -{ - "cniVersion": "0.4.0", - "name": "station-control", - "plugins": [ - { - "type": "bridge", - "bridge": "br9000", - "isDefaultGateway": true, - "forceAddress": false, - "ipMasq": true, - "hairpinMode": true, - "mtu": 9000, - "ipam": { - "type": "host-local", - "subnet": "172.31.0.0/16" - } - }, - { - "type": "firewall", - "backend": "iptables", - "iptablesAdminChainName": "CNI-BR9000" - }, - { - "type": "portmap", - "capabilities": { "portMappings": true }, - "snat": true - } - ] - } diff --git a/infra/station/cni/lofarnet.conflist b/infra/station/cni/stationnet.conflist similarity index 67% rename from infra/station/cni/lofarnet.conflist rename to infra/station/cni/stationnet.conflist index eff076e9901995dcbed6b3f9fb59edc1b2fc6fc8..07dcff35ebf26a73cb73b43ae987f774fbc6150d 100644 --- a/infra/station/cni/lofarnet.conflist +++ b/infra/station/cni/stationnet.conflist @@ -1,6 +1,6 @@ { "cniVersion": "0.4.0", - "name": "stationnet", + "name": "station", "plugins": [ { "type": "ovs", @@ -14,21 +14,13 @@ "ipam": { "type": "host-local", "subnet": "10.99.0.0/16", - "rangeStart": "10.99.250.2", - "rangeEnd": "10.99.250.249", + "rangeStart": "10.99.72.1", + "rangeEnd": "10.99.75.254", "gateway": "10.99.250.250", "routes": [ { "dst": "0.0.0.0/0" } ] } - }, - { - "type": "firewall" - }, - { - "type": "portmap", - "capabilities": { "portMappings": true }, - "snat": true } ] } diff --git a/infra/station/consul-agent.nomad b/infra/station/consul-agent.nomad new file mode 100644 index 0000000000000000000000000000000000000000..4a330b5bbb8704e12472b1bae92252f84aa9d607 --- /dev/null +++ b/infra/station/consul-agent.nomad @@ -0,0 +1,50 @@ +job "consul-agent" { + datacenters = ["stat"] + type = "system" + + group "consul" { + count = 1 + + volume "consul" { + type = "host" + source = "consul" + read_only = true + } + + network { + mode = "host" + } + + task "consul" { + driver = "exec" + + #config { + # image = "hashicorp/consul:1.18.0" + # ports = ["http", "grpc", "lan_serf"] + # command = "agent" + # args = ["-config-file=/local/consul.hcl"] + # volumes = [ + # # Use absolute paths to mount arbitrary paths on the host + # "/opt/consul/agent-certs/:/consul/agent-certs/" + # ] + #} + config { + # When running a binary that exists on the host, the path must be absolute. + command = "/bin/consul" + args = ["agent", "-config-file=/host/consul-agent.hcl"] + } + + # docker socket volume mount + volume_mount { + volume = "consul" + destination = "/host/" + read_only = true + } + + resources { + cpu = 1024 + memory = 2048 + } + } + } +} diff --git a/infra/station/consul.yml b/infra/station/consul.yml index 595a8769e004c6d36c5a5dc9c58f75f403f75b14..d0b581788e72cf7aeeb39491addbc2ab673aa968 100644 --- a/infra/station/consul.yml +++ b/infra/station/consul.yml @@ -1,51 +1,96 @@ --- -- name: setup nomad - hosts: all + +- name: setup vault role + hosts: station + connection: ssh + gather_facts: true + tasks: + - name: Lookup ansible_hostname in getent database + command: + argv: + - vault + - write + - -address=https://vault.vis.lofar.net + - pki_int/roles/consul-lofar-{{station_name}} + - allowed_domains=lofar-{{station_name}}.consul,server.lofar-{{station_name}}.consul + - allow_subdomains=true + - allowed_uri_sans=*.server.lofar-{{station_name}}.consul + - generate_lease=true + - max_ttl=720h + delegate_to: monitor + register: result +- name: setup consul + hosts: station remote_user: root become: true become_user: root + roles: + - hashicorp + - role: volume + volume_name: 'consul-data' + path: '/opt/consul' + size: 20g tasks: - - name: install xfs packages - apt: - pkg: - - xfsprogs - update_cache: yes - state: present - - - name: add nomad volume - lvol: - vg: vg0 - lv: consul-data - size: 20g - force: yes - - - name: format the xfs filesystem - filesystem: - fstype: xfs - dev: /dev/vg0/consul-data - - - name: mount consul-data - ansible.posix.mount: - path: /opt/consul - src: /dev/vg0/consul-data - fstype: xfs - opts: noatime - state: mounted - - - name: add hashicorp apt repo - import_tasks: hashicorp-repo.yml - name: install packages apt: pkg: - consul - dnsmasq + - consul-template update_cache: yes state: present + - name: configure consul ansible.builtin.template: src: consul/consul.hcl.j2 dest: /etc/consul.d/consul.hcl + - name: configure consul agent + ansible.builtin.template: + src: consul/consul-agent.hcl.j2 + dest: /opt/consul/consul-agent.hcl + + - name: create templates directory + file: + path: /etc/consul-template.d + state: directory + mode: '0755' + owner: consul + group: consul + + - name: copy consul template service + copy: + src: consul/consul-template.service + dest: /etc/systemd/system/ + + - name: start consul-template + systemd: state=started name=consul-template daemon_reload=yes + + - name: create templates directory + file: + path: /opt/consul/templates/ + state: directory + mode: '0755' + owner: consul + group: consul + + - name: copy pki templates + template: + src: consul/consul-pki/{{item}}.tpl + dest: /opt/consul/templates/{{item}}.tpl + owner: consul + group: consul + loop: + - ca.crt + - agent.key + - agent.crt + + - name: copy consul template service + template: + src: consul/consul_template.hcl + dest: /etc/consul-template.d/consul_template.hcl + owner: consul + group: consul - name: configure resolved ansible.builtin.template: @@ -59,6 +104,12 @@ content: > nameserver 10.99.250.250 + - name: Start consul template + service: + name: consul-template + state: restarted + enabled: yes + - name: Start consul ansible.builtin.service: name: consul diff --git a/infra/station/consul/consul-agent.hcl.j2 b/infra/station/consul/consul-agent.hcl.j2 new file mode 100644 index 0000000000000000000000000000000000000000..a02519b7267555af5e333e4cca141a94afb2f689 --- /dev/null +++ b/infra/station/consul/consul-agent.hcl.j2 @@ -0,0 +1,28 @@ +datacenter = "lofar-{{ station_name }}" +data_dir = "/consul" +node_name = "agent" +server = false +bind_addr = "0.0.0.0" +retry_join = [ "10.99.250.250:8301" ] +encrypt = "{{ consul_encrypt }}" +advertise_addr = "10.99.250.250" +ports { + dns = -1 + grpc = 9502 + http = 9500 + serf_lan = 9301 +} +connect { + enabled = true +} + +telemetry { + prometheus_retention_time = "24h" +} +verify_incoming = true +verify_outgoing = true +verify_server_hostname = true +ca_file = "/host/agent-certs/ca.crt" +auto_encrypt { + tls = true +} diff --git a/infra/station/consul/consul-pki/agent.crt.tpl b/infra/station/consul/consul-pki/agent.crt.tpl new file mode 100644 index 0000000000000000000000000000000000000000..7b00e7c1bdd416ddf1d1a8e2e943157a6af9ee35 --- /dev/null +++ b/infra/station/consul/consul-pki/agent.crt.tpl @@ -0,0 +1,3 @@ +[[ with secret "pki_int/issue/consul-lofar-{{ station_name }}" "common_name=server.lofar-{{ station_name }}.consul" "ttl=720h" "alt_names=localhost,{{ ansible_facts['hostname'] }}.server.lofar-{{ station_name }}.consul" "ip_sans=127.0.0.1"]] +[[ .Data.certificate ]] +[[ end ]] diff --git a/infra/station/consul/consul-pki/agent.key.tpl b/infra/station/consul/consul-pki/agent.key.tpl new file mode 100644 index 0000000000000000000000000000000000000000..8b3df038238c9c64a79be1d8a1d99fa0c4afeac2 --- /dev/null +++ b/infra/station/consul/consul-pki/agent.key.tpl @@ -0,0 +1,3 @@ +[[ with secret "pki_int/issue/consul-lofar-{{ station_name }}" "common_name=server.lofar-{{ station_name }}.consul" "ttl=720h" "alt_names=localhost,{{ ansible_facts['hostname'] }}.server.lofar-{{ station_name }}.consul" "ip_sans=127.0.0.1"]] +[[ .Data.private_key ]] +[[ end ]] diff --git a/infra/station/consul/consul-pki/ca.crt.tpl b/infra/station/consul/consul-pki/ca.crt.tpl new file mode 100644 index 0000000000000000000000000000000000000000..aed3ba478820bccc3ff358633fd0ea3d13a701cb --- /dev/null +++ b/infra/station/consul/consul-pki/ca.crt.tpl @@ -0,0 +1,3 @@ +[[ with secret "pki_int/issue/consul-lofar-{{ station_name }}" "common_name=server.lofar-{{ station_name }}.consul" "ttl=720h"]] +[[ .Data.issuing_ca ]] +[[ end ]] diff --git a/infra/station/consul/consul-template.service b/infra/station/consul/consul-template.service new file mode 100644 index 0000000000000000000000000000000000000000..128442e069d0be980ed43c0177b74fe110094b8f --- /dev/null +++ b/infra/station/consul/consul-template.service @@ -0,0 +1,15 @@ +[Unit] +Description=consul-template +Requires=network-online.target +After=network-online.target consul.service vault.service + +[Service] +Type=simple +KillSignal=SIGKILL +Restart=on-failure +ExecStart=/usr/bin/consul-template -config /etc/consul-template.d/ +User=consul +Group=consul + +[Install] +WantedBy=multi-user.target diff --git a/infra/station/consul/consul.hcl.j2 b/infra/station/consul/consul.hcl.j2 index 16ba7f389e13af191ef8f8c270c01cef95122e8f..6ca3bcf4ec24759f40dc718793352be9f21f9d6c 100644 --- a/infra/station/consul/consul.hcl.j2 +++ b/infra/station/consul/consul.hcl.j2 @@ -5,13 +5,13 @@ encrypt = "{{ consul_encrypt }}" data_dir = "/opt/consul" bind_addr = "0.0.0.0" -client_addr = "10.99.250.250 127.0.0.1" +client_addr = "10.99.250.250 {{ '{{' }} GetInterfaceIP \"{{ eth_ext }}\" {{ '}}' }} 127.0.0.1" advertise_addr = "10.99.250.250" retry_join = ["127.0.0.1"] serf_wan = "{{ '{{' }} GetInterfaceIP \"{{ eth_ext }}\" {{ '}}' }}" -advertise_addr_wan = "{{ '{{' }} GetInterfaceIP \"{{ eth_ext }}\" {{ '}}' }}" -retry_join_wan = ["consul.central.lofar.net"] +#advertise_addr_wan = "{{ '{{' }} GetInterfaceIP \"{{ eth_ext }}\" {{ '}}' }}" +primary_gateways = [ "mesh-gateway.central.lofar.net:8443" ] bootstrap=true @@ -26,6 +26,17 @@ ports { connect { enabled = true + enable_mesh_gateway_wan_federation = true +} + +verify_incoming = true +verify_outgoing = true +verify_server_hostname = true +ca_file = "/opt/consul/agent-certs/ca.crt" +cert_file = "/opt/consul/agent-certs/agent.crt" +key_file = "/opt/consul/agent-certs/agent.key" +auto_encrypt { + allow_tls = true } ui_config { diff --git a/infra/station/consul/consul_template.hcl b/infra/station/consul/consul_template.hcl new file mode 100644 index 0000000000000000000000000000000000000000..73819abb6912b8fa80db4cf95f4489350609fdb7 --- /dev/null +++ b/infra/station/consul/consul_template.hcl @@ -0,0 +1,47 @@ +vault { + address = "https://vault.vis.lofar.net" + token = "{{ consul_vault_token }}" + unwrap_token = false + renew_token = true +} + +# This block defines the configuration for a template. Unlike other blocks, +# this block may be specified multiple times to configure multiple templates. +template { + # This is the source file on disk to use as the input template. This is often + # called the "consul-template template". + source = "/opt/consul/templates/agent.crt.tpl" + + # This is the destination path on disk where the source template will render. + # If the parent directories do not exist, consul-template will attempt to + # create them, unless create_dest_dirs is false. + destination = "/opt/consul/agent-certs/agent.crt" + + # This is the permission to render the file. If this option is left + # unspecified, consul-template will attempt to match the permissions of the + # file that already exists at the destination path. If no file exists at that + # path, the permissions are 0644. + perms = 0700 + left_delimiter = "[[" + right_delimiter = "]]" + # This is the optional command to run when the template is rendered. The + # command will only run if the resulting template changes. + command = "sh -c 'date && consul reload'" +} + +template { + source = "/opt/consul/templates/agent.key.tpl" + destination = "/opt/consul/agent-certs/agent.key" + left_delimiter = "[[" + right_delimiter = "]]" + perms = 0700 + command = "sh -c 'date && consul reload'" +} + +template { + source = "/opt/consul/templates/ca.crt.tpl" + destination = "/opt/consul/agent-certs/ca.crt" + left_delimiter = "[[" + right_delimiter = "]]" + command = "sh -c 'date && consul reload'" +} diff --git a/infra/station/nomad.yml b/infra/station/nomad.yml index f7255262c7439bbeef1b3d03eb479e46eeb9b799..aa9d8c36f16bded8db48ed4a5425502fac8f192a 100644 --- a/infra/station/nomad.yml +++ b/infra/station/nomad.yml @@ -1,91 +1,34 @@ --- - name: setup nomad - hosts: all + hosts: station remote_user: root become: true become_user: root - vars: - station_name: - nomad_encrypt: - eth_ext: eno1 - eth_int: eno2 + roles: + - hashicorp + - role: volume + volume_name: 'nomad-data' + path: '/opt/nomad' + size: 100g + - role: volume + volume_name: 'docker-data' + path: '/var/lib/docker' + size: 100g + - role: volume + volume_name: 'station-data' + path: '/var/lib/station-data' + size: 2t tasks: - - name: install xfs packages + - name: install packages apt: pkg: - - xfsprogs + - nomad + - docker.io update_cache: yes state: present - - - name: add nomad volume - lvol: - vg: vg0 - lv: nomad-data - size: 20g - force: yes - - - name: format the xfs filesystem - filesystem: - fstype: xfs - dev: /dev/vg0/nomad-data - - - name: mount nomad-data - ansible.posix.mount: - path: /opt/nomad - src: /dev/vg0/nomad-data - fstype: xfs - opts: noatime - state: mounted - - - name: add docker volume - lvol: - vg: vg0 - lv: docker-data - size: 100g - force: yes - - - name: format the xfs filesystem - filesystem: - fstype: xfs - dev: /dev/vg0/docker-data - - - name: mount docker-data - ansible.posix.mount: - path: /var/lib/docker - src: /dev/vg0/docker-data - fstype: xfs - opts: noatime - state: mounted - - - name: add station data volume - lvol: - vg: vg0 - lv: station-data - size: 400g - force: yes - - - name: format the xfs filesystem - filesystem: - fstype: xfs - dev: /dev/vg0/station-data - - - name: create volume directory - ansible.builtin.file: - path: /opt/nomad/volumes - state: directory - mode: '0755' - - - name: mount station-data - ansible.posix.mount: - path: /opt/nomad/volumes - src: /dev/vg0/station-data - fstype: xfs - opts: noatime - state: mounted - - name: create directory if they don't exist file: - path: "/opt/nomad/volumes/{{ item }}" + path: "/var/lib/station-data/{{ item }}" state: directory owner: nomad group: nomad @@ -113,20 +56,7 @@ path: /opt/cni/config state: directory mode: '0755' - - ansible.builtin.copy: - src: cni/station-control.conflist - dest: /opt/cni/config/station-control.conflist - - name: add hashicorp apt repo - import_tasks: hashicorp-repo.yml - - - name: install packages - apt: - pkg: - - nomad - - docker.io - update_cache: yes - state: present - name: configure nomad ansible.builtin.template: @@ -135,17 +65,48 @@ - ansible.posix.sysctl: name: fs.inotify.max_user_instances - value: '256' + value: '1024' + state: present + + - ansible.posix.sysctl: + name: fs.inotify.max_user_instances + value: '12288' + state: present + + - ansible.posix.sysctl: + name: net.core.rmem_max + value: '16777216' state: present - name: Start docker ansible.builtin.service: - name: docker - state: restarted + name: nomad + state: started enabled: yes - - name: Start nomad + - name: Start docker ansible.builtin.service: - name: nomad - state: restarted + name: docker + state: started enabled: yes + +- name: deploy consul agent + hosts: station + connection: ssh + gather_facts: true + tasks: + - name: Lookup ansible_hostname in getent database + command: + argv: + - data=$(wget -qO- http://localhost:4646/v1/operator/scheduler/configuration | jq '.SchedulerConfig | .MemoryOversubscriptionEnabled=true') + - wget --method=PUT --body-data="$data" -qO- http://localhost:4646/v1/operator/scheduler/configuration + register: result + - name: Lookup ansible_hostname in getent database + command: + argv: + - nomad + - run + - -address=http://{{ansible_host}}:4646 + - consul-agent.nomad + delegate_to: localhost + register: result diff --git a/infra/station/nomad/nomad.hcl.j2 b/infra/station/nomad/nomad.hcl.j2 index b50e1d68f76242c385861a6ac5bdeeefcbf567aa..b39cace4450c42910986a37951ac0d1d665dc084 100644 --- a/infra/station/nomad/nomad.hcl.j2 +++ b/infra/station/nomad/nomad.hcl.j2 @@ -19,7 +19,7 @@ client { enabled = true servers = ["127.0.0.1"] cni_path = "/opt/cni/bin" - network_interface = "{{ eth_int }}" + network_interface = "br0" host_network "external" { interface = "{{ eth_ext }}" } @@ -38,32 +38,37 @@ client { read_only = true } + host_volume "consul" { + path = "/opt/consul" + read_only = true + } + host_volume "monitoring-postgresql-data" { - path = "/opt/nomad/volumes/monitoring-postgresql-data" + path = "/var/lib/station-data/monitoring-postgresql-data" } host_volume "monitoring-loki-data" { - path = "/opt/nomad/volumes/monitoring-loki-data" + path = "/var/lib/station-data/monitoring-loki-data" } host_volume "monitoring-prometheus-data" { - path = "/opt/nomad/volumes/monitoring-prometheus-data" + path = "/var/lib/station-data/monitoring-prometheus-data" } host_volume "tango-database" { - path = "/opt/nomad/volumes/tango-database" + path = "/var/lib/station-data/tango-database" } host_volume "object-storage-data" { - path = "/opt/nomad/volumes/object-storage-data" + path = "/var/lib/station-data/object-storage-data" } host_volume "IERS" { - path = "/opt/nomad/volumes/IERS-data" + path = "/var/lib/station-data/IERS-data" } host_volume "jupyter-notebooks" { - path = "/opt/nomad/volumes/jupyter-notebooks" + path = "/var/lib/station-data/jupyter-notebooks" } } @@ -83,9 +88,8 @@ telemetry { } consul { - address = "localhost:8500" - grpc_address = "localhost:8502" - checks_use_advertise = true + address = "127.0.0.1:9500" + grpc_address = "127.0.0.1:9502" } vault { @@ -102,13 +106,16 @@ plugin "docker" { volumes { enabled = true } + allow_caps = ["all"] + extra_labels = ["job_name", "job_id", "task_group_name", "task_name", "namespace", "node_name", "node_id"] } } -#plugin "qemu" { -# config { -# image_paths = ["/opt/nomad/images"] -# } -#} +plugin "qemu" { + config { + image_paths = ["/opt/nomad/images"] + } +} + #plugin "raw_exec" { # config { # enabled = true diff --git a/infra/station/ovs.yml b/infra/station/ovs.yml index ea29f1b31b141f6cfaf60cc9bc48053b71031ec4..8c61dfe6a83048819d1ae75f75ea112f3fae52a7 100644 --- a/infra/station/ovs.yml +++ b/infra/station/ovs.yml @@ -1,12 +1,9 @@ --- - name: setup open vswitch - hosts: all + hosts: station remote_user: root become: true become_user: root - vars: - eth_ext: eno1 - eth_int: eno2 tasks: - name: add interface config notify: networking changed @@ -65,6 +62,9 @@ - ansible.builtin.template: src: cni/nftables.conf.j2 dest: /etc/nftables.conf + - service: + name: nftables + state: restarted - name: Install CNI config block: - ansible.builtin.get_url: @@ -80,8 +80,8 @@ state: directory mode: '0755' - ansible.builtin.copy: - src: cni/lofarnet.conflist - dest: /opt/cni/config/lofarnet.conflist + src: cni/stationnet.conflist + dest: /opt/cni/config/stationnet.conflist - ansible.builtin.copy: src: cni/ovs.conf dest: /opt/cni/net.d/ovs.d/ovs.conf diff --git a/infra/station/hashicorp-repo.yml b/infra/station/roles/hashicorp/tasks/main.yml similarity index 92% rename from infra/station/hashicorp-repo.yml rename to infra/station/roles/hashicorp/tasks/main.yml index 91b91853f5186debca65909979e7c29b2dc2f943..d55d4248dfe18b83bfc5d978c2b8409cd6038e84 100644 --- a/infra/station/hashicorp-repo.yml +++ b/infra/station/roles/hashicorp/tasks/main.yml @@ -1,3 +1,5 @@ +--- +# Add the hashicorp repo - name: add hashicorp apt key ansible.builtin.get_url: url: https://apt.releases.hashicorp.com/gpg diff --git a/infra/station/roles/volume/defaults/main.yml b/infra/station/roles/volume/defaults/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..5e1b17d0e7ced8a7975f9158789c559c3371fde1 --- /dev/null +++ b/infra/station/roles/volume/defaults/main.yml @@ -0,0 +1,2 @@ +--- +fstype: 'xfs' diff --git a/infra/station/roles/volume/meta/argument_specs.yml b/infra/station/roles/volume/meta/argument_specs.yml new file mode 100644 index 0000000000000000000000000000000000000000..045d1f0bb42a0b66406b325d5a195ec137911265 --- /dev/null +++ b/infra/station/roles/volume/meta/argument_specs.yml @@ -0,0 +1,35 @@ +--- +argument_specs: + main: + short_description: Main entry point for the volume role + description: + - The volume role creates and configures a logical volume + author: + - Hannes Feldt + options: + volume_name: + type: "str" + required: true + description: "The name of the volume" + volume_group: + type: "str" + required: false + default: 'vg0' + description: "The name of the volume group" + path: + type: "str" + required: true + description: "The mount path of the volume" + size: + type: "str" + required: true + description: "The size of the volume" + fstype: + type: "str" + required: false + default: 'xfs' + description: "The fstype of the volume" + pvs: + type: "str" + required: false + description: "The pvs of the volume" diff --git a/infra/station/roles/volume/meta/main.yml b/infra/station/roles/volume/meta/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..61d3ffe4f9416869d4fff5118f784dd567977025 --- /dev/null +++ b/infra/station/roles/volume/meta/main.yml @@ -0,0 +1,2 @@ +--- +allow_duplicates: true diff --git a/infra/station/roles/volume/tasks/main.yml b/infra/station/roles/volume/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..ce2ec13ba73e15dbbc0f0cdb69e9d406e7efca59 --- /dev/null +++ b/infra/station/roles/volume/tasks/main.yml @@ -0,0 +1,34 @@ +- debug: + var: fstype +- name: install xfsprogs + apt: + pkg: + - xfsprogs + update_cache: yes + state: present + when: fstype == "xfs" +- name: 'add {{ volume_name }} volume' + lvol: + vg: '{{ volume_group }}' + lv: '{{ volume_name }}' + size: '{{ size }}' + pvs: '{{ pvs|default(omit) }}' + force: no + shrink: no + resizefs: yes +- name: format the xfs filesystem + filesystem: + fstype: '{{ fstype }}' + dev: '/dev/{{ volume_group }}/{{ volume_name }}' +- name: create volume directory + ansible.builtin.file: + path: '{{ path }}' + state: directory + mode: '0755' +- name: 'mount {{ volume_name }}' + ansible.posix.mount: + path: '{{ path }}' + src: '/dev/{{ volume_group }}/{{ volume_name }}' + fstype: '{{ fstype }}' + opts: noatime + state: mounted diff --git a/infra/station/chrony.yml b/infra/station/time.yml similarity index 86% rename from infra/station/chrony.yml rename to infra/station/time.yml index f417afd914bf52738387f1566d117917e9d8a8f7..d6f7d55271783adb1e1c3bb56436e7f8810070e6 100644 --- a/infra/station/chrony.yml +++ b/infra/station/time.yml @@ -5,6 +5,8 @@ become: true become_user: root tasks: + - name: set timezone to UTC + command: timedatectl set-timezone UTC - name: install packages apt: pkg: diff --git a/sbin/run_integration_test.sh b/sbin/run_integration_test.sh index 24cfdb7c97c38e40893fd242dd5ddbcbcc29ce24..0505478d9aea8a3564866f5a6bcccc42f131fc0f 100755 --- a/sbin/run_integration_test.sh +++ b/sbin/run_integration_test.sh @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # -export DNS=192.168.123.100 +export DNS=192.168.76.1 export do_cleanup=true # Usage function explains how parameters are parsed @@ -267,7 +267,7 @@ DOCKER_HOST="$DOCKER_HOST" HOME="$JUMPPAD_HOME" jumppad up "${jumppad_options[@] # shellcheck disable=SC2046 #eval $(HOME="$JUMPPAD_HOME" jumppad env "infra/dev/$module.hcl") -docker run --rm --network="station" --dns="192.168.123.100" busybox \ +docker run --rm --network="station" --dns="$DNS" busybox \ sh -c "echo -n 'Waiting for tango service to become available ..' until nc -z -w 1 tango.service.consul 10000; do sleep 2 diff --git a/tangostationcontrol/VERSION b/tangostationcontrol/VERSION index 0037a8bf8f3cc3005d8bb756084a3853a3ef8817..be386c9ede3c1add77a7a26a848e01e4d8133996 100644 --- a/tangostationcontrol/VERSION +++ b/tangostationcontrol/VERSION @@ -1 +1 @@ -0.32.7 +0.33.0 diff --git a/tangostationcontrol/integration_test/default/client/test_unb2_sim.py b/tangostationcontrol/integration_test/default/client/test_unb2_sim.py index d2aee824ba41015b346f6ab63ffe4fab2b20dbf3..72ff598e04ced1e553f6a66c7717bc988e3a0635 100644 --- a/tangostationcontrol/integration_test/default/client/test_unb2_sim.py +++ b/tangostationcontrol/integration_test/default/client/test_unb2_sim.py @@ -13,7 +13,7 @@ class TestUNB2Sim(base.IntegrationAsyncTestCase): async def test_opcua_connection(self): """Check if we can connect to unb2-sim""" - client = Client("opc.tcp://unb2-sim.service.consul:4841") + client = Client("opc.tcp://unb2-sim.service.consul:4840") root_node = None await client.connect() diff --git a/tangostationcontrol/requirements.txt b/tangostationcontrol/requirements.txt index f55a555e5024190b192990a0f13ea4a10b58191c..d6d27e18c61951a01b1fc234b4314b087c6ff155 100644 --- a/tangostationcontrol/requirements.txt +++ b/tangostationcontrol/requirements.txt @@ -22,3 +22,4 @@ minio >= 7.1.14 # Apache 2 prometheus-client # Apache 2 dnspython # ISC logfmter # MIT +psutil >= 5.4.6 # BSD3 diff --git a/tangostationcontrol/tangostationcontrol/common/net.py b/tangostationcontrol/tangostationcontrol/common/net.py new file mode 100644 index 0000000000000000000000000000000000000000..71118df433f02b9f54c5118918843140a5b9dd7a --- /dev/null +++ b/tangostationcontrol/tangostationcontrol/common/net.py @@ -0,0 +1,35 @@ +# Copyright (C) 2024 ASTRON (Netherlands Institute for Radio Astronomy) +# SPDX-License-Identifier: Apache-2.0 + +import psutil +from ipaddress import IPv4Address +from socket import AddressFamily + +__all__ = ["get_mac", "get_ip"] + + +def _get_interface_addresses(interface: str) -> list: + try: + return psutil.net_if_addrs()[interface] + except KeyError as e: + raise ValueError(f"Cannot find interface {interface}") from e + + +def get_mac(interface: str) -> str: + """Returns the MAC address of the given interface (f.e. 'eth0').""" + + for address in _get_interface_addresses(interface): + if address.family == AddressFamily.AF_PACKET: + return address.address + + raise ValueError(f"Cannot obtain MAC address of interface {interface}") + + +def get_ip(interface: str) -> IPv4Address: + """Returns the IPv4 address of the given interface (f.e. 'eth0').""" + + for address in _get_interface_addresses(interface): + if address.family == AddressFamily.AF_INET: + return IPv4Address(address.address) + + raise ValueError(f"Cannot obtain IP address of interface {interface}") diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py b/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py index 9a259373d79c60872f526b435ed7b0814832976a..f9032ffa4f19f93f1484b6b63bb5f82d362e722e 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py @@ -6,6 +6,8 @@ """ import numpy +from typing import Dict, List, Tuple + from attribute_wrapper.attribute_wrapper import AttributeWrapper from lofar_station_client.statistics.collector import BSTCollector from tango import AttrWriteType @@ -44,26 +46,11 @@ class BST(Statistics): # Device Properties # ----------------- - FPGA_bst_offload_hdr_eth_destination_mac_RW_default = device_property( - dtype="DevVarStringArray", mandatory=True - ) - - FPGA_bst_offload_hdr_ip_destination_address_RW_default = device_property( - dtype="DevVarStringArray", mandatory=True - ) - - FPGA_bst_offload_hdr_udp_destination_port_RW_default = device_property( - dtype="DevVarUShortArray", mandatory=True - ) - FPGA_bst_offload_enable_RW_default = device_property( dtype="DevVarBooleanArray", mandatory=False, default_value=[True] * N_pn ) FIRST_DEFAULT_SETTINGS = [ - "FPGA_bst_offload_hdr_eth_destination_mac_RW", - "FPGA_bst_offload_hdr_ip_destination_address_RW", - "FPGA_bst_offload_hdr_udp_destination_port_RW", # enable only after the offloading is configured correctly "FPGA_bst_offload_enable_RW", ] @@ -195,6 +182,11 @@ class BST(Statistics): # Overloaded functions # -------- + def get_defaults(self, properties: Dict[str, object]) -> List[Tuple[str, object]]: + return self._statistics_defaults("bst", properties) + super().get_defaults( + properties + ) + def _read_hardware_powered_fraction_R(self): """Read attribute which monitors the power""" return 1.0 * any(self.read_attribute("FPGA_bst_offload_enable_R")) diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/sst.py b/tangostationcontrol/tangostationcontrol/devices/sdp/sst.py index a237a3ac2473bc8f8d11c121937788b091da523f..9dc46dea2a3b8ede34f20f0117a99ebc74cfd3d5 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/sst.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/sst.py @@ -6,6 +6,8 @@ """ import numpy +from typing import Dict, List, Tuple + from attribute_wrapper.attribute_wrapper import AttributeWrapper from lofar_station_client.statistics.collector import SSTCollector @@ -47,18 +49,6 @@ class SST(Statistics): # Device Properties # ----------------- - FPGA_sst_offload_hdr_eth_destination_mac_RW_default = device_property( - dtype="DevVarStringArray", mandatory=True - ) - - FPGA_sst_offload_hdr_ip_destination_address_RW_default = device_property( - dtype="DevVarStringArray", mandatory=True - ) - - FPGA_sst_offload_hdr_udp_destination_port_RW_default = device_property( - dtype="DevVarUShortArray", mandatory=True - ) - FPGA_sst_offload_enable_RW_default = device_property( dtype="DevVarBooleanArray", mandatory=False, default_value=[True] * N_pn ) @@ -68,9 +58,6 @@ class SST(Statistics): ) FIRST_DEFAULT_SETTINGS = [ - "FPGA_sst_offload_hdr_eth_destination_mac_RW", - "FPGA_sst_offload_hdr_ip_destination_address_RW", - "FPGA_sst_offload_hdr_udp_destination_port_RW", "FPGA_sst_offload_weighted_subbands_RW", # enable only after the offloading is configured correctly "FPGA_sst_offload_enable_RW", @@ -222,6 +209,11 @@ class SST(Statistics): # Overloaded functions # -------- + def get_defaults(self, properties: Dict[str, object]) -> List[Tuple[str, object]]: + return self._statistics_defaults("sst", properties) + super().get_defaults( + properties + ) + def _read_hardware_powered_fraction_R(self): """Read attribute which monitors the power""" return 1.0 * any(self.read_attribute("FPGA_sst_offload_enable_R")) diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/statistics.py b/tangostationcontrol/tangostationcontrol/devices/sdp/statistics.py index 8aba6e1b3878637d7fda872ed7cafa19515923d5..5817063867a261fb5b5d050b16d5d2b273f45dd4 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/statistics.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/statistics.py @@ -9,13 +9,15 @@ import asyncio import logging import numpy +from typing import Dict from attribute_wrapper.attribute_wrapper import AttributeWrapper # PyTango imports from tango.server import device_property from tangostationcontrol.clients.statistics.client import StatisticsClient -from tangostationcontrol.common.constants import MAX_ETH_FRAME_SIZE +from tangostationcontrol.common.constants import MAX_ETH_FRAME_SIZE, N_pn from tangostationcontrol.common.lofar_logging import log_exceptions +from tangostationcontrol.common.net import get_mac, get_ip from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice from tangostationcontrol.metrics import device_metrics @@ -48,6 +50,10 @@ class Statistics(OPCUADevice): Statistics_Client_TCP_Port = device_property(dtype="DevUShort", mandatory=True) + Statistics_Client_UDP_Interface = device_property( + dtype="DevString", mandatory=False, default_value="eth0" + ) + # ---------- # Attributes # ---------- @@ -155,6 +161,23 @@ class Statistics(OPCUADevice): datatype=str, ) + @staticmethod + def _statistics_defaults( + statistics_type: str, properties: Dict[str, object] + ) -> Dict[str, object]: + interface = properties["Statistics_Client_UDP_Interface"] + mac = get_mac(interface) + ip = str(get_ip(interface)) + port = properties["Statistics_Client_UDP_Port"] + + prefix = f"FPGA_{statistics_type}_offload_hdr" + + return [ + (f"{prefix}_eth_destination_mac_RW", [mac] * N_pn), + (f"{prefix}_ip_destination_address_RW", [ip] * N_pn), + (f"{prefix}_udp_destination_port_RW", [port] * N_pn), + ] + # -------- # Overloaded functions # -------- diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/xst.py b/tangostationcontrol/tangostationcontrol/devices/sdp/xst.py index c304dcfe0d56afcaed574c8aa6a728bed0711861..8be377e788e66ff10d67243dc76e9348a9072691 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/xst.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/xst.py @@ -6,6 +6,8 @@ """ import numpy +from typing import Dict, List, Tuple + from attribute_wrapper.attribute_wrapper import AttributeWrapper from lofar_station_client.statistics.collector import XSTCollector from tango import AttrWriteType @@ -64,18 +66,6 @@ class XST(Statistics): # Device Properties # ----------------- - FPGA_xst_offload_hdr_eth_destination_mac_RW_default = device_property( - dtype="DevVarStringArray", mandatory=True - ) - - FPGA_xst_offload_hdr_ip_destination_address_RW_default = device_property( - dtype="DevVarStringArray", mandatory=True - ) - - FPGA_xst_offload_hdr_udp_destination_port_RW_default = device_property( - dtype="DevVarUShortArray", mandatory=True - ) - FPGA_xst_processing_enable_RW_default = device_property( dtype="DevVarBooleanArray", mandatory=False, default_value=[True] * N_pn ) @@ -99,11 +89,9 @@ class XST(Statistics): ) FIRST_DEFAULT_SETTINGS = [ - "FPGA_xst_offload_hdr_eth_destination_mac_RW", - "FPGA_xst_offload_hdr_ip_destination_address_RW", - "FPGA_xst_offload_hdr_udp_destination_port_RW", "FPGA_xst_subband_select_RW", "FPGA_xst_integration_interval_RW", + "FPGA_xst_ring_nof_transport_hops_RW", # enable only after the offloading is configured correctly "FPGA_xst_offload_enable_RW", ] @@ -722,6 +710,11 @@ class XST(Statistics): # Overloaded functions # -------- + def get_defaults(self, properties: Dict[str, object]) -> List[Tuple[str, object]]: + return self._statistics_defaults("xst", properties) + super().get_defaults( + properties + ) + def _read_hardware_powered_fraction_R(self): """Read attribute which monitors the power"""