Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

[2.0] Add a global cache for downloaded .gem files#5782

Merged
bundlerbot merged 6 commits intomasterfrom
seg-global-gem-cache
Jun 27, 2017
Merged

[2.0] Add a global cache for downloaded .gem files#5782
bundlerbot merged 6 commits intomasterfrom
seg-global-gem-cache

Conversation

@segiddins
Copy link
Copy Markdown
Contributor

@segiddins segiddins commented Jun 17, 2017

What was the end-user problem that led to this PR?

The problem was that bundler would need to download foo-1.0.gem files from a RubyGems server for each different ruby version installed on a user's machine. It also meant that people installing into a per-app path would need to re-download every gem for that bundle an additional time. This adds up, and makes bundle install slower than it needs to be.

Was was your diagnosis of the problem?

My diagnosis was that Bundler could keep a (per-source) cache of these .gem files, and pull from that cache instead of hitting the network whenever possible.

What is your fix for the problem, implemented in this PR?

My fix implements said cache, in a very similar way to the compact index cache (same cache slug per remote strategy, etc). This largely comes from #3983.

Why did you choose this fix out of the possible options?

I chose this fix because it is safe when used from multi-source gemfiles, it is easy to clear (rm -rf bundle cache), and it minimally interferes with the existing installation process.

@segiddins segiddins requested review from colby-swandale and indirect and removed request for indirect June 17, 2017 02:52
@indirect
Copy link
Copy Markdown

This is looking great to me. Very excited about using --path but not redownloading all the gems every time. 👍

@segiddins segiddins force-pushed the seg-global-gem-cache branch from 0fabbd2 to 6f8c0d9 Compare June 19, 2017 01:49
@segiddins
Copy link
Copy Markdown
Contributor Author

Green. Is there anything else I missed in #3983 that's relevant? (I think there were some commits related to other changes that made that diff needlessly large)

@indirect
Copy link
Copy Markdown

@bundlerbot r+

@bundlerbot
Copy link
Copy Markdown
Collaborator

📌 Commit 6f8c0d9 has been approved by indirect

@bundlerbot
Copy link
Copy Markdown
Collaborator

⌛ Testing commit 6f8c0d9 with merge 0fa2b9a...

bundlerbot added a commit that referenced this pull request Jun 22, 2017
[2.0] Add a global cache for downloaded .gem files

### What was the end-user problem that led to this PR?

The problem was that bundler would need to download `foo-1.0.gem` files from a RubyGems server for each different ruby version installed on a user's machine. It also meant that people installing into a per-app path would need to re-download every gem for that bundle an additional time. This adds up, and makes `bundle install` slower than it needs to be.

### Was was your diagnosis of the problem?

My diagnosis was that Bundler could keep a (per-source) cache of these `.gem` files, and pull from that cache instead of hitting the network whenever possible.

### What is your fix for the problem, implemented in this PR?

My fix implements said cache, in a very similar way to the compact index cache (same cache slug per remote strategy, etc). This largely comes from #3983.

### Why did you choose this fix out of the possible options?

I chose this fix because it is safe when used from multi-source gemfiles, it is easy to clear (`rm -rf bundle cache`), and it minimally interferes with the existing installation process.
@indirect
Copy link
Copy Markdown

(gonna export the env for this and run from master on my machine until this is released, now)

@segiddins
Copy link
Copy Markdown
Contributor Author

@indirect bundle config --global global_gem_cache true should also do the trick

@segiddins
Copy link
Copy Markdown
Contributor Author

Ugh has this timed out on CI?

@segiddins
Copy link
Copy Markdown
Contributor Author

@bundlerbot retry

@bundlerbot
Copy link
Copy Markdown
Collaborator

⌛ Testing commit 6f8c0d9 with merge 1bdb91d...

bundlerbot added a commit that referenced this pull request Jun 22, 2017
[2.0] Add a global cache for downloaded .gem files

### What was the end-user problem that led to this PR?

The problem was that bundler would need to download `foo-1.0.gem` files from a RubyGems server for each different ruby version installed on a user's machine. It also meant that people installing into a per-app path would need to re-download every gem for that bundle an additional time. This adds up, and makes `bundle install` slower than it needs to be.

### Was was your diagnosis of the problem?

My diagnosis was that Bundler could keep a (per-source) cache of these `.gem` files, and pull from that cache instead of hitting the network whenever possible.

### What is your fix for the problem, implemented in this PR?

My fix implements said cache, in a very similar way to the compact index cache (same cache slug per remote strategy, etc). This largely comes from #3983.

### Why did you choose this fix out of the possible options?

I chose this fix because it is safe when used from multi-source gemfiles, it is easy to clear (`rm -rf bundle cache`), and it minimally interferes with the existing installation process.
@bundlerbot
Copy link
Copy Markdown
Collaborator

💔 Test failed - status-travis

@segiddins
Copy link
Copy Markdown
Contributor Author

@bundlerbot retry

@bundlerbot
Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #5788) made this pull request unmergeable. Please resolve the merge conflicts.

@bundlerbot
Copy link
Copy Markdown
Collaborator

🔒 Merge conflict

@segiddins segiddins force-pushed the seg-global-gem-cache branch from 6f8c0d9 to 1c8b0f6 Compare June 27, 2017 15:26
@segiddins
Copy link
Copy Markdown
Contributor Author

Rebased. @bundlerbot r=indirect

@bundlerbot
Copy link
Copy Markdown
Collaborator

📌 Commit 1c8b0f6 has been approved by indirect

@bundlerbot
Copy link
Copy Markdown
Collaborator

⌛ Testing commit 1c8b0f6 with merge ff4a522...

bundlerbot added a commit that referenced this pull request Jun 27, 2017
[2.0] Add a global cache for downloaded .gem files

### What was the end-user problem that led to this PR?

The problem was that bundler would need to download `foo-1.0.gem` files from a RubyGems server for each different ruby version installed on a user's machine. It also meant that people installing into a per-app path would need to re-download every gem for that bundle an additional time. This adds up, and makes `bundle install` slower than it needs to be.

### Was was your diagnosis of the problem?

My diagnosis was that Bundler could keep a (per-source) cache of these `.gem` files, and pull from that cache instead of hitting the network whenever possible.

### What is your fix for the problem, implemented in this PR?

My fix implements said cache, in a very similar way to the compact index cache (same cache slug per remote strategy, etc). This largely comes from #3983.

### Why did you choose this fix out of the possible options?

I chose this fix because it is safe when used from multi-source gemfiles, it is easy to clear (`rm -rf bundle cache`), and it minimally interferes with the existing installation process.
@bundlerbot
Copy link
Copy Markdown
Collaborator

☀️ Test successful - status-travis
Approved by: indirect
Pushing ff4a522 to master...

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants