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
  • Розваги

КОМЕНТАРІ • 71

  • @aravjain
    @aravjain 4 місяці тому +2

    Great video, Kevin! Thanks again for creating this!

  • @tommyvanpelt2408
    @tommyvanpelt2408 4 місяці тому +1

    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!

  • @sunday-thequant8477
    @sunday-thequant8477 3 місяці тому +1

    i loved the tutorial bro! im actually loving to learn docker, i wanna create my own cluster.

  • @TreeLuvBurdpu
    @TreeLuvBurdpu 4 місяці тому +2

    The live debugging adds value to the video.

  • @TreeLuvBurdpu
    @TreeLuvBurdpu 4 місяці тому +2

    "what the bot's going on there?" Is a new favorite phrase.

  • @HometownUnicorn
    @HometownUnicorn 4 місяці тому

    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.

  • @BjornNeven
    @BjornNeven 4 місяці тому

    Hi, great video, can you please elaborate on the network setup part?

  • @steve230870
    @steve230870 4 місяці тому +1

    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.

  • @abzs5811
    @abzs5811 4 місяці тому +1

    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

  • @molonlabe8792
    @molonlabe8792 3 місяці тому

    I'd be interested to know your opinion on uilding a Pine4 RockPro cluster.

  • @DeepakNayak-vg8vu
    @DeepakNayak-vg8vu 3 місяці тому +1

    Hey Kevin, absolutely gr8 and superbly done presentation.
    Question: can I use PoE instead individual power adapter to above cluster configuration?

    • @kevinmcaleer28
      @kevinmcaleer28  3 місяці тому

      Yes - you’ll need a PoE Hat to use that power though as I understand it

  • @armisis
    @armisis 4 місяці тому +3

    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.

    • @armisis
      @armisis 2 місяці тому

      Not had luck ran a Minecraft server no one could join.

  • @Robert-sj8ld
    @Robert-sj8ld 4 місяці тому +1

    👍👍👍👍👍👍

  • @armisis
    @armisis 2 місяці тому

    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....

  • @neilvass6805
    @neilvass6805 4 місяці тому +1

    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.

    • @kevinmcaleer28
      @kevinmcaleer28  4 місяці тому

      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/

    • @neilvass6805
      @neilvass6805 4 місяці тому

      Thank you for a quick response. I can move forward now using your answers@@kevinmcaleer28

  • @ivint
    @ivint 4 місяці тому +1

    Great video, thank you. But can't understand why use Docker Swarm instead of Kubernetes.

    • @kevinmcaleer28
      @kevinmcaleer28  4 місяці тому +1

      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.

  • @abzs5811
    @abzs5811 3 місяці тому

    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???

  • @RickySupriyadi
    @RickySupriyadi 4 місяці тому +1

    in terms of security i really want to hear your thought this setup vs qubes os setup

    • @kevinmcaleer28
      @kevinmcaleer28  4 місяці тому +1

      I'm not familar with qubes os. I'll look into this and let you know

  • @srsqtee
    @srsqtee 4 місяці тому +1

    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

    • @offakerala
      @offakerala 21 день тому

      You can use multiport mobile chargers like Anker charger, 60w 6 port charging station or you get cheaper Chinese charges.

    • @srsqtee
      @srsqtee 21 день тому

      @@offakerala i have actually tried this, but because I use SSD as storage instead of SD card, my power requirements are a lot higher :(

    • @offakerala
      @offakerala 21 день тому

      @@srsqtee Oh ok, then its better to use power supplies as per the current consumption. Did you install K3S or Swarm?

    • @srsqtee
      @srsqtee 21 день тому

      @@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?

    • @offakerala
      @offakerala 21 день тому

      @@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 :)

  • @TreeLuvBurdpu
    @TreeLuvBurdpu 4 місяці тому +2

    What about using them for running local LLMs? Do we need a GPU?

    • @kevinmcaleer28
      @kevinmcaleer28  4 місяці тому +1

      You can absolutely run a LLM on the cluster - that's what I used for a recent video on Ollama and WebUI

    • @eMgotcha77
      @eMgotcha77 4 місяці тому +2

      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.

    • @kevinmcaleer28
      @kevinmcaleer28  4 місяці тому

      @@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

  • @Pngwolffman
    @Pngwolffman 4 місяці тому +1

    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?

    • @aslukili
      @aslukili 2 місяці тому

      interesting

  • @chrisparker8539
    @chrisparker8539 4 місяці тому +1

    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!

  • @seridyan
    @seridyan 4 місяці тому +1

    Hi Kevin, how do you power your Raspberry PI 5 cluster? POE?

  • @bluesdog88
    @bluesdog88 4 місяці тому

    Hi Kevin, sorry I cant quite make out where you got the cluster rack from?

    • @kevinmcaleer28
      @kevinmcaleer28  4 місяці тому +1

      Hey - its from ThePiHut

    • @bluesdog88
      @bluesdog88 4 місяці тому

      @@kevinmcaleer28 Thank you ;)

    • @wanjalaproduction
      @wanjalaproduction Місяць тому

      @kevinmcaleer28 Can you share the link to the case?

  • @investidorcalejado8344
    @investidorcalejado8344 2 місяці тому +1

    would a raspberry pi cluster, with 30+ raspberries, be good for metatrader 5 backtesting?

  • @rca7591a
    @rca7591a 4 місяці тому +1

    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.

  • @marcusworrell7175
    @marcusworrell7175 4 місяці тому

    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.

    • @cicadaskoan6260
      @cicadaskoan6260 Місяць тому

      Might want to check the compatibility of the drive on the pineboard. Not all work.

  • @ananyabhat9874
    @ananyabhat9874 3 місяці тому +1

    Could I use Raspi 3 instead of Raspi 5?

    • @kevinmcaleer28
      @kevinmcaleer28  3 місяці тому +1

      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)

    • @ananyabhat9874
      @ananyabhat9874 3 місяці тому

      Hey! Thanks a lot for replying! Could this be done for a college project using just one or two raspi boards!?

    • @kevinmcaleer28
      @kevinmcaleer28  3 місяці тому

      @@ananyabhat9874Sure - you'll need to Pi's minimum to make a swarm, otherwise if its just on one Pi its a standalone docker instance

    • @kevinmcaleer28
      @kevinmcaleer28  3 місяці тому +1

      I've created a free docker course you can check out here: www.kevsrobots.com/learn/docker/

  • @abzs5811
    @abzs5811 4 місяці тому

    Please do better close ups please! 🙏🏽

  • @Sven_Dongle
    @Sven_Dongle 4 місяці тому +9

    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.

    • @kevinmcaleer28
      @kevinmcaleer28  4 місяці тому +8

      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

    • @Sven_Dongle
      @Sven_Dongle 4 місяці тому +2

      @@kevinmcaleer28 Perhaps then the term "supercomputer" could have been de-clickbaited from the title 😀

    • @kevinmcaleer28
      @kevinmcaleer28  4 місяці тому +3

      @@Sven_Dongle it’s not inaccurate

    • @Sven_Dongle
      @Sven_Dongle 4 місяці тому +3

      @@kevinmcaleer28 And yet somehow, not truly accurate. It's like the Schrödinger's Cat of titles.

    • @somenygaard
      @somenygaard Місяць тому

      “Super” is a pretty relative word.

  • @marci1270
    @marci1270 3 місяці тому

    Docker swarm is very uncool in 2024 better use kubernetes.

    • @kevinmcaleer28
      @kevinmcaleer28  3 місяці тому

      It’s not a fashion cluster - it has work todo.

    • @marci1270
      @marci1270 3 місяці тому

      @@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.

    • @RichardKovacs
      @RichardKovacs 2 місяці тому

      ​@@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

  • @darah.k3221
    @darah.k3221 4 місяці тому +1

    buy a rpi 5 was waste of my time and money

    • @abzs5811
      @abzs5811 3 місяці тому

      Explain pls??? Cause I got 4

    • @darah.k3221
      @darah.k3221 3 місяці тому

      @@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

    • @jamescarrico1233
      @jamescarrico1233 3 місяці тому

      How is that? Just out of curiosity.

    • @armisis
      @armisis 3 місяці тому

      Wow I have 6 rpi 5 and their all. Clustered and brilliant