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