buildkite-config icon indicating copy to clipboard operation
buildkite-config copied to clipboard

Experiment with running rails/rails builds on Buildkite Hosted Agents

Open yob opened this issue 11 months ago • 0 comments

I've started exploring what changes are required to get rails/rails builds running on Buildkite Hosted Agents, and whether there are performance gains to be had. What's here works and runs a green build, but I'm not very familiar with the rails core conventions and preferences so this is an early preview for feedback.

The required changes are are all in the first commit. The second is a helpful debugging tweak that prints the content of the docker image store at the start of the job - helpful for understanding how the caching is working, but I assume we'd drop it before merging.

The high level changes are:

  1. Use the agent-local OCI registry rather than ECR
  2. We still push the compiled images to the registry at the start of build, and pull it at the start of each subsequent job. However, most layers of the image don't change between builds and in most cases only the changed layers are fetched (== speedy)
  3. In many cases the images for mysql/postgres/rabbitmq/etc will be cached on the agents from previous runs and won't need to be pulled
  4. Update docker-compose plugin to the 5.x series

In my testing I've found the builds complete in 5-8 minutes when run on agents with 2vCPU and 4Gb RAM, depending on cache warmth and hit rate.

yob avatar Jan 29 '25 07:01 yob