From f0aedc7612444e56daf6c34bfb7e11c446fd776f Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Fri, 8 Apr 2016 14:17:13 +0000
Subject: [PATCH] Task #8887: Updated qpid configuration for db, renamed
 population script

---
 .gitattributes                                |  2 +-
 .../QPIDInfrastructure/bin/cep4_config.sh     | 12 ----
 .../QPIDInfrastructure/bin/populateDB.sh      | 55 +++++++++++++++++++
 3 files changed, 56 insertions(+), 13 deletions(-)
 delete mode 100755 SAS/ResourceAssignment/QPIDInfrastructure/bin/cep4_config.sh
 create mode 100755 SAS/ResourceAssignment/QPIDInfrastructure/bin/populateDB.sh

diff --git a/.gitattributes b/.gitattributes
index 492376a1782..2831904f228 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -4981,10 +4981,10 @@ SAS/ResourceAssignment/QPIDInfrastructure/CMakeLists.txt -text
 SAS/ResourceAssignment/QPIDInfrastructure/README -text
 SAS/ResourceAssignment/QPIDInfrastructure/bin/CMakeLists.txt -text
 SAS/ResourceAssignment/QPIDInfrastructure/bin/addtoQPIDDB.py -text
-SAS/ResourceAssignment/QPIDInfrastructure/bin/cep4_config.sh -text
 SAS/ResourceAssignment/QPIDInfrastructure/bin/compareQPIDwithDB.py -text
 SAS/ResourceAssignment/QPIDInfrastructure/bin/configQPIDfromDB.py -text
 SAS/ResourceAssignment/QPIDInfrastructure/bin/gatherfrombrokers.sh -text
+SAS/ResourceAssignment/QPIDInfrastructure/bin/populateDB.sh -text
 SAS/ResourceAssignment/QPIDInfrastructure/bin/qpidinfra_dump.sql -text
 SAS/ResourceAssignment/QPIDInfrastructure/bin/route_to_struct.py -text
 SAS/ResourceAssignment/QPIDInfrastructure/lib/CMakeLists.txt -text
diff --git a/SAS/ResourceAssignment/QPIDInfrastructure/bin/cep4_config.sh b/SAS/ResourceAssignment/QPIDInfrastructure/bin/cep4_config.sh
deleted file mode 100755
index 901b43b95a3..00000000000
--- a/SAS/ResourceAssignment/QPIDInfrastructure/bin/cep4_config.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-for tnode in head{01..02}.cep4.lofar
-do
-for fnode in cpu{01..50}.cep4.lofar
-do
-    ./addtoQPIDDB.py -b $fnode -q lofar.task.feedback.dataproducts -f $tnode -e lofar.default.bus
-done
-./addtoQPIDDB.py -b$tnode -q lofar.task.feedback.dataproducts -f ccu001.control.lofar -e lofar.default.bus
-done
-
-
diff --git a/SAS/ResourceAssignment/QPIDInfrastructure/bin/populateDB.sh b/SAS/ResourceAssignment/QPIDInfrastructure/bin/populateDB.sh
new file mode 100755
index 00000000000..6e2edc7f802
--- /dev/null
+++ b/SAS/ResourceAssignment/QPIDInfrastructure/bin/populateDB.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+PROD=false
+
+# Define systems to use
+if $PROD; then
+  CCU=ccu001.control.lofar
+  MCU=mcu001.control.lofar
+  SCU=scu001.control.lofar
+else
+  CCU=ccu099.control.lofar
+  MCU=mcu099.control.lofar
+  SCU=scu099.control.lofar
+fi
+
+# -----------------------------------------
+#   Queues for processing feedback
+# -----------------------------------------
+
+# cpuXX.cep4 -> headXX.cep4 -> ccu001
+for tnode in head{01..02}.cep4.control.lofar
+do
+  for fnode in cpu{01..50}.cep4.control.lofar
+  do
+    addtoQPIDDB.py --broker $fnode --queue lofar.task.feedback.dataproducts --federation $tnode
+    addtoQPIDDB.py --broker $fnode --queue lofar.task.feedback.processing --federation $tnode
+    addtoQPIDDB.py --broker $fnode --queue lofar.task.feedback.state --federation $tnode
+  done
+
+  addtoQPIDDB.py --broker $tnode --queue lofar.task.feedback.dataproducts --federation $CCU
+  addtoQPIDDB.py --broker $tnode --queue lofar.task.feedback.processing --federation $CCU
+  addtoQPIDDB.py --broker $tnode --queue lofar.task.feedback.state --federation $CCU
+done
+
+# -----------------------------------------
+#   Exchanges for ResourceAssignment
+# -----------------------------------------
+addtoQPIDDB.py --broker $SCU --exchange lofar.ra.command
+addtoQPIDDB.py --broker $SCU --exchange lofar.ra.notification
+addtoQPIDDB.py --broker $SCU --exchange lofar.otdb.command
+addtoQPIDDB.py --broker $SCU --exchange lofar.otdb.notification
+addtoQPIDDB.py --broker $SCU --exchange lofar.ssdb.command
+addtoQPIDDB.py --broker $SCU --exchange lofar.ssdb.notification
+
+# cpuXX.cep4 -> headXX.cep4 -> scu001
+for tnode in head{01..02}.cep4.control.lofar
+do
+  for fnode in cpu{01..50}.cep4.control.lofar
+  do
+    addtoQPIDDB.py --broker $fnode --exchange lofar.otdb.command --federation $tnode
+  done
+
+  addtoQPIDDB.py --broker $tnode --exchange lofar.otdb.command --federation $SCU
+done
+
-- 
GitLab