Skip to content

Commit 19b6f42

Browse files
author
don.sizemore
committed
IQSS#6849 update Vagrantfile to use CentOS-8.2 and Payara5
1 parent 78527a2 commit 19b6f42

File tree

5 files changed

+53
-66
lines changed

5 files changed

+53
-66
lines changed

Vagrantfile

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,15 @@
44
VAGRANTFILE_API_VERSION = "2"
55

66
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
7-
config.vm.box = "bento/centos-7.7"
8-
9-
puts "Sorry, this Vagrant environment is not working."
10-
puts "If you'd like to help get it working, please see"
11-
puts "https://github.com/IQSS/dataverse/issues/6849"
12-
puts
13-
puts "You can also try the Vagrant environment at"
14-
puts "https://github.com/GlobalDataverseCommunityConsortium/dataverse-ansible"
15-
exit 1
7+
config.vm.box = "bento/centos-8.2"
168

179
config.vm.provider "virtualbox" do |vbox|
1810
vbox.cpus = 4
1911
vbox.memory = 4096
2012
end
2113

22-
#config.vm.provision "shell", path: "scripts/vagrant/setup.sh"
23-
#config.vm.provision "shell", path: "scripts/vagrant/setup-solr.sh"
14+
config.vm.provision "shell", path: "scripts/vagrant/setup.sh"
15+
config.vm.provision "shell", path: "scripts/vagrant/setup-solr.sh"
2416
config.vm.provision "shell", path: "scripts/vagrant/install-dataverse.sh"
2517

2618
config.vm.network "private_network", type: "dhcp"
@@ -30,12 +22,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
3022
config.vm.network "forwarded_port", guest: 8080, host: 8088
3123
config.vm.network "forwarded_port", guest: 8181, host: 8188
3224

33-
# FIXME: use /dataverse/downloads instead
34-
config.vm.synced_folder "downloads", "/downloads"
35-
# FIXME: use /dataverse/conf instead
36-
config.vm.synced_folder "conf", "/conf"
37-
# FIXME: use /dataverse/scripts instead
38-
config.vm.synced_folder "scripts", "/scripts"
3925
config.vm.synced_folder ".", "/dataverse"
4026

4127
end

downloads/download.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
curl -L -O https://search.maven.org/remotecontent?filepath=fish/payara/distributions/payara/5.201/payara-5.201.zip
2+
curl -L -O https://github.com/payara/Payara/releases/download/payara-server-5.2020.2/payara-5.2020.2.zip
33
curl -L -O https://archive.apache.org/dist/lucene/solr/7.7.2/solr-7.7.2.tgz
44
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
55
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

scripts/vagrant/install-dataverse.sh

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,20 @@ fi
77
WAR=/dataverse/target/dataverse*.war
88
if [ ! -f $WAR ]; then
99
echo "no war file found... building"
10-
echo "Installing nss on CentOS 6 to avoid java.security.KeyException while building war file: https://github.com/IQSS/dataverse/issues/2744"
11-
yum install -y nss
12-
su $SUDO_USER -s /bin/sh -c "cd /dataverse && mvn package"
10+
#echo "Installing nss on CentOS 6 to avoid java.security.KeyException while building war file: https://github.com/IQSS/dataverse/issues/2744"
11+
#yum install -y nss
12+
su $SUDO_USER -s /bin/sh -c "cd /dataverse && mvn -q package"
1313
fi
1414
cd /dataverse/scripts/installer
1515

1616
# move any pre-existing `default.config` file out of the way to avoid overwriting
1717
pid=$$
1818
if [ -e default.config ]; then
19-
mv default.config tmp-${pid}-default.config
19+
cp default.config tmp-${pid}-default.config
2020
fi
2121

22-
# FIXME: The default.config format changed in https://github.com/IQSS/dataverse/pull/6809
23-
echo "HOST_DNS_ADDRESS localhost" > default.config
24-
echo "GLASSFISH_DIRECTORY /home/dataverse/payara5" >> default.config
25-
26-
if [ ! -z "$MAILSERVER" ]; then
27-
echo "MAIL_SERVER $MAILSERVER" >> default.config
28-
fi
29-
30-
# FIXME: Switch to newer Python-based installer
31-
./install -y -f
22+
# Switch to newer Python-based installer
23+
python3 ./install.py --noninteractive --config_file="default.config"
3224

3325
if [ -e tmp-${pid}-default.config ]; then # if we moved it out, move it back
3426
mv -f tmp-${pid}-default.config default.config

scripts/vagrant/setup-solr.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#!/bin/bash
22
echo "Setting up Solr"
3+
dnf install -qy lsof
34
SOLR_USER=solr
45
SOLR_HOME=/usr/local/solr
56
mkdir $SOLR_HOME
67
chown $SOLR_USER:$SOLR_USER $SOLR_HOME
7-
su $SOLR_USER -s /bin/sh -c "cp /downloads/solr-7.7.2.tgz $SOLR_HOME"
8+
su $SOLR_USER -s /bin/sh -c "cp /dataverse/downloads/solr-7.7.2.tgz $SOLR_HOME"
89
su $SOLR_USER -s /bin/sh -c "cd $SOLR_HOME && tar xfz solr-7.7.2.tgz"
910
su $SOLR_USER -s /bin/sh -c "cd $SOLR_HOME/solr-7.7.2/server/solr && cp -r configsets/_default . && mv _default collection1"
10-
su $SOLR_USER -s /bin/sh -c "cp /conf/solr/7.7.2/schema*.xml $SOLR_HOME/solr-7.7.2/server/solr/collection1/conf/"
11-
su $SOLR_USER -s /bin/sh -c "cp /conf/solr/7.7.2/solrconfig.xml $SOLR_HOME/solr-7.7.2/server/solr/collection1/conf/solrconfig.xml"
11+
su $SOLR_USER -s /bin/sh -c "cp /dataverse/conf/solr/7.7.2/schema*.xml $SOLR_HOME/solr-7.7.2/server/solr/collection1/conf/"
12+
su $SOLR_USER -s /bin/sh -c "cp /dataverse/conf/solr/7.7.2/solrconfig.xml $SOLR_HOME/solr-7.7.2/server/solr/collection1/conf/solrconfig.xml"
1213
su $SOLR_USER -s /bin/sh -c "cd $SOLR_HOME/solr-7.7.2 && bin/solr start && bin/solr create_core -c collection1 -d server/solr/collection1/conf/"
1314
cp /dataverse/doc/sphinx-guides/source/_static/installation/files/etc/init.d/solr /etc/init.d/solr
1415
chmod 755 /etc/init.d/solr

scripts/vagrant/setup.sh

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,73 @@
11
#!/bin/bash
22
echo "Installing dependencies for Dataverse"
33

4-
# Add JQ
4+
# python3 and psycopg2 for the Dataverse installer
5+
dnf install -qy python3 python3-psycopg2
6+
7+
# Add JQ (TODO: just install this from EPEL?)
58
echo "Installing jq for the setup scripts"
6-
wget http://stedolan.github.io/jq/download/linux64/jq
9+
wget -q http://stedolan.github.io/jq/download/linux64/jq
710
chmod +x jq
811
# this is where EPEL puts it
912
sudo mv jq /usr/bin/jq
1013

1114
echo "Adding Shibboleth yum repo"
1215
cp /dataverse/conf/vagrant/etc/yum.repos.d/shibboleth.repo /etc/yum.repos.d
13-
cp /dataverse/conf/vagrant/etc/yum.repos.d/epel-apache-maven.repo /etc/yum.repos.d
1416
# Uncomment this (and other shib stuff below) if you want
1517
# to use Vagrant (and maybe PageKite) to test Shibboleth.
1618
#yum install -y shibboleth shibboleth-embedded-ds
1719

1820
# java configuration et al
19-
yum install -y java-1.8.0-openjdk-devel apache-maven httpd mod_ssl unzip
20-
alternatives --set java /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java
21-
alternatives --set javac /usr/lib/jvm/java-1.8.0-openjdk.x86_64/bin/javac
21+
dnf install -qy java-1.8.0-openjdk-headless maven httpd mod_ssl unzip
22+
alternatives --set java /usr/lib/jvm/jre-1.8.0-openjdk/bin/java
23+
# do we need javac? the symlink is tied to package version...
24+
# /etc/alternatives/javac -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el8_2.x86_64/bin/javac
25+
#alternatives --set javac /usr/lib/jvm/java-1.8.0-openjdk.x86_64/bin/javac
2226
java -version
23-
javac -version
27+
#javac -version
2428

25-
# switching to postgresql-9.6 per #4709
26-
yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
27-
yum makecache fast
28-
yum install -y postgresql96-server
29-
/usr/pgsql-9.6/bin/postgresql96-setup initdb
30-
/usr/bin/systemctl stop postgresql-9.6
31-
cp /dataverse/conf/vagrant/var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/9.6/data/pg_hba.conf
32-
/usr/bin/systemctl start postgresql-9.6
33-
/usr/bin/systemctl enable postgresql-9.6
29+
# disable centos8 postgresql module and install postgresql10-server
30+
dnf -qy module disable postgresql
31+
dnf install -qy https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
32+
dnf install -qy postgresql10-server
33+
/usr/pgsql-10/bin/postgresql-10-setup initdb
34+
/usr/bin/systemctl stop postgresql-10
35+
cp /dataverse/conf/vagrant/var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/10/data/pg_hba.conf
36+
/usr/bin/systemctl start postgresql-10
37+
/usr/bin/systemctl enable postgresql-10
3438

35-
GLASSFISH_USER=dataverse
36-
echo "Ensuring Unix user '$GLASSFISH_USER' exists"
37-
useradd $GLASSFISH_USER || :
39+
PAYARA_USER=dataverse
40+
echo "Ensuring Unix user '$PAYARA_USER' exists"
41+
useradd $PAYARA_USER || :
3842
SOLR_USER=solr
3943
echo "Ensuring Unix user '$SOLR_USER' exists"
4044
useradd $SOLR_USER || :
4145
DOWNLOAD_DIR='/dataverse/downloads'
42-
GLASSFISH_ZIP="$DOWNLOAD_DIR/payara-5.201.zip"
46+
PAYARA_ZIP="$DOWNLOAD_DIR/payara-5.2020.2.zip"
4347
SOLR_TGZ="$DOWNLOAD_DIR/solr-7.7.2.tgz"
44-
if [ ! -f $GLASSFISH_ZIP ] || [ ! -f $SOLR_TGZ ]; then
45-
echo "Couldn't find $GLASSFISH_ZIP or $SOLR_TGZ! Running download script...."
48+
if [ ! -f $PAYARA_ZIP ] || [ ! -f $SOLR_TGZ ]; then
49+
echo "Couldn't find $PAYARA_ZIP or $SOLR_TGZ! Running download script...."
4650
cd $DOWNLOAD_DIR && ./download.sh && cd
4751
echo "Done running download script."
4852
fi
49-
GLASSFISH_USER_HOME=~dataverse
50-
GLASSFISH_ROOT=$GLASSFISH_USER_HOME/payara5
51-
if [ ! -d $GLASSFISH_ROOT ]; then
52-
echo "Copying $GLASSFISH_ZIP to $GLASSFISH_USER_HOME and unzipping"
53-
su $GLASSFISH_USER -s /bin/sh -c "cp $GLASSFISH_ZIP $GLASSFISH_USER_HOME"
54-
su $GLASSFISH_USER -s /bin/sh -c "cd $GLASSFISH_USER_HOME && unzip -q $GLASSFISH_ZIP"
53+
PAYARA_USER_HOME=~dataverse
54+
PAYARA_ROOT=/usr/local/payara5
55+
if [ ! -d $PAYARA_ROOT ]; then
56+
echo "Copying $PAYARA_ZIP to $PAYARA_USER_HOME and unzipping"
57+
su $PAYARA_USER -s /bin/sh -c "cp $PAYARA_ZIP $PAYARA_USER_HOME"
58+
su $PAYARA_USER -s /bin/sh -c "cd $PAYARA_USER_HOME && unzip -q $PAYARA_ZIP"
59+
# default.config defaults to /usr/local/payara5 so let's go with that
60+
rsync -a $PAYARA_USER_HOME/payara5/ $PAYARA_ROOT/
5561
else
56-
echo "$GLASSFISH_ROOT already exists"
62+
echo "$PAYARA_ROOT already exists"
5763
fi
64+
5865
#service shibd start
59-
service httpd stop
66+
/usr/bin/systemctl stop httpd
6067
cp /dataverse/conf/httpd/conf.d/dataverse.conf /etc/httpd/conf.d/dataverse.conf
6168
mkdir -p /var/www/dataverse/error-documents
6269
cp /dataverse/conf/vagrant/var/www/dataverse/error-documents/503.html /var/www/dataverse/error-documents
63-
service httpd start
70+
/usr/bin/systemctl start httpd
6471
#curl -k --sslv3 https://pdurbin.pagekite.me/Shibboleth.sso/Metadata > /tmp/pdurbin.pagekite.me
6572
#cp -a /etc/shibboleth/shibboleth2.xml /etc/shibboleth/shibboleth2.xml.orig
6673
#cp -a /etc/shibboleth/attribute-map.xml /etc/shibboleth/attribute-map.xml.orig
@@ -72,6 +79,7 @@ service httpd start
7279
#service shibd restart
7380
#curl -k --sslv3 https://pdurbin.pagekite.me/Shibboleth.sso/Metadata > /downloads/pdurbin.pagekite.me
7481
#service httpd restart
82+
7583
echo "#########################################################################################"
7684
echo "# This is a Vagrant test box, so we're disabling firewalld. #
7785
echo "# Re-enable it with $ sudo systemctl enable firewalld && sudo systemctl start firewalld #"

0 commit comments

Comments
 (0)