Skip to content

ledakis/picluster

Repository files navigation

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

/ip/

Contains the generated IP (individual) files for all nodes (including master).

README.md

This file you are reading, contains all relevant information about the project.

ip2file.sh

Saves the current IP of eth0 to the /ip/<eth0-MAC-ADDRESS> file, and overrides it, if exists.

up2git.sh

Pushes to git the new IP that has been generated by ip2file.sh.

/local-vars/

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.

/master

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.

service.sh

This file is a service running at all times that configures the cluster and keeps everything updated.

picluster.service

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.

/boot/picluster/config

Will include (initially) the git repository address. Probably more configuration options in later revisions.

/boot/picluster/master

Exists only on the designated master sdcard/node. Will be checked by the /node-master.sh script.

/boot/picluster/priv.key

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.

/boot/picluster/pub.key

The public key for the aforementioned private one. It is going to be copied to /home/pi/.ssh/id_rsa.pub automatically.

Processes

Raspberry Pi boot process

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.

Master

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published