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.
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>
If you want to add a slave to an existing cluster do the following:
- Add the slave's IP to the
slaves
group in your inventory file. - Run
ansible-playbook slaves.yml -i <PATH TO INVENTORY>
Vagrant is used to create development VMs against which you can test changes to the Ansible scripts.
- Install Vagrant.
- 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
By default running vagrant up
will create two slave nodes. This can be changed via the TOTAL_SLAVES variable in the Vagrantfile
.