From 912bfc11d8f53cb95fda026d871406095b52964e Mon Sep 17 00:00:00 2001 From: Philip Durbin Date: Fri, 31 Jul 2020 16:47:42 -0400 Subject: [PATCH 1/2] get memory tests running on Payara, 5.0 RC #7089 --- scripts/tests/ec2-memory-benchmark/README.md | 4 ++++ .../ec2-memory-benchmark-remote.sh | 22 ++++++++++--------- .../ec2-memory-benchmark.sh | 4 ++-- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/scripts/tests/ec2-memory-benchmark/README.md b/scripts/tests/ec2-memory-benchmark/README.md index 3aca81d28eb..fba2ab42703 100644 --- a/scripts/tests/ec2-memory-benchmark/README.md +++ b/scripts/tests/ec2-memory-benchmark/README.md @@ -13,6 +13,10 @@ All the other pieces will be downloaded automatically (from the either locally, where you're running the script, or on the newly created instance. +The script downloads an Ansible config file called `main.yml` which you +should copy to `main2.yml` and edit to enable "sampledata". This config +file changes often enough upstream that it's better to make changes locally. + Run the script as follows: ``` diff --git a/scripts/tests/ec2-memory-benchmark/ec2-memory-benchmark-remote.sh b/scripts/tests/ec2-memory-benchmark/ec2-memory-benchmark-remote.sh index d5a647ac071..0cfdd20c272 100755 --- a/scripts/tests/ec2-memory-benchmark/ec2-memory-benchmark-remote.sh +++ b/scripts/tests/ec2-memory-benchmark/ec2-memory-benchmark-remote.sh @@ -5,23 +5,25 @@ then EC2_HTTP_LOCATION="" fi -DATAVERSE_APP_DIR=/usr/local/glassfish4/glassfish/domains/domain1/applications/dataverse; export DATAVERSE_APP_DIR +DATAVERSE_APP_DIR=/usr/local/payara5/glassfish/domains/domain1/applications/dataverse; export DATAVERSE_APP_DIR -# restart glassfish: +# restart app server -echo "Restarting Glassfish..." +echo "Restarting app server..." + +# still "glassfish" until Ansible is updated systemctl restart glassfish echo "done." -# obtain the pid of the running glassfish process: +# obtain the pid of the running app server process: -GLASSFISH_PID=`ps awux | grep ^glassfi | awk '{print $2}' `; export GLASSFISH_PID +APP_SERVER_PID=`ps awux | grep ^dataver | awk '{print $2}' `; export APP_SERVER_PID -if [ ${GLASSFISH_PID}"x" = "x" ] +if [ ${APP_SERVER_PID}"x" = "x" ] then - echo "Failed to obtain the process id of the running Glassfish process!" + echo "Failed to obtain the process id of the running app server process!" exit 1; fi @@ -34,7 +36,7 @@ yum -y install gnuplot >/dev/null GPLOT=gplot-1.11/gplot.pl; export GPLOT GPLOTDIST=https://pilotfiber.dl.sourceforge.net/project/gplot/gplot/gplot-1.11.tar.gz; export GPLOTDIST -(cd /tmp; curl --insecure ${GPLOTDIST} 2>/dev/null | tar xzf - ${GPLOT} >/dev/null) +(cd /tmp; curl -L --insecure ${GPLOTDIST} 2>/dev/null | tar xzf - ${GPLOT} >/dev/null) # Bombard the application with some GET requests. @@ -97,7 +99,7 @@ do # after every {repeat_outer} number of GETs, run jmap and save the output in a temp file: - sudo -u glassfish jmap -histo ${GLASSFISH_PID} > /tmp/jmap.histo.out + sudo -u dataverse jmap -histo ${APP_SERVER_PID} > /tmp/jmap.histo.out # select the dataverse classes from the histo output: #grep ' edu\.harvard\.iq\.dataverse' /tmp/jmap.histo.out @@ -119,7 +121,7 @@ do echo # run jstat to check on GC: - sudo -u glassfish jstat -gcutil ${GLASSFISH_PID} 1000 1 2>/dev/null + sudo -u dataverse jstat -gcutil ${APP_SERVER_PID} 1000 1 2>/dev/null echo diff --git a/scripts/tests/ec2-memory-benchmark/ec2-memory-benchmark.sh b/scripts/tests/ec2-memory-benchmark/ec2-memory-benchmark.sh index 292442cb0aa..ba4080e0363 100755 --- a/scripts/tests/ec2-memory-benchmark/ec2-memory-benchmark.sh +++ b/scripts/tests/ec2-memory-benchmark/ec2-memory-benchmark.sh @@ -12,10 +12,10 @@ curl -O https://raw.githubusercontent.com/GlobalDataverseCommunityConsortium/dat chmod 755 ec2-create-instance.sh # download the sample data ec2 config: -curl -O https://raw.githubusercontent.com/IQSS/dataverse-sample-data/memory-monitoring-experiments/ec2config_memory_test.yaml +curl -O https://raw.githubusercontent.com/GlobalDataverseCommunityConsortium/dataverse-ansible/master/defaults/main.yml # run the script: -./ec2-create-instance.sh -a ec2-memory-benchmark -b ${dataverse_branch} -r https://github.com/IQSS/dataverse.git -g ec2config_memory_test.yaml 2>&1 | tee create-instance.log +./ec2-create-instance.sh -b ${dataverse_branch} -r https://github.com/IQSS/dataverse.git -g main2.yml 2>&1 | tee create-instance.log # obtain the address of the new instance, and the ssh key: From 4d042123af5028016803d87f2bd51c3cd9c94f18 Mon Sep 17 00:00:00 2001 From: Philip Durbin Date: Wed, 5 Aug 2020 10:54:28 -0400 Subject: [PATCH 2/2] use dedicated Ansible config #7089 --- scripts/tests/ec2-memory-benchmark/README.md | 4 +--- scripts/tests/ec2-memory-benchmark/ec2-memory-benchmark.sh | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/tests/ec2-memory-benchmark/README.md b/scripts/tests/ec2-memory-benchmark/README.md index fba2ab42703..a7c394002d5 100644 --- a/scripts/tests/ec2-memory-benchmark/README.md +++ b/scripts/tests/ec2-memory-benchmark/README.md @@ -13,9 +13,7 @@ All the other pieces will be downloaded automatically (from the either locally, where you're running the script, or on the newly created instance. -The script downloads an Ansible config file called `main.yml` which you -should copy to `main2.yml` and edit to enable "sampledata". This config -file changes often enough upstream that it's better to make changes locally. +The main reason a dedicated Ansible config file is used is to enable "sampledata". Run the script as follows: diff --git a/scripts/tests/ec2-memory-benchmark/ec2-memory-benchmark.sh b/scripts/tests/ec2-memory-benchmark/ec2-memory-benchmark.sh index ba4080e0363..1694cdd4a19 100755 --- a/scripts/tests/ec2-memory-benchmark/ec2-memory-benchmark.sh +++ b/scripts/tests/ec2-memory-benchmark/ec2-memory-benchmark.sh @@ -12,10 +12,10 @@ curl -O https://raw.githubusercontent.com/GlobalDataverseCommunityConsortium/dat chmod 755 ec2-create-instance.sh # download the sample data ec2 config: -curl -O https://raw.githubusercontent.com/GlobalDataverseCommunityConsortium/dataverse-ansible/master/defaults/main.yml +curl -O https://raw.githubusercontent.com/GlobalDataverseCommunityConsortium/dataverse-ansible/master/tests/group_vars/memorytests.yml # run the script: -./ec2-create-instance.sh -b ${dataverse_branch} -r https://github.com/IQSS/dataverse.git -g main2.yml 2>&1 | tee create-instance.log +./ec2-create-instance.sh -b ${dataverse_branch} -r https://github.com/IQSS/dataverse.git -g memorytests.yml 2>&1 | tee create-instance.log # obtain the address of the new instance, and the ssh key: