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

improve worst case image build time #7014

Merged
merged 12 commits into from
Apr 6, 2023
Merged

Conversation

jakecoffman
Copy link
Member

@jakecoffman jakecoffman commented Apr 6, 2023

In #5356 we switched away from a PPA since it wasn't keeping up with new versions of Ruby. Ruby-install was good but building from source is slow, and it seems like we break the cache more often than we care to.

This approach is to copy Ruby et al from the official Ruby Docker image which should stay up-to-date. This allows us to skip the build to save time, and we can stay on our current version of Ubuntu by copying out the binaries. This also saves ~100MB from somewhere, the bundler image is now around 640MB for me.

I had to move the bundle install out since it didn't seem to like to be run on a different version of Ubuntu? I'm not sure, but even with less parallelism this is very fast locally. Submitting as Draft to test against CI, check the speed, and get feedback.

@jakecoffman
Copy link
Member Author

jakecoffman commented Apr 6, 2023

An uncached build time of 1:30-1:40 for most ecosystems!

This would probably also greatly reduce an ARM emulated build.

@jakecoffman jakecoffman force-pushed the jakecoffman/ruby-from-ruby-image branch from 7e8b491 to 5b86853 Compare April 6, 2023 17:10
@jakecoffman jakecoffman marked this pull request as ready for review April 6, 2023 17:30
@jakecoffman jakecoffman requested a review from a team as a code owner April 6, 2023 17:30
@jakecoffman
Copy link
Member Author

@pavera Do you think we could do something similar with Python? Might be hacky since we depend on pyenv.

Copy link
Member

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever.

Feels a little risky to me, but I assume the official Ruby binary is statically linked?

I know one thing we'd also discussed before was the idea of using the pre-compiled binary that the GitHub Actions team maintains... this seems more straightforward though...

Copy link
Contributor

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really awesome! I had the same idea for Python and did give it a try but couldn't make it work.

@jakecoffman jakecoffman merged commit a4078db into main Apr 6, 2023
@jakecoffman jakecoffman deleted the jakecoffman/ruby-from-ruby-image branch April 6, 2023 20:37
@abdulapopoola abdulapopoola added the EE Engineering Efficiency label Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EE Engineering Efficiency
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants