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

Already on GitHub? Sign in to your account

Avoid reinstalling dependencies with bundler on every build #939

Merged
merged 2 commits into from Jul 4, 2015

Conversation

Projects
None yet
2 participants
Contributor

saivann commented Jul 4, 2015

This change brings significant performance improvement for the build process, as the build script otherwise deletes ./vendor, which forces bundler to reinstall every dependency from scratch on every build, which then delays the build for approximately 3 minutes.

It also seems to me that downloading and installing dependencies on every build exposes us to some more third party risk for no reason.

Git clean man file for the -x option:
https://git-scm.com/docs/git-clean

Contributor

harding commented Jul 4, 2015

@saivann huh. I think that's a regression, as I don't remember it doing that when I first set it up. (But I just tested, and you are correct) However, I haven't been able to find a plausible commit where anything changed.

I think dropping -x is the good option for now. However, if we want it back later, we can add --path=/some/directory to the install-deps-deployment target in the Makefile. (See bundle help install for details.)

LGTM. Suggest merging whenever you're ready to manually update the live build script. Thanks for catching this!

Contributor

saivann commented Jul 4, 2015

@harding Ah... for a moment I forgot that the repository is copied to a temporary directory before "bundle install" is ever called, so my previous solution just wouldn't work. I've just implemented your second suggestion which I think should work fine this time. Thanks!

Re Regression: At least that's now the intended behavior according to their current documentation

Gems are installed to vendor/bundle not your default system location
Contributor

saivann commented Jul 4, 2015

Note; I haven't implemented this solution on the build server yet. If there is no opposition, I will apply these changes to the VM later today.

@saivann saivann changed the title from Avoid deleting excluded files in .gitignore in build script to Avoid reinstalling dependencies with bundler on every build Jul 4, 2015

Contributor

harding commented Jul 4, 2015

4e40909 untested LGTM. Thanks!

@saivann saivann merged commit 4e40909 into bitcoin-dot-org:master Jul 4, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@saivann saivann deleted the saivann:buildvendor branch Jul 4, 2015

Contributor

saivann commented Jul 4, 2015

Thanks! I just finished testing and the script is working as intended.

Contributor

harding commented Jul 4, 2015

I don't know if this is related, but the about-us and development pages aren't displaying the contributor listings from github. I'm looking into it now.

Contributor

saivann commented Jul 4, 2015

@harding Ah, I restarted the builds quite many times and the GitHub API has a limit on the number of calls you can make per minute (Edit: or hour). I would really not be surprised if that's the only reason. This API call use to fail once in a while, but works fine the vast majority of the time.

Edit: This is usually an issue that auto-resolves after an hour.

Contributor

harding commented Jul 4, 2015

@saivann yeah, that was my first guess too (I used to have the issue for local builds all the time until you added selective plugin disablement), and it seems to have been the correct guess: I triggered a rebuild of the site on the server with no other changes, and it looks fine now. thanks!

Contributor

saivann commented Jul 5, 2015

@harding Thanks a lot for watching at those issues so carefully!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment