Skip to content

Commit

Permalink
[VIVO-1648] upgrade to v1.10.0 (#43)
Browse files Browse the repository at this point in the history
* vivo 1.10 vagrant
* add synced src directory
* src directory auto created
* removed redundant tomcat restart
* add back vmwar_fusion support, some cleanup
* update readme
* increase memory for performance, minor readme updates
* allow re-provisioning, ignore failing commands in which have been ran before
* add java ca cert configure back
* clean maven install for re-provisioning
* add 1.9 to list of previous versions
* fix vlog alias, deploy v1.10 release from tag

Resolves: https://jira.duraspace.org/browse/VIVO-1648
  • Loading branch information
wwelling authored and Andrew Woods committed Dec 7, 2018
1 parent b594af3 commit 6755c7f
Show file tree
Hide file tree
Showing 18 changed files with 940 additions and 711 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vagrant*
*~
work/*
src/*
work/*
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

# VIVO Vagrant 1.9.3
# VIVO Vagrant 1.10

For the most recent version that downloads the full source for VIVO 1.9.3 and is GUI enabled with eclipse please go to branch: https://github.com/vivo-community/vivo-vagrant/tree/gui-developer-v1.9.3

[Vagrant](http://www.vagrantup.com/) configuration and install scripts for running [VIVO](http://vivoweb.org) on a virtual machine, aka [Vagrant box](http://docs.vagrantup.com/v2/boxes.html), running an Ubuntu 64 Server 16.04.3 image.

The virtual machine will boot and install VIVO 1.9.3 and its dependencies. This will take several minutes for the initial install.
The virtual machine will boot and install VIVO 1.10 and its dependencies. This will take several minutes for the initial install.

If you have questions or encounter problems, please email the VIVO technical list at [vivo-tech@googlegroups.com](https://groups.google.com/forum/#!forum/vivo-tech) or open issue here in the Github issue tracker.

Expand All @@ -24,9 +24,9 @@ $ cd vivo-vagrant
$ vagrant up
~~~

When the Vagrant provisioning script is complete, the VIVO web application will be available in a browser on the host machine at `http://localhost:8080/vivo`. You can log into your new VIVO with the default admin user (`vivo_root@school.edu`) and password (`rootPassword`), which are specified in the `/provision/vivo/deploy.properties` source file in this repository.
When the Vagrant provisioning script is complete, the VIVO web application will be available in a browser on the host machine at `http://localhost:8080/vivo`. You can log into your new VIVO with the default admin user (`vivo_root@school.edu`) and password (`rootPassword`), which are specified in the `/provision/vivo/runtime.properties` source file in this repository.

The vivo application will be at `/home/vagrant/vivo`. Mac users can log into your Vagrant box securely using this command from a Terminal session. Windows users will want to use an SSH utility, e.g. [Putty](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html):
The vivo application will be at `/home/vagrant/src/vivo`. Mac users can log into your Vagrant box securely using this command from a Terminal session. Windows users will want to use an SSH utility, e.g. [Putty](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html):

~~~
$ vagrant ssh
Expand All @@ -39,12 +39,13 @@ $ vlog
~~~

### Commands / system layout
* VIVO application: `/home/vagrant/vivo`.
* VIVO data directory: `/usr/local/vdata`
* VIVO TDB triple store: `/usr/local/vdata/tdbContentModels`
* Tomcat: `/var/lib/tomcat7/`
* To start/stop Tomcat run `sudo /etc/init.d/tomcat start|stop|restart`.
* VIVO application: `/home/vagrant/src/vivo`.
* VIVO data directory: `/opt/vivo`
* VIVO TDB triple store: `/opt/vivo/tdbContentModels`
* Tomcat: `/opt/tomcat`
* To start/stop Tomcat run `sudo systemctl start|stop|restart tomcat`.
* A Vagrant [shared directory](http://docs.vagrantup.com/v2/synced-folders/) is available at `/work` from the box.
* A Vagrant [shared directory](http://docs.vagrantup.com/v2/synced-folders/) is available at `/home/vagrant/src` from the box. * This synced directory contains VIVO and Vitro source. Which can be developed from the host machine. *
* Use the `vagrant suspend` and `vagrant resume` commands to manage your Vagrant box when not in use or if you plan to restart or shutdown the host system, as opposed to using the VirtualBox or VMWare Fusion admin user interface.

## Re-provisioning
Expand All @@ -56,11 +57,11 @@ You can, at anytime, re-provision your Vagrant box. By running the following fr
~~~

## Reseting the VIVO database
From time to time, you might also want to rollback to a clean VIVO database. This can be done by stopping tomcat and removing the file-based TDB triple store: `rm /usr/local/vdata/tdbContentModels`. Warning - this will delete all of the data you have loaded into VIVO and any ontology changes.
From time to time, you might also want to rollback to a clean VIVO database. This can be done by stopping tomcat and removing the file-based TDB triple store: `rm /opt/vivo/tdbContentModels`. Warning - this will delete all of the data you have loaded into VIVO and any ontology changes.


## Running previous releases of VIVO and Vitro
If you are interested in running VIVO 1.5, 1.6, 1.7, 1.8 there are separate branches for each of those released version.
If you are interested in running VIVO 1.5, 1.6, 1.7, 1.8, 1.9 there are separate branches for each of those released version.
~~~
$ git clone https://github.com/lawlesst/vivo-vagrant.git vivo-vagrant
$ cd vivo-vagrant
Expand Down
95 changes: 57 additions & 38 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,59 +1,78 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|

config.vm.provider "virtualbox" do |v,override|
config.vm.box = "ubuntu/xenial64"
v.gui = false
v.cpus = 1
v.memory = 1024
end

config.vm.provider "vmware_fusion" do |v,override|
v.gui = false
v.vmx["numvcpus"] = "1"
v.vmx["memsize"] = "1024"
override.vm.box = "precise64_vmware_fusion"
override.vm.box_url = "http://files.vagrantup.com/precise64_vmware_fusion.box"
end
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.

# Assign this VM to a host-only network IP, allowing you to access it
# via the IP. Host-only networks can talk to the host machine as well as
# any other machines on the same network, but cannot be accessed (through this
# network interface) by any external networks.
# config.vm.network :hostonly, "192.168.33.10"
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "hashicorp-vagrant/ubuntu-16.04"

# Assign this VM to a bridged network, allowing you to connect directly to a
# network using the host's network device. This makes the VM appear as another
# physical device on your network.
# config.vm.network :bridged
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false

# Forward a port from the guest to the host, which allows for outside
# computers to access the VM, whereas host only networking does not.
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
config.vm.network "forwarded_port", guest: 80, host: 8081
config.vm.network "forwarded_port", guest: 8080, host: 8080
config.vm.network "forwarded_port", guest: 8000, host: 8000

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"

# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# Share an additional folder to the guest VM. The first argument is
# an identifier, the second is the path on the guest to mount the
# folder, and the third is the path on the host to the actual folder.
config.vm.synced_folder "work", "/work"
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
config.vm.synced_folder "provision", "/home/vagrant/provision"
config.vm.synced_folder "src", "/home/vagrant/src"
config.vm.synced_folder "work", "/work"

#config.vm.share_folder "v-data", "/work", "work"
#config.vm.share_folder "provision", "/home/vagrant/provision", "provision"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:

config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = false
# Customize number of CPUs on the VM:
vb.cpus = 1
# Customize the amount of memory on the VM:
vb.memory = "4096"
end

# Setup box
config.vm.provision "bootstrap", type: "shell" do |s|
s.path = "provision/bootstrap.sh"
s.privileged = true
config.vm.provider "vmware_fusion" do |v,override|
v.gui = false
v.vmx["numvcpus"] = "1"
v.vmx["memsize"] = "4096"
end

# Setup box
config.vm.provision "bootstrap", type: "shell", path: "provision/bootstrap.sh", privileged: true

# Install VIVO
config.vm.provision "vivo", type: "shell" do |s|
s.path = "provision/vivo/install.sh"
s.privileged = true
end
config.vm.provision "vivo", type: "shell", path: "provision/install.sh", privileged: true

end
90 changes: 53 additions & 37 deletions provision/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,76 @@
#
# Setup the base box
#
set -o verbose
#Exit on first error

# Exit on first error
set -e

#Update Ubuntu packages. Comment out during development
# Print shell commands
set -o verbose

# Update Ubuntu packages. Comment out during development
apt-get update -y

#Set time zone
area="America"
zone="New_York"
echo "$area/$zone" > /tmp/timezone
cp -f /tmp/timezone /etc/timezone
cp -f /usr/share/zoneinfo/$area/$zone /etc/localtime
# Install Java and Maven
apt-get install -y default-jdk maven

# Basics.
# Some utils
apt-get install -y git vim screen wget curl raptor-utils unzip

# Install open jdk 8
installJava(){
add-apt-repository ppa:openjdk-r/ppa -y
apt-get update -y
apt-get install openjdk-8-jdk -y
}
# Set time zone
timedatectl set-timezone America/New_York

# Maven
installMaven () {
cd /usr/local
rm -rf /usr/bin/mvn
rm -rf /usr/local/apache-maven-3.3.9
wget http://mirrors.sonic.net/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar -xvf apache-maven-3.3.9-bin.tar.gz
ln -s /usr/local/apache-maven-3.3.9/bin/mvn /usr/bin/mvn
# Install MySQL
installMySQL () {
DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server
mysqladmin -u root password vivo
}

# Install Tomcat 7 with JAVA_HOME export so Tomcat starts when install completes,
# Install Tomcat 8
installTomcat () {
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
apt-get install -y tomcat7
sed -i '/#JAVA_HOME.*$/a JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64' /etc/default/tomcat7
}
groupadd tomcat || true
useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat || true

curl -O http://mirrors.sonic.net/apache/tomcat/tomcat-8/v8.5.35/bin/apache-tomcat-8.5.35.tar.gz

mkdir /opt/tomcat || true
tar xzvf apache-tomcat-8.5.35.tar.gz -C /opt/tomcat --strip-components=1

# MySQL
# echo mysql-server mysql-server/root_password password vivo | debconf-set-selections
# echo mysql-server mysql-server/root_password_again password vivo | debconf-set-selections
# apt-get install -y mysql-server
# apt-get install -y mysql-client
chgrp -R tomcat /opt/tomcat
chmod -R g+r /opt/tomcat/conf
chmod g+x /opt/tomcat/conf
chown -R tomcat /opt/tomcat/webapps /opt/tomcat/work /opt/tomcat/temp /opt/tomcat/logs

cp /home/vagrant/provision/tomcat/tomcat.service /etc/systemd/system/tomcat.service

cp /home/vagrant/provision/tomcat/server.xml /opt/tomcat/conf/server.xml

cp /home/vagrant/provision/tomcat/context.xml /opt/tomcat/webapps/manager/META-INF/context.xml

cp /home/vagrant/provision/tomcat/context.xml /opt/tomcat/webapps/host-manager/META-INF/context.xml

cp /home/vagrant/provision/tomcat/tomcat-users.xml /opt/tomcat/conf/tomcat-users.xml

systemctl daemon-reload

systemctl start tomcat
systemctl enable tomcat
}

# Setup Ubuntu Firewall
setupFirewall () {
ufw allow 22
ufw allow 8080
ufw allow 8081
ufw allow 8000
ufw enable
}

installJava
installMaven
installMySQL
installTomcat
setupFirewall

#ca-certificates-java must be explicitly installed as it is needed for maven based installation
# ca-certificates-java must be explicitly installed as it is needed for maven based installation
/var/lib/dpkg/info/ca-certificates-java.postinst configure

# Make Karma scripts executable
Expand Down
Loading

0 comments on commit 6755c7f

Please sign in to comment.