I am pleased to announce PiCluster version 2.0! In case you are unfamiliar with PiCluster, it is a container management tool written in Node.js used to manage Docker containers. It has been a long journey this past year coming up with new features and trying to community involvement. In this post, I will go over the contributions that the community has made for this release and discuss the exciting new feature: automatic container failover to different hosts.
When I first started creating PiCluster, I showed a few people in IRC what I was doing and first caught the attention of Jordan Sinn. He helped design the current PiCluster logo which was a major improvement from my idea of just using the Raspberry Pi logo. In 2.0, the logo was redone by a cool hacker by the name of chzbacon.
When PiCluster was first announced on Hacker News, many developers started to take interest and popularity began to spread. Shortly after that, PiCluster was featured on the show Linux Unplugged on the JupiterBroadcasting network. These two media contributions helped create awareness and I greatly appreciate it.
A smart hacker by the name of TokinRing was the first code contributor to PiCluster. He helped fix the npm build dependency errors and helped make the web console work better for deployments without Internet access by having the web server provide the required libraries. Also, he implemented pm2 support for managing the PiCluster services instead of custom SystemD scripts.
The last code contributor for this release was Aidan Harris. He helped improve the web console by adding a touch of personalization. In previous PiCluster releases, it would display a server icon for specific operations run. Thanks to Aidan’s improvements, you will now see the operating system or distribution logo for each server.
Friendly Welcome Page
No more blank screen after you log in! Links were added to access the GitHub page and file an issue if needed.
Better CSS and no more jQuery Windows
In a large effort to make PiCluster look more modern and cleaner, CSS was added throughout the web interface and the jQuery dialog windows were replaced with modal windows.
Try PiCluster on your laptop
Thanks to Aidan Harris, you can now try PiCluster on your laptop. All you need is Docker installed and run the following commands:
cd picluster docker-compose up -d
Finally, navigate to http://127.0.0.1:3003 in your browser.
Pull Docker images from a registry
With this new feature, you can now pull Docker images from a registry and choose which node(s) that will get the image.
Automatic Container Failover to different Hosts
This is the new exciting feature that will automatically migrate a container to another host after three failed heartbeat attempts. It is recommended to use a Git repository for your Dockerfile’s to easily build and move containers across nodes. For applications that require data persistence using Docker volumes, it is best to use a distributed filesystem like GlusterFS or NFS so the container will have access to its data on any host.
How does it work?
When container_host_constraints is enabled in config.json, each failed heartbeat attempt to a container is logged. When three failed heartbeat attempts occur, the following action is taken:
- A new host is chosen randomly from the container map that you designated in container_host_constraints.
- The container is deleted on its current host.
- The configuration file is updated with the new host layout.
- The container image is built and run on the new host.
For more information on how this works, please view the README on GitHub.
We need your help!
We are always looking for contributors, feedback, and ideas for new features to add to PiCluster. With the help of the community, PiCluster will have the potential to grow and thrive in the container space and make workflows easier.