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

sotm: use a bundler cache for kitchen runs #538

Conversation

Firefishy
Copy link
Member

In kitchen cache the bundle install from the first jekyll sotm site and re-use the cache for other sotm runs of bundle install

@Firefishy
Copy link
Member Author

Firefishy commented Sep 21, 2022

FYI bundle cache command only caches the gem sources files and does not cache any compiled gem native extension code.
jekyll bundle install is slow due to sass/sassc-ruby#189

@Firefishy
Copy link
Member Author

20 minutes fast! :-)

Copy link
Member

@tomhughes tomhughes left a comment

Choose a reason for hiding this comment

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

Mostly this makes me want to vomit - adding an insane amount of complexity just to speed up the tests a bit.

cwd "/srv/#{year}.stateofthemap.org/vendor"
only_if { kitchen? }
only_if { ::Dir.exist?("/srv/#{year}.stateofthemap.org/vendor/bundle") }
not_if { ::File.exist?("#{Chef::Config[:file_cache_path]}/stateofthemap-gem-bundle-cache.tar") }
Copy link
Member

Choose a reason for hiding this comment

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

All these conditions are pointless if the action is :nothing because it's not going to run anyway, and when it is run by notifies they will be ignored.

overwrite false
only_if { ::File.exist?("#{Chef::Config[:file_cache_path]}/stateofthemap-gem-bundle-cache.tar") }
not_if { ::Dir.exist?("/srv/#{year}.stateofthemap.org/vendor/bundle") }
only_if { kitchen? }
Copy link
Member

Choose a reason for hiding this comment

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

Why limit it to when running under kitchen? Either it is safe, in which case we can always use it, or it isn't.

Mind if you are caching binaries there would then be questions about invalidating the cache when the dependencies of those binaries change.

@Firefishy
Copy link
Member Author

Going to abandon this PR. Going to replace SOTM sites with docker containers built upstream.

@Firefishy Firefishy closed this Dec 21, 2022
@Firefishy Firefishy deleted the sotm-cache-bundler-in-kitchen branch December 21, 2022 16:49
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