Skip to content

pragmagrid/cloud-scheduler

Repository files navigation

Cloud Scheduler roll

This roll installs cloud scheduler GUI and its needed database All prerequisite software listed below are a part of the roll and will be installed and configured during roll installation. The source code for the GUI has been developed by the Thammmasat satudents and can be found in cloud-scheduler-gui git repository.

Previous version og GUI based on Booked AIP is at the tag booked-2.5.3

  1. The following prerequisites are installed with the roll:
    mysql-python:v.1.2.5
    nodejs:v6.10.2-linux-x64
  2. Python roll

A lifemapper-server roll installs mysql-python. In case lifemapper roll is present when installing the cloud-scheduler roll, omit the cloud-scheduler-MySQL-python RPM installation.

Checkout roll distribution from git repo

# git clone https://github.com/pragmagrid/cloud-scheduler
# cd cloud-scheduler/

To build a roll, first execute a script that build nodejs and installs cloud-scheduler-gui source distro

# ./bootstrap.sh

Then proceeed with building the roll:

# make roll

The resulting ISO file cloud-scheduler-*.iso can be added to the frontend.

A roll can be added to the existing frontend. Make sure that the python roll is installed (can be downloaded from Rocks Downloads )

# rocks add roll cloud-scheduler-6.2-0.x86_64.disk1.iso
# rocks enable roll cloud-scheduler
# (cd /export/rocks/install; rocks create distro)
# yum clean all
# rocks run roll cloud-scheduler > add-roll.sh
# bash add-roll.sh  > add-roll.out 2>&1

After the last command is finished, examine the add-roll.out file for errors. A /tmp/cs-config.log file contains output from the roll configuration commands that set a database and its access. During the roll install a cs-config command is executed. It creates the database and the db admin user access. A password is saved in /opt/cloud-scheduler/etc/pragmac.pass

  1. /opt/cloud-scheduler/UI - cloud scheduler gui code distribution and a bild framework for npm. To make (debug) changes to the app.js file :

    # cd /opt/cloud-scheduler/UI
    # make needed chanfges in src/*
    # npm run build-unix
    # cp dist/app.js /var/www/html/cloud-scheudler/app.js
    
  2. /opt/cloud-scheduler/etc/ - pragma.sql

    1. pragma.sql - input data for the pragma database, including a default password for the admin user. During the cs-config run, this file is executed by mysql.

Installs Node.js in /usr/local/*

Installs mysql-python in /opt/python/lib/python2.7/site-packages/MySQLdb

  1. /etc/httpd/conf.d/cloud-scheduler.conf - add apache directive for python scripts
  2. /etc/ld.so.conf.d/cloud-scheduler.conf - adds python library to dynamic linker runtime bindings
  3. /opt/cloud-scheduler/bin - cs-config, cs-uninstall, sha512.py
    1. cs-config - is run during the roll post install. Creates and initializes the pragma database, sets the db administrator user (pragmac) access. NOTE: if the database exists it gets destroyed.
    2. cs-uninstall - If the roll needs to be removed, the script deletes installed RPMs and removes all created files and directories in /opt/cloud-scheduler and /var/www/html/cloud-scheduler
    3. sha512.py - a helper python script to create sha512 hash object and its hex digest. Used to create a hash for a random password for the db administrative user. The digests for passwords are used for the GUI login.
  4. /opt/cloud-scheduler/etc/ - cs-admin.sql.tmpl, cs-initdb.sql.tmpl
    1. cs-initdb.sql.tmpl - a template sql script to create a pragmac database and its admin user pragmac. During the cs-config run, a file cs-initdb.sql is created from this template and is executed by mysql.
    2. cs-admin.sql.tmpl - a template sql script to update a password for the db admin user in the user table. During the cs-config run, a file cs-initdb.sql is created from this template and is executed by mysql.

By default, you can access the Cloud Scheduler via http://myhost.edu/cloud-scheduler. If you want to enable https and create a friendlier name such as https://cloud.mydomain.edu, you will need to

  1. As your administrator to create a DNS host alias (e.g., cloud.mydomain.edu) that points to your host.

  2. Create a SSL host certificate via Let's Encrypt or other service.

  3. Modify the /etc/httpd/conf.d/cloud-scheduler.conf as follows

    NameVirtualHost youripaddress:80
    
    <VirtualHost myhost.edu:80>
        ServerName myhost.edu
        DocumentRoot "/var/www/html"
    </VirtualHost>
    
    <VirtualHost cloud.mydomain.edu:80>
        ServerName cloud.mydomain.edu
        DocumentRoot "/var/www/html/cloud-scheduler"
        Redirect permanent / https://cloud.mydomain.edu/
        AddHandler cgi-script .cgi .py
    </VirtualHost>
    
    <VirtualHost cloud.mydomain.edu:443>
        ServerName cloud.mydomain.edu
        DocumentRoot "/var/www/html/cloud-scheduler"
        SSLEngine on
    
        SSLCertificateFile  /etc/pki/tls/certs/cloud_letsencrypt_cert.pem
        SSLCertificateKeyFile /etc/pki/tls/private/cloud_letsencrypt_key.pem
        SSLCertificateChainFile /etc/pki/tls/certs/cloud_letsencrypt_fullchain.pem
        AddHandler cgi-script .cgi .py
    </VirtualHost>
    
    <Directory /var/www/html/cloud-scheduler>
       RewriteEngine On
       RewriteCond %{HTTPS} off
       RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
    </Directory>