This is the repository described in my BSc thesis (link here):
An Ansible implementation of a self-configuring Beowulf cluster of Raspberry Pis in a localised environment for the purpose of distributed computing using Open MPI
The picluster repository will have the necessary files for the ansible-backed raspberry pi beowulf cluster project.
File structure of the repository
Contains the generated IP (individual) files for all nodes (including master).
This file you are reading, contains all relevant information about the project.
Saves the current IP of eth0
to the /ip/<eth0-MAC-ADDRESS>
file, and overrides it, if exists.
Pushes to git the new IP that has been generated by ip2file.sh
.
Directory that will contain all the variables for the individual deployment each time. For example the MAC address of the master node, the public SSH key that the master will use, etc.
File which will contain the MAC Address of the designated master node.
On fresh repositories this file will not exist, but will generated from the first node that saves its IP in /ip/
directory. If the file exists (either because the Pi is not the first to boot and add its IP or because the user has added the file manually) it will not be touched.
This file is a service running at all times that configures the cluster and keeps everything updated.
This file will be copied to /etc/systemd/user/
to be automatically started with the system in order the service.sh
to start setting up the node for Ansible to get access.
Will include (initially) the git repository address. Probably more configuration options in later revisions.
Exists only on the designated master sdcard/node. Will be checked by the /node-master.sh
script.
The private key that ought to have write access to the git repository. Otherwise nothing will work.
This key is going to be used for regular SSH as well. It is going to be copied to /home/pi/.ssh/id_rsa
automatically.
The public key for the aforementioned private one. It is going to be copied to /home/pi/.ssh/id_rsa.pub
automatically.
After the Debian process finishes, the scripts in /etc/rc.local
will run. In those scripts there will be initialisation procedures that will get the configuration from /boot/picluster.conf
and parse it accordingly.
The script will also copy the ssh keys to /home/pi/.ssh/
Given there is internet connection the script will clone the git repository into /home/pi/picluster
(now referred to as $LOCALREPODIR and add decide if it is a master and add the master file in the root of the directory. Then it will add its IP in $LOCALREPODIR/ip/
and commit-push back.
Then it will set up a process to be added as a service in the system so that it never gets killed.
That service will from now on handle everything and the initial script can terminate.
If the Pi is configured to be a master, it will initiate the master script.
The master procedure will initially start openmpi as master node and serve ganglia on its IP address.
It will wait at least 5 minutes before starting polling the git repository for changes every 30 seconds.
The service will be checking periodically for disconnected nodes using the ansible -m ping
module and remove the failed nodes.