Skip to content

Installation on CentOS

Vahid Daneshmand edited this page Mar 18, 2019 · 12 revisions

Instructions for setting up GRAPLEr

The steps below explain the process of setting up GRAPLE in its minimal configuration

Recommended Operating System version: CentOS 7

Recommended setup:

Central Manager Node

Perform a Minimal Installation with Development tools.

Optional Installations

  • open-vm-tools (if using a VMWare hypervisor)

Please perform yum check-update and update to install the latest distribution before proceeding.

Recommended Installations

Add the EPEL repository:

sudo yum install epel-release

Install the following with yum:

  • bash-completion
  • net-tools
  • vim
  • git
  • curl

Installing IPOP

IPOP is necessary if the worker nodes do not share the same network

  • Download the latest release from Github

  • Extract and modify sample GroupVPN configuration

    • Set the following in CFx: xmpp_username, xmpp_password, xmpp_host
    • Set ip4 in BaseTopologyManager. See default values below:
      • 172.31.0.200 for submit node
      • 172.31.0.100 for central manager
      • 172.31.1.x for workers
  • Stop and disable the firewall service by running //FIXME: solution to run with firewall preferred

    systemctl disable firewalld.service
    
  • Make IPOP run at startup by adding the following systemd scripts

    sudo vim /etc/systemd/system/ipopTincan.service
    
    [Unit]
    Description=IPOP Tincan service
    After=network.target
    
    [Service]
    ExecStart=/home/grapleadmin/ipopbin/ipop-tincan
    
    [Install]
    WantedBy=multi-user.target
    
    sudo vim /etc/systemd/system/ipopController.service
    
    [Unit]
    Description=IPOP controller service
    After=ipopTincan.service
    
    [Service]
    WorkingDirectory=/home/grapleadmin/ipopbin
    ExecStart=/usr/bin/python -m controller.Controller -c config/gvpn-config.json
    
    [Install]
    WantedBy=multi-user.target
    
  • Enable and start the services

    sudo systemctl enable ipopTincan ipopController
    sudo systemctl start ipopTincan ipopController
    

Installing Condor

  • Follow the instructions to install condor from htcondor website

  • Run the following commands: (see NOTE below)

    cd /etc/yum.repos.d
    sudo wget http://research.cs.wisc.edu/htcondor/yum/repo.d/htcondor-stable-rhel7.repo
    sudo rpm --import http://research.cs.wisc.edu/htcondor/yum/RPM-GPG-KEY-HTCondor
    sudo yum install condor
    cp condor_config.local /etc/condor
    systemctl restart condor.service
    

NOTE: Copy the appropriate condor_config.local file for each machine

Change SELinux mode to disabled

sudo vim /etc/selinux/config

SELINUX=disabled

NOTE: SELinux causes a number of issues with condor, mongodb and nginx. Try enabling and authorizing services after configuring the entire setup.

Worker Node

Follow the instructions for central manager first and then continue from below

Installing R

Run the following commands:

sudo yum check-update
sudo yum install R

Installing GLMr

Install the following with yum:

  • netcdf-devel.x86-64
  • python-pandas

Run the following R command in superuser mode:

install.packages(c("GLMr", "glmtools"), repos = c("http://owi.usgs.gov/R", getOption("repos")))
install.packages("rjson")

Installing glmtools

// FIXME: own release of glm binary with libraries extracted from .deb

  • Download glmtools binary

  • Run the following commands:

         sudo cp glm /usr/local/bin
         sudo unzip libglm.zip -d /lib64/
    

Submit Node

Follow the instructions for central manager first and then continue from below

Installing python dependencies

Install the following with yum:

  • python-pip
  • python-pandas
  • erlang
  • parallel
  • pigz

Install the following with specific instructions:

Install the following with pip:

  • numpy
  • Flask
  • Celery
  • pymongo

Check the startup status of mongodb and rabbitmq-server

Setting up GEMT

Download GEMT repository (remember to delete .git folder and files) and create a static folder. Setup the Filters as necessary. The static folder is the working directory of GWS. All experiments and results will be stored in it.

The end result should look like this:

grapleService
├── GRAPLE_SCRIPTS
│   ├── CreateWorkingFolders.py
│   ├── Filters
│   │   ├── Filter1.R
│   │   └── Filter2.R
│   ├── Graple
│   │   └── Graple.py
│   ├── Graple.sln
│   ├── ProcessGrapleBatchOutputs.py
│   └── SubmitGrapleBatch.py
└── static

The GWS code can be placed elsewhere.

The absolute path of grapleService folder should be set as base_working_path in gws.py

base_working_path = /home/grapleadmin/grapleService/

Starting and stopping the service

Run startGWS.sh or stopGWS.sh

The application should be running at :5000 by default. It should now be possible to use the application from GRAPLEr

For best results, it is recommended to spawn multiple processes using uWSGI and Nginx.

Installing and running uWSGI and Nginx

Install the following with yum:

  • nginx

Install the following with pip:

  • uwsgi

Create a configuration file gws.ini (uWSGI configuration file for GWS) with the following content:

(in directory where gws.py is stored)$ vim gws.ini
[uwsgi]

module = gws
callable = app

# http-socket = :8000 # enable to run without nginx
master = true
processes = 5

socket = gws.sock
chmod-socket = 660
vacuum = true

die-on-term = true

Create folders sites-enabled and sites-available under /etc/nginx

sudo mkdir /etc/nginx/sites-available /etc/nginx/sites-enabled

Edit /etc/nginx/nginx.conf to include the enabled directory at the end of http block

include /etc/nginx/sites-enabled/*.conf;

Create a new file (server block configuration) for Nginx and with the following content:

NOTE: Replace x with your server IP or name.

sudo vim /etc/nginx/sites-available/gws.conf
server {
    listen 80;
    server_name xxx.xxx.xxx.xxx;
    client_max_body_size 200M;

    location / {
        include uwsgi_params;
        uwsgi_pass unix:/home/grapleadmin/GWS/gws.sock;
    }
}

Link the new configuration to enable it:

sudo ln -s /etc/nginx/sites-available/gws /etc/nginx/sites-enabled/

Add nginx user to current usergroup and enable execute permissions for usergroup:

sudo usermod -a -G grapleadmin nginx
chmod 710 /home/grapleadmin

Restart Nginx by executing sudo service nginx restart

Create systemd scripts for uWSGI and Celery with the following content:

sudo vim /etc/systemd/system/gwsUwsgi.service
[Unit]
Description=uWSGI instance to serve gws
After=network.target

[Service]
User=grapleadmin
Group=nginx
WorkingDirectory=/home/grapleadmin/GWS
ExecStart=/usr/bin/uwsgi --ini gws.ini

[Install]
WantedBy=multi-user.target
sudo vim /etc/systemd/system/gwsCelery.service
[Unit]
Description=Celery workers to serve gws
After=network.target

[Service]
User=grapleadmin
WorkingDirectory=/home/grapleadmin/GWS
ExecStart=/usr/bin/celery -A gws.celeryob worker --loglevel=info

[Install]
WantedBy=multi-user.target

Start the services:

sudo systemctl start gwsUwsgi.service
sudo systemctl start gwsCelery.service