Tutorial

Note

This section only intends to give a quick presentation of GridCompute through the use of a very simple demo application Random Counter.

This application takes a file as input, performs a countdown from a random number, and returns the time needed for that countdown, along with the name of the input file. This output is then added to a file in the home directory of the person who requested the process.

Create GridCompute database

GridCompute requires a MongoDB server to store all cases related information.

Create a MongoDB server

In this section, we are going to detail two possible scenarios: using a private server or using a specialized host.

Option 1: Create a private MongoDB server

In this example, we are going to assume that you want to use a Ubuntu server in a virtual machine created with VirtualBox. You can adapt it to install on a different OS and use of a virtual machine is only optional.

  1. Install VirtualBox.

  2. Create a virtual machine in VirtualBox with at least 512MB RAM and 8Go drive.

  3. Install Ubuntu server. Activate option “Open-SSH Server” during installation for convenient access to your server.

  4. Set up port forwarding in VirtualBox:

    • host=22 (or 2222 for Ubuntu host), guest=22 if you want to access to your machine by ssh
    • host=27017, guest=27017 for access to Mongo database
  5. From host, connect to guest through ssh.

    On Ubuntu: ssh -p 2222 GUEST_USERNAME@HOST_MACHINE_NAME
    On Windows: you can use a program such as putty
  6. Update Ubuntu packages and reboot.

    >>> sudo apt-get update
    >>> sudo apt-get upgrade
    >>> sudo sudo reboot
    
  7. Install MongoDB per instructions from MongoDB tutorial.

  8. In file /etc/mongod.conf, comment line bindip [...]

  9. Run sudo service mongod start

  10. Create a new database called gridcompute

    >>> mongo
    >>> use gridcompute
    
  11. Add the user you will use from gridcompute. For example, for user Group1 with password gridcompute:

    >>> db.createUser({user:"Group1", pwd:"gridcompute", roles:["readWrite"]})
    >>> quit()
    
  12. Set up MongoDB server.

Option 2: Use a specialized host

MongDB server instance can be hosted by a specialized website such as Compose or Mongolab.

  1. Register to the host of your choice.
  2. Create a new database named “gridcompute”.
  3. Add the user you will use from gridcompute. For example, user Group1 with password gridcompute.
  4. Set up MongoDB server.

Set up MongoDB server

The main purpose is only to define what version of gridcompute can work with the database.

Note

This section is optional. If you don’t set up the database, a warning message will appear to notify you that the program version is not controlled by the server but the program will still work.

  1. Open script source/admin/database_management.py.
  2. Edit the variables under if __name__ == "__main__".
  3. Run the script with python 3.

Set-up of GridCompute

Before starting the program, you should follow these steps:

  1. Download latest version of GridCompute binary. Choose the version associated to your OS.
  2. Create a shared folder accessible (read and write) to every person that will use the program.
  3. Copy folder template/Shared_Folder from source code to the shared folder you are going to use with GridCompute.
  4. At the root folder of GridCompute executable, there should be a file server.txt. Open it and copy the path to GridCompute shared folder. Ex: \\Server010\...\Shared_Folder.
  5. Edit settings.txt from the template folder with applicable parameters (refer to settings.txt specifications)
  6. Edit Software_Per_Machine.csv from the template folder (for more details refer to Software_Per_Machine.csv specifications):
  • Add the name of your machine in the first column
  • Enter 1 for application Random Counter on the row corresponding to your machine name
  • Save as csv

Test GridCompute

The following section will give you a brief overview of the program.

  1. Run GridCompute executable. You will see the main window of the program.
  2. Check at the bottom of the application that you can run Random_Counter as selected in Software_Per_Machine.csv.
  3. Click on the application checkbox and select Random Counter.
  4. Click on add cases and select 10-20 files (they will not be modified).
  5. Check that cases have been added to the interface.
  6. Click on submit list to server and confirm.
  7. Click on the tab my cases and button refresh now. You will see the status of all your cases.
  8. Increase the number of processes allowed to run.
  9. While process are running, click on refresh now to see their status.
  10. Go to the tab my processes to see what is happening on your computer.
  11. Random Counter demo application has been set-up so that outputs are added to the file gridcompute_output.txt present in your home folder.