Skip to content

Commit

Permalink
Merge pull request #6809 from IQSS/6761-payara-installer-update
Browse files Browse the repository at this point in the history
6761 payara installer update
  • Loading branch information
kcondon authored Apr 21, 2020
2 parents 6352b89 + a677da1 commit 68bb656
Show file tree
Hide file tree
Showing 12 changed files with 312 additions and 246 deletions.
2 changes: 1 addition & 1 deletion conf/jhove/jhove.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://hul.harvard.edu/ois/xml/ns/jhove/jhoveConfig"
xsi:schemaLocation="http://hul.harvard.edu/ois/xml/ns/jhove/jhoveConfig
file:///usr/local/glassfish4/glassfish/domains/domain1/config/jhoveConfig.xsd">
file:///usr/local/payara5/glassfish/domains/domain1/config/jhoveConfig.xsd">
<jhoveHome>/usr/local/src/jhove</jhoveHome>
<defaultEncoding>utf-8</defaultEncoding>
<tempDirectory>/tmp</tempDirectory>
Expand Down
53 changes: 26 additions & 27 deletions scripts/installer/Makefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
INSTALLER_ZIP_DIR=dvinstall
DISTRIBUTION_WAR_FILE=${INSTALLER_ZIP_DIR}/dataverse.war
GLASSFISH_SETUP_SCRIPT=${INSTALLER_ZIP_DIR}/glassfish-setup.sh
GLASSFISH_SETUP_SCRIPT=${INSTALLER_ZIP_DIR}/as-setup.sh
POSTGRES_DRIVERS=${INSTALLER_ZIP_DIR}/pgdriver
JSF_PATCH_DIR=${INSTALLER_ZIP_DIR}/jsfpatch
API_SCRIPTS=${INSTALLER_ZIP_DIR}/setup-datasetfields.sh ${INSTALLER_ZIP_DIR}/setup-users.sh ${INSTALLER_ZIP_DIR}/setup-builtin-roles.sh ${INSTALLER_ZIP_DIR}/setup-dvs.sh ${INSTALLER_ZIP_DIR}/data ${INSTALLER_ZIP_DIR}/setup-identity-providers.sh ${INSTALLER_ZIP_DIR}/setup-all.sh ${INSTALLER_ZIP_DIR}/post-install-api-block.sh
DB_SCRIPT=${INSTALLER_ZIP_DIR}/reference_data.sql
JHOVE_CONFIG=${INSTALLER_ZIP_DIR}/jhove.conf
JHOVE_SCHEMA=${INSTALLER_ZIP_DIR}/jhoveConfig.xsd
SOLR_SCHEMA=${INSTALLER_ZIP_DIR}/schema.xml ${INSTALLER_ZIP_DIR}/schema_dv_mdb_fields.xml ${INSTALLER_ZIP_DIR}/schema_dv_mdb_copies.xml ${INSTALLER_ZIP_DIR}/updateSchemaMDB.sh
SOLR_CONFIG=${INSTALLER_ZIP_DIR}/solrconfig.xml
PYTHON_FILES=${INSTALLER_ZIP_DIR}/README_python.txt ${INSTALLER_ZIP_DIR}/installConfig.py ${INSTALLER_ZIP_DIR}/installUtils.py ${INSTALLER_ZIP_DIR}/install.py ${INSTALLER_ZIP_DIR}/installGlassfish.py ${INSTALLER_ZIP_DIR}/requirements.txt ${INSTALLER_ZIP_DIR}/default.config ${INSTALLER_ZIP_DIR}/interactive.config
PYTHON_FILES=${INSTALLER_ZIP_DIR}/README_python.txt ${INSTALLER_ZIP_DIR}/installConfig.py ${INSTALLER_ZIP_DIR}/installUtils.py ${INSTALLER_ZIP_DIR}/install.py ${INSTALLER_ZIP_DIR}/installAppServer.py ${INSTALLER_ZIP_DIR}/requirements.txt ${INSTALLER_ZIP_DIR}/default.config ${INSTALLER_ZIP_DIR}/interactive.config
INSTALL_SCRIPT=${INSTALLER_ZIP_DIR}/install

installer: dvinstall.zip

clean:
/bin/rm -rf ${INSTALLER_ZIP_DIR} dvinstall.zip

dvinstall.zip: ${GLASSFISH_SETUP_SCRIPT} ${POSTGRES_DRIVERS} ${DISTRIBUTION_WAR_FILE} ${API_SCRIPTS} ${DB_SCRIPT} ${JHOVE_CONFIG} ${JHOVE_SCHEMA} ${SOLR_SCHEMA} ${SOLR_CONFIG} ${PYTHON_FILES} ${INSTALL_SCRIPT}
dvinstall.zip: ${GLASSFISH_SETUP_SCRIPT} ${POSTGRES_DRIVERS} ${JSF_PATCH_DIR} ${DISTRIBUTION_WAR_FILE} ${API_SCRIPTS} ${DB_SCRIPT} ${JHOVE_CONFIG} ${JHOVE_SCHEMA} ${SOLR_SCHEMA} ${SOLR_CONFIG} ${PYTHON_FILES} ${INSTALL_SCRIPT}
@echo making installer...
zip -r dvinstall.zip ${GLASSFISH_SETUP_SCRIPT} ${POSTGRES_DRIVERS} ${DISTRIBUTION_WAR_FILE} ${API_SCRIPTS} ${DB_SCRIPT} ${JHOVE_CONFIG} ${JHOVE_SCHEMA} ${SOLR_SCHEMA} ${SOLR_CONFIG} ${PYTHON_FILES} ${INSTALL_SCRIPT}
zip -r dvinstall.zip ${GLASSFISH_SETUP_SCRIPT} ${POSTGRES_DRIVERS} ${JSF_PATCH_DIR} ${DISTRIBUTION_WAR_FILE} ${API_SCRIPTS} ${DB_SCRIPT} ${JHOVE_CONFIG} ${JHOVE_SCHEMA} ${SOLR_SCHEMA} ${SOLR_CONFIG} ${PYTHON_FILES} ${INSTALL_SCRIPT}
@echo
@echo "Done!"

${INSTALL_SCRIPT}: install
@echo copying the installer script
${INSTALLER_ZIP_DIR}:
mkdir -p ${INSTALLER_ZIP_DIR}

${INSTALL_SCRIPT}: install ${INSTALLER_ZIP_DIR}
@echo copying the installer script
/bin/cp install ${INSTALLER_ZIP_DIR}

${DISTRIBUTION_WAR_FILE}:
@echo copying war file...
@mkdir -p ${INSTALLER_ZIP_DIR}
@VERSION_NUMBER=`grep -m1 '<version>' ../../pom.xml | sed 's/ *<\/*version>//g'`; export VERSION_NUMBER; \
BUILT_WAR_FILE=../../target/dataverse-$$VERSION_NUMBER.war; export BUILT_WAR_FILE; \
if [ -f $$BUILT_WAR_FILE ]; \
Expand All @@ -41,47 +43,44 @@ ${DISTRIBUTION_WAR_FILE}:
exit 1; \
fi

${GLASSFISH_SETUP_SCRIPT}: glassfish-setup.sh
${GLASSFISH_SETUP_SCRIPT}: as-setup.sh ${INSTALLER_ZIP_DIR}
@echo copying glassfish setup
mkdir -p ${INSTALLER_ZIP_DIR}
/bin/cp glassfish-setup.sh ${INSTALLER_ZIP_DIR}
/bin/cp as-setup.sh ${INSTALLER_ZIP_DIR}

${POSTGRES_DRIVERS}: pgdriver/postgresql-42.2.12.jar
mkdir -p ${POSTGRES_DRIVERS}
@echo copying postgres driver
@mkdir -p ${POSTGRES_DRIVERS}
/bin/cp pgdriver/postgresql-42.2.12.jar ${INSTALLER_ZIP_DIR}/pgdriver
/bin/cp pgdriver/postgresql-42.2.12.jar ${POSTGRES_DRIVERS}

${JSF_PATCH_DIR}: jsfpatch/jakarta.faces_dv.jar
mkdir -p ${JSF_PATCH_DIR}
@echo copying jsf patch
/bin/cp jsfpatch/jakarta.faces_dv.jar ${JSF_PATCH_DIR}

${API_SCRIPTS}: ../api/setup-datasetfields.sh ../api/setup-users.sh ../api/setup-dvs.sh ../api/setup-identity-providers.sh ../api/setup-all.sh ../api/post-install-api-block.sh ../api/setup-builtin-roles.sh ../api/data
${API_SCRIPTS}: ../api/setup-datasetfields.sh ../api/setup-users.sh ../api/setup-dvs.sh ../api/setup-identity-providers.sh ../api/setup-all.sh ../api/post-install-api-block.sh ../api/setup-builtin-roles.sh ../api/data ${INSTALLER_ZIP_DIR}
@echo copying api scripts
@mkdir -p ${INSTALLER_ZIP_DIR}
/bin/cp -R ../api/setup-datasetfields.sh ../api/setup-users.sh ../api/setup-dvs.sh ../api/setup-identity-providers.sh ../api/setup-all.sh ../api/post-install-api-block.sh ../api/setup-builtin-roles.sh ../api/data ${INSTALLER_ZIP_DIR}

${DB_SCRIPT}: ../database/reference_data.sql
${DB_SCRIPT}: ../database/reference_data.sql ${INSTALLER_ZIP_DIR}
@echo copying reference data sql script
@mkdir -p ${INSTALLER_ZIP_DIR}
/bin/cp ../database/reference_data.sql ${INSTALLER_ZIP_DIR}

${JHOVE_CONFIG}: ../../conf/jhove/jhove.conf
${JHOVE_CONFIG}: ../../conf/jhove/jhove.conf ${INSTALLER_ZIP_DIR}
@echo copying jhove config file
@mkdir -p ${INSTALLER_ZIP_DIR}
/bin/cp ../../conf/jhove/jhove.conf ${INSTALLER_ZIP_DIR}

${JHOVE_SCHEMA}: ../../conf/jhove/jhoveConfig.xsd
${JHOVE_SCHEMA}: ../../conf/jhove/jhoveConfig.xsd ${INSTALLER_ZIP_DIR}
@echo copying jhove schema file
@mkdir -p ${INSTALLER_ZIP_DIR}
/bin/cp ../../conf/jhove/jhoveConfig.xsd ${INSTALLER_ZIP_DIR}

${SOLR_SCHEMA}: ../../conf/solr/7.7.2/schema.xml ../../conf/solr/7.7.2/schema_dv_mdb_fields.xml ../../conf/solr/7.7.2/schema_dv_mdb_copies.xml ../../conf/solr/7.7.2/updateSchemaMDB.sh
${SOLR_SCHEMA}: ../../conf/solr/7.7.2/schema.xml ../../conf/solr/7.7.2/schema_dv_mdb_fields.xml ../../conf/solr/7.7.2/schema_dv_mdb_copies.xml ../../conf/solr/7.7.2/updateSchemaMDB.sh ${INSTALLER_ZIP_DIR}
@echo copying Solr schema file
@mkdir -p ${INSTALLER_ZIP_DIR}
/bin/cp ../../conf/solr/7.7.2/schema*.xml ../../conf/solr/7.7.2/updateSchemaMDB.sh ${INSTALLER_ZIP_DIR}

${SOLR_CONFIG}: ../../conf/solr/7.7.2/solrconfig.xml
${SOLR_CONFIG}: ../../conf/solr/7.7.2/solrconfig.xml ${INSTALLER_ZIP_DIR}
@echo copying Solr config file
@mkdir -p ${INSTALLER_ZIP_DIR}
/bin/cp ../../conf/solr/7.7.2/solrconfig.xml ${INSTALLER_ZIP_DIR}

${PYTHON_FILES}: README_python.txt install.py installConfig.py installGlassfish.py installUtils.py requirements.txt default.config interactive.config
${PYTHON_FILES}: README_python.txt install.py installConfig.py installAppServer.py installUtils.py requirements.txt default.config interactive.config ${INSTALLER_ZIP_DIR}
@echo copying Python installer files
@mkdir -p ${INSTALLER_ZIP_DIR}
/bin/cp README_python.txt install.py installConfig.py installGlassfish.py installUtils.py requirements.txt default.config interactive.config ${INSTALLER_ZIP_DIR}
/bin/cp README_python.txt install.py installConfig.py installAppServer.py installUtils.py requirements.txt default.config interactive.config ${INSTALLER_ZIP_DIR}
26 changes: 17 additions & 9 deletions scripts/installer/README_python.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,28 @@ backward compatibility, for now, but please use version 2.7 or newer.


The extra module psycopg2 (PostgreSQL client) is required. The
installer has been tested with psycopg2 version 2.8.4.
installer has been tested with psycopg2 version 2.8.4.

Install the module with
We recommend that you try installing the "binary", pre-built version of the package:

pip install psycopg2
pip install psycopg2-binary

(or "pip3 install psycopg2" if you intend to use python3 and it's
(or "pip3 install psycopg2-binary" if you intend to use python3 and it's
installed separately on your system)

In order to build the module, pip will need to execute pg_config,
PostgreSQL configuration utility. Make sure it is in your PATH. If you
have multiple versions of PostgresQL installed, make sure the version
that you will be using with Dataverse is the first on your PATH. For
example,
If for whatever reason the binary psycopg2 package doesn't run
properly on your system, you can try the more complex process of
making pip build it from sources:

pip3 install psycopg2

This will require compilers to be properly installed on your system.
(On MacOS, you'll need XCode installed).
In order to link with the PostgresQL libraries, pip will need to
execute pg_config, PostgreSQL configuration utility. Make sure it is
in your PATH. If you have multiple versions of PostgresQL installed,
make sure the version that you will be using with Dataverse is the
first on your PATH. For example,

PATH=/usr/pgsql-9.6/bin:$PATH; export PATH

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
# as environmental variables:
# (no defaults for these values are provided here!)
#
# glassfish configuration:
# app. server (payara) configuration:
# the variables used by this script still has the word "glassfish" in them.
# this is kept as legacy, just to avoid unncessary changes.
# GLASSFISH_ROOT
# GLASSFISH_DOMAIN
# ASADMIN_OPTS
Expand Down Expand Up @@ -49,14 +51,25 @@ function preliminary_setup()
{
# undeploy the app, if running:

./asadmin $ASADMIN_OPTS undeploy dataverse-4.0
./asadmin $ASADMIN_OPTS undeploy dataverse

# avoid OutOfMemoryError: PermGen per http://eugenedvorkin.com/java-lang-outofmemoryerror-permgen-space-error-during-deployment-to-glassfish/
#./asadmin $ASADMIN_OPTS list-jvm-options
./asadmin $ASADMIN_OPTS delete-jvm-options "-XX\:MaxPermSize=192m"
./asadmin $ASADMIN_OPTS create-jvm-options "-XX\:MaxPermSize=512m"
./asadmin $ASADMIN_OPTS create-jvm-options "-XX\:PermSize=256m"
./asadmin $ASADMIN_OPTS delete-jvm-options -client
# Note that these JVM options are different for Payara5 and Glassfish4:
# old Glassfish4 options: (commented out)
#./asadmin $ASADMIN_OPTS delete-jvm-options "-XX\:MaxPermSize=192m"
#./asadmin $ASADMIN_OPTS create-jvm-options "-XX\:MaxPermSize=512m"
#./asadmin $ASADMIN_OPTS create-jvm-options "-XX\:PermSize=256m"
# payara5 ships with the "-server" option already in domain.xml, so no need:
#./asadmin $ASADMIN_OPTS delete-jvm-options -client

# new Payara5 options: (thanks to donsizemore@unc.edu)
./asadmin $ASADMIN_OPTS create-jvm-options "-XX\:MaxMetaspaceSize=512m"
./asadmin $ASADMIN_OPTS create-jvm-options "-XX\:MetaspaceSize=256m"
./asadmin $ASADMIN_OPTS create-jvm-options "-Dfish.payara.classloading.delegate=false"
./asadmin $ASADMIN_OPTS create-jvm-options "-XX\:+UseG1GC"
./asadmin $ASADMIN_OPTS create-jvm-options "-XX\:+UseStringDeduplication"
./asadmin $ASADMIN_OPTS create-jvm-options "-XX\:+DisableExplicitGC"

# alias passwords
for alias in "rserve_password_alias ${RSERVE_PASS}" "doi_password_alias ${DOI_PASSWORD}" "db_password_alias ${DB_PASS}"
Expand All @@ -67,8 +80,8 @@ function preliminary_setup()
rm /tmp/$1.txt
done

###
# Add the necessary JVM options:
###
# Add the Dataverse-specific JVM options:
#
# location of the datafiles temp directory:
# (defaults to dataverse/files in the users home directory, ${FILES_DIR}/temp if this is set)
Expand All @@ -82,8 +95,9 @@ function preliminary_setup()
./asadmin $ASADMIN_OPTS create-jvm-options "\-Ddataverse.rserve.port=${RSERVE_PORT}"
./asadmin $ASADMIN_OPTS create-jvm-options "\-Ddataverse.rserve.user=${RSERVE_USER}"
./asadmin $ASADMIN_OPTS create-jvm-options '\-Ddataverse.rserve.password=${ALIAS=rserve_password_alias}'
# Data Deposit API options
# The host and url addresses this Dataverse will be using:
./asadmin $ASADMIN_OPTS create-jvm-options "\-Ddataverse.fqdn=${HOST_ADDRESS}"
./asadmin $ASADMIN_OPTS create-jvm-options "\-Ddataverse.siteUrl=http\://\${dataverse.fqdn}\:8080"
# password reset token timeout in minutes
./asadmin $ASADMIN_OPTS create-jvm-options "\-Ddataverse.auth.password-reset-timeout-in-minutes=60"

Expand Down Expand Up @@ -167,18 +181,18 @@ function final_setup(){

if [ "$DOCKER_BUILD" = "true" ]
then
FILES_DIR="/usr/local/glassfish4/glassfish/domains/domain1/files"
FILES_DIR="/usr/local/payara5/glassfish/domains/domain1/files"
RSERVE_HOST="localhost"
RSERVE_PORT="6311"
RSERVE_USER="rserve"
RSERVE_PASS="rserve"
HOST_ADDRESS="localhost\:8080"
pushd /usr/local/glassfish4/glassfish/bin/
pushd /usr/local/payara5/glassfish/bin/
./asadmin start-domain domain1
preliminary_setup
chmod -R 777 /usr/local/glassfish4/
rm -rf /usr/local/glassfish4/glassfish/domains/domain1/generated
rm -rf /usr/local/glassfish4/glassfish/domains/domain1/applications
chmod -R 777 /usr/local/payara5/
rm -rf /usr/local/payara5/glassfish/domains/domain1/generated
rm -rf /usr/local/payara5/glassfish/domains/domain1/applications
popd
exit 0
fi
Expand Down Expand Up @@ -288,11 +302,11 @@ if [ ! -d "$DOMAIN_DIR" ]
exit 2
fi

echo "Setting up your glassfish4 to support Dataverse"
echo "Glassfish directory: "$GLASSFISH_ROOT
echo "Setting up your app. server (Payara5) to support Dataverse"
echo "Payara directory: "$GLASSFISH_ROOT
echo "Domain directory: "$DOMAIN_DIR

# Move to the glassfish dir
# Move to the payara dir
pushd $GLASSFISH_BIN_DIR

###
Expand Down Expand Up @@ -331,6 +345,6 @@ echo Updates done. Restarting...
# Clean up
popd

echo "Glassfish setup complete"
echo "Payara setup complete"
date

4 changes: 2 additions & 2 deletions scripts/installer/default.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[glassfish]
HOST_DNS_ADDRESS = localhost
GLASSFISH_USER = glassfish
GLASSFISH_DIRECTORY = /usr/local/glassfish4
GLASSFISH_USER = dataverse
GLASSFISH_DIRECTORY = /usr/local/payara5
GLASSFISH_ADMIN_USER = admin
GLASSFISH_ADMIN_PASSWORD = secret
GLASSFISH_HEAP = 2048
Expand Down
Loading

0 comments on commit 68bb656

Please sign in to comment.