• Stars
    star
    255
  • Rank 158,737 (Top 4 %)
  • Language
    C
  • License
    Other
  • Created over 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Notes and scripts for setting up (yet another) Raspberry Pi computing cluster

raspi-cluster (now with Kubernetes thanks to k3s!)

Pi 2

What?

A while ago I decided to build a small cluster of Raspberry Pi boards. I've since upgraded to Pi 2 boards, and this repository is used for versioning design notes, configuration files and sundry.

Why?

I wanted something challenging to do in terms of distributed processing, and lacked dedicated hardware to do it. There's a lot to be learned even from simple, unsophisticated solutions, and virtual machines can only do so much.

How?

The cluster consists of five nodes: a master and four slaves. The master acts as a gateway, DHCP and NFS server and the slave nodes get their IP address and /srv/jobs directory from it.

All slave nodes are identical -- completely identical, except for hostname and MAC address, and there is no need to log in and configure things manually for each node.

Here's a few more shots of the original version, with the 5-port PSU and the old Model B boards:

Cabled Power cords First assembly

In retrospect I probably ought to have gone for longer USB cables and moved all of the cabling to the USB side (since it leaves the SD card slot clear), but I also need to be able to see the activity lights, and the Pi isn't exactly designed for easy stacking.

A larger cluster is certainly feasible, but 5 boards is as much as I can power with the PSU I have.

Hardware

This is a partial list of the stuff I'm using (Amazon UK affiliate links):

Software

As a base OS, this cluster spent most of its useful life using the Ubuntu 16.04 official image for the Pi 2, which worked much better than Raspbian for running Swarm, Docker or Spark (nevertheless, the configuration files in this repo should work in both systems).

Up to the point where I had unfettered access to public cloud resources as part of my work, the cluster ran a mix of Docker Swarm and the occasional Clojure program using Hazelcast atop JDK 1.8, as well as Jupyter, which runs very nicely indeed and provided me with an agnostic, notebook-oriented front-end.

Earlier (back in the Rev 1 days) I had set up Disco on it and intended to fiddle with MPI, but now I have plenty more ways to parallelize things.

It's a bit ironic to do some kinds of processing on merely 5GB of aggregated RAM, but my interest was in the algorithms themselves and I never planned on doing something silly like tackling the next Netflix Prize with this -- besides, running things on low-end hardware is often the only way to do proper optimization, and I like the extra challenges.

List of packages involved so far:

  • k3s, which is the latest addition and has rendered pretty much everything else below obsolete. See the k3s folder for a simple Makefile to install it and keep it running.
  • etcd, which I was using to store (and distribute) configurations across nodes
  • Docker, which ships with Ubuntu 14.04 and makes it a lot easier to build and tear down environments. Currently trying to get 1.7 to build so I can use swarm and other niceties.
  • OpenVSwitch, which I'm using for playing around with network topologies
  • Jupyter, which provides me with a nice web front-end and basic Python parallel computing.
  • Spark, which has mostly replaced Disco for map/reduce jobs.
  • Dash, a real-time status dashboard (rewritten in Go, available under the dashboard folder here, and still being worked on)
  • A custom daemon that sends out a JSON-formatted multicast packet with system load, CPU usage and RAM statistics (written in raw C, available in tools)
  • ElasticSearch, which I'm using for storing metrics.
  • Oracle JDK 8
  • leiningen (which fetches Hazelcast and other dependencies for me, via this library)
  • Nightcode as a development environment (LightTable doesn't run on ARM, and a lot of my hobby coding these days is actually done on an ODROID)
  • distcc for building binaries slightly faster
  • dnsmasq for DHCP and DNS service

This repository also ships with a very simple monitoring dashboard that looks like this:

Updated dashboard

But isn't the Raspberry Pi slow?

Well spotted, young person. It was, and the Pi 2, despite being a marked improvement, isn't exactly a supercomputer. But it's also cheap, and beggars can't be choosers.

Nevertheless, the current configuration provides me with 20 ARMv7 cores clocked at 1GHz, and that's nothing to sneeze at.

But I'm open to sponsoring so that I can upgrade this to have at least twice as many boards, or move to a set of beefier ARM64 boards. The NVIDIA Jetson, in particular, would be great, but five of them aren't easy to come by.

More Repositories

1

imapbackup

A Python script for incremental backups of IMAP mailboxes
Python
273
star
2

textwrangler-bbedit-solarized

solarized color scheme for BBEdit and TextWrangler
Perl
174
star
3

rss2imap

An adaptation of rss2mail that uses IMAP directly
Python
85
star
4

sushy

A wiki/blogging engine with a static file back-end
Python
78
star
5

HJKLPlugin

A plugin for using vim movement keys (HJKL) to navigate messages and message lists in Mac OS X Mail
Python
63
star
6

bottle-fever

A clean-room clone of the Fever RSS aggregator, focusing on the API
Python
61
star
7

Yaki

A filesystem based wiki
Python
55
star
8

pythonium

This is an archive of a Python 3 to Javascript translator written in Python that produces fast portable javascript code
JavaScript
48
star
9

azure-docker-swarm-cluster

A simple, auto-scaling Docker Swarm cluster template for Azure
Makefile
47
star
10

pngcanvas

A minimalist library to render PNG images using pure Python
Python
44
star
11

python-webarchive

Create WebKit/Safari .webarchive files on any platform
Python
42
star
12

soup-strainer

A reimplementation of the Readability/Decruft algorithm using BeautifulSoup and html5lib
Python
33
star
13

python-utils

A set of libraries to allow for sane use of old Python runtimes
Python
30
star
14

docker-templates

A set of Docker templates (Dockerfiles and associated scripts)
Makefile
25
star
15

ink-bottle

A minimal skeleton for doing Bottle apps in a structured fashion (targeting Python 2.7 or above)
Python
24
star
16

newsfeed-corpus

A Dockerized RSS feed fetcher for NLP work, using asyncio
JavaScript
19
star
17

azure-toolbox

A Docker container with Azure Resource Manager administration tools and a machine/deep learning stack
Dockerfile
18
star
18

azure-stable-diffusion

An Azure template to run Stable Diffusion on a GPU-enabled spot instance
Makefile
17
star
19

ubuntu-python

A base Docker container for running Python apps with an Ubuntu userland
Makefile
15
star
20

azure-pipelines-multiarch-docker

A reference example on how to build multi-arch Linux images using Azure Pipelines
Makefile
14
star
21

azure-ubuntu-jitsi

A private Jitsi videoconferencing set up on Azure
Makefile
13
star
22

yaki-tng

A modern, revamped implementation of Yaki
JavaScript
13
star
23

homeworld

C
12
star
24

transducers-py

A (discontinued) attempt at creating a Python transducer library, done as a weekend project
Python
12
star
25

EyeFi-Config

Clone of git://git.sr71.net/eyefi-config.git
C
11
star
26

divmod.org

Archive of the old divmod.org SVN repo (snapshot from Launchpad)
Python
10
star
27

terraform-azure-linux-vm

An end-to-end, full-stack provisioning demo that can be used as a starting point for more complex solutions
Smarty
10
star
28

qsb-mac

Personal fork of (Google) Quick Search Box
Objective-C
9
star
29

azure-durable-functions-node-blog-engine

A simple blog engine and static site generator written as an Azure Durable Functions code sample
JavaScript
9
star
30

netbeans-clojure

A NetBeans plugin for Clojure support
Java
8
star
31

gnome-thumbnailers

My personal set of file thumbnailing utilities for GNOME 42+
Python
8
star
32

docker-ssh-bastion-armhf

A Docker container with a tailored SSH bastion
Shell
7
star
33

vagrant-templates

Templates for Vagrant VMs with useful snippets
Python
7
star
34

go-http-mdns

A minimal web server inside a Docker container for testing mDNS networking
Go
7
star
35

ground-init

Install a Linux machine locally with something that is almost, but not quite, cloud-init
Python
6
star
36

docker-plex-armhf

Run the Plex media server as a Docker container on the Raspberry Pi and other armhf machines
Makefile
6
star
37

docker-airprint-armhf

CUPS container for setting up an AirPrint server on armhf machines like the Raspberry Pi
C++
6
star
38

mqtt-feed-fetcher

An RSS feed fetcher that pipes new items to an MQTT topic
Hy
6
star
39

pink

An architectural Pattern for Ink
JavaScript
6
star
40

wasi-sqlite

sqlite3 CLI for a-Shell on iOS
C
5
star
41

android-signage-server

A companion server for the android signage client
Python
5
star
42

azure-golang-iothub

Experimental (minimalistic) client for Azure IoT Hub
Go
5
star
43

azure-iot-esp-01-minimal-cpp

The smallest Azure IoT Hub client in the world
C++
5
star
44

hy-there

A hylang playground
JavaScript
5
star
45

docker-homebridge

A Homebridge setup with the plugins I need, for armhf and x86_64
Makefile
3
star
46

azure-functions-bot

A reference bot design using Azure Functions
JavaScript
3
star
47

AirVideo

Python port of jphastings' excellent Ruby AirVideo client, enhanced with further functionality
Python
3
star
48

docker-zigbee2mqtt

Dockerized ZigBee gateway for my home setup
Makefile
3
star
49

hyrule

An improved REPL for HyLang
Python
3
star
50

kernseife

A fork of http://code.google.com/p/kernseife to scratch a few itches of mine. GPLv3.
3
star
51

terraform-azure-ha

a demo plan to deploy a high-availability scenario using an Azure Standard Load Balancer in HA mode
Smarty
3
star
52

docker-handbrake

A batch conversion wrapper for video files
Shell
2
star
53

azure-acme-foundation

A set of Azure Resource Manager templates and scripts for multi-tier, multi-tenant architectures
Python
2
star
54

azure-functions-bootstrap

An ARM template and additional boilerplate to build Azure Functions solutions
Makefile
2
star
55

aiogemini

A barebones Gemini protocol server written in async Python 3.x
Python
2
star
56

docker-other-video-transcoding

Don Melton's transcoding scripts as a Docker container
Shell
2
star
57

docker-homekit2mqtt

My personal setup
Makefile
2
star
58

docker-xmind

Dockerized Guacamole wrapper for legacy XMind 8
Dockerfile
2
star
59

openscad-kp3spro-filler

a spool holder arm for the KP3S Pro that uses the Filler modular system
OpenSCAD
2
star
60

rss2imap-gae

A reboot of rss2imap to run on Google App Engine
JavaScript
1
star
61

ansible-rancher

Ansible playbook to set up Rancher
1
star
62

loki-render

Loki Render with some tweaks
Java
1
star
63

PlasmaKit

Scripts and utilities for managing a set of plasma displays
JavaScript
1
star
64

ink-dash

A set of InkJS modules to build data-oriented displays
JavaScript
1
star
65

openscad-pikvm-case

a PiKVM case to hold a Raspberry Pi Zero W (or a Zero 2W) together with an HDMI-to-CSI bridge.
OpenSCAD
1
star
66

cogewebkit

A fork of http://code.google.com/p/cogewebkit/ that has a few extra properties (for now, essentially hiding the webview scrollbars)
1
star
67

docker-homeassistant

A Home Assistant container with the plugins I need
Makefile
1
star
68

openscad-vodafone-smart-router-base

A replacement base part for the Vodafone/Sagem ONT used by Vodafone Portugal
OpenSCAD
1
star
69

vagrant-docker

Docker provider for Vagrant 1.1
Ruby
1
star
70

azure-dev-bootstrap

An updated developer sandbox for Ubuntu 22.04 LTS, Node, Python and Go, accessible via Tailscale
Makefile
1
star
71

java-templates

A small collection of Java/Maven project templates for IDE-free development.
Java
1
star
72

yakitori

A test project to get my feet wet with Kotlin
Kotlin
1
star
73

raspbian-vlc-cross-compile

A Vagrantfile and assorted scripting to cross-compile VLC for Raspbian
Shell
1
star
74

http-benchmarks

Toy HTTP benchmarks for various runtimes
Makefile
1
star
75

docker-redis-build

experimental build scripts
Makefile
1
star
76

clj-nylon

A Textile markup parser for Clojure based on Instaparse
Clojure
1
star
77

aioazstorage

A thin asyncio wrapper for Azure Storage
Python
1
star