0% found this document useful (0 votes)
10 views

Building a Raspberry Pi Supercomputer (2021)

This document is a hands-on tutorial for building Raspberry Pi supercomputers, detailing hardware and software setup, user management, network configuration, and cluster management. It includes instructions for setting up SSH keys, NFS file sharing, and running parallel SSH commands. The tutorial emphasizes user responsibility and provides resources for further assistance.

Uploaded by

condorito
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Building a Raspberry Pi Supercomputer (2021)

This document is a hands-on tutorial for building Raspberry Pi supercomputers, detailing hardware and software setup, user management, network configuration, and cluster management. It includes instructions for setting up SSH keys, NFS file sharing, and running parallel SSH commands. The tutorial emphasizes user responsibility and provides resources for further assistance.

Uploaded by

condorito
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

A hands-on tutorial

Building
Raspberry PI
Supercomputers
Federico LucifredI
me me me
Things I worked on

Red hat Ceph STORAGE


Ubuntu Server
Landscape
SUSE Studio
SLES
SMT
Ximian Red Carpet
Man (I)

Federico Lucifredi MMXXi


disclaimer
while the following was
conscientiously researched and
verified, neither THE ORGANIZERS
nor the author will accept any
liability if you render your
ORGANIZATION inoperable as a
result of these instructions.

Proceed at your own risk.

Federico Lucifredi MMXXi


ASSEMBLY

Federico Lucifredi MMXXi


HARDWARE

Federico Lucifredi MMXXi


SOFTWARE

Federico Lucifredi MMXXi


user setup
———————————————————————————————————————————————————
give the root user a password

# passwd

rename the picocluster user to your liking

# groupmod -n federico picocluster


# usermod -l federico picocluster
# usermod -d /home/federico federico #update home directory
# cd /home; mv picocluster federico

# vi /etc/password
$ passwd #update password

$ rm .XAuthority #force new xauth

Federico Lucifredi MMXXi


users
———————————————————————————————————————————————————
users set up on the system

federico (you) # sudo capable

root (just in case) # no SSH access

make sure you can become a superuser

# vi /etc/sudoers
federico ALL=(ALL) NOPASSWD: ALL

Federico Lucifredi MMXXi


runlevels
———————————————————————————————————————————————————
nodes other than the master node (pc0) need not run X:

# systemctl set-default multi-user.target

Federico Lucifredi MMXXi


network
———————————————————————————————————————————————————
ethernet wired network for local intra-cluster communication:

pc0 eth0 (head node) 10.1.10.240 # HDMI interface

pc1 eth0 10.1.10.241

pc2 eth0 10.1.10.242

wifi network for external connectivity and downloads:

pc0 wlan0 (head node) DHCP

pc1 wlan0 DHCP

pc2 wlan0 DHCP

Federico Lucifredi MMXXi


WiFi
———————————————————————————————————————————————————
/etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Include files from /etc/network/interfaces.d:


source-directory /etc/network/interfaces.d

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

auto eth0
iface eth0 inet static
address 10.1.10.240
netmask 255.255.255.0
gateway 10.1.10.1
dns-nameservers 10.1.10.1 8.8.8.8

Federico Lucifredi MMXXi


connections
———————————————————————————————————————————————————
automtically joining known wireless networks:

/etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
ssid="Red Hat Guest"
psk="Shadowman33"
}

network={
ssid="scale-public-fast"
psk="pasadena"
}

Federico Lucifredi MMXXi


access keys
———————————————————————————————————————————————————
use SSH keys to enable rapid, secure access between nodes:

$ ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa


$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

authorize the key on every node of the cluster

$ ssh-copy-id -i .ssh/id_rsa.pub federico@pc0


$ ssh-copy-id -i .ssh/id_rsa.pub federico@pc1
$ ssh-copy-id -i .ssh/id_rsa.pub federico@pc2

genKeys.sh in the PicoCluster image set

ssh-import-id on GitHub

Federico Lucifredi MMXXi


cluster management
———————————————————————————————————————————————————
some handy scripts are part of the Picocluster base system:

restartAllNodes.sh
stopAllNodes.sh
testAllNodes.sh

resize_rpi.sh

Federico Lucifredi MMXXi


parallel SSH
———————————————————————————————————————————————————
for one-time tasks, parallel SSH is the way to go:

$ parallel-ssh [-l user] [-h file |-H hosts] [--inline] <command>

some examples:

$ parallel-ssh -h nodes “cat /etc/hosts”

$ parallel-ssh -h nodes --inline “cat /etc/hosts”

$ parallel-ssh -h nodes “ping -c 1 10.1.10.240”

$ parallel-ssh -h nodes --inline “ping -c 1 -W 5 www.mit.edu”

$ parallel-ssh -h nodes -i "vcgencmd measure_temp"

Federico Lucifredi MMXXi


time
———————————————————————————————————————————————————
give the cluster a reliable source for timestamps:

# timedatectl # get status


# timedatectl set-ntp true

set the correct timezone

# timedatectl list-timezones | grep America


# timedatectl set-timezone America/New_York

time source is defined in /etc/systemd/timesyncd.conf

Federico Lucifredi MMXXi


shared folder
———————————————————————————————————————————————————
NFS file share setup on primary node:

$ sudo apt install nfs-kernel-server


# mkdir /export
# chown federico:federico /export

# vi /etc/exports
/export 10.1.10.0/24(rw,sync)

$ sudo systemctl restart nfs-server # update shares

Federico Lucifredi MMXXi


mounts
———————————————————————————————————————————————————
NFS mount on secondaries:

# mkdir /export
# chown federico:federico /export

you can now $ sudo mount pc0:/export /export

$ sudo vi /etc/fstab
pc0:/export /export nfs defaults 0 0

Federico Lucifredi MMXXi


blinkenlights
———————————————————————————————————————————————————
Pimoroni Blinkt libraries need to be pre-installed.

$ curl https://get.pimoroni.com/blinkt | bash

then, inevitably, the Cylons arrive:

$ cd Pimoroni/blinkt/examples

$ larson.py
$ parallel-ssh -h ~/nodes /export/larson.py

$ clear_all.py # clear any residual state

perhaps a better example:

$ cpu_load.py
$ stress -c 2

Federico Lucifredi MMXXi


Conclusion

Federico Lucifredi MMXXi


resources
———————————————————————————————————————————————————
Picocluster Dustin Kirkland
genKeys.sh ssh-import-id
restartAllNodes.sh
stopAllNodes.sh Carlos Morrison
testAllNodes.sh
resize_rpi.sh
Oak Ridge National Lab
Additional tools serialpi.c
apt install wolfram-engine

Federico Lucifredi MMXXi


Questions

flucifredi@acm.org
@0xF2
Federico Lucifredi MMXXi
(c) 2021 Federico Lucifredi

(CC)Attribution-Noncommercial-
No Derivative Works 3.0

Federico Lucifredi MMXXi

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy