Skip to content
Snippets Groups Projects
Commit 488634ce authored by Arno Schoenmakers's avatar Arno Schoenmakers
Browse files

Task #1771: Add install of OTDB component files (in etc/otdb) and SQL files...

Task #1771: Add install of OTDB component files (in etc/otdb) and SQL files (in sbin/sql) to OTDB build; update of script fresh_database; reorganize Deployment by adding StaticMetaData, PVSS_Datapoints, OTDB_Comps as separate packages not as part of Deployment (only builds SAS database update executables now)
parent 57eb55fd
No related branches found
No related tags found
No related merge requests found
Showing
with 129 additions and 20 deletions
......@@ -3522,6 +3522,7 @@ SAS/OTB/scripts/src/stopOTBServer -text
SAS/OTDB/include/OTDB/DefaultTemplate.h -text
SAS/OTDB/sql/assignProcessType_func.sql -text
SAS/OTDB/sql/campaignAPI.sql -text
SAS/OTDB/sql/fresh_database -text
SAS/OTDB/sql/fresh_sas001_database.sh -text
SAS/OTDB/sql/getAllTaskID_func.sql -text
SAS/OTDB/sql/getBrokenHardware_func.sql -text
......
# - Create for each LOFAR package a variable containing the absolute path to
# its source directory.
#
# Generated by gen_LofarPackageList_cmake.sh at Thu Apr 26 08:44:53 UTC 2012
# Generated by gen_LofarPackageList_cmake.sh at Thu May 10 19:57:35 UTC 2012
#
# ---- DO NOT EDIT ----
#
......@@ -14,6 +14,12 @@
#
if(NOT DEFINED LOFAR_PACKAGE_LIST_INCLUDED)
set(LOFAR_PACKAGE_LIST_INCLUDED TRUE)
set(BBSKernel_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Calibration/BBSKernel)
set(BBSControl_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Calibration/BBSControl)
set(ExpIon_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Calibration/ExpIon)
set(pystationresponse_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Calibration/pystationresponse)
set(BBSTools_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Calibration/BBSTools)
set(ElementResponse_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Calibration/ElementResponse)
set(Calibration_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Calibration)
set(DP3_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3)
set(GSM_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/GSM)
......@@ -24,12 +30,6 @@ if(NOT DEFINED LOFAR_PACKAGE_LIST_INCLUDED)
set(Pipeline_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Pipeline)
set(PyBDSM_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/PyBDSM)
set(pyparmdb_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/pyparmdb)
set(BBSKernel_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Calibration/BBSKernel)
set(BBSControl_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Calibration/BBSControl)
set(ExpIon_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Calibration/ExpIon)
set(pystationresponse_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Calibration/pystationresponse)
set(BBSTools_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Calibration/BBSTools)
set(ElementResponse_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Calibration/ElementResponse)
set(DPPP_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3/DPPP)
set(AOFlagger_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3/AOFlagger)
set(SPW_Combine_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3/SPWCombine)
......@@ -104,6 +104,9 @@ if(NOT DEFINED LOFAR_PACKAGE_LIST_INCLUDED)
set(Deployment_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/Deployment)
set(Navigator2_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/Navigator2)
set(MACTools_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/Tools)
set(PVSS_Datapoints_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/Deployment/data/PVSS)
set(OTDB_Comps_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/Deployment/data/OTDB)
set(StaticMetaData_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/Deployment/data/StaticMetaData)
set(GCFTM_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/GCF/TM)
set(GCFPVSS_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/GCF/PVSS)
set(GCFRTDB_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/GCF/RTDB)
......@@ -117,6 +120,7 @@ if(NOT DEFINED LOFAR_PACKAGE_LIST_INCLUDED)
set(OTDB_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/OTDB)
set(OTB_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/OTB)
set(Beaminfo_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/Beaminfo)
set(OTDB_SQL_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/OTDB/sql)
set(jOTDB3_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/OTB/jOTDB3)
set(OTB-Java_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/OTB/OTB)
set(CCU_MAC_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SubSystems/CCU_MAC)
......
......@@ -6,3 +6,8 @@ lofar_add_package(APL) # Application subdirectory
lofar_add_package(Deployment) # Deployment related functions
lofar_add_package(Navigator2)
lofar_add_package(MACTools Tools)
lofar_add_package(PVSS_Datapoints Deployment/data/PVSS)
lofar_add_package(OTDB_Comps Deployment/data/OTDB)
lofar_add_package(StaticMetaData Deployment/data/StaticMetaData)
# $Id$
add_subdirectory(bin)
add_subdirectory(StaticMetaData)
add_subdirectory(PVSS)
#add_subdirectory(StaticMetaData)
#add_subdirectory(PVSS)
# $Id$
lofar_package(OTDB_COMPS 1.0)
install(PROGRAMS
create_OTDB_comps
createPICfile
loadComponents
loadPICtree
DESTINATION sbin)
file(GLOB otdb_comps
*.comp
*.list
*.base)
install(FILES
${otdb_comps}
DESTINATION etc/otdb)
# $Id$
lofar_package(PVSS_Datapoints 1.0)
install(PROGRAMS
create_db_files
DESTINATION sbin)
......
# $Id$
lofar_package(StaticMetaData 1.0)
install(PROGRAMS
createFiles
DESTINATION sbin)
......@@ -22,7 +24,6 @@ file(GLOB staticmeta_data
iHBADeltas/*.conf
AntennaFields/*.conf
PPSDelays/*.conf
# CalTables/*.dat
TBBConnections.dat)
install(FILES
${staticmeta_data}
......
......@@ -3,3 +3,5 @@
lofar_add_package(OTDB)
lofar_add_package(OTB)
lofar_add_package(Beaminfo)
lofar_add_package(OTDB_SQL OTDB/sql)
# $Id$
lofar_package(OTDB_SQL 1.0)
install(PROGRAMS
fresh_database
DESTINATION sbin)
file(GLOB otdb_sql_files
*.sql)
install(FILES
${otdb_sql_files}
DESTINATION sbin/sql)
#!/bin/bash
#
# Script to (re)create a OTDB database from scratch, using the sql statements
#
# Usage: fresh_database <DBNAME>
#
# Requires all sql-commands to be present in /opt/lofar/sbin/sql
# If existing, DROPS the current database
#
if [ -z $1 ]; then
echo "Usage: fresh_database <DBNAME>"
exit 0
fi
if [ "$1" == "-h" ]; then
echo "Usage: fresh_database <DBNAME>"
exit 0
fi
DBNAME=$1
DBUSER=postgres
DBHOST=localhost
DBPORT=5432
# The following commands assume that the user has super user privileges.
#
# Access to PostgreSQL databases is managed via the 'pg_hba.conf' file.
#
# Postgres should be told to listen to external TCP ports.
# Edit /sasdb/data/postgresq.conf
# to have the following stanzas:
#
# Listen_addresses = '*'
# Port = 5432
#
# Don't forget to restart Postgres after altering these files,
# as follows (Debian):
#
# pg_ctl start -D /sasdb/data -l /sasdb/data/pg_log/logfile
#
# Drop DB & USER. User DBUSER owns DBNAME, so we have to remove the database
# first!
# Note the '|| true' at the end. This ensures that the commands succeed,
# even if the database is not found.
echo " == Dropping database $DBNAME =="
echo dropdb --host $DBHOST --port $DBPORT --user postgres --echo $DBNAME || true
dropdb --host $DBHOST --port $DBPORT --user postgres --echo $DBNAME || true
# Create USER, DB, and add the 'plpgsql' language for stored procedures.
echo " == Creating new database $DBNAME =="
echo createdb --host $DBHOST --port $DBPORT --user postgres --owner $DBUSER --echo $DBNAME
createdb --host $DBHOST --port $DBPORT --user postgres --owner $DBUSER --echo $DBNAME
echo createlang --host $DBHOST --port $DBPORT --user postgres --dbname $DBNAME --echo "plpgsql"
createlang --host $DBHOST --port $DBPORT --user postgres --dbname $DBNAME --echo "plpgsql"
echo " == Creating new tables in $DBNAME =="
if [ -e /opt/lofar/sbin/sql/create_OTDB.sql ]; then
cd /opt/lofar/sbin/sql
echo psql -f create_OTDB.sql --host $DBHOST --port $DBPORT --user $DBUSER $DBNAME 2>&1 | grep ERROR | grep -v "does not exist"
psql -f create_OTDB.sql --host $DBHOST --port $DBPORT --user $DBUSER $DBNAME 2>&1 | grep ERROR | grep -v "does not exist"
else
echo "Cannot find /opt/lofar/sbin/sql/create_OTDB.sql; did you install this?"
fi
echo " == Done =="
# $Id$
lofar_package(CCU_MAC
DEPENDS CEPCU CUDaemons CURTDBDaemons Deployment Navigator2)
DEPENDS CEPCU CUDaemons CURTDBDaemons)
......@@ -2,4 +2,3 @@
lofar_package(CN_MAC
DEPENDS StationTest MACTools)
# $Id$
lofar_package(LCU_MAC
DEPENDS StationCU PIC PAC CUDaemons CURTDBDaemons Deployment Navigator2
AMC Firmware-Tools StationTest MACTools)
DEPENDS StationCU PIC PAC CUDaemons CURTDBDaemons
AMC Firmware-Tools MACTools StaticMetaData)
# $Id$
lofar_package(MCU_MAC
DEPENDS MainCU CUDaemons CURTDBDaemons Deployment Navigator2)
DEPENDS MainCU CUDaemons CURTDBDaemons)
# $Id$
lofar_package(Offline DEPENDS CEP MSLofar Deployment)
lofar_package(Offline DEPENDS CEP MSLofar StatticMetaData)
# $Id$
lofar_package(PVSS_DB
DEPENDS Deployment Navigator2)
DEPENDS PVSS_Datapoints Navigator2)
# $Id$
lofar_package(SAS_OTDB
DEPENDS OTB Deployment)
DEPENDS Deployment OTDB_Comps OTDB_SQL)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment