From d8472534f2df5aac2467f7679452aa252cafdc5b Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Wed, 17 Mar 2021 16:01:36 +0100 Subject: [PATCH 01/34] feature(appserver): update to Payara 5.2021.1 #7700 --- doc/release-notes/7700-upgrade-payara.md | 6 ++++++ pom.xml | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 doc/release-notes/7700-upgrade-payara.md diff --git a/doc/release-notes/7700-upgrade-payara.md b/doc/release-notes/7700-upgrade-payara.md new file mode 100644 index 00000000000..370e4def9fc --- /dev/null +++ b/doc/release-notes/7700-upgrade-payara.md @@ -0,0 +1,6 @@ +### Payara 5.2021.1 (or Higher) Required + +Some changes in this release require an upgrade to Payara 5.2021.1 or higher. + +Instructions on how to update can be found in the +[Payara documentation](https://docs.payara.fish/community/docs/5.2021.1/documentation/user-guides/upgrade-payara.html) \ No newline at end of file diff --git a/pom.xml b/pom.xml index ed7e800f797..98b5e1967f0 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ false 8.0.0 - 5.2020.6 + 5.2021.1 42.2.19 1.11.762 1.2 @@ -58,6 +58,18 @@ + + payara-nexus-artifacts + Payara Nexus Artifacts + https://nexus.payara.fish/repository/payara-artifacts + + true + + + false + + + payara-patched-externals Payara Patched Externals From 0172cde4041648cc17c78302572e18522390668f Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Thu, 18 Mar 2021 16:59:03 +0100 Subject: [PATCH 02/34] feature(appserver): update Docker AIO + Vagrant to Payara 5.2021.1 #7700 --- conf/docker-aio/0prep_deps.sh | 4 ++-- conf/docker-aio/c8.dockerfile | 2 +- downloads/download.sh | 2 +- scripts/vagrant/setup.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/conf/docker-aio/0prep_deps.sh b/conf/docker-aio/0prep_deps.sh index 5bf44bfbe82..04706dad342 100755 --- a/conf/docker-aio/0prep_deps.sh +++ b/conf/docker-aio/0prep_deps.sh @@ -4,10 +4,10 @@ if [ ! -d dv/deps ]; then fi wdir=`pwd` -if [ ! -e dv/deps/payara-5.2020.6.zip ]; then +if [ ! -e dv/deps/payara-5.2021.1.zip ]; then echo "payara dependency prep" # no more fiddly patching :) - wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2020.6/payara-5.2020.6.zip -O dv/deps/payara-5.2020.6.zip + wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.1/payara-5.2021.1.zip -O dv/deps/payara-5.2021.1.zip fi if [ ! -e dv/deps/solr-8.8.1dv.tgz ]; then diff --git a/conf/docker-aio/c8.dockerfile b/conf/docker-aio/c8.dockerfile index 92c3dc24d56..d06918279f3 100644 --- a/conf/docker-aio/c8.dockerfile +++ b/conf/docker-aio/c8.dockerfile @@ -18,7 +18,7 @@ COPY disableipv6.conf /etc/sysctl.d/ RUN rm /etc/httpd/conf/* COPY httpd.conf /etc/httpd/conf RUN cd /opt ; tar zxf /tmp/dv/deps/solr-8.8.1dv.tgz -RUN cd /opt ; unzip /tmp/dv/deps/payara-5.2020.6.zip ; ln -s /opt/payara5 /opt/glassfish4 +RUN cd /opt ; unzip /tmp/dv/deps/payara-5.2021.1.zip ; ln -s /opt/payara5 /opt/glassfish4 # this copy of domain.xml is the result of running `asadmin set server.monitoring-service.module-monitoring-levels.jvm=LOW` on a default glassfish installation (aka - enable the glassfish REST monitir endpoint for the jvm` # this dies under Java 11, do we keep it? diff --git a/downloads/download.sh b/downloads/download.sh index 8c2b51dd4c7..a4e132e4a40 100755 --- a/downloads/download.sh +++ b/downloads/download.sh @@ -1,5 +1,5 @@ #!/bin/sh -curl -L -O https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2020.6/payara-5.2020.6.zip +curl -L -O https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.1/payara-5.2021.1.zip curl -L -O https://archive.apache.org/dist/lucene/solr/8.8.1/solr-8.8.1.tgz curl -L -O https://search.maven.org/remotecontent?filepath=org/jboss/weld/weld-osgi-bundle/2.2.10.Final/weld-osgi-bundle-2.2.10.Final-glassfish4.jar curl -s -L http://sourceforge.net/projects/schemaspy/files/schemaspy/SchemaSpy%205.0.0/schemaSpy_5.0.0.jar/download > schemaSpy_5.0.0.jar diff --git a/scripts/vagrant/setup.sh b/scripts/vagrant/setup.sh index 14f12cea692..f48895187eb 100644 --- a/scripts/vagrant/setup.sh +++ b/scripts/vagrant/setup.sh @@ -53,7 +53,7 @@ SOLR_USER=solr echo "Ensuring Unix user '$SOLR_USER' exists" useradd $SOLR_USER || : DOWNLOAD_DIR='/dataverse/downloads' -PAYARA_ZIP="$DOWNLOAD_DIR/payara-5.2020.6.zip" +PAYARA_ZIP="$DOWNLOAD_DIR/payara-5.2021.1.zip" SOLR_TGZ="$DOWNLOAD_DIR/solr-8.8.1.tgz" if [ ! -f $PAYARA_ZIP ] || [ ! -f $SOLR_TGZ ]; then echo "Couldn't find $PAYARA_ZIP or $SOLR_TGZ! Running download script...." From 079be6dad197b4623fcb3f9a9e656192c931cc1e Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Thu, 18 Mar 2021 17:00:34 +0100 Subject: [PATCH 03/34] doc(appserver): change docs to refer to Payara 5.2021.1 #7700 --- doc/sphinx-guides/source/developers/dev-environment.rst | 4 ++-- doc/sphinx-guides/source/installation/prerequisites.rst | 6 +++--- .../edu/harvard/iq/dataverse/util/DataSourceProducer.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/sphinx-guides/source/developers/dev-environment.rst b/doc/sphinx-guides/source/developers/dev-environment.rst index ed1849e6059..45467ee23b1 100755 --- a/doc/sphinx-guides/source/developers/dev-environment.rst +++ b/doc/sphinx-guides/source/developers/dev-environment.rst @@ -85,9 +85,9 @@ To install Payara, run the following commands: ``cd /usr/local`` -``sudo curl -O -L https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2020.6/payara-5.2020.6.zip`` +``sudo curl -O -L https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.1/payara-5.2021.1.zip`` -``sudo unzip payara-5.2020.6.zip`` +``sudo unzip payara-5.2021.1.zip`` ``sudo chown -R $USER /usr/local/payara5`` diff --git a/doc/sphinx-guides/source/installation/prerequisites.rst b/doc/sphinx-guides/source/installation/prerequisites.rst index 435c5c59b61..870f95a20b9 100644 --- a/doc/sphinx-guides/source/installation/prerequisites.rst +++ b/doc/sphinx-guides/source/installation/prerequisites.rst @@ -44,7 +44,7 @@ On RHEL/CentOS you can make Java 11 the default with the ``alternatives`` comman Payara ------ -Payara 5.2020.6 is recommended. Newer versions might work fine, regular updates are recommended. +Payara 5.2021.1 is recommended. Newer versions might work fine, regular updates are recommended. Installing Payara ================= @@ -55,8 +55,8 @@ Installing Payara - Download and install Payara (installed in ``/usr/local/payara5`` in the example commands below):: - # wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2020.6/payara-5.2020.6.zip - # unzip payara-5.2020.6.zip + # wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.1/payara-5.2021.1.zip + # unzip payara-5.2021.1.zip # mv payara5 /usr/local If you intend to install and run Payara under a service account (and we hope you do), chown -R the Payara hierarchy to root to protect it but give the service account access to the below directories: diff --git a/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java b/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java index 02ba331cdd5..aa6068ef9f2 100644 --- a/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java +++ b/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java @@ -38,7 +38,7 @@ //}) // // ... but at this time we don't think we need any. The full list -// of properties can be found at https://docs.payara.fish/community/docs/5.2020.6/documentation/payara-server/jdbc/advanced-connection-pool-properties.html#full-list-of-properties +// of properties can be found at https://docs.payara.fish/community/docs/5.2021.1/documentation/payara-server/jdbc/advanced-connection-pool-properties.html#full-list-of-properties // // All these properties cannot be configured via MPCONFIG as Payara doesn't support this (yet). To be enhanced. // See also https://github.com/payara/Payara/issues/5024 From 4e94a8015ae392d66868b77c35e6f1b5ec7124b5 Mon Sep 17 00:00:00 2001 From: Philip Durbin Date: Mon, 22 Mar 2021 14:06:07 -0400 Subject: [PATCH 04/34] include previous note about upgrading #7700 --- doc/release-notes/7700-upgrade-payara.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/release-notes/7700-upgrade-payara.md b/doc/release-notes/7700-upgrade-payara.md index 370e4def9fc..72183772be7 100644 --- a/doc/release-notes/7700-upgrade-payara.md +++ b/doc/release-notes/7700-upgrade-payara.md @@ -3,4 +3,6 @@ Some changes in this release require an upgrade to Payara 5.2021.1 or higher. Instructions on how to update can be found in the -[Payara documentation](https://docs.payara.fish/community/docs/5.2021.1/documentation/user-guides/upgrade-payara.html) \ No newline at end of file +[Payara documentation](https://docs.payara.fish/community/docs/5.2021.1/documentation/user-guides/upgrade-payara.html) + +It would likely be safer to upgrade Payara first, while still running Dataverse 5.3, and then proceed with the steps below. Upgrading from an earlier version of Payara should be a straightforward process: Undeploy Dataverse; stop Payara; move the current Payara directory out of the way; unzip the new Payara version in its place; replace the brand new payara/glassfish/domains/domain1 with your old, preserved domain1; start Payara, deploy Dataverse 5.3. We still recommend that you read the detailed upgrade instructions above; and, if you run into any issues with this upgrade, it will help to be able to separate them from any problems with the upgrade of Dataverse proper. From 804086ebdfedb59ce19b7ead24c4e43d4e44660c Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Thu, 8 Apr 2021 17:01:31 +0200 Subject: [PATCH 05/34] chore(appserver): upgrade to Payara 5.2021.2 #7700 --- conf/docker-aio/0prep_deps.sh | 4 ++-- conf/docker-aio/c8.dockerfile | 2 +- doc/release-notes/7700-upgrade-payara.md | 19 +++++++++++++++---- .../source/developers/dev-environment.rst | 4 ++-- .../source/installation/prerequisites.rst | 6 +++--- downloads/download.sh | 2 +- pom.xml | 2 +- scripts/vagrant/setup.sh | 2 +- .../iq/dataverse/util/DataSourceProducer.java | 2 +- 9 files changed, 27 insertions(+), 16 deletions(-) diff --git a/conf/docker-aio/0prep_deps.sh b/conf/docker-aio/0prep_deps.sh index 04706dad342..f75b762623a 100755 --- a/conf/docker-aio/0prep_deps.sh +++ b/conf/docker-aio/0prep_deps.sh @@ -4,10 +4,10 @@ if [ ! -d dv/deps ]; then fi wdir=`pwd` -if [ ! -e dv/deps/payara-5.2021.1.zip ]; then +if [ ! -e dv/deps/payara-5.2021.2.zip ]; then echo "payara dependency prep" # no more fiddly patching :) - wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.1/payara-5.2021.1.zip -O dv/deps/payara-5.2021.1.zip + wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.2/payara-5.2021.2.zip -O dv/deps/payara-5.2021.2.zip fi if [ ! -e dv/deps/solr-8.8.1dv.tgz ]; then diff --git a/conf/docker-aio/c8.dockerfile b/conf/docker-aio/c8.dockerfile index d06918279f3..ff2c2950568 100644 --- a/conf/docker-aio/c8.dockerfile +++ b/conf/docker-aio/c8.dockerfile @@ -18,7 +18,7 @@ COPY disableipv6.conf /etc/sysctl.d/ RUN rm /etc/httpd/conf/* COPY httpd.conf /etc/httpd/conf RUN cd /opt ; tar zxf /tmp/dv/deps/solr-8.8.1dv.tgz -RUN cd /opt ; unzip /tmp/dv/deps/payara-5.2021.1.zip ; ln -s /opt/payara5 /opt/glassfish4 +RUN cd /opt ; unzip /tmp/dv/deps/payara-5.2021.2.zip ; ln -s /opt/payara5 /opt/glassfish4 # this copy of domain.xml is the result of running `asadmin set server.monitoring-service.module-monitoring-levels.jvm=LOW` on a default glassfish installation (aka - enable the glassfish REST monitir endpoint for the jvm` # this dies under Java 11, do we keep it? diff --git a/doc/release-notes/7700-upgrade-payara.md b/doc/release-notes/7700-upgrade-payara.md index 72183772be7..36f40d7e665 100644 --- a/doc/release-notes/7700-upgrade-payara.md +++ b/doc/release-notes/7700-upgrade-payara.md @@ -1,8 +1,19 @@ -### Payara 5.2021.1 (or Higher) Required +### Payara 5.2021.2 (or Higher) Required -Some changes in this release require an upgrade to Payara 5.2021.1 or higher. +Some changes in this release require an upgrade to Payara 5.2021.2 or higher. Instructions on how to update can be found in the -[Payara documentation](https://docs.payara.fish/community/docs/5.2021.1/documentation/user-guides/upgrade-payara.html) +[Payara documentation](https://docs.payara.fish/community/docs/5.2021.2/documentation/user-guides/upgrade-payara.html) -It would likely be safer to upgrade Payara first, while still running Dataverse 5.3, and then proceed with the steps below. Upgrading from an earlier version of Payara should be a straightforward process: Undeploy Dataverse; stop Payara; move the current Payara directory out of the way; unzip the new Payara version in its place; replace the brand new payara/glassfish/domains/domain1 with your old, preserved domain1; start Payara, deploy Dataverse 5.3. We still recommend that you read the detailed upgrade instructions above; and, if you run into any issues with this upgrade, it will help to be able to separate them from any problems with the upgrade of Dataverse proper. +It would likely be safer to upgrade Payara first, while still running Dataverse 5.4, and then proceed with the steps +below. Upgrading from an earlier version of Payara should be a straightforward process: + +1. Undeploy Dataverse +2. Stop Payara +3. Move the current Payara directory out of the way +4. Unzip the new Payara version in its place +5. Replace the brand new payara/glassfish/domains/domain1 with your old, preserved `domain1` +6. Start Payara, deploy Dataverse 5.4. + +We still recommend that you read the detailed upgrade instructions above and if you run into any issues with this +upgrade, it will help to be able to separate them from any problems with the upgrade of Dataverse proper. diff --git a/doc/sphinx-guides/source/developers/dev-environment.rst b/doc/sphinx-guides/source/developers/dev-environment.rst index 45467ee23b1..818f4682091 100755 --- a/doc/sphinx-guides/source/developers/dev-environment.rst +++ b/doc/sphinx-guides/source/developers/dev-environment.rst @@ -85,9 +85,9 @@ To install Payara, run the following commands: ``cd /usr/local`` -``sudo curl -O -L https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.1/payara-5.2021.1.zip`` +``sudo curl -O -L https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.2/payara-5.2021.2.zip`` -``sudo unzip payara-5.2021.1.zip`` +``sudo unzip payara-5.2021.2.zip`` ``sudo chown -R $USER /usr/local/payara5`` diff --git a/doc/sphinx-guides/source/installation/prerequisites.rst b/doc/sphinx-guides/source/installation/prerequisites.rst index 870f95a20b9..f919c078c70 100644 --- a/doc/sphinx-guides/source/installation/prerequisites.rst +++ b/doc/sphinx-guides/source/installation/prerequisites.rst @@ -44,7 +44,7 @@ On RHEL/CentOS you can make Java 11 the default with the ``alternatives`` comman Payara ------ -Payara 5.2021.1 is recommended. Newer versions might work fine, regular updates are recommended. +Payara 5.2021.2 is recommended. Newer versions might work fine, regular updates are recommended. Installing Payara ================= @@ -55,8 +55,8 @@ Installing Payara - Download and install Payara (installed in ``/usr/local/payara5`` in the example commands below):: - # wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.1/payara-5.2021.1.zip - # unzip payara-5.2021.1.zip + # wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.2/payara-5.2021.2.zip + # unzip payara-5.2021.2.zip # mv payara5 /usr/local If you intend to install and run Payara under a service account (and we hope you do), chown -R the Payara hierarchy to root to protect it but give the service account access to the below directories: diff --git a/downloads/download.sh b/downloads/download.sh index a4e132e4a40..55db21b92b0 100755 --- a/downloads/download.sh +++ b/downloads/download.sh @@ -1,5 +1,5 @@ #!/bin/sh -curl -L -O https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.1/payara-5.2021.1.zip +curl -L -O https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.2/payara-5.2021.2.zip curl -L -O https://archive.apache.org/dist/lucene/solr/8.8.1/solr-8.8.1.tgz curl -L -O https://search.maven.org/remotecontent?filepath=org/jboss/weld/weld-osgi-bundle/2.2.10.Final/weld-osgi-bundle-2.2.10.Final-glassfish4.jar curl -s -L http://sourceforge.net/projects/schemaspy/files/schemaspy/SchemaSpy%205.0.0/schemaSpy_5.0.0.jar/download > schemaSpy_5.0.0.jar diff --git a/pom.xml b/pom.xml index c0aa9fd25a0..de5ba582873 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ false 8.0.0 - 5.2021.1 + 5.2021.2 42.2.19 1.11.762 1.2 diff --git a/scripts/vagrant/setup.sh b/scripts/vagrant/setup.sh index f48895187eb..081b6cd0b90 100644 --- a/scripts/vagrant/setup.sh +++ b/scripts/vagrant/setup.sh @@ -53,7 +53,7 @@ SOLR_USER=solr echo "Ensuring Unix user '$SOLR_USER' exists" useradd $SOLR_USER || : DOWNLOAD_DIR='/dataverse/downloads' -PAYARA_ZIP="$DOWNLOAD_DIR/payara-5.2021.1.zip" +PAYARA_ZIP="$DOWNLOAD_DIR/payara-5.2021.2.zip" SOLR_TGZ="$DOWNLOAD_DIR/solr-8.8.1.tgz" if [ ! -f $PAYARA_ZIP ] || [ ! -f $SOLR_TGZ ]; then echo "Couldn't find $PAYARA_ZIP or $SOLR_TGZ! Running download script...." diff --git a/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java b/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java index aa6068ef9f2..5828861f0e2 100644 --- a/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java +++ b/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java @@ -38,7 +38,7 @@ //}) // // ... but at this time we don't think we need any. The full list -// of properties can be found at https://docs.payara.fish/community/docs/5.2021.1/documentation/payara-server/jdbc/advanced-connection-pool-properties.html#full-list-of-properties +// of properties can be found at https://docs.payara.fish/community/docs/5.2021.2/documentation/payara-server/jdbc/advanced-connection-pool-properties.html#full-list-of-properties // // All these properties cannot be configured via MPCONFIG as Payara doesn't support this (yet). To be enhanced. // See also https://github.com/payara/Payara/issues/5024 From 2fb09ea3ea65080ce4805111a7320f4655694c08 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Mon, 17 May 2021 14:10:35 +0200 Subject: [PATCH 06/34] chore(appserver): update to Payara 5.2021.3 #7700 --- conf/docker-aio/0prep_deps.sh | 4 ++-- conf/docker-aio/c8.dockerfile | 2 +- doc/release-notes/7700-upgrade-payara.md | 6 +++--- doc/sphinx-guides/source/developers/dev-environment.rst | 4 ++-- doc/sphinx-guides/source/installation/prerequisites.rst | 6 +++--- downloads/download.sh | 2 +- pom.xml | 2 +- scripts/vagrant/setup.sh | 2 +- .../edu/harvard/iq/dataverse/util/DataSourceProducer.java | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/conf/docker-aio/0prep_deps.sh b/conf/docker-aio/0prep_deps.sh index f75b762623a..3f4e3d53e81 100755 --- a/conf/docker-aio/0prep_deps.sh +++ b/conf/docker-aio/0prep_deps.sh @@ -4,10 +4,10 @@ if [ ! -d dv/deps ]; then fi wdir=`pwd` -if [ ! -e dv/deps/payara-5.2021.2.zip ]; then +if [ ! -e dv/deps/payara-5.2021.3.zip ]; then echo "payara dependency prep" # no more fiddly patching :) - wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.2/payara-5.2021.2.zip -O dv/deps/payara-5.2021.2.zip + wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.3/payara-5.2021.3.zip -O dv/deps/payara-5.2021.3.zip fi if [ ! -e dv/deps/solr-8.8.1dv.tgz ]; then diff --git a/conf/docker-aio/c8.dockerfile b/conf/docker-aio/c8.dockerfile index d7c7190c9c2..328ef98d342 100644 --- a/conf/docker-aio/c8.dockerfile +++ b/conf/docker-aio/c8.dockerfile @@ -23,7 +23,7 @@ COPY disableipv6.conf /etc/sysctl.d/ RUN rm /etc/httpd/conf/* COPY httpd.conf /etc/httpd/conf RUN cd /opt ; tar zxf /tmp/dv/deps/solr-8.8.1dv.tgz -RUN cd /opt ; unzip /tmp/dv/deps/payara-5.2021.2.zip ; ln -s /opt/payara5 /opt/glassfish4 +RUN cd /opt ; unzip /tmp/dv/deps/payara-5.2021.3.zip ; ln -s /opt/payara5 /opt/glassfish4 # this copy of domain.xml is the result of running `asadmin set server.monitoring-service.module-monitoring-levels.jvm=LOW` on a default glassfish installation (aka - enable the glassfish REST monitir endpoint for the jvm` # this dies under Java 11, do we keep it? diff --git a/doc/release-notes/7700-upgrade-payara.md b/doc/release-notes/7700-upgrade-payara.md index 36f40d7e665..45c75d6c0f1 100644 --- a/doc/release-notes/7700-upgrade-payara.md +++ b/doc/release-notes/7700-upgrade-payara.md @@ -1,9 +1,9 @@ -### Payara 5.2021.2 (or Higher) Required +### Payara 5.2021.3 (or Higher) Required -Some changes in this release require an upgrade to Payara 5.2021.2 or higher. +Some changes in this release require an upgrade to Payara 5.2021.3 or higher. Instructions on how to update can be found in the -[Payara documentation](https://docs.payara.fish/community/docs/5.2021.2/documentation/user-guides/upgrade-payara.html) +[Payara documentation](https://docs.payara.fish/community/docs/5.2021.3/documentation/user-guides/upgrade-payara.html) It would likely be safer to upgrade Payara first, while still running Dataverse 5.4, and then proceed with the steps below. Upgrading from an earlier version of Payara should be a straightforward process: diff --git a/doc/sphinx-guides/source/developers/dev-environment.rst b/doc/sphinx-guides/source/developers/dev-environment.rst index 818f4682091..fe95d0d85c3 100755 --- a/doc/sphinx-guides/source/developers/dev-environment.rst +++ b/doc/sphinx-guides/source/developers/dev-environment.rst @@ -85,9 +85,9 @@ To install Payara, run the following commands: ``cd /usr/local`` -``sudo curl -O -L https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.2/payara-5.2021.2.zip`` +``sudo curl -O -L https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.3/payara-5.2021.3.zip`` -``sudo unzip payara-5.2021.2.zip`` +``sudo unzip payara-5.2021.3.zip`` ``sudo chown -R $USER /usr/local/payara5`` diff --git a/doc/sphinx-guides/source/installation/prerequisites.rst b/doc/sphinx-guides/source/installation/prerequisites.rst index f4e3c3c60c9..8e886212a73 100644 --- a/doc/sphinx-guides/source/installation/prerequisites.rst +++ b/doc/sphinx-guides/source/installation/prerequisites.rst @@ -44,7 +44,7 @@ On RHEL/derivative you can make Java 11 the default with the ``alternatives`` co Payara ------ -Payara 5.2021.2 is recommended. Newer versions might work fine, regular updates are recommended. +Payara 5.2021.3 is recommended. Newer versions might work fine, regular updates are recommended. Installing Payara ================= @@ -55,8 +55,8 @@ Installing Payara - Download and install Payara (installed in ``/usr/local/payara5`` in the example commands below):: - # wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.2/payara-5.2021.2.zip - # unzip payara-5.2021.2.zip + # wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.3/payara-5.2021.3.zip + # unzip payara-5.2021.3.zip # mv payara5 /usr/local If you intend to install and run Payara under a service account (and we hope you do), chown -R the Payara hierarchy to root to protect it but give the service account access to the below directories: diff --git a/downloads/download.sh b/downloads/download.sh index 55db21b92b0..957f54dd599 100755 --- a/downloads/download.sh +++ b/downloads/download.sh @@ -1,5 +1,5 @@ #!/bin/sh -curl -L -O https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.2/payara-5.2021.2.zip +curl -L -O https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.3/payara-5.2021.3.zip curl -L -O https://archive.apache.org/dist/lucene/solr/8.8.1/solr-8.8.1.tgz curl -L -O https://search.maven.org/remotecontent?filepath=org/jboss/weld/weld-osgi-bundle/2.2.10.Final/weld-osgi-bundle-2.2.10.Final-glassfish4.jar curl -s -L http://sourceforge.net/projects/schemaspy/files/schemaspy/SchemaSpy%205.0.0/schemaSpy_5.0.0.jar/download > schemaSpy_5.0.0.jar diff --git a/pom.xml b/pom.xml index 6f51689c07b..d2e173d1f2f 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ false 8.0.0 - 5.2021.2 + 5.2021.3 42.2.19 1.11.762 1.2 diff --git a/scripts/vagrant/setup.sh b/scripts/vagrant/setup.sh index 081b6cd0b90..84c9a094ca9 100644 --- a/scripts/vagrant/setup.sh +++ b/scripts/vagrant/setup.sh @@ -53,7 +53,7 @@ SOLR_USER=solr echo "Ensuring Unix user '$SOLR_USER' exists" useradd $SOLR_USER || : DOWNLOAD_DIR='/dataverse/downloads' -PAYARA_ZIP="$DOWNLOAD_DIR/payara-5.2021.2.zip" +PAYARA_ZIP="$DOWNLOAD_DIR/payara-5.2021.3.zip" SOLR_TGZ="$DOWNLOAD_DIR/solr-8.8.1.tgz" if [ ! -f $PAYARA_ZIP ] || [ ! -f $SOLR_TGZ ]; then echo "Couldn't find $PAYARA_ZIP or $SOLR_TGZ! Running download script...." diff --git a/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java b/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java index 5828861f0e2..e4f2cf7fa7b 100644 --- a/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java +++ b/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java @@ -38,7 +38,7 @@ //}) // // ... but at this time we don't think we need any. The full list -// of properties can be found at https://docs.payara.fish/community/docs/5.2021.2/documentation/payara-server/jdbc/advanced-connection-pool-properties.html#full-list-of-properties +// of properties can be found at https://docs.payara.fish/community/docs/5.2021.3/documentation/payara-server/jdbc/advanced-connection-pool-properties.html#full-list-of-properties // // All these properties cannot be configured via MPCONFIG as Payara doesn't support this (yet). To be enhanced. // See also https://github.com/payara/Payara/issues/5024 From 8b51789e76c4d072e0d4abde88ccf34a0b947ea0 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Fri, 28 May 2021 15:22:56 +0200 Subject: [PATCH 07/34] chore: update release note on Payara upgrade to Dataverse 5.6 --- doc/release-notes/7700-upgrade-payara.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/release-notes/7700-upgrade-payara.md b/doc/release-notes/7700-upgrade-payara.md index 45c75d6c0f1..7f76d993b18 100644 --- a/doc/release-notes/7700-upgrade-payara.md +++ b/doc/release-notes/7700-upgrade-payara.md @@ -5,7 +5,7 @@ Some changes in this release require an upgrade to Payara 5.2021.3 or higher. Instructions on how to update can be found in the [Payara documentation](https://docs.payara.fish/community/docs/5.2021.3/documentation/user-guides/upgrade-payara.html) -It would likely be safer to upgrade Payara first, while still running Dataverse 5.4, and then proceed with the steps +It would likely be safer to upgrade Payara first, while still running Dataverse 5.6, and then proceed with the steps below. Upgrading from an earlier version of Payara should be a straightforward process: 1. Undeploy Dataverse @@ -13,7 +13,7 @@ below. Upgrading from an earlier version of Payara should be a straightforward p 3. Move the current Payara directory out of the way 4. Unzip the new Payara version in its place 5. Replace the brand new payara/glassfish/domains/domain1 with your old, preserved `domain1` -6. Start Payara, deploy Dataverse 5.4. +6. Start Payara, deploy Dataverse 5.6. We still recommend that you read the detailed upgrade instructions above and if you run into any issues with this upgrade, it will help to be able to separate them from any problems with the upgrade of Dataverse proper. From bf72ff9c0a42ed2f1b79a3ae7ba4141acbbf4de2 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 8 Jun 2021 10:27:25 +0200 Subject: [PATCH 08/34] chore(appserver): update to Payara 5.2021.4 #7700 --- conf/docker-aio/0prep_deps.sh | 4 ++-- conf/docker-aio/c8.dockerfile | 2 +- doc/release-notes/7700-upgrade-payara.md | 6 +++--- doc/sphinx-guides/source/developers/dev-environment.rst | 4 ++-- doc/sphinx-guides/source/installation/prerequisites.rst | 6 +++--- downloads/download.sh | 2 +- pom.xml | 2 +- scripts/vagrant/setup.sh | 2 +- .../edu/harvard/iq/dataverse/util/DataSourceProducer.java | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/conf/docker-aio/0prep_deps.sh b/conf/docker-aio/0prep_deps.sh index 3f4e3d53e81..c26492b2d25 100755 --- a/conf/docker-aio/0prep_deps.sh +++ b/conf/docker-aio/0prep_deps.sh @@ -4,10 +4,10 @@ if [ ! -d dv/deps ]; then fi wdir=`pwd` -if [ ! -e dv/deps/payara-5.2021.3.zip ]; then +if [ ! -e dv/deps/payara-5.2021.4.zip ]; then echo "payara dependency prep" # no more fiddly patching :) - wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.3/payara-5.2021.3.zip -O dv/deps/payara-5.2021.3.zip + wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.4/payara-5.2021.4.zip -O dv/deps/payara-5.2021.4.zip fi if [ ! -e dv/deps/solr-8.8.1dv.tgz ]; then diff --git a/conf/docker-aio/c8.dockerfile b/conf/docker-aio/c8.dockerfile index 328ef98d342..4fe12201fc3 100644 --- a/conf/docker-aio/c8.dockerfile +++ b/conf/docker-aio/c8.dockerfile @@ -23,7 +23,7 @@ COPY disableipv6.conf /etc/sysctl.d/ RUN rm /etc/httpd/conf/* COPY httpd.conf /etc/httpd/conf RUN cd /opt ; tar zxf /tmp/dv/deps/solr-8.8.1dv.tgz -RUN cd /opt ; unzip /tmp/dv/deps/payara-5.2021.3.zip ; ln -s /opt/payara5 /opt/glassfish4 +RUN cd /opt ; unzip /tmp/dv/deps/payara-5.2021.4.zip ; ln -s /opt/payara5 /opt/glassfish4 # this copy of domain.xml is the result of running `asadmin set server.monitoring-service.module-monitoring-levels.jvm=LOW` on a default glassfish installation (aka - enable the glassfish REST monitir endpoint for the jvm` # this dies under Java 11, do we keep it? diff --git a/doc/release-notes/7700-upgrade-payara.md b/doc/release-notes/7700-upgrade-payara.md index 7f76d993b18..de7c58bf963 100644 --- a/doc/release-notes/7700-upgrade-payara.md +++ b/doc/release-notes/7700-upgrade-payara.md @@ -1,9 +1,9 @@ -### Payara 5.2021.3 (or Higher) Required +### Payara 5.2021.4 (or Higher) Required -Some changes in this release require an upgrade to Payara 5.2021.3 or higher. +Some changes in this release require an upgrade to Payara 5.2021.4 or higher. Instructions on how to update can be found in the -[Payara documentation](https://docs.payara.fish/community/docs/5.2021.3/documentation/user-guides/upgrade-payara.html) +[Payara documentation](https://docs.payara.fish/community/docs/5.2021.4/documentation/user-guides/upgrade-payara.html) It would likely be safer to upgrade Payara first, while still running Dataverse 5.6, and then proceed with the steps below. Upgrading from an earlier version of Payara should be a straightforward process: diff --git a/doc/sphinx-guides/source/developers/dev-environment.rst b/doc/sphinx-guides/source/developers/dev-environment.rst index fe95d0d85c3..41e986c0ea3 100755 --- a/doc/sphinx-guides/source/developers/dev-environment.rst +++ b/doc/sphinx-guides/source/developers/dev-environment.rst @@ -85,9 +85,9 @@ To install Payara, run the following commands: ``cd /usr/local`` -``sudo curl -O -L https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.3/payara-5.2021.3.zip`` +``sudo curl -O -L https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.4/payara-5.2021.4.zip`` -``sudo unzip payara-5.2021.3.zip`` +``sudo unzip payara-5.2021.4.zip`` ``sudo chown -R $USER /usr/local/payara5`` diff --git a/doc/sphinx-guides/source/installation/prerequisites.rst b/doc/sphinx-guides/source/installation/prerequisites.rst index 8e886212a73..4f04024607f 100644 --- a/doc/sphinx-guides/source/installation/prerequisites.rst +++ b/doc/sphinx-guides/source/installation/prerequisites.rst @@ -44,7 +44,7 @@ On RHEL/derivative you can make Java 11 the default with the ``alternatives`` co Payara ------ -Payara 5.2021.3 is recommended. Newer versions might work fine, regular updates are recommended. +Payara 5.2021.4 is recommended. Newer versions might work fine, regular updates are recommended. Installing Payara ================= @@ -55,8 +55,8 @@ Installing Payara - Download and install Payara (installed in ``/usr/local/payara5`` in the example commands below):: - # wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.3/payara-5.2021.3.zip - # unzip payara-5.2021.3.zip + # wget https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.4/payara-5.2021.4.zip + # unzip payara-5.2021.4.zip # mv payara5 /usr/local If you intend to install and run Payara under a service account (and we hope you do), chown -R the Payara hierarchy to root to protect it but give the service account access to the below directories: diff --git a/downloads/download.sh b/downloads/download.sh index 957f54dd599..c9cd2942295 100755 --- a/downloads/download.sh +++ b/downloads/download.sh @@ -1,5 +1,5 @@ #!/bin/sh -curl -L -O https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.3/payara-5.2021.3.zip +curl -L -O https://s3-eu-west-1.amazonaws.com/payara.fish/Payara+Downloads/5.2021.4/payara-5.2021.4.zip curl -L -O https://archive.apache.org/dist/lucene/solr/8.8.1/solr-8.8.1.tgz curl -L -O https://search.maven.org/remotecontent?filepath=org/jboss/weld/weld-osgi-bundle/2.2.10.Final/weld-osgi-bundle-2.2.10.Final-glassfish4.jar curl -s -L http://sourceforge.net/projects/schemaspy/files/schemaspy/SchemaSpy%205.0.0/schemaSpy_5.0.0.jar/download > schemaSpy_5.0.0.jar diff --git a/pom.xml b/pom.xml index 4a175af124d..0eb489b4c15 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ false 8.0.0 - 5.2021.3 + 5.2021.4 42.2.19 1.11.762 1.2 diff --git a/scripts/vagrant/setup.sh b/scripts/vagrant/setup.sh index 84c9a094ca9..fdce9210ef4 100644 --- a/scripts/vagrant/setup.sh +++ b/scripts/vagrant/setup.sh @@ -53,7 +53,7 @@ SOLR_USER=solr echo "Ensuring Unix user '$SOLR_USER' exists" useradd $SOLR_USER || : DOWNLOAD_DIR='/dataverse/downloads' -PAYARA_ZIP="$DOWNLOAD_DIR/payara-5.2021.3.zip" +PAYARA_ZIP="$DOWNLOAD_DIR/payara-5.2021.4.zip" SOLR_TGZ="$DOWNLOAD_DIR/solr-8.8.1.tgz" if [ ! -f $PAYARA_ZIP ] || [ ! -f $SOLR_TGZ ]; then echo "Couldn't find $PAYARA_ZIP or $SOLR_TGZ! Running download script...." diff --git a/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java b/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java index e4f2cf7fa7b..b393ca4a605 100644 --- a/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java +++ b/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java @@ -38,7 +38,7 @@ //}) // // ... but at this time we don't think we need any. The full list -// of properties can be found at https://docs.payara.fish/community/docs/5.2021.3/documentation/payara-server/jdbc/advanced-connection-pool-properties.html#full-list-of-properties +// of properties can be found at https://docs.payara.fish/community/docs/5.2021.4/documentation/payara-server/jdbc/advanced-connection-pool-properties.html#full-list-of-properties // // All these properties cannot be configured via MPCONFIG as Payara doesn't support this (yet). To be enhanced. // See also https://github.com/payara/Payara/issues/5024 From 724c3359f7431c9b1b6e345edfeef317a30efa5b Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Mon, 31 Aug 2020 22:44:40 +0200 Subject: [PATCH 09/34] Proof of concept creating a (non-working) container image for Dataverse based on Payara --- conf/container/Dockerfile | 55 +++++++++++++++++++++++++++++++++++++ conf/container/assembly.xml | 18 ++++++++++++ pom.xml | 34 +++++++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 conf/container/Dockerfile create mode 100644 conf/container/assembly.xml diff --git a/conf/container/Dockerfile b/conf/container/Dockerfile new file mode 100644 index 00000000000..cb72d3f5665 --- /dev/null +++ b/conf/container/Dockerfile @@ -0,0 +1,55 @@ +# Copyright 2019 Forschungszentrum Jülich GmbH +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 + +# TODO: replace tag with $VERSION arg once d-m-p supports it (expected for 0.34.0 release) +FROM payara/server-full:@payara.version@ +LABEL maintainer="FDM FZJ " + +ENV DATA_DIR=/data\ + DOCROOT_DIR=/docroot\ + METADATA_DIR=/metadata\ + SECRETS_DIR=/secrets\ + DUMPS_DIR=/dumps\ + DOMAIN_DIR=${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}\ + PGDRIVER_PKG=https://jdbc.postgresql.org/download/postgresql-42.2.12.jar\ + # Make heap dumps on OOM appear in DUMPS_DIR + JVM_ARGS="-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\${ENV=DUMPS_DIR}" + +# Create basic pathes +USER root +RUN mkdir -p ${DATA_DIR} ${METADATA_DIR} ${DOCROOT_DIR} ${SECRETS_DIR} ${DUMPS_DIR} && \ + chown -R payara: ${DATA_DIR} ${METADATA_DIR} ${DOCROOT_DIR} ${SECRETS_DIR} ${DUMPS_DIR} + +# Install prerequisites +RUN apt-get -qq update && \ + apt-get -qqy install postgresql-client jq imagemagick curl wget unzip && \ + rm -rf /var/lib/apt/lists/* + +# Install esh template engine from Github +RUN wget --no-verbose -O esh https://raw.githubusercontent.com/jirutka/esh/v0.3.0/esh && \ + echo 'fe030e23fc1383780d08128eecf322257cec743b esh' | sha1sum -c - && \ + chmod +x esh && mv esh /usr/local/bin + +# Install PostgreSQL JDBC driver in AppServer +# TODO: remove this once upstream includes the Postgres Client lib in the WAR. +USER payara +RUN wget --no-verbose -O postgresql.jar ${PGDRIVER_PKG} && \ + mv postgresql.jar ${PAYARA_DIR}/glassfish/lib + +# Make docroot of Payara reside in higher level directory for easier targeting +# Due to IQSS/dataverse-kubernetes#177: create the generated pathes so they are +# writeable by us. TBR with #178. +RUN rm -rf ${DOMAIN_DIR}/docroot && \ + ln -s ${DOCROOT_DIR} ${DOMAIN_DIR}/docroot && \ + mkdir -p ${DOMAIN_DIR}/generated/jsp/dataverse + +# Copy app and deps from assembly in proper layers +COPY --chown=payara:payara maven/deps ${DEPLOY_DIR}/dataverse/WEB-INF/lib/ +COPY --chown=payara:payara maven/app ${DEPLOY_DIR}/dataverse/ + +# Copy across docker scripts +#COPY --chown=payara:payara docker/dataverse-k8s/bin/* docker/dataverse-k8s/payara/bin/*.sh ${SCRIPT_DIR}/ +RUN chmod +x ${SCRIPT_DIR}/* diff --git a/conf/container/assembly.xml b/conf/container/assembly.xml new file mode 100644 index 00000000000..51f544427bd --- /dev/null +++ b/conf/container/assembly.xml @@ -0,0 +1,18 @@ + + + + + target/${project.artifactId}-${project.version} + app + + WEB-INF/lib/**/* + + + + + target/${project.artifactId}-${project.version}/WEB-INF/lib + deps + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index ca2d3570956..cb823111be4 100644 --- a/pom.xml +++ b/pom.xml @@ -887,5 +887,39 @@ + + container + + true + + + + + + io.fabric8 + docker-maven-plugin + 0.33.0 + + + + + dataverse + gdcc/dataverse-k8s:${project.version} + + ${project.basedir}/conf/container/Dockerfile + @ + + tar + gnu + ${project.basedir}/conf/container/assembly.xml + + + + + + + + + From 0ee2251016252cb2b10c59a243b0380824f53c4d Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Mon, 31 Aug 2020 23:13:33 +0200 Subject: [PATCH 10/34] Add supplemental data and scripts plus JRebel lib to application container image. --- conf/container/Dockerfile | 10 +++++++--- conf/container/assembly.xml | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/conf/container/Dockerfile b/conf/container/Dockerfile index cb72d3f5665..89a234b3997 100644 --- a/conf/container/Dockerfile +++ b/conf/container/Dockerfile @@ -4,7 +4,6 @@ # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 -# TODO: replace tag with $VERSION arg once d-m-p supports it (expected for 0.34.0 release) FROM payara/server-full:@payara.version@ LABEL maintainer="FDM FZJ " @@ -15,6 +14,7 @@ ENV DATA_DIR=/data\ DUMPS_DIR=/dumps\ DOMAIN_DIR=${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}\ PGDRIVER_PKG=https://jdbc.postgresql.org/download/postgresql-42.2.12.jar\ + JREBEL_LIB=${HOME_DIR}/jrebel/lib/libjrebel64.so\ # Make heap dumps on OOM appear in DUMPS_DIR JVM_ARGS="-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\${ENV=DUMPS_DIR}" @@ -39,6 +39,9 @@ USER payara RUN wget --no-verbose -O postgresql.jar ${PGDRIVER_PKG} && \ mv postgresql.jar ${PAYARA_DIR}/glassfish/lib +RUN wget --no-verbose -O "${HOME_DIR}/jrebel.zip" http://dl.zeroturnaround.com/jrebel-stable-nosetup.zip && \ + unzip -q "${HOME_DIR}/jrebel.zip" -d "${HOME_DIR}" + # Make docroot of Payara reside in higher level directory for easier targeting # Due to IQSS/dataverse-kubernetes#177: create the generated pathes so they are # writeable by us. TBR with #178. @@ -49,7 +52,8 @@ RUN rm -rf ${DOMAIN_DIR}/docroot && \ # Copy app and deps from assembly in proper layers COPY --chown=payara:payara maven/deps ${DEPLOY_DIR}/dataverse/WEB-INF/lib/ COPY --chown=payara:payara maven/app ${DEPLOY_DIR}/dataverse/ +COPY --chown=payara:payara maven/supplements ${DEPLOY_DIR}/dataverse/supplements/ -# Copy across docker scripts -#COPY --chown=payara:payara docker/dataverse-k8s/bin/* docker/dataverse-k8s/payara/bin/*.sh ${SCRIPT_DIR}/ +# Copy init and application scripts +#COPY --chown=payara:payara maven/scripts ${SCRIPT_DIR}/ RUN chmod +x ${SCRIPT_DIR}/* diff --git a/conf/container/assembly.xml b/conf/container/assembly.xml index 51f544427bd..73b4009273b 100644 --- a/conf/container/assembly.xml +++ b/conf/container/assembly.xml @@ -14,5 +14,31 @@ target/${project.artifactId}-${project.version}/WEB-INF/lib deps + + + scripts/api + supplements + + data/**/* + *.sh + + + data/metadatablocks/custom*.tsv + + + + scripts/database + supplements + + reference_data.sql + + + + conf/jhove + supplements + + * + + \ No newline at end of file From cde55bc744a3f206851615d420fb47db922c8f78 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 1 Sep 2020 00:13:49 +0200 Subject: [PATCH 11/34] Add init scripts to the Dataverse application image. --- conf/container/Dockerfile | 8 +- conf/container/assembly.xml | 8 +- conf/container/scripts/default.config | 44 +++++++ conf/container/scripts/init_2_conf_payara.sh | 129 +++++++++++++++++++ conf/container/scripts/init_3_enabledev.sh | 46 +++++++ 5 files changed, 230 insertions(+), 5 deletions(-) create mode 100644 conf/container/scripts/default.config create mode 100644 conf/container/scripts/init_2_conf_payara.sh create mode 100644 conf/container/scripts/init_3_enabledev.sh diff --git a/conf/container/Dockerfile b/conf/container/Dockerfile index 89a234b3997..26b8d7b5fb2 100644 --- a/conf/container/Dockerfile +++ b/conf/container/Dockerfile @@ -16,7 +16,11 @@ ENV DATA_DIR=/data\ PGDRIVER_PKG=https://jdbc.postgresql.org/download/postgresql-42.2.12.jar\ JREBEL_LIB=${HOME_DIR}/jrebel/lib/libjrebel64.so\ # Make heap dumps on OOM appear in DUMPS_DIR - JVM_ARGS="-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\${ENV=DUMPS_DIR}" + JVM_ARGS="-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\${ENV=DUMPS_DIR}"\ + # Documenting development options (see init_3_enabledev.sh) + ENABLE_JMX=0\ + ENABLE_JDWP=0\ + ENABLE_JREBEL=0 # Create basic pathes USER root @@ -55,5 +59,5 @@ COPY --chown=payara:payara maven/app ${DEPLOY_DIR}/dataverse/ COPY --chown=payara:payara maven/supplements ${DEPLOY_DIR}/dataverse/supplements/ # Copy init and application scripts -#COPY --chown=payara:payara maven/scripts ${SCRIPT_DIR}/ +COPY --chown=payara:payara maven/scripts ${SCRIPT_DIR}/ RUN chmod +x ${SCRIPT_DIR}/* diff --git a/conf/container/assembly.xml b/conf/container/assembly.xml index 73b4009273b..b965fe7b975 100644 --- a/conf/container/assembly.xml +++ b/conf/container/assembly.xml @@ -36,9 +36,11 @@ conf/jhove supplements - - * - + + + + conf/container/scripts + scripts \ No newline at end of file diff --git a/conf/container/scripts/default.config b/conf/container/scripts/default.config new file mode 100644 index 00000000000..eb18ab34deb --- /dev/null +++ b/conf/container/scripts/default.config @@ -0,0 +1,44 @@ +# Variables used in resource creation + +POSTGRES_SERVER=${POSTGRES_SERVER:-postgresql} +POSTGRES_PORT=${POSTGRES_PORT:-5432} +POSTGRES_USER=${POSTGRES_USER:-dataverse} +POSTGRES_DATABASE=${POSTGRES_DATABASE:-${POSTGRES_USER}} +MAIL_SERVER=${MAIL_SERVER:-"postfix"} +MAIL_FROMADDRESS=${MAIL_FROMADDRESS:-"do-not-reply@mailinator.com"} +CONTACT_MAIL=${CONTACT_MAIL:-"dataverse-k8s-contact@mailinator.com"} +ENABLE_JMX_EXPORT=${ENABLE_JMX_EXPORT:-0} +JMX_EXPORTER_PORT=${JMX_EXPORTER_PORT:-8081} +JMX_EXPORTER_CONFIG=${JMX_EXPORTER_CONFIG:-"${HOME}/jmx_exporter_config.yaml"} + +##### ##### ##### ##### ##### ##### ##### ##### ##### ##### +# System properties based Dataverse configuration options +# (Exporting needed as they cannot be seen by `env` otherwise) + +export dataverse_files_directory=${dataverse_files_directory:-/data} +export dataverse_files_storage__driver__id=${dataverse_files_storage__driver__id:-local} + +if [ "${dataverse_files_storage__driver__id}" = "local" ]; then + export dataverse_files_local_type=${dataverse_files_local_type:-file} + export dataverse_files_local_label=${dataverse_files_local_label:-Local} + export dataverse_files_local_directory=${dataverse_files_local_directory:-/data} +fi + +export dataverse_rserve_host=${dataverse_rserve_host:-rserve} +export dataverse_rserve_port=${dataverse_rserve_port:-6311} +export dataverse_rserve_user=${dataverse_rserve_user:-rserve} +export dataverse_rserve_password='${ALIAS=rserve_password_alias}' +export dataverse_fqdn=${dataverse_fqdn:-"localhost"} +export dataverse_siteUrl=${dataverse_siteUrl:-"http://\${dataverse.fqdn}:8080"} +export dataverse_auth_password__reset__timeout__in__minutes=${dataverse_auth_password__reset__timeout__in__minutes:-60} +export dataverse_timerServer=${dataverse_timerServer:-true} + +export doi_username=${doi_username:-test} +export doi_password='${ALIAS=doi_password_alias}' +export doi_baseurlstring=${doi_baseurlstring:-http://mds.test.datacite.org} + +##### ##### ##### ##### ##### ##### ##### ##### ##### ##### +# Database based Dataverse configuration options +# (Exporting needed as they cannot be seen by `env` otherwise) + +export db_SystemEmail=${db_SystemEmail:-"Dataverse on K8S "} diff --git a/conf/container/scripts/init_2_conf_payara.sh b/conf/container/scripts/init_2_conf_payara.sh new file mode 100644 index 00000000000..f5e26c7fbf0 --- /dev/null +++ b/conf/container/scripts/init_2_conf_payara.sh @@ -0,0 +1,129 @@ +#!/bin/bash +################################################################################ +# Configure Glassfish +# +# BEWARE: As this is done for Kubernetes, we will ALWAYS start with a fresh container! +# When moving to Glassfish/Payara 5+ the option commands are idempotent. +# The resources are to be created by the application on deployment, +# once Dataverse has proper refactoring, etc. +# See upstream issue IQSS/dataverse#5292 +################################################################################ + +# Fail on any error +set -e +# Include some sane defaults +. ${SCRIPT_DIR}/default.config + +# 0. Define postboot commands file to be read by Payara and clear it +DV_POSTBOOT=${PAYARA_DIR}/dataverse_postboot +echo "# Dataverse postboot configuration for Payara" > ${DV_POSTBOOT} + +# 1. Password aliases from secrets +# TODO: This is ugly and dirty. It leaves leftovers on the filesystem. +# It should be replaced by using proper config mechanisms sooner than later, +# like MicroProfile Config API. +for alias in rserve doi db +do + if [ -f ${SECRETS_DIR}/$alias/password ]; then + echo "INFO: Defining password alias for $alias" + cat ${SECRETS_DIR}/$alias/password | sed -e "s#^#AS_ADMIN_ALIASPASSWORD=#" > ${SECRETS_DIR}/${alias}_asadmin + echo "create-password-alias ${alias}_password_alias --passwordfile ${SECRETS_DIR}/${alias}_asadmin" >> ${DV_POSTBOOT} + else + echo "WARNING: Could not find 'password' secret for ${alias} in ${SECRETS_DIR}. Check your Kubernetes Secrets and their mounting!" + fi +done + +# 1b. Create AWS access credentials when storage driver is set to s3 +# Find all access keys +if [ -d "${SECRETS_DIR}/s3" ]; then + S3_KEYS=`find "${SECRETS_DIR}/s3" -readable -type f -iname '*access-key'` + S3_CRED_FILE=${HOME_DIR}/.aws/credentials + mkdir -p `dirname "${S3_CRED_FILE}"` + rm -f ${S3_CRED_FILE} + # Iterate keys + while IFS= read -r S3_ACCESS_KEY; do + echo "Loading S3 key ${S3_ACCESS_KEY}" + # Try to find the secret key, parse for profile and add to the credentials file. + S3_PROFILE=`echo "${S3_ACCESS_KEY}" | sed -ne "s#.*/\(.*\)-access-key#\1#p"` + S3_SECRET_KEY=`echo "${S3_ACCESS_KEY}" | sed -ne "s#\(.*/\|.*/.*-\)access-key#\1secret-key#p"` + + if [ -r ${S3_SECRET_KEY} ]; then + [ -z "${S3_PROFILE}" ] && echo "[default]" >> "${S3_CRED_FILE}" || echo "[${S3_PROFILE}]" >> "${S3_CRED_FILE}" + cat "${S3_ACCESS_KEY}" | sed -e "s#^#aws_access_key_id = #" -e "s#\$#\n#" >> "${S3_CRED_FILE}" + cat "${S3_SECRET_KEY}" | sed -e "s#^#aws_secret_access_key = #" -e "s#\$#\n#" >> "${S3_CRED_FILE}" + echo "" >> "${S3_CRED_FILE}" + else + echo "ERROR: Could not find or read matching \"$S3_SECRET_KEY\"." + exit 1 + fi + done <<< "${S3_KEYS}" +fi + +# 2. Domain-spaced resources (JDBC, JMS, ...) +# TODO: This is ugly and dirty. It should be replaced with resources from +# EE 8 code annotations or at least glassfish-resources.xml +# NOTE: postboot commands is not multi-line capable, thus spaghetti needed. + +# JMS +echo "INFO: Defining JMS resources." +cat >> ${DV_POSTBOOT} << 'EOF' +delete-connector-connection-pool --cascade=true jms/__defaultConnectionFactory-Connection-Pool +create-connector-connection-pool --steadypoolsize=1 --maxpoolsize=250 --poolresize=2 --maxwait=60000 --raname=jmsra --connectiondefinition=javax.jms.QueueConnectionFactory jms/IngestQueueConnectionFactoryPool +create-connector-resource --poolname=jms/IngestQueueConnectionFactoryPool jms/IngestQueueConnectionFactory +create-admin-object --restype=javax.jms.Queue --raname=jmsra --property=Name=DataverseIngest jms/DataverseIngest +EOF + +# JDBC +echo "INFO: Defining JDBC resources." +echo "create-jdbc-connection-pool --restype=javax.sql.DataSource --datasourceclassname=org.postgresql.ds.PGPoolingDataSource --property=create=true:User=${POSTGRES_USER}:PortNumber=${POSTGRES_PORT}:databaseName=${POSTGRES_DATABASE}:ServerName=${POSTGRES_SERVER} dvnDbPool" >> ${DV_POSTBOOT} +echo 'set resources.jdbc-connection-pool.dvnDbPool.property.password=${ALIAS=db_password_alias}' >> ${DV_POSTBOOT} +echo "create-jdbc-resource --connectionpoolid=dvnDbPool jdbc/VDCNetDS" >> ${DV_POSTBOOT} + +# JavaMail +echo "INFO: Defining JavaMail." +echo "create-javamail-resource --mailhost=${MAIL_SERVER} --mailuser=dataversenotify --fromaddress=${MAIL_FROMADDRESS} mail/notifyMailSession" >> ${DV_POSTBOOT} + +echo "INFO: defining miscellaneous configuration options." +# Timer data source +echo "set configs.config.server-config.ejb-container.ejb-timer-service.timer-datasource=jdbc/VDCNetDS" >> ${DV_POSTBOOT} +# AJP connector +echo "create-network-listener --protocol=http-listener-1 --listenerport=8009 --jkenabled=true jk-connector" >> ${DV_POSTBOOT} +# Disable logging for grizzly SSL problems -- commented out as this is not GF 4.1 +# echo "set-log-levels org.glassfish.grizzly.http.server.util.RequestUtils=SEVERE" >> ${DV_POSTBOOT} +# COMET support +echo "set server-config.network-config.protocols.protocol.http-listener-1.http.comet-support-enabled=true" >> ${DV_POSTBOOT} +# SAX parser options +echo "create-system-properties javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl" >> ${DV_POSTBOOT} + +# 3. Domain based configuration options +# Set Dataverse environment variables +echo "INFO: Defining system properties for Dataverse configuration options." +#env | grep -Ee "^(dataverse|doi)_" | sort -fd +env -0 | grep -z -Ee "^(dataverse|doi)_" | while IFS='=' read -r -d '' k v; do + # transform __ to - + KEY=`echo "${k}" | sed -e "s#__#-#g"` + # transform remaining single _ to . + KEY=`echo "${KEY}" | tr '_' '.'` + + # escape colons in values + v=`echo "${v}" | sed -e 's/:/\\\:/g'` + + echo "DEBUG: Handling ${KEY}=${v}." + echo "create-system-properties ${KEY}=${v}" >> ${DV_POSTBOOT} +done + +# 4. Add the commands to the existing postboot file, but insert BEFORE deployment +echo "$(cat ${DV_POSTBOOT} | cat - ${POSTBOOT_COMMANDS} )" > ${POSTBOOT_COMMANDS} +echo "DEBUG: postboot contains the following commands:" +echo "--------------------------------------------------" +cat ${POSTBOOT_COMMANDS} +echo "--------------------------------------------------" + +# 5. Symlink the jHove configuration +echo "INFO: Symlinking and editing jHove configuration." +ln -s ${DEPLOY_DIR}/dataverse/supplements/jhove.conf ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhove.conf +ln -s ${DEPLOY_DIR}/dataverse/supplements/jhoveConfig.xsd ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhoveConfig.xsd +sed -i ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhove.conf -e "s:/usr/local/glassfish4/glassfish/domains/domain1:${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}:g" + +# 6. Disable phone home. Always. +echo "disable-phome-home" >> ${PREBOOT_COMMANDS} diff --git a/conf/container/scripts/init_3_enabledev.sh b/conf/container/scripts/init_3_enabledev.sh new file mode 100644 index 00000000000..42b12498018 --- /dev/null +++ b/conf/container/scripts/init_3_enabledev.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +set -e + +###### ###### ###### ###### ###### ###### ###### ###### ###### ###### ###### +# This script enables different development options, like a JMX connector +# usable with VisualVM, JRebel hot-reload support and JDWP debugger service. +# Enable it by adding env vars on startup (e.g. via ConfigMap) +###### ###### ###### ###### ###### ###### ###### ###### ###### ###### ###### + +# 0. Init variables +ENABLE_JMX=${ENABLE_JMX:-0} +ENABLE_JDWP=${ENABLE_JDWP:-0} +ENABLE_JREBEL=${ENABLE_JREBEL:-0} +JDWP_PORT=${JDWP_PORT:-9009} + +DV_PREBOOT=${PAYARA_DIR}/dataverse_preboot +echo "# Dataverse preboot configuration for Payara" > ${DV_PREBOOT} + +# 1. Configure JMX (enabled by default on port 8686, but requires SSL) +# See also https://blog.payara.fish/monitoring-payara-server-with-jconsole +# To still use it, you can use a sidecar container proxying or using JMX via localhost without SSL. +if [ "x${ENABLE_JMX}" = "x1" ]; then + echo "Enabling JMX on 127.0.0.1:8686. You'll need a sidecar for this." + echo "set configs.config.server-config.admin-service.jmx-connector.system.address=127.0.0.1" >> ${DV_PREBOOT} +fi + +# 2. Enable JDWP (debugger) +if [ "x${ENABLE_JDWP}" = "x1" ]; then + echo "Enabling JDWP debugger, listening on port ${JDWP_PORT} of this container/pod." + echo "create-jvm-options --target=server-config \"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=${JDWP_PORT}\"" >> ${DV_PREBOOT} +fi + +# 3. Enable JRebel (hot-redeploy) +if [ "x${ENABLE_JREBEL}" = "x1" ] && [ -s "${JREBEL_LIB}" ]; then + echo "Enabling JRebel support with enabled remoting_plugin option." + echo "create-jvm-options --target=server-config \"-agentpath:${JREBEL_LIB}\"" >> ${DV_PREBOOT} + echo "create-system-properties rebel.remoting_plugin=true" >> ${DV_PREBOOT} +fi + +# 4. Add the commands to the existing postboot file, but insert BEFORE deployment +echo "$(cat ${DV_PREBOOT} | cat - ${PREBOOT_COMMANDS} )" > ${PREBOOT_COMMANDS} +echo "DEBUG: preboot contains the following commands:" +echo "--------------------------------------------------" +cat ${PREBOOT_COMMANDS} +echo "--------------------------------------------------" From 17fdd3624418cd42effef3435a27edbbb9728aeb Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 1 Sep 2020 00:47:32 +0200 Subject: [PATCH 12/34] Add usage scripts for config, bootstrap and metadata blocks to Dataverse application container image. --- conf/container/scripts/bootstrap-job.sh | 71 +++++++++++++++++++++++ conf/container/scripts/config-job.sh | 66 +++++++++++++++++++++ conf/container/scripts/metadata-update.sh | 59 +++++++++++++++++++ 3 files changed, 196 insertions(+) create mode 100644 conf/container/scripts/bootstrap-job.sh create mode 100644 conf/container/scripts/config-job.sh create mode 100644 conf/container/scripts/metadata-update.sh diff --git a/conf/container/scripts/bootstrap-job.sh b/conf/container/scripts/bootstrap-job.sh new file mode 100644 index 00000000000..dc8479931f6 --- /dev/null +++ b/conf/container/scripts/bootstrap-job.sh @@ -0,0 +1,71 @@ +#!/bin/bash +################################################################################ +# This script is used to bootstrap a Dataverse installation. +# +# It runs all necessary database foo that cannot be done from EclipseLink. +# It initializes the most basic settings and +# creates root dataverse and admin account. +################################################################################ + +# Fail on any error +set -euo pipefail +# Include some sane defaults +. ${SCRIPT_DIR}/default.config +DATAVERSE_SERVICE_HOST=${DATAVERSE_SERVICE_HOST:-"dataverse"} +DATAVERSE_SERVICE_PORT_HTTP=${DATAVERSE_SERVICE_PORT_HTTP:-"8080"} +DATAVERSE_URL=${DATAVERSE_URL:-"http://${DATAVERSE_SERVICE_HOST}:${DATAVERSE_SERVICE_PORT_HTTP}"} +# The Solr Service IP is always available under its name within the same namespace. +# If people want to use a different Solr than we normally deploy, they have the +# option to override. +SOLR_K8S_HOST=${SOLR_K8S_HOST:-"solr"} + +# Check postgres and API key secrets are available +if [ ! -s "${SECRETS_DIR}/db/password" ]; then + echo "No database password present. Failing." + exit 126 +fi +if [ ! -s "${SECRETS_DIR}/api/key" ]; then + echo "No API key present. Failing." + exit 126 +fi + +# Load dataverseAdmin password if present +if [ -s "${SECRETS_DIR}/admin/password" ]; then + echo "Loading admin password from secret file." + ADMIN_PASSWORD=`cat ${SECRETS_DIR}/admin/password` +fi + +# Drop the Postgres credentials into .pgpass +echo "${POSTGRES_SERVER}:*:*:${POSTGRES_USER}:`cat ${SECRETS_DIR}/db/password`" > ${HOME_DIR}/.pgpass +chmod 0600 ${HOME_DIR}/.pgpass + +# 1.) Load SQL data +psql -h ${POSTGRES_SERVER} -U ${POSTGRES_USER} ${POSTGRES_DATABASE} < ${DEPLOY_DIR}/dataverse/supplements/reference_data.sql + +# 2) Initialize common data structures to make Dataverse usable +cd ${DEPLOY_DIR}/dataverse/supplements +# 2a) Patch load scripts with k8s based URL +sed -i -e "s#localhost:8080#${DATAVERSE_SERVICE_HOST}:${DATAVERSE_SERVICE_PORT_HTTP}#" setup-*.sh +# 2b) Patch user and root dataverse JSON with contact email +sed -i -e "s#root@mailinator.com#${CONTACT_MAIL}#" data/dv-root.json +sed -i -e "s#dataverse@mailinator.com#${CONTACT_MAIL}#" data/user-admin.json +# 2c) Use script(s) to bootstrap the instance. +./setup-all.sh --insecure -p="${ADMIN_PASSWORD:-admin}" + +# 4.) Configure Solr location +curl -sS -X PUT -d "${SOLR_K8S_HOST}:8983" "${DATAVERSE_URL}/api/admin/settings/:SolrHostColonPort" + +# 5.) Provision builtin users key to enable creation of more builtin users +if [ -s "${SECRETS_DIR}/api/userskey" ]; then + curl -sS -X PUT -d "`cat ${SECRETS_DIR}/api/userskey`" "${DATAVERSE_URL}/api/admin/settings/BuiltinUsers.KEY" +else + curl -sS -X DELETE "${DATAVERSE_URL}/api/admin/settings/BuiltinUsers.KEY" +fi + +# 6.) Block access to the API endpoints, but allow for request with key from secret +curl -sS -X PUT -d "`cat ${SECRETS_DIR}/api/key`" "${DATAVERSE_URL}/api/admin/settings/:BlockedApiKey" +curl -sS -X PUT -d unblock-key "${DATAVERSE_URL}/api/admin/settings/:BlockedApiPolicy" +curl -sS -X PUT -d admin,test "${DATAVERSE_URL}/api/admin/settings/:BlockedApiEndpoints" + +# Initial configuration of Dataverse +exec ${SCRIPT_DIR}/config-job.sh diff --git a/conf/container/scripts/config-job.sh b/conf/container/scripts/config-job.sh new file mode 100644 index 00000000000..86535b83adb --- /dev/null +++ b/conf/container/scripts/config-job.sh @@ -0,0 +1,66 @@ +#!/bin/bash +################################################################################ +# This script is used to configure a Dataverse installation from a ConfigMap. +# It is used solely for changing Database settings! +################################################################################ + +# Fail on any error +set -euo pipefail +DATAVERSE_SERVICE_HOST=${DATAVERSE_SERVICE_HOST:-"dataverse"} +DATAVERSE_SERVICE_PORT_HTTP=${DATAVERSE_SERVICE_PORT_HTTP:-"8080"} +DATAVERSE_URL=${DATAVERSE_URL:-"http://${DATAVERSE_SERVICE_HOST}:${DATAVERSE_SERVICE_PORT_HTTP}"} + +echo -e "\nRunning configuration job for Dataverse at ${DATAVERSE_URL}." + +# Check API key secret is available +if [ ! -s "${SECRETS_DIR}/api/key" ]; then + echo "No API key present. Failing." + exit 126 +fi +API_KEY=`cat ${SECRETS_DIR}/api/key` + +# Set Database options based on environment variables db_XXX from ConfigMap +echo "Setting Database options:" +if `env | grep -Ee '^db_' 2>&1 > /dev/null`; then + env -0 | grep -z -Ee "^db_" | while IFS='=' read -r -d '' k v; do + KEY=`echo "${k}" | sed -e 's/^db_/:/'` + echo -n "Handling ${KEY}=${v}." + if [[ -z "${v}" ]]; then + # empty var => delete the setting + echo -n " Deleting... " + OUTPUT=`curl -sSf -X DELETE "${DATAVERSE_URL}/api/admin/settings/${KEY}?unblock-key=${API_KEY}" 2>&1 || echo -n ""` + echo "$OUTPUT" | jq -rM '.status' 2>/dev/null || echo -e 'FAILED\n' "$OUTPUT" + else + # set the setting + echo -n " Setting... " + OUTPUT=`curl -sSf -X PUT -d "${v}" "${DATAVERSE_URL}/api/admin/settings/${KEY}?unblock-key=${API_KEY}" 2>&1 || echo -n ""` + echo "$OUTPUT" | jq -rM '.status' 2>/dev/null || echo -e 'FAILED\n' "$OUTPUT" + fi + done +else + echo "--- none found ---" +fi + +# Parse and configure authentication providers +echo "Deploying authentication providers:" +if [ -n "${AUTH_PROVIDERS+x}" ]; then + # iterate all providers in array + for k in $(echo "${AUTH_PROVIDERS}" | jq '. | keys | .[]'); do + # get provider element, do nice logging and create tempfile + PROVIDER=`echo "$AUTH_PROVIDERS" | jq -r ".[$k]"` + echo -n "Loading `echo "${PROVIDER}" | jq -r ".id"`: " + TMPFILE=`mktemp` + + # templating magic with esh + echo "${PROVIDER}" | esh - > "${TMPFILE}" + + # upload with nice logging + OUTPUT=`curl -sSf -H "Content-type: application/json" -X POST --upload-file "${TMPFILE}" "${DATAVERSE_URL}/api/admin/authenticationProviders?unblock-key=${API_KEY}" 2>&1 || echo -n ""` + echo "$OUTPUT" | jq -rM '.status' 2>/dev/null || echo -e 'FAILED\n' "$OUTPUT" + + # cleanup behind us, delete tempfile + rm "${TMPFILE}" + done +else + echo "--- none found ---" +fi diff --git a/conf/container/scripts/metadata-update.sh b/conf/container/scripts/metadata-update.sh new file mode 100644 index 00000000000..b7afa69d46e --- /dev/null +++ b/conf/container/scripts/metadata-update.sh @@ -0,0 +1,59 @@ +#!/bin/bash +################################################################################ +# This script is used to update metadata blocks from release and custom files. +################################################################################ + +# Fail on any error +set -euo pipefail +DATAVERSE_SERVICE_HOST=${DATAVERSE_SERVICE_HOST:-"dataverse"} +DATAVERSE_SERVICE_PORT_HTTP=${DATAVERSE_SERVICE_PORT_HTTP:-"8080"} +DATAVERSE_URL=${DATAVERSE_URL:-"http://${DATAVERSE_SERVICE_HOST}:${DATAVERSE_SERVICE_PORT_HTTP}"} + +SOLR_SERVICE_HOST=${SOLR_SERVICE_HOST:-"solr"} +SOLR_SERVICE_PORT_WEBHOOK=${SOLR_SERVICE_PORT_WEBHOOK:-"9000"} +SOLR_URL=${SOLR_URL:-"http://${SOLR_SERVICE_HOST}:${SOLR_SERVICE_PORT_WEBHOOK}/hooks/update-schema"} + +# Check API key secret is available +if [ ! -s "${SECRETS_DIR}/api/key" ]; then + echo "No API key present. Failing." + exit 126 +fi +API_KEY=`cat ${SECRETS_DIR}/api/key` + +# Find all TSV files +TSVS=`find "${METADATA_DIR}" "${HOME_DIR}" -maxdepth 5 -iname '*.tsv'` + +# Check for builtin blocks to be present +BUILTIN=("astrophysics.tsv" "biomedical.tsv" "citation.tsv" "geospatial.tsv" "journals.tsv" "social_science.tsv") +miss=1 +fail=1 +for mdb in "${BUILTIN[@]}"; do + grep "${mdb}" <<< "${TSVS}" > /dev/null 2>&1 || miss=0 + if [ $miss -eq 0 ]; then + echo "ERROR: could not find builtin (release) metadata block file ${mdb} within ${METADATA_DIR} or ${HOME_DIR}" + fail=0 + miss=1 + fi +done + +# Abort if any builtin metadata file has not been find- or readable +if [ $fail -eq 0 ]; then + echo "Aborting." + exit 125 +fi + +# Load metadata blocks +while IFS= read -r TSV; do + echo -n "Loading ${TSV}: " + OUTPUT=`curl -sS -f -H "Content-type: text/tab-separated-values" -X POST --data-binary "@${TSV}" "${DATAVERSE_URL}/api/admin/datasetfield/load?unblock-key=${API_KEY}" 2>&1 || echo -n ""` + echo "$OUTPUT" | jq -rM '.status' 2>/dev/null || echo -e 'FAILED\n' "$OUTPUT" +done <<< "${TSVS}" + +# Trigger Solr Index configuration update +echo "--------------" +echo "Firing webhook for Solr update. Response following:" +echo "--------------" +curl --header "Content-Type: application/json" \ + --request POST -sS -f \ + --data "`jq -Mn --arg key "${API_KEY}" --arg url "${DATAVERSE_URL}" '{ "api_key": $key, "dataverse_url": $url }'`" \ + "${SOLR_URL}" From b4ebe04388eb4672548cf0f5854b6570e4d81ff5 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 1 Sep 2020 00:47:58 +0200 Subject: [PATCH 13/34] Make the Docker Maven Plugin Profile usable with Skaffold. --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cb823111be4..56dc49a434d 100644 --- a/pom.xml +++ b/pom.xml @@ -891,6 +891,7 @@ container true + gdcc/dataverse-k8s:${project.version} @@ -904,7 +905,7 @@ dataverse - gdcc/dataverse-k8s:${project.version} + ${app.image.name} ${project.basedir}/conf/container/Dockerfile @ From 8ed0d633d2b31b089681383fe20c646d2ee8b462 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Fri, 23 Oct 2020 15:16:14 +0200 Subject: [PATCH 14/34] Update docker-maven-plugin to 0.34.1. #5292 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 56dc49a434d..4ca2b6dc816 100644 --- a/pom.xml +++ b/pom.xml @@ -899,7 +899,7 @@ io.fabric8 docker-maven-plugin - 0.33.0 + 0.34.1 From e19852c2d8498331d4f88fddb0dddc7eea9f38a3 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 1 Dec 2020 15:08:16 +0100 Subject: [PATCH 15/34] dataverse-k8s: remove postgres client lib handling as #6819 has been resolved. --- conf/container/Dockerfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/conf/container/Dockerfile b/conf/container/Dockerfile index 26b8d7b5fb2..17486fb5fc7 100644 --- a/conf/container/Dockerfile +++ b/conf/container/Dockerfile @@ -13,7 +13,6 @@ ENV DATA_DIR=/data\ SECRETS_DIR=/secrets\ DUMPS_DIR=/dumps\ DOMAIN_DIR=${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}\ - PGDRIVER_PKG=https://jdbc.postgresql.org/download/postgresql-42.2.12.jar\ JREBEL_LIB=${HOME_DIR}/jrebel/lib/libjrebel64.so\ # Make heap dumps on OOM appear in DUMPS_DIR JVM_ARGS="-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\${ENV=DUMPS_DIR}"\ @@ -40,9 +39,6 @@ RUN wget --no-verbose -O esh https://raw.githubusercontent.com/jirutka/esh/v0.3. # Install PostgreSQL JDBC driver in AppServer # TODO: remove this once upstream includes the Postgres Client lib in the WAR. USER payara -RUN wget --no-verbose -O postgresql.jar ${PGDRIVER_PKG} && \ - mv postgresql.jar ${PAYARA_DIR}/glassfish/lib - RUN wget --no-verbose -O "${HOME_DIR}/jrebel.zip" http://dl.zeroturnaround.com/jrebel-stable-nosetup.zip && \ unzip -q "${HOME_DIR}/jrebel.zip" -d "${HOME_DIR}" From 97759719db4ddd1300007aab0ca7ee32080d6c45 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 1 Dec 2020 15:13:56 +0100 Subject: [PATCH 16/34] dataverse-k8s: fix typo in startup script for disable-phone-home --- conf/container/scripts/init_2_conf_payara.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/container/scripts/init_2_conf_payara.sh b/conf/container/scripts/init_2_conf_payara.sh index f5e26c7fbf0..a3c272522e2 100644 --- a/conf/container/scripts/init_2_conf_payara.sh +++ b/conf/container/scripts/init_2_conf_payara.sh @@ -126,4 +126,4 @@ ln -s ${DEPLOY_DIR}/dataverse/supplements/jhoveConfig.xsd ${PAYARA_DIR}/glassfis sed -i ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhove.conf -e "s:/usr/local/glassfish4/glassfish/domains/domain1:${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}:g" # 6. Disable phone home. Always. -echo "disable-phome-home" >> ${PREBOOT_COMMANDS} +echo "disable-phone-home" >> ${PREBOOT_COMMANDS} From 5ae67f3dae4887d2a25a844641fba5dccb9e67d6 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 1 Dec 2020 15:16:27 +0100 Subject: [PATCH 17/34] dataverse-k8s: remove reference_data.sql loading from bootstrap, as #7256 introduced a migration for this. --- conf/container/Dockerfile | 2 +- conf/container/scripts/bootstrap-job.sh | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/conf/container/Dockerfile b/conf/container/Dockerfile index 17486fb5fc7..6516107106e 100644 --- a/conf/container/Dockerfile +++ b/conf/container/Dockerfile @@ -28,7 +28,7 @@ RUN mkdir -p ${DATA_DIR} ${METADATA_DIR} ${DOCROOT_DIR} ${SECRETS_DIR} ${DUMPS_D # Install prerequisites RUN apt-get -qq update && \ - apt-get -qqy install postgresql-client jq imagemagick curl wget unzip && \ + apt-get -qqy install jq imagemagick curl wget unzip && \ rm -rf /var/lib/apt/lists/* # Install esh template engine from Github diff --git a/conf/container/scripts/bootstrap-job.sh b/conf/container/scripts/bootstrap-job.sh index dc8479931f6..d7936525503 100644 --- a/conf/container/scripts/bootstrap-job.sh +++ b/conf/container/scripts/bootstrap-job.sh @@ -19,11 +19,7 @@ DATAVERSE_URL=${DATAVERSE_URL:-"http://${DATAVERSE_SERVICE_HOST}:${DATAVERSE_SER # option to override. SOLR_K8S_HOST=${SOLR_K8S_HOST:-"solr"} -# Check postgres and API key secrets are available -if [ ! -s "${SECRETS_DIR}/db/password" ]; then - echo "No database password present. Failing." - exit 126 -fi +# Check API key secret is available if [ ! -s "${SECRETS_DIR}/api/key" ]; then echo "No API key present. Failing." exit 126 @@ -35,13 +31,6 @@ if [ -s "${SECRETS_DIR}/admin/password" ]; then ADMIN_PASSWORD=`cat ${SECRETS_DIR}/admin/password` fi -# Drop the Postgres credentials into .pgpass -echo "${POSTGRES_SERVER}:*:*:${POSTGRES_USER}:`cat ${SECRETS_DIR}/db/password`" > ${HOME_DIR}/.pgpass -chmod 0600 ${HOME_DIR}/.pgpass - -# 1.) Load SQL data -psql -h ${POSTGRES_SERVER} -U ${POSTGRES_USER} ${POSTGRES_DATABASE} < ${DEPLOY_DIR}/dataverse/supplements/reference_data.sql - # 2) Initialize common data structures to make Dataverse usable cd ${DEPLOY_DIR}/dataverse/supplements # 2a) Patch load scripts with k8s based URL From 4cad6d547689cb442ac6e09cff8f422736106643 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 1 Dec 2020 15:54:02 +0100 Subject: [PATCH 18/34] dataverse-k8s: small doc correction in Dockerfile --- conf/container/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conf/container/Dockerfile b/conf/container/Dockerfile index 6516107106e..5700ced50ba 100644 --- a/conf/container/Dockerfile +++ b/conf/container/Dockerfile @@ -36,8 +36,7 @@ RUN wget --no-verbose -O esh https://raw.githubusercontent.com/jirutka/esh/v0.3. echo 'fe030e23fc1383780d08128eecf322257cec743b esh' | sha1sum -c - && \ chmod +x esh && mv esh /usr/local/bin -# Install PostgreSQL JDBC driver in AppServer -# TODO: remove this once upstream includes the Postgres Client lib in the WAR. +# Install JRebel library (for development use) USER payara RUN wget --no-verbose -O "${HOME_DIR}/jrebel.zip" http://dl.zeroturnaround.com/jrebel-stable-nosetup.zip && \ unzip -q "${HOME_DIR}/jrebel.zip" -d "${HOME_DIR}" From d90a3bfa821e9944cc1fb6b74172fac8d2b6c95a Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 8 Dec 2020 02:07:00 +0100 Subject: [PATCH 19/34] Remove POSTGRES vars from default.config, no longer necessary. #7418 --- conf/container/scripts/default.config | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/conf/container/scripts/default.config b/conf/container/scripts/default.config index eb18ab34deb..7011534bc69 100644 --- a/conf/container/scripts/default.config +++ b/conf/container/scripts/default.config @@ -1,9 +1,7 @@ # Variables used in resource creation -POSTGRES_SERVER=${POSTGRES_SERVER:-postgresql} -POSTGRES_PORT=${POSTGRES_PORT:-5432} -POSTGRES_USER=${POSTGRES_USER:-dataverse} -POSTGRES_DATABASE=${POSTGRES_DATABASE:-${POSTGRES_USER}} +export DATAVERSE_DB_HOST=${DATAVERSE_DB_HOST:-"postgresql"} + MAIL_SERVER=${MAIL_SERVER:-"postfix"} MAIL_FROMADDRESS=${MAIL_FROMADDRESS:-"do-not-reply@mailinator.com"} CONTACT_MAIL=${CONTACT_MAIL:-"dataverse-k8s-contact@mailinator.com"} From 5698a97317ccba1bc60f7e62aa87aebd63319b61 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 8 Dec 2020 02:07:32 +0100 Subject: [PATCH 20/34] Create symlinks for jHove in Dockerfile. --- conf/container/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conf/container/Dockerfile b/conf/container/Dockerfile index 5700ced50ba..c075cb0488e 100644 --- a/conf/container/Dockerfile +++ b/conf/container/Dockerfile @@ -53,6 +53,11 @@ COPY --chown=payara:payara maven/deps ${DEPLOY_DIR}/dataverse/WEB-INF/lib/ COPY --chown=payara:payara maven/app ${DEPLOY_DIR}/dataverse/ COPY --chown=payara:payara maven/supplements ${DEPLOY_DIR}/dataverse/supplements/ +# Create symlinks for jHove +RUN ln -s ${DEPLOY_DIR}/dataverse/supplements/jhove.conf ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhove.conf && \ + ln -s ${DEPLOY_DIR}/dataverse/supplements/jhoveConfig.xsd ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhoveConfig.xsd && \ + sed -i ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhove.conf -e "s:/usr/local/payara5/glassfish/domains/domain1:${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}:g" + # Copy init and application scripts COPY --chown=payara:payara maven/scripts ${SCRIPT_DIR}/ RUN chmod +x ${SCRIPT_DIR}/* From f73b3b34f183c76d63e0f477071f604a68abcd71 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 8 Dec 2020 02:08:46 +0100 Subject: [PATCH 21/34] Container init script: remove jHove symlink (see Dockerfile), remove JMS and JDBC handling due to #7418 and #7423 --- conf/container/scripts/init_2_conf_payara.sh | 25 -------------------- 1 file changed, 25 deletions(-) diff --git a/conf/container/scripts/init_2_conf_payara.sh b/conf/container/scripts/init_2_conf_payara.sh index a3c272522e2..5ca61aeb32f 100644 --- a/conf/container/scripts/init_2_conf_payara.sh +++ b/conf/container/scripts/init_2_conf_payara.sh @@ -64,32 +64,13 @@ fi # EE 8 code annotations or at least glassfish-resources.xml # NOTE: postboot commands is not multi-line capable, thus spaghetti needed. -# JMS -echo "INFO: Defining JMS resources." -cat >> ${DV_POSTBOOT} << 'EOF' -delete-connector-connection-pool --cascade=true jms/__defaultConnectionFactory-Connection-Pool -create-connector-connection-pool --steadypoolsize=1 --maxpoolsize=250 --poolresize=2 --maxwait=60000 --raname=jmsra --connectiondefinition=javax.jms.QueueConnectionFactory jms/IngestQueueConnectionFactoryPool -create-connector-resource --poolname=jms/IngestQueueConnectionFactoryPool jms/IngestQueueConnectionFactory -create-admin-object --restype=javax.jms.Queue --raname=jmsra --property=Name=DataverseIngest jms/DataverseIngest -EOF - -# JDBC -echo "INFO: Defining JDBC resources." -echo "create-jdbc-connection-pool --restype=javax.sql.DataSource --datasourceclassname=org.postgresql.ds.PGPoolingDataSource --property=create=true:User=${POSTGRES_USER}:PortNumber=${POSTGRES_PORT}:databaseName=${POSTGRES_DATABASE}:ServerName=${POSTGRES_SERVER} dvnDbPool" >> ${DV_POSTBOOT} -echo 'set resources.jdbc-connection-pool.dvnDbPool.property.password=${ALIAS=db_password_alias}' >> ${DV_POSTBOOT} -echo "create-jdbc-resource --connectionpoolid=dvnDbPool jdbc/VDCNetDS" >> ${DV_POSTBOOT} - # JavaMail echo "INFO: Defining JavaMail." echo "create-javamail-resource --mailhost=${MAIL_SERVER} --mailuser=dataversenotify --fromaddress=${MAIL_FROMADDRESS} mail/notifyMailSession" >> ${DV_POSTBOOT} echo "INFO: defining miscellaneous configuration options." -# Timer data source -echo "set configs.config.server-config.ejb-container.ejb-timer-service.timer-datasource=jdbc/VDCNetDS" >> ${DV_POSTBOOT} # AJP connector echo "create-network-listener --protocol=http-listener-1 --listenerport=8009 --jkenabled=true jk-connector" >> ${DV_POSTBOOT} -# Disable logging for grizzly SSL problems -- commented out as this is not GF 4.1 -# echo "set-log-levels org.glassfish.grizzly.http.server.util.RequestUtils=SEVERE" >> ${DV_POSTBOOT} # COMET support echo "set server-config.network-config.protocols.protocol.http-listener-1.http.comet-support-enabled=true" >> ${DV_POSTBOOT} # SAX parser options @@ -119,11 +100,5 @@ echo "--------------------------------------------------" cat ${POSTBOOT_COMMANDS} echo "--------------------------------------------------" -# 5. Symlink the jHove configuration -echo "INFO: Symlinking and editing jHove configuration." -ln -s ${DEPLOY_DIR}/dataverse/supplements/jhove.conf ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhove.conf -ln -s ${DEPLOY_DIR}/dataverse/supplements/jhoveConfig.xsd ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhoveConfig.xsd -sed -i ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhove.conf -e "s:/usr/local/glassfish4/glassfish/domains/domain1:${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}:g" - # 6. Disable phone home. Always. echo "disable-phone-home" >> ${PREBOOT_COMMANDS} From 4cd2eca8524516b560bf2855b19b2a77ac4b3476 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Mon, 8 Feb 2021 15:48:46 +0100 Subject: [PATCH 22/34] Move to JDK 11 as Dataverse 5.4+ is updated to recent Java LTS. --- conf/container/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conf/container/Dockerfile b/conf/container/Dockerfile index c075cb0488e..007acf69f4d 100644 --- a/conf/container/Dockerfile +++ b/conf/container/Dockerfile @@ -4,7 +4,10 @@ # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 -FROM payara/server-full:@payara.version@ +# THIS FILE IS TO BE USED WITH MAVEN DOCKER BUILD: +# mvn -Pcontainer clean package docker:build + +FROM payara/server-full:@payara.version@-jdk11 LABEL maintainer="FDM FZJ " ENV DATA_DIR=/data\ From 6b96b718963fed45cfe945b73f8a6a568e8dde95 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Wed, 17 Feb 2021 09:44:16 +0100 Subject: [PATCH 23/34] feature(container): Refactor Dockerfile basing on openjdk:11-jre Instead of using the upstream Payara image we build on the OpenJDK image which is also used by Solr. That way we reduce image pulls. We also optimize the domain1 configuration to be more production ready. Relates to #5292 --- conf/container/Dockerfile | 145 ++++++++++++++---- .../scripts/{ => app}/bootstrap-job.sh | 0 .../container/scripts/{ => app}/config-job.sh | 0 .../scripts/{ => app}/default.config | 0 .../scripts/{ => app}/init_2_conf_payara.sh | 13 +- .../scripts/{ => app}/init_3_enabledev.sh | 0 .../scripts/{ => app}/metadata-update.sh | 0 conf/container/scripts/system/entrypoint.sh | 11 ++ .../system/init_1_generate_deploy_commands.sh | 62 ++++++++ .../scripts/system/startInForeground.sh | 73 +++++++++ 10 files changed, 272 insertions(+), 32 deletions(-) rename conf/container/scripts/{ => app}/bootstrap-job.sh (100%) rename conf/container/scripts/{ => app}/config-job.sh (100%) rename conf/container/scripts/{ => app}/default.config (100%) rename conf/container/scripts/{ => app}/init_2_conf_payara.sh (94%) rename conf/container/scripts/{ => app}/init_3_enabledev.sh (100%) rename conf/container/scripts/{ => app}/metadata-update.sh (100%) create mode 100644 conf/container/scripts/system/entrypoint.sh create mode 100644 conf/container/scripts/system/init_1_generate_deploy_commands.sh create mode 100644 conf/container/scripts/system/startInForeground.sh diff --git a/conf/container/Dockerfile b/conf/container/Dockerfile index 007acf69f4d..29d64ed6f8f 100644 --- a/conf/container/Dockerfile +++ b/conf/container/Dockerfile @@ -7,42 +7,128 @@ # THIS FILE IS TO BE USED WITH MAVEN DOCKER BUILD: # mvn -Pcontainer clean package docker:build -FROM payara/server-full:@payara.version@-jdk11 +# Using same base image as Solr (https://hub.docker.com/_/solr), reducing pulls +FROM openjdk:11-jre LABEL maintainer="FDM FZJ " +# Default payara ports to expose +# 4848: admin console +# 9009: debug port (JPDA) +# 8080: http +# 8181: https +EXPOSE 4848 9009 8080 8181 -ENV DATA_DIR=/data\ - DOCROOT_DIR=/docroot\ - METADATA_DIR=/metadata\ - SECRETS_DIR=/secrets\ - DUMPS_DIR=/dumps\ - DOMAIN_DIR=${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}\ - JREBEL_LIB=${HOME_DIR}/jrebel/lib/libjrebel64.so\ +ENV HOME_DIR="/opt/payara" +ENV PAYARA_DIR="${HOME_DIR}/appserver" \ + SCRIPT_DIR="${HOME_DIR}/scripts" \ + CONFIG_DIR="${HOME_DIR}/config" \ + DEPLOY_DIR="${HOME_DIR}/deployments" \ + DATA_DIR="/data" \ + DOCROOT_DIR="/docroot" \ + METADATA_DIR="/metadata" \ + SECRETS_DIR="/secrets" \ + DUMPS_DIR="/dumps" \ + PASSWORD_FILE="${HOME_DIR}/passwordFile" \ + ADMIN_USER="admin" \ + ADMIN_PASSWORD="admin" \ + DOMAIN_NAME="domain1" \ + PAYARA_ARGS="" +ENV PATH="${PATH}:${PAYARA_DIR}/bin" \ + DOMAIN_DIR="${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}" \ + JVM_ARGS="" \ + MEM_MAX_RAM_PERCENTAGE="70.0" \ + MEM_XSS="512k" \ + PREBOOT_COMMANDS="${CONFIG_DIR}/pre-boot-commands.asadmin" \ + POSTBOOT_COMMANDS="${CONFIG_DIR}/post-boot-commands.asadmin" \ + DEPLOY_PROPS="" \ # Make heap dumps on OOM appear in DUMPS_DIR - JVM_ARGS="-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\${ENV=DUMPS_DIR}"\ + ENABLE_DUMPS=0 \ + JVM_DUMPS_ARGS="-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\${ENV=DUMPS_DIR}" \ # Documenting development options (see init_3_enabledev.sh) - ENABLE_JMX=0\ - ENABLE_JDWP=0\ - ENABLE_JREBEL=0 + ENABLE_JMX=0 \ + ENABLE_JDWP=0 \ + ENABLE_JREBEL=0 \ + JREBEL_LIB="${HOME_DIR}/jrebel/lib/libjrebel64.so" -# Create basic pathes +ARG PAYARA_VERSION="@payara.version@" +ARG TINI_VERSION=0.19.0 +ARG ESH_VERSION=0.3.1 +ARG ESH_CHECKSUM="" +ARG PKGS="jq imagemagick curl unzip" +ARG ASADMIN="${PAYARA_DIR}/bin/asadmin --user=${ADMIN_USER} --passwordfile=${PASSWORD_FILE}" + +### PART 1: SYSTEM ### USER root -RUN mkdir -p ${DATA_DIR} ${METADATA_DIR} ${DOCROOT_DIR} ${SECRETS_DIR} ${DUMPS_DIR} && \ +WORKDIR / +RUN true && \ + # Download tini + curl -sSfL -o /tini "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini" && \ + curl -sSfL -o /tini.sha256 "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini.sha256sum" && \ + # Check and install tini + sha256sum -c /tini.sha256 && \ + chmod +x /tini && \ + # Create pathes + mkdir -p ${HOME_DIR} ${PAYARA_DIR} ${DEPLOY_DIR} ${CONFIG_DIR} ${SCRIPT_DIR} && \ + mkdir -p ${DATA_DIR} ${METADATA_DIR} ${DOCROOT_DIR} ${SECRETS_DIR} ${DUMPS_DIR} && \ + # Create user + addgroup --gid 1000 payara && \ + adduser --system --uid 1000 --no-create-home --shell /bin/bash --home "${HOME_DIR}" --gecos "" --ingroup payara payara && \ + echo payara:payara | chpasswd && \ + # Set permissions + chown -R payara: ${HOME_DIR} && \ chown -R payara: ${DATA_DIR} ${METADATA_DIR} ${DOCROOT_DIR} ${SECRETS_DIR} ${DUMPS_DIR} -# Install prerequisites -RUN apt-get -qq update && \ - apt-get -qqy install jq imagemagick curl wget unzip && \ - rm -rf /var/lib/apt/lists/* - -# Install esh template engine from Github -RUN wget --no-verbose -O esh https://raw.githubusercontent.com/jirutka/esh/v0.3.0/esh && \ - echo 'fe030e23fc1383780d08128eecf322257cec743b esh' | sha1sum -c - && \ - chmod +x esh && mv esh /usr/local/bin +RUN true && \ + # Download & check esh template script + curl -sSfL -o /usr/bin/esh https://raw.githubusercontent.com/jirutka/esh/v${ESH_VERSION}/esh && \ + echo '1e0bd783f930cba13d6708b11c1ac844bbb1eddd02ac1666fc10d47eb9517bd7 /usr/bin/esh' | sha256sum -c - && \ + chmod +x /usr/bin/esh && \ + # Download & unzip JRebel to $JREBEL_LIB = ${HOME_DIR}/jrebel/lib/libjrebel64.so (for development use) + curl -sS -f -o ${HOME_DIR}/jrebel.zip http://dl.zeroturnaround.com/jrebel-stable-nosetup.zip && \ + unzip -q "${HOME_DIR}/jrebel.zip" -d "${HOME_DIR}" && \ + # Install packages + apt-get update -q && \ + apt-get install -qqy ${PKGS} && \ + rm -rf /var/lib/apt/lists/* "${HOME_DIR}/jrebel.zip" -# Install JRebel library (for development use) +### PART 2: PAYARA ### +# After setting up system, now configure Payara USER payara -RUN wget --no-verbose -O "${HOME_DIR}/jrebel.zip" http://dl.zeroturnaround.com/jrebel-stable-nosetup.zip && \ - unzip -q "${HOME_DIR}/jrebel.zip" -d "${HOME_DIR}" +WORKDIR ${HOME_DIR} + +# Download, check and install Payara +RUN curl -sSfL -o payara.zip "https://repo1.maven.org/maven2/fish/payara/distributions/payara/${PAYARA_VERSION}/payara-${PAYARA_VERSION}.zip" && \ + curl -sSfL -o payara.zip.sha256 "https://repo1.maven.org/maven2/fish/payara/distributions/payara/${PAYARA_VERSION}/payara-${PAYARA_VERSION}.zip.sha256" && \ + echo "$(cat payara.zip.sha256) payara.zip" | sha256sum -c - && \ + unzip -q payara.zip -d ${HOME_DIR} && \ + mv ${HOME_DIR}/payara5/* ${PAYARA_DIR}/ && \ + rm -rf ${HOME_DIR}/payara5 payara.zip* + +# Copy the system (appserver level) scripts like entrypoint, etc +COPY --chown=payara:payara maven/scripts/system ${SCRIPT_DIR}/ + +# TODO: refactor and make production ready +# Configure the domain to be container and production ready +RUN true && \ + # Set admin password + echo "AS_ADMIN_PASSWORD=\nAS_ADMIN_NEWPASSWORD=${ADMIN_PASSWORD}" > /tmp/password-change-file.txt && \ + echo "AS_ADMIN_PASSWORD=${ADMIN_PASSWORD}" >> ${PASSWORD_FILE} && \ + asadmin --user=${ADMIN_USER} --passwordfile=/tmp/password-change-file.txt change-admin-password --domain_name=${DOMAIN_NAME} && \ + # Start domain for configuration + ${ASADMIN} start-domain ${DOMAIN_NAME} && \ + # Allow access to admin with password only + ${ASADMIN} enable-secure-admin && \ + # List & delete memory settings from domain + for MEMORY_JVM_OPTION in $(asadmin --user=${ADMIN_USER} --passwordfile=${PASSWORD_FILE} list-jvm-options | grep "Xm[sx]\|Xss"); \ + do \ + ${ASADMIN} delete-jvm-options $MEMORY_JVM_OPTION;\ + done && \ + ${ASADMIN} create-jvm-options '-XX\:+UseContainerSupport:-XX\:MaxRAMPercentage=${ENV=MEM_MAX_RAM_PERCENTAGE}:-Xss${ENV=MEM_XSS}' && \ + ${ASADMIN} set-log-attributes com.sun.enterprise.server.logging.GFFileHandler.logtoFile=false && \ + ${ASADMIN} stop-domain ${DOMAIN_NAME} && \ + rm -rf \ + /tmp/password-change-file.txt \ + ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/osgi-cache \ + ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/logs # Make docroot of Payara reside in higher level directory for easier targeting # Due to IQSS/dataverse-kubernetes#177: create the generated pathes so they are @@ -51,6 +137,7 @@ RUN rm -rf ${DOMAIN_DIR}/docroot && \ ln -s ${DOCROOT_DIR} ${DOMAIN_DIR}/docroot && \ mkdir -p ${DOMAIN_DIR}/generated/jsp/dataverse +### PART 3: DATAVERSE INSTALLATION ### # Copy app and deps from assembly in proper layers COPY --chown=payara:payara maven/deps ${DEPLOY_DIR}/dataverse/WEB-INF/lib/ COPY --chown=payara:payara maven/app ${DEPLOY_DIR}/dataverse/ @@ -62,5 +149,9 @@ RUN ln -s ${DEPLOY_DIR}/dataverse/supplements/jhove.conf ${PAYARA_DIR}/glassfish sed -i ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhove.conf -e "s:/usr/local/payara5/glassfish/domains/domain1:${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}:g" # Copy init and application scripts -COPY --chown=payara:payara maven/scripts ${SCRIPT_DIR}/ +COPY --chown=payara:payara maven/scripts/app ${SCRIPT_DIR}/ RUN chmod +x ${SCRIPT_DIR}/* + +# Set the entrypoint +ENTRYPOINT ["/tini", "--"] +CMD "${SCRIPT_DIR}/entrypoint.sh" \ No newline at end of file diff --git a/conf/container/scripts/bootstrap-job.sh b/conf/container/scripts/app/bootstrap-job.sh similarity index 100% rename from conf/container/scripts/bootstrap-job.sh rename to conf/container/scripts/app/bootstrap-job.sh diff --git a/conf/container/scripts/config-job.sh b/conf/container/scripts/app/config-job.sh similarity index 100% rename from conf/container/scripts/config-job.sh rename to conf/container/scripts/app/config-job.sh diff --git a/conf/container/scripts/default.config b/conf/container/scripts/app/default.config similarity index 100% rename from conf/container/scripts/default.config rename to conf/container/scripts/app/default.config diff --git a/conf/container/scripts/init_2_conf_payara.sh b/conf/container/scripts/app/init_2_conf_payara.sh similarity index 94% rename from conf/container/scripts/init_2_conf_payara.sh rename to conf/container/scripts/app/init_2_conf_payara.sh index 5ca61aeb32f..c34c2230772 100644 --- a/conf/container/scripts/init_2_conf_payara.sh +++ b/conf/container/scripts/app/init_2_conf_payara.sh @@ -22,7 +22,7 @@ echo "# Dataverse postboot configuration for Payara" > ${DV_POSTBOOT} # TODO: This is ugly and dirty. It leaves leftovers on the filesystem. # It should be replaced by using proper config mechanisms sooner than later, # like MicroProfile Config API. -for alias in rserve doi db +for alias in rserve doi do if [ -f ${SECRETS_DIR}/$alias/password ]; then echo "INFO: Defining password alias for $alias" @@ -93,12 +93,15 @@ env -0 | grep -z -Ee "^(dataverse|doi)_" | while IFS='=' read -r -d '' k v; do echo "create-system-properties ${KEY}=${v}" >> ${DV_POSTBOOT} done -# 4. Add the commands to the existing postboot file, but insert BEFORE deployment +# 4. Disable phone home. Always. +echo "disable-phone-home" >> ${DV_POSTBOOT} + +# 5. Enable config dir for dealing with secrets etc. +echo "set-config-dir --directory=$SECRETS_DIR" >> ${DV_POSTBOOT} + +# 6. Add the commands to the existing postboot file, but insert BEFORE deployment echo "$(cat ${DV_POSTBOOT} | cat - ${POSTBOOT_COMMANDS} )" > ${POSTBOOT_COMMANDS} echo "DEBUG: postboot contains the following commands:" echo "--------------------------------------------------" cat ${POSTBOOT_COMMANDS} echo "--------------------------------------------------" - -# 6. Disable phone home. Always. -echo "disable-phone-home" >> ${PREBOOT_COMMANDS} diff --git a/conf/container/scripts/init_3_enabledev.sh b/conf/container/scripts/app/init_3_enabledev.sh similarity index 100% rename from conf/container/scripts/init_3_enabledev.sh rename to conf/container/scripts/app/init_3_enabledev.sh diff --git a/conf/container/scripts/metadata-update.sh b/conf/container/scripts/app/metadata-update.sh similarity index 100% rename from conf/container/scripts/metadata-update.sh rename to conf/container/scripts/app/metadata-update.sh diff --git a/conf/container/scripts/system/entrypoint.sh b/conf/container/scripts/system/entrypoint.sh new file mode 100644 index 00000000000..438f177a11b --- /dev/null +++ b/conf/container/scripts/system/entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +for f in ${SCRIPT_DIR}/init_* ${SCRIPT_DIR}/init.d/*; do + case "$f" in + *.sh) echo "[Entrypoint] running $f"; . "$f" ;; + *) echo "[Entrypoint] ignoring $f" ;; + esac + echo +done + +exec ${SCRIPT_DIR}/startInForeground.sh $PAYARA_ARGS diff --git a/conf/container/scripts/system/init_1_generate_deploy_commands.sh b/conf/container/scripts/system/init_1_generate_deploy_commands.sh new file mode 100644 index 00000000000..234196ee246 --- /dev/null +++ b/conf/container/scripts/system/init_1_generate_deploy_commands.sh @@ -0,0 +1,62 @@ +#!/bin/bash +################################################################################ +# +# A script to append deploy commands to the post boot command file at +# $PAYARA_HOME/scripts/post-boot-commands.asadmin file. All applications in the +# $DEPLOY_DIR (either files or folders) will be deployed. +# The $POSTBOOT_COMMANDS file can then be used with the start-domain using the +# --postbootcommandfile parameter to deploy applications on startup. +# +# Usage: +# ./generate_deploy_commands.sh +# +# Optionally, any number of parameters of the asadmin deploy command can be +# specified as parameters to this script. +# E.g., to deploy applications with implicit CDI scanning disabled: +# +# ./generate_deploy_commands.sh --properties=implicitCdiEnabled=false +# +# Environment variables used: +# - $PREBOOT_COMMANDS - the pre boot command file. +# - $POSTBOOT_COMMANDS - the post boot command file. +# +# Note that many parameters to the deploy command can be safely used only when +# a single application exists in the $DEPLOY_DIR directory. +################################################################################ + +# Check required variables are set +if [ -z $DEPLOY_DIR ]; then echo "Variable DEPLOY_DIR is not set."; exit 1; fi +if [ -z $PREBOOT_COMMANDS ]; then echo "Variable PREBOOT_COMMANDS is not set."; exit 1; fi +if [ -z $POSTBOOT_COMMANDS ]; then echo "Variable POSTBOOT_COMMANDS is not set."; exit 1; fi + +# Create pre and post boot command files if they don't exist +touch $POSTBOOT_COMMANDS +touch $PREBOOT_COMMANDS + +deploy() { + + if [ -z $1 ]; then + echo "No deployment specified"; + exit 1; + fi + + DEPLOY_STATEMENT="deploy $DEPLOY_PROPS $1" + if grep -q $1 $POSTBOOT_COMMANDS; then + echo "post boot commands already deploys $1"; + else + echo "Adding deployment target $1 to post boot commands"; + echo $DEPLOY_STATEMENT >> $POSTBOOT_COMMANDS; + fi +} + +# RAR files first +for deployment in $(find $DEPLOY_DIR -mindepth 1 -maxdepth 1 -name "*.rar"); +do + deploy $deployment; +done + +# Then every other WAR, EAR, JAR or directory +for deployment in $(find $DEPLOY_DIR -mindepth 1 -maxdepth 1 ! -name "*.rar" -a -name "*.war" -o -name "*.ear" -o -name "*.jar" -o -type d); +do + deploy $deployment; +done diff --git a/conf/container/scripts/system/startInForeground.sh b/conf/container/scripts/system/startInForeground.sh new file mode 100644 index 00000000000..f2b82ee2020 --- /dev/null +++ b/conf/container/scripts/system/startInForeground.sh @@ -0,0 +1,73 @@ +#!/bin/bash +########################################################################################################## +# +# This script is to execute Payara Server in foreground, mainly in a docker environment. +# It allows to avoid running 2 instances of JVM, which happens with the start-domain --verbose command. +# +# Usage: +# Running +# startInForeground.sh +# is equivalent to running +# asadmin start-domain +# +# It's possible to use any arguments of the start-domain command as arguments to startInForeground.sh +# +# Environment variables used: +# - $ADMIN_USER - the username to use for the asadmin utility. +# - $PASSWORD_FILE - the password file to use for the asadmin utility. +# - $PREBOOT_COMMANDS - the pre boot command file. +# - $POSTBOOT_COMMANDS - the post boot command file. +# - $DOMAIN_NAME - the name of the domain to start. +# - $JVM_ARGS - extra JVM options to pass to the Payara Server instance. +# - $AS_ADMIN_MASTERPASSWORD - the master password for the Payara Server instance. +# +# This script executes the asadmin tool which is expected at ~/appserver/bin/asadmin. +# +########################################################################################################## + +# Check required variables are set +if [ -z $ADMIN_USER ]; then echo "Variable ADMIN_USER is not set."; exit 1; fi +if [ -z $PASSWORD_FILE ]; then echo "Variable PASSWORD_FILE is not set."; exit 1; fi +if [ -z $PREBOOT_COMMANDS ]; then echo "Variable PREBOOT_COMMANDS is not set."; exit 1; fi +if [ -z $POSTBOOT_COMMANDS ]; then echo "Variable POSTBOOT_COMMANDS is not set."; exit 1; fi +if [ -z $DOMAIN_NAME ]; then echo "Variable DOMAIN_NAME is not set."; exit 1; fi + +# The following command gets the command line to be executed by start-domain +# - print the command line to the server with --dry-run, each argument on a separate line +# - remove -read-string argument +# - surround each line except with parenthesis to allow spaces in paths +# - remove lines before and after the command line and squash commands on a single line + +# Create pre and post boot command files if they don't exist +touch $POSTBOOT_COMMANDS +touch $PREBOOT_COMMANDS + +OUTPUT=`${PAYARA_DIR}/bin/asadmin --user=${ADMIN_USER} --passwordfile=${PASSWORD_FILE} start-domain --dry-run --prebootcommandfile=${PREBOOT_COMMANDS} --postbootcommandfile=${POSTBOOT_COMMANDS} $@ $DOMAIN_NAME` +STATUS=$? +if [ "$STATUS" -ne 0 ] + then + echo ERROR: $OUTPUT >&2 + exit 1 +fi + +COMMAND=`echo "$OUTPUT"\ + | sed -n -e '2,/^$/p'\ + | sed "s|glassfish.jar|glassfish.jar $JVM_ARGS |g"` + +echo Executing Payara Server with the following command line: +echo $COMMAND | tr ' ' '\n' +echo + +# Run the server in foreground - read master password from variable or file or use the default "changeit" password + +set +x +if test "$AS_ADMIN_MASTERPASSWORD"x = x -a -f "$PASSWORD_FILE" + then + source "$PASSWORD_FILE" +fi +if test "$AS_ADMIN_MASTERPASSWORD"x = x + then + AS_ADMIN_MASTERPASSWORD=changeit +fi +echo "AS_ADMIN_MASTERPASSWORD=$AS_ADMIN_MASTERPASSWORD" > /tmp/masterpwdfile +exec ${COMMAND} < /tmp/masterpwdfile From c75b5070f78f770161a4f718493337f741666808 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Wed, 17 Feb 2021 10:51:31 +0100 Subject: [PATCH 24/34] feature(container): Make domain1 more production ready 1. Moving some specifics from the startup script to the build time config, saving time during startup. 2. Enlarging thread pools, setting better options for memory management and many other optimizations for using in production. See also gdcc/dataverse-kubernetes#218 Relates to #5292 --- conf/container/Dockerfile | 39 ++++++++++++++++++- .../scripts/app/init_2_conf_payara.sh | 16 +------- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/conf/container/Dockerfile b/conf/container/Dockerfile index 29d64ed6f8f..47dd86a9345 100644 --- a/conf/container/Dockerfile +++ b/conf/container/Dockerfile @@ -117,14 +117,49 @@ RUN true && \ ${ASADMIN} start-domain ${DOMAIN_NAME} && \ # Allow access to admin with password only ${ASADMIN} enable-secure-admin && \ + + ### CONTAINER USAGE ENABLEMENT # List & delete memory settings from domain - for MEMORY_JVM_OPTION in $(asadmin --user=${ADMIN_USER} --passwordfile=${PASSWORD_FILE} list-jvm-options | grep "Xm[sx]\|Xss"); \ + for MEMORY_JVM_OPTION in $(${ASADMIN} list-jvm-options | grep "Xm[sx]\|Xss\|NewRatio"); \ do \ - ${ASADMIN} delete-jvm-options $MEMORY_JVM_OPTION;\ + ${ASADMIN} delete-jvm-options $(echo $MEMORY_JVM_OPTION | sed -e 's/:/\\:/g'); \ done && \ ${ASADMIN} create-jvm-options '-XX\:+UseContainerSupport:-XX\:MaxRAMPercentage=${ENV=MEM_MAX_RAM_PERCENTAGE}:-Xss${ENV=MEM_XSS}' && \ + # Set logging to console only ${ASADMIN} set-log-attributes com.sun.enterprise.server.logging.GFFileHandler.logtoFile=false && \ + + ### PRODUCTION READINESS + ${ASADMIN} create-jvm-options '-XX\:+UseG1GC:-XX\:+UseStringDeduplication:-XX\:MaxGCPauseMillis=500' && \ + ${ASADMIN} create-jvm-options '-XX\:MetaspaceSize=256m:-XX\:MaxMetaspaceSize=2g:-XX\:+IgnoreUnrecognizedVMOptions' && \ + # Enlarge thread pools + ${ASADMIN} set server-config.thread-pools.thread-pool.http-thread-pool.max-thread-pool-size="50" && \ + ${ASADMIN} set server-config.thread-pools.thread-pool.http-thread-pool.max-queue-size="" && \ + ${ASADMIN} set default-config.thread-pools.thread-pool.thread-pool-1.max-thread-pool-size="250" && \ + # Enable file caching + ${ASADMIN} set server-config.network-config.protocols.protocol.http-listener-1.http.file-cache.enabled="true" && \ + ${ASADMIN} set server-config.network-config.protocols.protocol.http-listener-2.http.file-cache.enabled="true" && \ + ${ASADMIN} set default-config.network-config.protocols.protocol.http-listener-1.http.file-cache.enabled="true" && \ + ${ASADMIN} set default-config.network-config.protocols.protocol.http-listener-2.http.file-cache.enabled="true" && \ + # Enlarge EJB pools (cannot do this for server-config as set does not create new entries) + ${ASADMIN} set default-config.ejb-container.max-pool-size="128" && \ + # Misc settings + ${ASADMIN} create-system-properties fish.payara.classloading.delegate="false" && \ + ${ASADMIN} create-system-properties jersey.config.client.readTimeout="300000" && \ + ${ASADMIN} create-system-properties jersey.config.client.connectTimeout="300000" && \ + + ### DATAVERSE APPLICATION SPECIFICS + ${ASADMIN} set-config-dir --directory=${SECRETS_DIR} && \ + # TODO: what of the below 3 items can be deleted for container usage? + ${ASADMIN} create-network-listener --protocol=http-listener-1 --listenerport=8009 --jkenabled=true jk-connector && \ + ${ASADMIN} set server-config.network-config.protocols.protocol.http-listener-1.http.comet-support-enabled=true && \ + ${ASADMIN} create-system-properties javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl && \ + # Always disable phoning home... + ${ASADMIN} disable-phone-home && \ + + ### CLEANUP + # Stop domain ${ASADMIN} stop-domain ${DOMAIN_NAME} && \ + # Delete generated files rm -rf \ /tmp/password-change-file.txt \ ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/osgi-cache \ diff --git a/conf/container/scripts/app/init_2_conf_payara.sh b/conf/container/scripts/app/init_2_conf_payara.sh index c34c2230772..8f90e2f0b08 100644 --- a/conf/container/scripts/app/init_2_conf_payara.sh +++ b/conf/container/scripts/app/init_2_conf_payara.sh @@ -68,14 +68,6 @@ fi echo "INFO: Defining JavaMail." echo "create-javamail-resource --mailhost=${MAIL_SERVER} --mailuser=dataversenotify --fromaddress=${MAIL_FROMADDRESS} mail/notifyMailSession" >> ${DV_POSTBOOT} -echo "INFO: defining miscellaneous configuration options." -# AJP connector -echo "create-network-listener --protocol=http-listener-1 --listenerport=8009 --jkenabled=true jk-connector" >> ${DV_POSTBOOT} -# COMET support -echo "set server-config.network-config.protocols.protocol.http-listener-1.http.comet-support-enabled=true" >> ${DV_POSTBOOT} -# SAX parser options -echo "create-system-properties javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl" >> ${DV_POSTBOOT} - # 3. Domain based configuration options # Set Dataverse environment variables echo "INFO: Defining system properties for Dataverse configuration options." @@ -93,13 +85,7 @@ env -0 | grep -z -Ee "^(dataverse|doi)_" | while IFS='=' read -r -d '' k v; do echo "create-system-properties ${KEY}=${v}" >> ${DV_POSTBOOT} done -# 4. Disable phone home. Always. -echo "disable-phone-home" >> ${DV_POSTBOOT} - -# 5. Enable config dir for dealing with secrets etc. -echo "set-config-dir --directory=$SECRETS_DIR" >> ${DV_POSTBOOT} - -# 6. Add the commands to the existing postboot file, but insert BEFORE deployment +# 4. Add the commands to the existing postboot file, but insert BEFORE deployment echo "$(cat ${DV_POSTBOOT} | cat - ${POSTBOOT_COMMANDS} )" > ${POSTBOOT_COMMANDS} echo "DEBUG: postboot contains the following commands:" echo "--------------------------------------------------" From eccbdbfa71b8ce448592449ff90357390946caf7 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Mon, 8 Mar 2021 12:13:41 +0100 Subject: [PATCH 25/34] feature(container): adding more packages for analysis inside container plus jattach --- conf/container/Dockerfile | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/conf/container/Dockerfile b/conf/container/Dockerfile index 47dd86a9345..2d4cc955750 100644 --- a/conf/container/Dockerfile +++ b/conf/container/Dockerfile @@ -50,22 +50,17 @@ ENV PATH="${PATH}:${PAYARA_DIR}/bin" \ JREBEL_LIB="${HOME_DIR}/jrebel/lib/libjrebel64.so" ARG PAYARA_VERSION="@payara.version@" -ARG TINI_VERSION=0.19.0 ARG ESH_VERSION=0.3.1 -ARG ESH_CHECKSUM="" -ARG PKGS="jq imagemagick curl unzip" +ARG ESH_CHECKSUM="1e0bd783f930cba13d6708b11c1ac844bbb1eddd02ac1666fc10d47eb9517bd7" +ARG JATTACH_VERSION="v1.5" +ARG JATTACH_CHECKSUM="adab16e1081aa4fafc91f3f2e44262338a498d8f853d3c6801050889e6389548" +ARG PKGS="jq imagemagick curl unzip wget acl dirmngr gpg lsof procps netcat tini" ARG ASADMIN="${PAYARA_DIR}/bin/asadmin --user=${ADMIN_USER} --passwordfile=${PASSWORD_FILE}" ### PART 1: SYSTEM ### USER root WORKDIR / RUN true && \ - # Download tini - curl -sSfL -o /tini "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini" && \ - curl -sSfL -o /tini.sha256 "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini.sha256sum" && \ - # Check and install tini - sha256sum -c /tini.sha256 && \ - chmod +x /tini && \ # Create pathes mkdir -p ${HOME_DIR} ${PAYARA_DIR} ${DEPLOY_DIR} ${CONFIG_DIR} ${SCRIPT_DIR} && \ mkdir -p ${DATA_DIR} ${METADATA_DIR} ${DOCROOT_DIR} ${SECRETS_DIR} ${DUMPS_DIR} && \ @@ -78,16 +73,25 @@ RUN true && \ chown -R payara: ${DATA_DIR} ${METADATA_DIR} ${DOCROOT_DIR} ${SECRETS_DIR} ${DUMPS_DIR} RUN true && \ + # Install packages + apt-get update -q && \ + apt-get install -qqy ${PKGS} && \ + # Download & check esh template script curl -sSfL -o /usr/bin/esh https://raw.githubusercontent.com/jirutka/esh/v${ESH_VERSION}/esh && \ - echo '1e0bd783f930cba13d6708b11c1ac844bbb1eddd02ac1666fc10d47eb9517bd7 /usr/bin/esh' | sha256sum -c - && \ + echo "${ESH_CHECKSUM} /usr/bin/esh" | sha256sum -c - && \ chmod +x /usr/bin/esh && \ + + # Install jattach + curl -sSfL -o /usr/bin/jattach https://github.com/apangin/jattach/releases/download/${JATTACH_VERSION}/jattach && \ + echo "${JATTACH_CHECKSUM} /usr/bin/jattach" | sha256sum -c - && \ + chmod +x /usr/bin/jattach && \ + # Download & unzip JRebel to $JREBEL_LIB = ${HOME_DIR}/jrebel/lib/libjrebel64.so (for development use) curl -sS -f -o ${HOME_DIR}/jrebel.zip http://dl.zeroturnaround.com/jrebel-stable-nosetup.zip && \ unzip -q "${HOME_DIR}/jrebel.zip" -d "${HOME_DIR}" && \ - # Install packages - apt-get update -q && \ - apt-get install -qqy ${PKGS} && \ + + # Cleanup rm -rf /var/lib/apt/lists/* "${HOME_DIR}/jrebel.zip" ### PART 2: PAYARA ### @@ -166,8 +170,8 @@ RUN true && \ ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/logs # Make docroot of Payara reside in higher level directory for easier targeting -# Due to IQSS/dataverse-kubernetes#177: create the generated pathes so they are -# writeable by us. TBR with #178. +# Due to gdcc/dataverse-kubernetes#177: create the generated pathes so they are +# writeable by us. TBR with gdcc/dataverse-kubernetes#178. RUN rm -rf ${DOMAIN_DIR}/docroot && \ ln -s ${DOCROOT_DIR} ${DOMAIN_DIR}/docroot && \ mkdir -p ${DOMAIN_DIR}/generated/jsp/dataverse @@ -188,5 +192,5 @@ COPY --chown=payara:payara maven/scripts/app ${SCRIPT_DIR}/ RUN chmod +x ${SCRIPT_DIR}/* # Set the entrypoint -ENTRYPOINT ["/tini", "--"] +ENTRYPOINT ["/usr/bin/tini", "--"] CMD "${SCRIPT_DIR}/entrypoint.sh" \ No newline at end of file From 01c0f26015a285030dd9ec73bc76ff8b96cc3b96 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Mon, 8 Mar 2021 13:22:42 +0100 Subject: [PATCH 26/34] feature(container): make pom.xml contain a variable for the Solr version --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4ca2b6dc816..8938efb71bb 100644 --- a/pom.xml +++ b/pom.xml @@ -28,6 +28,7 @@ 8.0.0 5.2020.6 42.2.19 + 8.8.1 1.11.762 1.2 3.12.0 @@ -336,7 +337,7 @@ org.apache.solr solr-solrj - 8.8.1 + ${solr.version} org.apache.commons From d5d90ade1d5b61925bd098d7da5e842b124a3b89 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Mon, 8 Mar 2021 16:17:23 +0100 Subject: [PATCH 27/34] feature(solr): add a Solr container with our prebaked schema and solrconfig. --- conf/solr/Dockerfile | 27 +++++++++++++++++++++++++++ conf/solr/assembly.xml | 24 ++++++++++++++++++++++++ pom.xml | 15 +++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 conf/solr/Dockerfile create mode 100644 conf/solr/assembly.xml diff --git a/conf/solr/Dockerfile b/conf/solr/Dockerfile new file mode 100644 index 00000000000..8e67f038601 --- /dev/null +++ b/conf/solr/Dockerfile @@ -0,0 +1,27 @@ +# Copyright 2019 Forschungszentrum Jülich GmbH +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 + +FROM solr:@solr.version@ + +LABEL maintainer="FDM FZJ " + +ENV SOLR_OPTS="-Dsolr.jetty.request.header.size=102400" \ + COLLECTION="collection1" \ + CONFIGSET="dataverse" \ + CONFIGSETS_DIR=/opt/solr-@solr.version@/server/solr/configsets + +USER root +# Create the Dataverse configset for Solr +# 1) Copy the default configset +# 2) Modify with config files from build context +RUN true && \ + cp -a ${CONFIGSETS_DIR}/_default ${CONFIGSETS_DIR}/${CONFIGSET} && \ + rm ${CONFIGSETS_DIR}/${CONFIGSET}/conf/managed-schema +COPY --chown=root:root maven/config/*.xml ${CONFIGSETS_DIR}/${CONFIGSET}/conf/ + +USER ${SOLR_USER} +# Make the precreate script build our collection on startup (can change the env vars to use different) +CMD ["sh", "-c", "solr-precreate ${COLLECTION} ${CONFIGSETS_DIR}/${CONFIGSET}"] \ No newline at end of file diff --git a/conf/solr/assembly.xml b/conf/solr/assembly.xml new file mode 100644 index 00000000000..1c832f1f5f0 --- /dev/null +++ b/conf/solr/assembly.xml @@ -0,0 +1,24 @@ + + + + + conf/solr/${solr.version} + config + + *.xml + + + + + + conf/solr/${solr.version} + scripts + + *.sh + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 8938efb71bb..7ef64771413 100644 --- a/pom.xml +++ b/pom.xml @@ -893,6 +893,7 @@ true gdcc/dataverse-k8s:${project.version} + gdcc/solr-k8s:${project.version} @@ -917,6 +918,20 @@ + + + solr + ${solr.image.name} + + ${project.basedir}/conf/solr/Dockerfile + @ + + tar + gnu + ${project.basedir}/conf/solr/assembly.xml + + + From 63bc42a16c21988c5d857d15880f7d67f864bc87 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Fri, 26 Mar 2021 00:35:00 +0100 Subject: [PATCH 28/34] fix(container): fix missing version info in deployment with temporary workaround. --- conf/container/Dockerfile | 6 +++++- conf/container/assembly.xml | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/conf/container/Dockerfile b/conf/container/Dockerfile index 2d4cc955750..fd6e019b2e0 100644 --- a/conf/container/Dockerfile +++ b/conf/container/Dockerfile @@ -47,7 +47,8 @@ ENV PATH="${PATH}:${PAYARA_DIR}/bin" \ ENABLE_JMX=0 \ ENABLE_JDWP=0 \ ENABLE_JREBEL=0 \ - JREBEL_LIB="${HOME_DIR}/jrebel/lib/libjrebel64.so" + JREBEL_LIB="${HOME_DIR}/jrebel/lib/libjrebel64.so" \ + DATAVERSE_VERSION="@project.version@" ARG PAYARA_VERSION="@payara.version@" ARG ESH_VERSION=0.3.1 @@ -181,6 +182,9 @@ RUN rm -rf ${DOMAIN_DIR}/docroot && \ COPY --chown=payara:payara maven/deps ${DEPLOY_DIR}/dataverse/WEB-INF/lib/ COPY --chown=payara:payara maven/app ${DEPLOY_DIR}/dataverse/ COPY --chown=payara:payara maven/supplements ${DEPLOY_DIR}/dataverse/supplements/ +# TEMPORARY WORKAROUND FOR DATAVERSE VERSION SUPPORT +# http://github.com/IQSS/dataverse/blob/5dc5db197ab1c0c50cc7f932b45875f5699518e8/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java#L176-L176 +COPY --chown=payara:payara maven/maven-archiver ${DEPLOY_DIR}/maven-archiver/ # Create symlinks for jHove RUN ln -s ${DEPLOY_DIR}/dataverse/supplements/jhove.conf ${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhove.conf && \ diff --git a/conf/container/assembly.xml b/conf/container/assembly.xml index b965fe7b975..c0ea9b1bcd1 100644 --- a/conf/container/assembly.xml +++ b/conf/container/assembly.xml @@ -42,5 +42,12 @@ conf/container/scripts scripts + + + + + target/maven-archiver + maven-archiver + \ No newline at end of file From 3dd85c68f0694e43a86bea57fd0c7a2d8f165c21 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Fri, 26 Mar 2021 00:37:04 +0100 Subject: [PATCH 29/34] refactor(container): make dv and solr container different profiles, shorten profile names to ct & solr-ct --- pom.xml | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 7ef64771413..3ea9cca1f46 100644 --- a/pom.xml +++ b/pom.xml @@ -889,13 +889,11 @@ - container + ct true gdcc/dataverse-k8s:${project.version} - gdcc/solr-k8s:${project.version} - @@ -918,6 +916,27 @@ + + + + + + + + solr-ct + + true + gdcc/solr-k8s:${project.version} + + + + + + io.fabric8 + docker-maven-plugin + 0.34.1 + + solr From 9e3f9927e1b14a24fb07e0180bc059918c19eb16 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Fri, 26 Mar 2021 00:51:14 +0100 Subject: [PATCH 30/34] refactor(pom): upgrade Maven plugins, stop using special JDK9+ profile --- pom.xml | 43 +++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/pom.xml b/pom.xml index 3ea9cca1f46..7f624d28b09 100644 --- a/pom.xml +++ b/pom.xml @@ -42,6 +42,7 @@ 5.2.4 1.20.1 0.8.6 + 0.34.1 @@ -715,10 +716,20 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + + ${compilerArgument} + + org.apache.maven.plugins maven-jar-plugin - 2.3 + 3.2.0 @@ -731,7 +742,7 @@ org.apache.maven.plugins maven-war-plugin - 2.3 + 3.3.1 true false @@ -746,12 +757,12 @@ org.apache.maven.plugins maven-dependency-plugin - 3.1.1 + 3.1.2 de.qaware.maven go-offline-maven-plugin - 1.2.1 + 1.2.8 @@ -838,26 +849,6 @@ all-unit-tests - - Java9Plus - - [1.9 - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 11 - - ${compilerArgument} - - - - - tc @@ -899,7 +890,7 @@ io.fabric8 docker-maven-plugin - 0.34.1 + ${dmp.version} @@ -934,7 +925,7 @@ io.fabric8 docker-maven-plugin - 0.34.1 + ${dmp.version} From 6d6b9d115dff0ec00a04d980f658c6ac317c13a0 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Fri, 26 Mar 2021 03:02:22 +0100 Subject: [PATCH 31/34] refactor(container): reunite the docker images to enable usage with run & start targets, etc. #5292 --- pom.xml | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/pom.xml b/pom.xml index 7f624d28b09..93cde08ee94 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,6 @@ 5.2.4 1.20.1 0.8.6 - 0.34.1 @@ -883,14 +882,17 @@ ct true + false + false gdcc/dataverse-k8s:${project.version} + gdcc/solr-k8s:${project.version} io.fabric8 docker-maven-plugin - ${dmp.version} + 0.34.1 @@ -898,6 +900,7 @@ dataverse ${app.image.name} + ${app.build.skip} ${project.basedir}/conf/container/Dockerfile @ @@ -907,32 +910,12 @@ - - - - - - - - solr-ct - - true - gdcc/solr-k8s:${project.version} - - - - - - io.fabric8 - docker-maven-plugin - ${dmp.version} - - solr ${solr.image.name} + ${solr.build.skip} ${project.basedir}/conf/solr/Dockerfile @ From e94024c4dc67bfcc90545837e1ffdd24dbface0a Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Fri, 26 Mar 2021 03:07:40 +0100 Subject: [PATCH 32/34] feature(container): add simple run configuration to start Dataverse, Solr and Postgres in single Maven call. #5292 --- pom.xml | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 93cde08ee94..25dd4d28317 100644 --- a/pom.xml +++ b/pom.xml @@ -28,6 +28,7 @@ 8.0.0 5.2020.6 42.2.19 + 13 8.8.1 1.11.762 1.2 @@ -852,7 +853,6 @@ tc true - 9.6 @@ -909,6 +909,24 @@ ${project.basedir}/conf/container/assembly.xml + + + dataverse + changeme + + dataverse + + 8080:8080 + + + custom + dataverse + + + solr + postgresql + + @@ -924,8 +942,32 @@ ${project.basedir}/conf/solr/assembly.xml + + solr + + custom + dataverse + + + + + + postgresql + postgres:${postgresql.server.version} + + postgresql + + custom + dataverse + + + dataverse + changeme + + + true From e9f691e0b32dada81229c738fb31f87377867925 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Fri, 11 Jun 2021 15:24:25 +0200 Subject: [PATCH 33/34] build(container): update to Docker Maven Plugin 0.36.0 #5292 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7d7de786222..3078f46ad4c 100644 --- a/pom.xml +++ b/pom.xml @@ -904,7 +904,7 @@ io.fabric8 docker-maven-plugin - 0.34.1 + 0.36.0 From d78e463449fef2aeb990e1ce049dc07e0b598b15 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Fri, 11 Jun 2021 15:25:41 +0200 Subject: [PATCH 34/34] style(container): add missing license informations and sources for container scripts. #5292 --- conf/container/Dockerfile | 18 ++++++++++++++---- conf/container/scripts/system/entrypoint.sh | 6 ++++++ .../system/init_1_generate_deploy_commands.sh | 11 +++++++++-- .../scripts/system/startInForeground.sh | 6 ++++++ 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/conf/container/Dockerfile b/conf/container/Dockerfile index fd6e019b2e0..e3d7bb4fb9a 100644 --- a/conf/container/Dockerfile +++ b/conf/container/Dockerfile @@ -3,11 +3,21 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 - +# +################################################################################################################ +# # THIS FILE IS TO BE USED WITH MAVEN DOCKER BUILD: -# mvn -Pcontainer clean package docker:build - -# Using same base image as Solr (https://hub.docker.com/_/solr), reducing pulls +# mvn -Pct clean package docker:build +# +################################################################################################################ +# +# Some commands used are inspired by https://github.com/payara/Payara/tree/master/appserver/extras/docker-images. +# Most parts origin from older versions of https://github.com/gdcc/dataverse-kubernetes. +# +# We are not using upstream Payara images because: +# - Using same base image as Solr (https://hub.docker.com/_/solr) is reducing pulls +# - Their image is less optimised for production usage by design choices +# FROM openjdk:11-jre LABEL maintainer="FDM FZJ " # Default payara ports to expose diff --git a/conf/container/scripts/system/entrypoint.sh b/conf/container/scripts/system/entrypoint.sh index 438f177a11b..ed656e41093 100644 --- a/conf/container/scripts/system/entrypoint.sh +++ b/conf/container/scripts/system/entrypoint.sh @@ -1,4 +1,10 @@ #!/bin/bash +########################################################################################################## +# +# This script is a fork of https://github.com/payara/Payara/blob/master/appserver/extras/docker-images/ +# server-full/src/main/docker/bin/entrypoint.sh and licensed under CDDL 1.1 by the Payara Foundation. +# +########################################################################################################## for f in ${SCRIPT_DIR}/init_* ${SCRIPT_DIR}/init.d/*; do case "$f" in diff --git a/conf/container/scripts/system/init_1_generate_deploy_commands.sh b/conf/container/scripts/system/init_1_generate_deploy_commands.sh index 234196ee246..e2f0730d40f 100644 --- a/conf/container/scripts/system/init_1_generate_deploy_commands.sh +++ b/conf/container/scripts/system/init_1_generate_deploy_commands.sh @@ -1,5 +1,5 @@ #!/bin/bash -################################################################################ +########################################################################################################## # # A script to append deploy commands to the post boot command file at # $PAYARA_HOME/scripts/post-boot-commands.asadmin file. All applications in the @@ -22,7 +22,14 @@ # # Note that many parameters to the deploy command can be safely used only when # a single application exists in the $DEPLOY_DIR directory. -################################################################################ +# +########################################################################################################## +# +# This script is a fork of https://github.com/payara/Payara/blob/master/appserver/extras/docker-images/ +# server-full/src/main/docker/bin/init_1_generate_deploy_commands.sh and licensed under CDDL 1.1 +# by the Payara Foundation. +# +########################################################################################################## # Check required variables are set if [ -z $DEPLOY_DIR ]; then echo "Variable DEPLOY_DIR is not set."; exit 1; fi diff --git a/conf/container/scripts/system/startInForeground.sh b/conf/container/scripts/system/startInForeground.sh index f2b82ee2020..4f22825202c 100644 --- a/conf/container/scripts/system/startInForeground.sh +++ b/conf/container/scripts/system/startInForeground.sh @@ -24,6 +24,12 @@ # This script executes the asadmin tool which is expected at ~/appserver/bin/asadmin. # ########################################################################################################## +# +# This script is a fork of https://github.com/payara/Payara/blob/master/appserver/ +# extras/docker-images/server-full/src/main/docker/bin/startInForeground.sh and licensed under CDDL 1.1 +# by the Payara Foundation. +# +########################################################################################################## # Check required variables are set if [ -z $ADMIN_USER ]; then echo "Variable ADMIN_USER is not set."; exit 1; fi