From a831574787fdbe8495c87298427c31f48f543e42 Mon Sep 17 00:00:00 2001 From: Chris Hyzer Date: Sun, 14 Nov 2021 18:14:21 -0500 Subject: [PATCH] GRP-3696: remove hsqldb from grouper --- Dockerfile | 7 ++-- .../tier-support/supervisord-hsqldb.conf | 10 ------ .../test/grouperContainerUnitTest.sh | 2 +- .../test/grouperContainerUnitTestDaemon.sh | 2 -- .../grouperContainerUnitTestQuickstart.sh | 7 ++-- .../test/grouperContainerUnitTestUi.sh | 1 - .../test/grouperContainerUnitTestUi2.sh | 1 - .../grouperContainerUnitTestUiSubimage.sh | 1 - container_files/usr-local-bin/libraryPrep.sh | 18 ----------- .../usr-local-bin/libraryRunCommand.sh | 1 - .../librarySetupFilesForProcess.sh | 32 ------------------- .../usr-local-bin/librarySetupPipe.sh | 11 ------- .../grouper/grouper.hibernate.properties | 2 -- .../conf/grouper.hibernate.properties | 2 -- 14 files changed, 6 insertions(+), 91 deletions(-) delete mode 100644 container_files/tier-support/supervisord-hsqldb.conf diff --git a/Dockerfile b/Dockerfile index 5c0b5004..72ab9998 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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/ @@ -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 ; \ diff --git a/container_files/tier-support/supervisord-hsqldb.conf b/container_files/tier-support/supervisord-hsqldb.conf deleted file mode 100644 index 0f65fb81..00000000 --- a/container_files/tier-support/supervisord-hsqldb.conf +++ /dev/null @@ -1,10 +0,0 @@ -[program:hsqldb] -__GROUPER_RUN_PROCESSES_AS_USERS__user=tomcat -directory=/opt/hsqldb -command=/usr/lib/jvm/java-1.8.0-amazon-corretto/bin/java -cp /opt/grouper/grouperWebapp/WEB-INF/lib/hsqldb-2.3.5.jar org.hsqldb.Server -port 9001 -database.0 file:/opt/hsqldb/grouperHSQL -dbname.0 grouper -stderr_logfile = /tmp/loghsqldb -stderr_logfile_maxbytes=0 -stdout_logfile = /tmp/loghsqldb -stdout_logfile_maxbytes=0 - - diff --git a/container_files/tier-support/test/grouperContainerUnitTest.sh b/container_files/tier-support/test/grouperContainerUnitTest.sh index fae4cd7d..8305ad4f 100644 --- a/container_files/tier-support/test/grouperContainerUnitTest.sh +++ b/container_files/tier-support/test/grouperContainerUnitTest.sh @@ -5,7 +5,7 @@ if [ "$#" -ne 4 ]; then exit 1 fi -expectedSuccesses=721 +expectedSuccesses=716 export containerName=$1 export imageName=$2 diff --git a/container_files/tier-support/test/grouperContainerUnitTestDaemon.sh b/container_files/tier-support/test/grouperContainerUnitTestDaemon.sh index bb8e5507..765dd709 100644 --- a/container_files/tier-support/test/grouperContainerUnitTestDaemon.sh +++ b/container_files/tier-support/test/grouperContainerUnitTestDaemon.sh @@ -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 "__" @@ -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 diff --git a/container_files/tier-support/test/grouperContainerUnitTestQuickstart.sh b/container_files/tier-support/test/grouperContainerUnitTestQuickstart.sh index 16afbb02..57325591 100644 --- a/container_files/tier-support/test/grouperContainerUnitTestQuickstart.sh +++ b/container_files/tier-support/test/grouperContainerUnitTestQuickstart.sh @@ -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 @@ -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 @@ -126,8 +124,7 @@ testContainerQuickstart() { sleep $globalSleepSecondsAfterRun - # one for hsqldb - assertNumberOfTomcatProcesses 2 + assertNumberOfTomcatProcesses 1 assertNumberOfApacheProcesses 5 assertNumberOfShibProcesses 0 diff --git a/container_files/tier-support/test/grouperContainerUnitTestUi.sh b/container_files/tier-support/test/grouperContainerUnitTestUi.sh index 0259521e..21d757ee 100644 --- a/container_files/tier-support/test/grouperContainerUnitTestUi.sh +++ b/container_files/tier-support/test/grouperContainerUnitTestUi.sh @@ -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" diff --git a/container_files/tier-support/test/grouperContainerUnitTestUi2.sh b/container_files/tier-support/test/grouperContainerUnitTestUi2.sh index bcc02e0e..01acfece 100644 --- a/container_files/tier-support/test/grouperContainerUnitTestUi2.sh +++ b/container_files/tier-support/test/grouperContainerUnitTestUi2.sh @@ -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" diff --git a/container_files/tier-support/test/grouperContainerUnitTestUiSubimage.sh b/container_files/tier-support/test/grouperContainerUnitTestUiSubimage.sh index ca44a46a..daafec7e 100644 --- a/container_files/tier-support/test/grouperContainerUnitTestUiSubimage.sh +++ b/container_files/tier-support/test/grouperContainerUnitTestUiSubimage.sh @@ -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 diff --git a/container_files/usr-local-bin/libraryPrep.sh b/container_files/usr-local-bin/libraryPrep.sh index 4b4685eb..62fdf847 100644 --- a/container_files/usr-local-bin/libraryPrep.sh +++ b/container_files/usr-local-bin/libraryPrep.sh @@ -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 @@ -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" @@ -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" diff --git a/container_files/usr-local-bin/libraryRunCommand.sh b/container_files/usr-local-bin/libraryRunCommand.sh index 8c07149d..d859e088 100644 --- a/container_files/usr-local-bin/libraryRunCommand.sh +++ b/container_files/usr-local-bin/libraryRunCommand.sh @@ -3,7 +3,6 @@ runCommand() { echo "grouperContainer; INFO: (libraryRunCommand.sh-runCommand) Start setting up remaining pipes" - setupPipe_hsqldbLog setupPipe_httpdLog setupPipe_shibdLog setupPipe_tomcatLog diff --git a/container_files/usr-local-bin/librarySetupFilesForProcess.sh b/container_files/usr-local-bin/librarySetupFilesForProcess.sh index 5e3fb295..493538d0 100644 --- a/container_files/usr-local-bin/librarySetupFilesForProcess.sh +++ b/container_files/usr-local-bin/librarySetupFilesForProcess.sh @@ -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 @@ -36,10 +12,6 @@ setupFilesForProcess_supervisor() { setupFilesForProcess() { - setupFilesForProcess_hsqldbVersions - - setupFilesForProcess_hsqldb - setupFilesForProcess_shib } @@ -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 @@ -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 diff --git a/container_files/usr-local-bin/librarySetupPipe.sh b/container_files/usr-local-bin/librarySetupPipe.sh index 664b27ba..4d8589cc 100644 --- a/container_files/usr-local-bin/librarySetupPipe.sh +++ b/container_files/usr-local-bin/librarySetupPipe.sh @@ -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 @@ -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 @@ -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 diff --git a/test-compose/configs-and-secrets/grouper/grouper.hibernate.properties b/test-compose/configs-and-secrets/grouper/grouper.hibernate.properties index 96abb4cd..1bcf6449 100644 --- a/test-compose/configs-and-secrets/grouper/grouper.hibernate.properties +++ b/test-compose/configs-and-secrets/grouper/grouper.hibernate.properties @@ -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 diff --git a/test-compose/data/container_files/conf/grouper.hibernate.properties b/test-compose/data/container_files/conf/grouper.hibernate.properties index 154b8ebf..7e4f1706 100644 --- a/test-compose/data/container_files/conf/grouper.hibernate.properties +++ b/test-compose/data/container_files/conf/grouper.hibernate.properties @@ -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