Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 1.85 KB

README.md

File metadata and controls

61 lines (40 loc) · 1.85 KB

Ansible MPI Cluster

Ansible project to automatically configure APT-based hosts to act as master/slave nodes in an MPI cluster.

I should caveat the above by saying that I've only tested the scripts against Ubuntu v14.04. If you discover any problems using the playbook be sure to issue a pull-request.

Creating a cluster

To configure your Ubuntu machines as an MPI cluster first create an inventory file matching the following template. Slot numbers for OpenMPI hosts can be defined if required.

master 10.211.55.178

[slaves]
10.211.55.177 slots=2
10.211.55.175 # Defaults to slot=1 if not defined
10.211.55.176 slots=4

Execute the playbooks against the hosts:

cd ./provisioning
ansible-playbook site.yml -i <PATH TO INVENTORY>

Adding a new slave to the cluster

If you want to add a slave to an existing cluster do the following:

  1. Add the slave's IP to the slaves group in your inventory file.
  2. Run ansible-playbook slaves.yml -i <PATH TO INVENTORY>

Development

Vagrant is used to create development VMs against which you can test changes to the Ansible scripts.

  1. Install Vagrant.
  2. Provision and configure the local cluster with:
vagrant up

Once provisioned the Ansible Provisioner creates a inventory which can be used manually with the ansible-playbook utility:

cd ./provisioning
ansible-playbook site.yml -i ../.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory

Or you can let Vagrant do the provisioning:

vagrant provision

Amount of slaves

By default running vagrant up will create two slave nodes. This can be changed via the TOTAL_SLAVES variable in the Vagrantfile.