An opportunity for improvement
Our server team spotted an opportunity for improvement: bootstrapping clusters was taking longer than ideal. Setting up a CloudAMQP instance gives customers the freedom to select their desired RabbitMQ or LavinMQ versions and plugins. Once you create your instance, a lot happens under the hood.
Previously, we started with a base Ubuntu image and installed all the necessary tools and RabbitMQ one by one each time a customer needed a cluster. This process kicked in whenever customers requested new servers, Ubuntu upgrades, or plan changes, and since upgrading is simple, plan changes are recurring events.
Building a Pre-Configured image with Packer
The solution was straightforward: build an image with all the required tools pre-installed. Instead of starting with a base image and setting everything up each time customers need it, everything the customer needs is available in advance. Anton started with a proof of concept, carefully tracking how much time customers could save.
Using Packer we worked with our existing bootstrap scripts, refined the configurations, and tested things step by step. The research and proof of concept phase took a few weeks. Once we confirmed the results met our requirements, the finishing touches came together quickly.
POLICYRCD=/usr/local/sbin/prevent-start-on-install.sh apt-get install \
--yes \
--option Dir::Etc::SourceList=/dev/null \
--option Dpkg::Options::="--force-confold" \
rabbitmq-server="$RABBITMQ_VERSION"
This snippet shows how CloudAMQP installs RabbitMQ. We moved 20 installs and 24 uninstalls from the bootstrap process to our image.
Significantly faster installation times
We're already exploring the next steps: looking at ways to run certain processes in parallel rather than one after another for even better performance.
Until next time,
CloudAMQP team