Creating a Supercomputer with a Raspberry Pi 5 Cluster and Docker Swarm!
Вставка
- Опубліковано 2 лип 2024
- Sponsored by PCBWay: www.pcbway.com
PCBWay, your ultimate destination for PCB manufacturing and assembly. Whether you're a hobbyist, a startup, or a seasoned professional, PCBWay has got you covered.
Unlock the Future of Computing with Your Raspberry Pi 5 Cluster!
Welcome to our step-by-step tutorial on building a powerful supercomputer using a Raspberry Pi 5 Cluster and Docker Swarm.
In this exciting video, we'll guide you through the process of creating your very own high-performance computing cluster, turning your Raspberry Pi 5 devices into a collaborative powerhouse.
What You'll Learn
Installing and configuring Docker Swarm
Building a scalable cluster network
Deploying containers and managing services
Harnessing the combined processing power of your cluster
Whether you're a tech enthusiast, a student, or a professional looking to explore the possibilities of parallel computing, this tutorial has got you covered!
For more information on Kevs Robots, tutorials and more visit: www.kevsrobots.com
To join the membership at bronze, silver or gold levels, head over to
www.smarsfan.com/membership
Join me on Discord - www.kevsrobots.com/discord
Join the list - www.kevsrobots.com/join
️ Enjoy this video? Buy me a coffee! www.buymeacoffee.com/kevinmca...
Follow me on Instagram - @kevinmcaleer / kevinmcaleer
Follow me on Twitter - @kevsmac / kevsmac
Join the Facebook group - Small Robots / smallrobots
My Code on GitHub: www.github.com/kevinmcaleer
Music by Epidemic Sounds www.epidemicsound.com/referra...
#RaspberryPi5 #Docker #Cluster
Building a Supercomputer Cluster using Raspberry Pi 5s
Kevin walks us through the process of building a supercomputer cluster using Raspberry Pi 5s. He details the features of the Pi 5 and explains how to use Docker Swarm for clustering. The video takes a hands-on approach as he builds the cluster, demonstrating the utility of Docker Swarm. The tutorial also outlines how to use Portainer for managing a Docker Swarm, highlighting its advantages such as visualizing and spreading workload. Further, Kevin explains how to dockerize a Python app and deploy it across nodes, add a new worker, and remove services from nodes, thereby showcasing the flexibility and control that Docker offers. The tutorial concludes with a brief note on how to support Kevin’s channel. Please note that this video is aimed at an intermediate level audience.
00:00 Introduction to Building a Supercomputer Cluster with Raspberry Pi 5
00:21 Overview of the Raspberry Pi 5 Cluster
01:29 Sponsor Message: PCBWay
03:00 Introduction to Docker Swarm
04:28 Setting Up the Raspberry Pi 5 Cluster
05:02 Benefits of Using Raspberry Pi 5 for the Cluster
06:23 Requirements for Building the Cluster
08:54 Introduction to Docker Swarm: Part 2
09:44 Setting Up the Docker Swarm
17:27 Visualizing the Docker Swarm with Portainer
22:59 Deploying Apps and Spreading Workload in the Swarm
27:50 Building a Custom App for the Cluster
28:59 Introduction to Dockerizing a Python Program
29:36 Creating a Dockerfile and Docker Compose File
29:45 Building, Tagging, and Uploading the Docker Image
30:06 Deploying the Dockerized Python Program
30:53 Exploring the Dockerfile and Docker Compose File
32:52 Building and Deploying the Dockerized Python Program
33:24 Testing the Deployed Python Program
39:59 Adding and Removing Nodes in the Docker Swarm
43:59 Managing Docker Containers and Images
48:35 Promoting a Worker Node to a Manager Node
49:56 Removing Services from the Docker Swarm
53:31 Conclusion and Acknowledgements - Розваги
Great video, Kevin! Thanks again for creating this!
Hello Kevin from Pensacola, Florida... because of work and time availability, haven't been able to watch your live events but great videos and i appreciate your Raspberry Pi tips and projects. Thanks again! Be well!
i loved the tutorial bro! im actually loving to learn docker, i wanna create my own cluster.
The live debugging adds value to the video.
"what the bot's going on there?" Is a new favorite phrase.
Hey Kevin, I really love your videos. This one's great but I'm just wanting to set up a portainer .Would you be able to if you've not already show us how to set up portainer and docker and some containers? Because I like the way that you present it and the way that you can teach us how to do this. Thank you.
Hi, great video, can you please elaborate on the network setup part?
Great video, just put together a Pi cluster with 3 raspberry pi 4 using the uctronics case, will add a 4th node eventually.
New to docker and swarms, so your videos have been really useful.
Can you make the screen bigger next time so we can see up close what you’re typing in the terminals cheers bro, good video
I'd be interested to know your opinion on uilding a Pine4 RockPro cluster.
Hey Kevin, absolutely gr8 and superbly done presentation.
Question: can I use PoE instead individual power adapter to above cluster configuration?
Yes - you’ll need a PoE Hat to use that power though as I understand it
Building mine bit by bit, I want to make a cluster powerful enough to run my plex, nas, home assistant, and maybe if I can figure it out a local Mincraft server... I am aiming for a 8 Raspberry PI 5 cluster but due to finances will have to add the nodes as i get them or change them from pi 4 to pi 5 as I get the 5 in, I have a load of 4s laying around.
Not had luck ran a Minecraft server no one could join.
👍👍👍👍👍👍
I thought swarm would be parellel processing for containerised applications. Not what I experienced. Got all these devices but cannot find a great home use yet....
Great Clear Video Thank you. I have just setup a super6c CM4 cluster with a view to learning about clusters. I was planning to use k3s but Docker swarm looks easier to use and still meets my needs.
My Questions:
1/ Do I need to worry about setting up public-key authentication on all the nodes before I start. (This is confusing me right now)
2/ I am am planning to run InfluxDB and Grafana so do I need/can I setup persistent storage for this.
3/ Can I use the multiple attached NVME drives in such a way as to provide a duplicate of all the swarm data and containers in case one manager node fails and how many manager nodes would you suggest!
4/ Is there a way to simply backup this storage every night to my seperate NaS storage in case I have a major problem.
Thanks.
Hi Neil, Some great questions there. 1 - don't think you need to worry about that, ssh is fine, 2) Yes you'll need to setup a bind volume rather than using a container volume, that way you can persist the data even if the container is recreated. This also means you'll need to constrain that container to a specific node (where the data is). 3) I'm not aware of any multi-NVMe hats or bases yet, but I'm sure they will be available **soon**. Docker doesn't do live file system replication across the cluster. 4) Yes - just follow the docker docs - docs.docker.com/desktop/backup-and-restore/
Thank you for a quick response. I can move forward now using your answers@@kevinmcaleer28
Great video, thank you. But can't understand why use Docker Swarm instead of Kubernetes.
Uses less memory, which is essential on single board computers with limited resources. Its also simpler to learn for people with no experience in container orchestration.
Hey Kev. I have a q! I was thinking to use wifi for my clusters . But now I’m seriously thinking about Ethernet.
Which Cat/ Cat e cable to use?
Cat 6/ 7 or even 8???
in terms of security i really want to hear your thought this setup vs qubes os setup
I'm not familar with qubes os. I'll look into this and let you know
Thanks for the video. Curious, are you running a single power supply per pi? I have two raspberry pi 5s and 2 4bs and Im wondering if theres a more efficient way to power them
You can use multiport mobile chargers like Anker charger, 60w 6 port charging station or you get cheaper Chinese charges.
@@offakerala i have actually tried this, but because I use SSD as storage instead of SD card, my power requirements are a lot higher :(
@@srsqtee Oh ok, then its better to use power supplies as per the current consumption. Did you install K3S or Swarm?
@@offakerala yea I ended up having a separate power supply for each. Once i can get my hands on some PoE hats for these, Ill swap to those.
I have been running k3s on my pi cluster for a few years now. Whatre you installing on yours?
@@srsqtee I am a newbie, made a K3S cluster with 5 X pi 4B's. I tied to make custom power supplies, unfortunately dint work. I feel pi's need some kind of isolation. Or may be something like an Online UPS setup backed by a battery might work. Not sure though :)
What about using them for running local LLMs? Do we need a GPU?
You can absolutely run a LLM on the cluster - that's what I used for a recent video on Ollama and WebUI
Can the LLM workload be distributed? I know you can run multiple instances, yes, but can you "split" a huge LLM to multiple PIs. LLMs can use way more RAM than any PI has.
@@eMgotcha77 Thats a great question - I've not seen that done yet, but it should be possible to break the work in to parallel tasks and for them to work on it independently. Pretty sure Ollama could be used to do that
Can I use different Raspberry Pi's in a cluster? So basically, a combination of Raspberry Pi 3, Pi 4, and Pi 5. Could I even possibly add an X86 computer like a Zimaboard to run specific x86 containers? How about managing them so that the lower powered Pis get the easier workloads?
interesting
Great video as usual, Kevin. One note for you though. You said "depreciate" when talking about, well I forget what it was now, but the word is "deprecate". Keep up the great work!
Thanks Chris
Hi Kevin, how do you power your Raspberry PI 5 cluster? POE?
I use 4 27watt power supplies!
Hi Kevin, sorry I cant quite make out where you got the cluster rack from?
Hey - its from ThePiHut
@@kevinmcaleer28 Thank you ;)
@kevinmcaleer28 Can you share the link to the case?
would a raspberry pi cluster, with 30+ raspberries, be good for metatrader 5 backtesting?
Save your money (buy the pis though)
Pi 5, you gonna heat your house with that cluster?
I'm trying to figure out how to mitigate the heat generated from a single Pi 5.
I can't get my nvme base to work. I have pineberry pi. I think I know what the issue is. I'm waiting on a raspi5 charger. The old ones worm, but I don't think I have enough juice for external pcie. We will see. I want to make sure I can get one to work before I buy 4, lol. Also, I'm running Ubuntu. I don't think that changes anything except the name of the configuration file that you edit to enable pcie. If anyone else is running Ubuntu with nvme base, and you have it working, please let me know if that's the only difference.
Might want to check the compatibility of the drive on the pineboard. Not all work.
Could I use Raspi 3 instead of Raspi 5?
Yes! Raspberry Pi 3B only have 1Gb of Ram, which might restrict what you can do with it, but it will work fine (One of my Pi 4's is a 1Gb and that's happily serving up www.kevsrobots.com to 1000s of people per month)
Hey! Thanks a lot for replying! Could this be done for a college project using just one or two raspi boards!?
@@ananyabhat9874Sure - you'll need to Pi's minimum to make a swarm, otherwise if its just on one Pi its a standalone docker instance
I've created a free docker course you can check out here: www.kevsrobots.com/learn/docker/
Please do better close ups please! 🙏🏽
A "supercomputer" with boulder sized granularity of tasking and dog slow switching fabric isnt very interesting. To make this shine ideally a crossbar that would plug into the PCIe to interconnect the nodes combined with a custom linux distro that would present a virtualized, unified image of a multi-core processor architecture and a ccNUMA memory that could run native apps transparently, even if recompilation of source was necessary. Granted, the cost would increase but usability and performance would be orders of magnitude beyond this setup. There are already switching fabrics that could be utilized so it wouldnt be a ground up endeavor; infiniband, or even ethernet thats now pushing 10gb+ and MPI drivers integrated into the linux kernel would make it doable.
That would be an entirely different show; this show was about showing everyone how to build a cluster using a bunch of Raspberry Pi 5 (first 4 seconds). I am interested in the progress you make on your suggestion, though
@@kevinmcaleer28 Perhaps then the term "supercomputer" could have been de-clickbaited from the title 😀
@@Sven_Dongle it’s not inaccurate
@@kevinmcaleer28 And yet somehow, not truly accurate. It's like the Schrödinger's Cat of titles.
“Super” is a pretty relative word.
Docker swarm is very uncool in 2024 better use kubernetes.
It’s not a fashion cluster - it has work todo.
@@kevinmcaleer28 K8s is heavly production ready and used by your most used apps like youtube. I dont know why you think, that k8s cannot do some work.
@@marci1270 utilization should be higher compare to docker swarm, but the features are not comparable :) if i have to run something simple i wote on Nomad
buy a rpi 5 was waste of my time and money
Explain pls??? Cause I got 4
@@abzs5811 with adaptor, case, heatsink and memory the price will be equal to a mini pc. mini pc is more powerfull and faster pci with m2 nand and better os support. i wish i would buy a mini pc instead
How is that? Just out of curiosity.
Wow I have 6 rpi 5 and their all. Clustered and brilliant