Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop bundling bootstrap Ruby #1481

Merged
merged 1 commit into from
Jul 9, 2024
Merged

Stop bundling bootstrap Ruby #1481

merged 1 commit into from
Jul 9, 2024

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Jul 8, 2024

Since this buildpack is written in Ruby, it needs a Ruby installation to be installed in order to run. As such, during buildpack compile, a bootstrap Ruby is downloaded and installed.

As a performance optimisation, this bootstrap Ruby is vendored into the buildpack archive published to the Buildpack Registry, via the [[publish.Vendor]] entries in buildpack.toml. Since Ruby installs are OS-specific, this meant bundling three copies of Ruby, even though only one would ever be used. With the old build system this was still a net benefit, since the official language buildpacks would be downloaded in advance when a build worker first booted.

However, with the new build system architecture, the build system workers are no longer booted en-mass in advance, but instead started on demand. This means there is no worker idle time, and so speculative downloading of possibly-needed assets no longer makes sense.

As such, the bundling of multiple copies of Ruby in the buildpack registry archive has now been removed.

This not only makes non-Ruby builds faster (since they have no need for a Ruby installation at all), but will also speed up Ruby builds, since they'll only need to download one bootstrap Ruby (for their specific stack), rather than a version for every stack.

GUS-W-16184923.

@edmorley edmorley self-assigned this Jul 8, 2024
@edmorley edmorley marked this pull request as ready for review July 8, 2024 10:32
@edmorley edmorley requested review from schneems and a team as code owners July 8, 2024 10:32
@edmorley edmorley removed the request for review from a team July 8, 2024 10:32
Since this buildpack is written in Ruby, it needs a Ruby installation
to be installed in order to run. As such, during buildpack compile, a
bootstrap Ruby is downloaded installed.

As a performance optimisation, this bootstrap Ruby was vendored into
the buildpack archive published to the Buildpack Registry, via the
`[[publish.Vendor]]` entries in `buildpack.toml`. Since Ruby installs
are OS-specific, this meant bundling three copies of Ruby, even though
only one would ever be used. With the old build system this was still a
net benefit, since the official language buildpacks would be downloaded
in advance when a build worker first booted.

However, with the new build system architecture, the build system
workers are no longer booted en-mass in advance, but instead started
on demand. This means there is no worker idle time, and so speculative
downloading of possible-needed assets no longer makes sense.

As such, the bundling of multiple copies of Ruby in the buildpack
registry archive has now been removed.

This not only makes non-Ruby builds faster (since they have no need
for a Ruby installation at all), but will also speed up Ruby builds,
since they'll only need to download one bootstrap Ruby (for their
specific stack), rather than a version for every stack.
@edmorley edmorley merged commit 9a1729e into main Jul 9, 2024
4 checks passed
@edmorley edmorley deleted the edmorley/rm-bundled-ruby branch July 9, 2024 10:28
@heroku-linguist heroku-linguist bot mentioned this pull request Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants