Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku CI Pipeline - Caching gems between builds

I've just set up a Ruby on Rails app on Heroku, but, I'm experiencing a CI setup performance problem, which is quite annoying.

During the setup of our unit tests, Heroku is always re-installing our gems, producing logs like:

Fetching activestorage 6.0.2.2
Installing activestorage 6.0.2.2

This is not the case when setting up our app, as it shows lines like this instead:

Using activestorage 6.0.2.2

In both cases, bundler looks to be called with the correct arguments:

(for CI setup)

Running: bundle install --without development --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment

(for app setup)

Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment

In both cases, we're having the line:

Bundled gems are installed into `./vendor/bundle`

So, I'm wondering: do you know why Heroku does not cache gems between CI test setups, while it's the case during consequent builds of our app? If yes, is there a way to force the reuse of gems previously installed in our CI pipeline? This is taking a lot of time and can benefit from that.

Thanks a lot

like image 505
Alexis Clarembeau Avatar asked Apr 06 '20 06:04

Alexis Clarembeau


People also ask

Why build a CI/CD pipeline with Heroku CI?

- DEV Community Build a CI/CD pipeline with Heroku CI. Heroku CI automatically runs your app’s test suite with every push to your app’s GitHub repository, enabling you to easily review test results before merging or deploying changes to your codebase. Besides strong Dev/prod parity, using Heroku CI comes with many benefits key of which include;

What is seamlessly integrated with Heroku pipelines?

Seamlessly integrated with Heroku Pipelines, it completes Heroku Flow to provide a unified solution for continuous integration/continuous delivery. On every push to GitHub, Heroku CI immediately runs your tests on Performance Dynos in a disposable Heroku app, so there’s never a wait time for a free CI worker.

How do I use Heroku CI on GitHub?

If you’re using GitHub, you can turn on Heroku CI, Heroku’s visual, low-configuration test runner that integrates easily with Heroku Pipelines. Any Heroku Pipeline is already CI-ready – just turn it on in the pipeline’s Settings tab.

How do I add an app to a Heroku pipeline?

A Heroku app can belong to exactly one stage of exactly one pipeline. From your pipeline’s overview page, click + Add app next to a deployment stage to add an existing application to that stage of the pipeline. Add an app to your pipeline with the heroku pipelines:add command:


1 Answers

After asking Heroku's team, it was a bug in the ruby's buildpack. This is now fixed, and works well. Buildpack creators can cache data between CI build, it was just turned off during one of their upgrade.

like image 170
Alexis Clarembeau Avatar answered Oct 16 '22 19:10

Alexis Clarembeau