Skip to content

Provisioning an Opal2 Web Service with Singularity

Tyson L. Swetnam edited this page Jan 19, 2020 · 3 revisions

Provision the master VM with Opal2 and link it to OpenTopography service

We are going to launch a small (two core) VM, with /scratch space on two attached volumes. The cpu will handle the jobs, and the volumes will hold the results data temporarily. Our VM serves as a 'master' for coordinating jobs sent from OpenTopography jobs running on Open Science Grid. It can also handle user submitted jobs which target the same Makeflow job name and matching password.

Singularity manages our container dependencies.

To coordinate jobs to OpenTopography we use the Opal-Toolkit upon which OpenTopography is built.

Create a new VM on CyVerse Atmosphere or XSEDE Jetstream

On CyVerse Atmosphere, Centos 7.4 or Centos 7.4

On XSEDE Jetstream, Centos 7.6 or Centos 7.6

Select an instance size of "tiny" 1-core or "small" 2-core instance.

Create two large volumes (1-2 TB each) and mount the volumes to the running instance. These will likely show up as /vol_b, /vol_c, or /vol_d.

Use these instructions for mounting a volume in Centos

Note: if you are running an OpenStack instance, make sure to add the appropriate ports for Tomcat (80,8080) and Makeflow (20000-24000) to the Security group.

First time setup of VM

1 System updates

Always run an update to get the latest security and fixes

sudo yum -y update

2 Install dependencies

We need to add some additional packages

sudo yum install curl-devel expat-devel gcc gettext-devel htop nano openssl-devel perl-ExtUtils-MakeMaker wget zlib-devel

3 Install Salt

We use Salt to provision the VM.

sudo yum install https://repo.saltstack.com/py3/redhat/salt-py3-repo-latest.el7.noarch.rpm
sudo yum install salt-master

4 Removing old git and installing newer version

sudo yum remove git
cd /usr/src
sudo wget https://www.kernel.org/pub/software/scm/git/git-2.9.4.tar.gz
sudo tar xzf  git-2.9.4.tar.gz
rm -rf git-2.9.4.tar.gz
cd git-2.9.4
sudo make prefix=/usr/local/git all
sudo make prefix=/usr/local/git install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc

Check git version

git --version

Clone the Repository

Clone this GitHub repository to the /srv directory

cd /srv
git clone https://github.com/cyverse-gis/eemt.git

5 Create user

Create the eemt user, give it a password, and sudo privileges.

Instructions for Centos user creation here

Set Makeflow password

Create a file under the eemt account with the password:

~/.eemt-makeflow-password

6 Bootstrapping with Salt

Mats has created a Salt provisioning script in this repository that will install Opal2, Singularity, and Tomcat.

cd /srv/eemt/opal2-vm
sudo ./bootstrap.sh

If you have additional problems, try reinstalling everything:

./srv/eemt/opal2-vm/salt/opal2/redeploy-opal2

Set the new IP to match the opal2.properties file

Make sure to update the opal.properties file. There are several on the VM (in the repo, and in the deployed opal2 folder) to find them:

find /srv -name opal.properties

Then edit each HOSTNAME with the appropriate public IP address of the VM

Restarting Apache

If you have to reboot the VM, you might need to restart Apache (do so as the eemt user)

/srv/tomcat/bin/catalina.sh start

7 Troubleshooting

Installing Singularity

Featured images on Atmosphere and Jetstream now have an ez installation feature. See CyVerse Learning Center for details. To install Singularity type:

ezs

Alternately, you can install Singularity yourself.

Download Singularity image

Create a directory for downloading a pre-built Singularity image:

cd /opt
sudo mkdir singularity_imgs
cd singularity_imgs

Download the latest Singularity image:

singularity pull shub://cyverse-gis/eemt:master

Build Singularity container locally:

cd /srv/eemt/singularity
sudo singularity build osgeo-singularity.simg /srv/software/eemt/singularity/Singularity 

Test your Singularity installation

singularity exec --home $PWD:/srv --pwd /srv --contain --ipc --pid /srv/software/eemt/singularity/Singularity.simg echo "Hello World"

Install iptables

If you get an error for iptables try check to see if it is installed, and if not -- install it

sudo yum install iptables-services
sudo systemctl start iptables