Skip to content

Commit

Permalink
GRP-3696: remove hsqldb from grouper
Browse files Browse the repository at this point in the history
  • Loading branch information
mchyzer committed Nov 14, 2021
1 parent a7dee34 commit a831574
Show file tree
Hide file tree
Showing 14 changed files with 6 additions and 91 deletions.
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ RUN groupadd -r tomcat \
&& useradd -r -m -s /sbin/nologin -g tomcat tomcat \
&& rm -f /etc/alternatives/java \
&& ln -s $JAVA_HOME/bin/java /etc/alternatives/java \
&& mkdir -p /opt/tomee/conf/Catalina/localhost/ \
&& mkdir /opt/hsqldb
&& mkdir -p /opt/tomee/conf/Catalina/localhost/

COPY container_files/tier-support/ /opt/tier-support/
COPY container_files/usr-local-bin/ /usr/local/bin/
Expand All @@ -99,8 +98,8 @@ RUN cp /dev/null /etc/httpd/conf.d/ssl.conf
# this is to improve openshift
RUN touch /opt/grouper/grouperEnv.sh \
&& mkdir -p /opt/tomee/work/Catalina/localhost/ \
&& chown -R tomcat:root /opt/grouper/ /etc/httpd/conf/ /home/tomcat/ /opt/tomee/ /usr/local/bin /etc/httpd/conf.d/ /opt/hsqldb/ /opt/tier-support/ \
&& chmod -R g+rwx /opt/grouper/ /etc/httpd/conf/ /home/tomcat/ /opt/tomee/ /usr/local/bin /etc/httpd/conf.d/ /opt/hsqldb/ /opt/tier-support/
&& chown -R tomcat:root /opt/grouper/ /etc/httpd/conf/ /home/tomcat/ /opt/tomee/ /usr/local/bin /etc/httpd/conf.d/ /opt/tier-support/ \
&& chmod -R g+rwx /opt/grouper/ /etc/httpd/conf/ /home/tomcat/ /opt/tomee/ /usr/local/bin /etc/httpd/conf.d/ /opt/tier-support/

# keep backup of files
RUN mkdir -p /opt/tier-support/originalFiles ; \
Expand Down
10 changes: 0 additions & 10 deletions container_files/tier-support/supervisord-hsqldb.conf

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if [ "$#" -ne 4 ]; then
exit 1
fi

expectedSuccesses=721
expectedSuccesses=716

export containerName=$1
export imageName=$2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ testContainerDaemon() {
assertFileNotContains /opt/tier-support/supervisord.conf "program:shibbolethsp"
assertFileContains /opt/tier-support/supervisord.conf "program:tomee"
assertFileNotContains /opt/tier-support/supervisord.conf "program:httpd"
assertFileNotContains /opt/tier-support/supervisord.conf "program:hsqldb"
assertFileNotContains /opt/tier-support/supervisord.conf "user=shibd"
assertFileNotContains /opt/tier-support/supervisord.conf "__"

Expand Down Expand Up @@ -68,7 +67,6 @@ testContainerDaemon() {
assertEnvVar GROUPER_WS "false"
assertEnvVar GROUPER_WS_GROUPER_AUTH "false"

# one for hsqldb
assertNumberOfTomcatProcesses 1
# bad cert apache wont start
assertNumberOfApacheProcesses 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ testContainerQuickstart() {
assertFileNotContains /opt/tier-support/supervisord.conf "program:shibbolethsp"
assertFileContains /opt/tier-support/supervisord.conf "program:tomee"
assertFileContains /opt/tier-support/supervisord.conf "program:httpd"
assertFileContains /opt/tier-support/supervisord.conf "program:hsqldb"
assertFileNotContains /opt/tier-support/supervisord.conf "user=shibd"
assertFileNotContains /opt/tier-support/supervisord.conf "__"
assertFileNotContains /etc/httpd/conf.d/ssl-enabled.conf cachain.pem
Expand Down Expand Up @@ -80,8 +79,7 @@ testContainerQuickstart() {
assertEnvVar GROUPER_WS "true"
assertEnvVar GROUPER_WS_GROUPER_AUTH "true"

# one for hsqldb
assertNumberOfTomcatProcesses 2
assertNumberOfTomcatProcesses 1
# bad cert apache wont start
assertNumberOfApacheProcesses 5
assertNumberOfShibProcesses 0
Expand Down Expand Up @@ -126,8 +124,7 @@ testContainerQuickstart() {

sleep $globalSleepSecondsAfterRun

# one for hsqldb
assertNumberOfTomcatProcesses 2
assertNumberOfTomcatProcesses 1
assertNumberOfApacheProcesses 5
assertNumberOfShibProcesses 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ testContainerUi() {
assertFileContains /opt/tier-support/supervisord.conf "program:tomee"
assertFileContains /opt/tier-support/supervisord.conf "program:httpd"
assertFileContains /opt/tier-support/supervisord.conf "user=shibd"
assertFileNotContains /opt/tier-support/supervisord.conf "program:hsqldb"
assertFileNotContains /opt/tier-support/supervisord.conf "__"

assertFileContains /etc/httpd/conf.d/ssl-enabled.conf "SSLUseStapling on"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ testContainerUi2() {
assertFileContains /opt/tier-support/supervisord.conf "program:tomee"
assertFileContains /opt/tier-support/supervisord.conf "program:httpd"
assertFileContains /opt/tier-support/supervisord.conf "user=shibd"
assertFileNotContains /opt/tier-support/supervisord.conf "program:hsqldb"
assertFileNotContains /opt/tier-support/supervisord.conf "__"

assertFileContains /opt/tomee/conf/server.xml "maxHeaderCount"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ testContainerUiSubimage() {
assertFileContains /opt/tier-support/supervisord.conf "program:tomee"
assertFileContains /opt/tier-support/supervisord.conf "program:httpd"
assertFileContains /opt/tier-support/supervisord.conf "user=shibd"
assertFileNotContains /opt/tier-support/supervisord.conf "program:hsqldb"
assertFileNotContains /opt/tier-support/supervisord.conf "__"
assertFileNotContains /etc/httpd/conf.d/ssl-enabled.conf cachain.pem
assertFileNotContains /etc/httpd/conf.d/ssl-enabled.conf /etc/pki/tls/certs/localhost.crt
Expand Down
18 changes: 0 additions & 18 deletions container_files/usr-local-bin/libraryPrep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ prep_quickstart() {

if [ "$GROUPER_RUN_TOMCAT_NOT_SUPERVISOR" != "true" ]; then
echo "grouperContainer; INFO: (libraryPrep.sh-prep_quickstart) GROUPER_RUN_TOMCAT_NOT_SUPERVISOR is not true"
if [ -z "$GROUPER_RUN_HSQLDB" ]; then
echo "grouperContainer; INFO: (libraryPrep.sh-prep_quickstart) export GROUPER_RUN_HSQLDB=true"
export GROUPER_RUN_HSQLDB=true
fi
if [ -z "$GROUPER_SELF_SIGNED_CERT" ] && [ "$GROUPER_OPENSHIFT" != "true" ]; then
echo "grouperContainer; INFO: (libraryPrep.sh-prep_quickstart) export GROUPER_SELF_SIGNED_CERT=true"
export GROUPER_SELF_SIGNED_CERT=true
Expand All @@ -42,14 +38,6 @@ prep_quickstart() {
echo "grouperContainer; INFO: (libraryPrep.sh-prep_quickstart) export GROUPER_START_DELAY_SECONDS='10'"
export GROUPER_START_DELAY_SECONDS='10'
fi
if [ -z "$GROUPER_DATABASE_URL_FILE" ] && [ -z "$GROUPER_DATABASE_URL" ]; then
echo "grouperContainer; INFO: (libraryPrep.sh-prep_quickstart) export GROUPER_DATABASE_URL=jdbc:hsqldb:hsql://localhost:9001/grouper"
export GROUPER_DATABASE_URL=jdbc:hsqldb:hsql://localhost:9001/grouper
fi
if [ -z "$GROUPER_DATABASE_USERNAME_FILE" ] && [ -z "$GROUPER_DATABASE_USERNAME" ]; then
echo "grouperContainer; INFO: (libraryPrep.sh-prep_quickstart) export GROUPER_DATABASE_USERNAME=sa"
export GROUPER_DATABASE_USERNAME=sa
fi
fi
if [ -z "$GROUPER_RUN_SHIB_SP" ] && [ "$GROUPER_OPENSHIFT" != "true" ]; then
echo "grouperContainer; INFO: (libraryPrep.sh-prep_quickstart) export GROUPER_RUN_SHIB_SP=false"
Expand Down Expand Up @@ -238,12 +226,6 @@ prep_initDeprecatedEnvVars() {
export GROUPER_RUN_TOMEE="$RUN_TOMEE"
fi

if [ ! -z "$RUN_HSQLDB" ] && [ -z "$GROUPER_RUN_HSQLDB" ]
then
echo "grouperContainer; INFO: (libraryPrep.sh-prep_initDeprecatedEnvVars) export GROUPER_RUN_HSQLDB=$RUN_HSQLDB"
export GROUPER_RUN_HSQLDB="$RUN_HSQLDB"
fi

if [ ! -z "$SELF_SIGNED_CERT" ] && [ -z "$GROUPER_SELF_SIGNED_CERT" ]
then
echo "grouperContainer; INFO: (libraryPrep.sh-prep_initDeprecatedEnvVars) export GROUPER_SELF_SIGNED_CERT=$SELF_SIGNED_CERT"
Expand Down
1 change: 0 additions & 1 deletion container_files/usr-local-bin/libraryRunCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
runCommand() {

echo "grouperContainer; INFO: (libraryRunCommand.sh-runCommand) Start setting up remaining pipes"
setupPipe_hsqldbLog
setupPipe_httpdLog
setupPipe_shibdLog
setupPipe_tomcatLog
Expand Down
32 changes: 0 additions & 32 deletions container_files/usr-local-bin/librarySetupFilesForProcess.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
#!/bin/bash

setupFilesForProcess_hsqldb() {
# construct the supervisord file based on FLAGS passed in or what was in CMD
if [ "$GROUPER_RUN_HSQLDB" = "true" ]
then
cat /opt/tier-support/supervisord-hsqldb.conf >> /opt/tier-support/supervisord.conf
returnCode=$?
echo "grouperContainer; INFO: (librarySetupFilesForProcess.sh-setupFilesForProcess_hsqldb) cat /opt/tier-support/supervisord-hsqldb.conf >> /opt/tier-support/supervisord.conf , result: $returnCode"
if [ $returnCode != 0 ]; then exit $returnCode; fi
fi
}

setupFilesForProcess_hsqldbVersions() {

# tomee hsql must match the grouper one, and the version cannot be 2.3.2 since it is query bugs (unit tests fail)
rm -f /opt/tomee/lib/hsqldb-*.jar
returnCode=$?
echo "grouperContainer; INFO: (librarySetupFilesForProcess.sh-setupFilesForProcess_hsqldbVersions) rm -f /opt/tomee/lib/hsqldb-*.jar , result: $returnCode"
if [ $returnCode != 0 ]; then exit $returnCode; fi
cp /opt/grouper/grouperWebapp/WEB-INF/lib/hsqldb-*.jar /opt/tomee/lib/
returnCode=$?
echo "grouperContainer; INFO: (librarySetupFilesForProcess.sh-setupFilesForProcess_hsqldbVersions) cp /opt/grouper/grouperWebapp/WEB-INF/lib/hsqldb-*.jar /opt/tomee/lib/ , result: $returnCode"
if [ $returnCode != 0 ]; then exit $returnCode; fi
}

setupFilesForProcess_supervisor() {

if [ "$GROUPER_RUN_TOMCAT_NOT_SUPERVISOR" != "true" ]; then
Expand All @@ -36,10 +12,6 @@ setupFilesForProcess_supervisor() {

setupFilesForProcess() {

setupFilesForProcess_hsqldbVersions

setupFilesForProcess_hsqldb

setupFilesForProcess_shib

}
Expand Down Expand Up @@ -107,8 +79,6 @@ setupFilesForProcess_shib() {
setupFilesForProcess_unsetAll() {

unset -f setupFilesForProcess
unset -f setupFilesForProcess_hsqldb
unset -f setupFilesForProcess_hsqldbVersions
unset -f setupFilesForProcess_shib
unset -f setupFilesForProcess_supervisor
unset -f setupFilesForProcess_supervisorFinal
Expand All @@ -119,8 +89,6 @@ setupFilesForProcess_unsetAll() {
setupFilesForProcess_exportAll() {

export -f setupFilesForProcess
export -f setupFilesForProcess_hsqldb
export -f setupFilesForProcess_hsqldbVersions
export -f setupFilesForProcess_shib
export -f setupFilesForProcess_supervisor
export -f setupFilesForProcess_supervisorFinal
Expand Down
11 changes: 0 additions & 11 deletions container_files/usr-local-bin/librarySetupPipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ setupPipe_tomcatAccessLog() {
fi
}

setupPipe_hsqldbLog() {
if [ "$GROUPER_USE_PIPES" == "true" ]; then
if [ "$GROUPER_RUN_HSQLDB" = "true" ]; then
setupPipe /tmp/loghsqldb
(cat <> /tmp/loghsqldb | awk -v ENV="$ENV" -v UT="$USERTOKEN" '{printf "hsqldb;console;%s;%s;%s\n", ENV, UT, $0; fflush()}' &>/tmp/logpipe) &
fi
fi
}

setupPipe_supervisordLog() {
if [ "$GROUPER_USE_PIPES" == "true" ]; then
setupPipe /tmp/logsuperd
Expand All @@ -90,7 +81,6 @@ setupPipe_unsetAll() {

unset -f setupPipe
unset -f setupPipe_grouperLog
unset -f setupPipe_hsqldbLog
unset -f setupPipe_httpdLog
unset -f setupPipe_logging
unset -f setupPipe_shibdLog
Expand All @@ -105,7 +95,6 @@ setupPipe_exportAll() {

export -f setupPipe
export -f setupPipe_grouperLog
export -f setupPipe_hsqldbLog
export -f setupPipe_httpdLog
export -f setupPipe_logging
export -f setupPipe_shibdLog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
# e.g. mysql: jdbc:mysql://localhost:3306/grouper
# e.g. p6spy (log sql): [use the URL that your DB requires]
# e.g. oracle: jdbc:oracle:thin:@server.school.edu:1521:sid
# e.g. hsqldb (a): jdbc:hsqldb:dist/run/grouper;create=true
# e.g. hsqldb (b): jdbc:hsqldb:hsql://localhost:9001/grouper
# e.g. postgres: jdbc:postgresql://localhost:5432/database
# e.g. mssql: jdbc:sqlserver://localhost:3280;databaseName=grouper
hibernate.connection.url = jdbc:mysql://data:3306/grouper?CharSet=utf8&useUnicode=true&characterEncoding=utf8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
# e.g. mysql: jdbc:mysql://localhost:3306/grouper
# e.g. p6spy (log sql): [use the URL that your DB requires]
# e.g. oracle: jdbc:oracle:thin:@server.school.edu:1521:sid
# e.g. hsqldb (a): jdbc:hsqldb:dist/run/grouper;create=true
# e.g. hsqldb (b): jdbc:hsqldb:hsql://localhost:9001/grouper
# e.g. postgres: jdbc:postgresql://localhost:5432/database
# e.g. mssql: jdbc:sqlserver://localhost:3280;databaseName=grouper
hibernate.connection.url = jdbc:mysql://localhost:3306/grouper?CharSet=utf8&useUnicode=true&characterEncoding=utf8
Expand Down

0 comments on commit a831574

Please sign in to comment.