Yet Another Rubygems Proxy
On a example medium-sizes application with 34 direct gems dependencies, Yarp
bundle commands up to 80% faster:
|direct Rubygems||with `yarp.io`||local Yarp|
|bundle install (1 gem missing)||170 s||51 s||24 s|
|bundle update (73 updates)||140 s||65 s||45 s|
|bundle update (no change)||26 s||13 s||8.5 s|
Thats a 45% percent win right there. 8 seconds shaved of my deploy times. If you deploy 20 times a day to your staging environments and 5 times a day to production, you're getting 15 minutes of your life back every week. Make those count!
Installation and usage
Deploy your own Yarp or use the one at
For projects using
Just replace this line on top of your Gemfile:
By one of the following:
source 'http://us.yarp.io' source 'http://eu.yarp.io'
If you want/need SSL connections, you can use the Heroku URLs:
source 'https://yarp-us.herokuapp.com' source 'https://yarp-eu.herokuapp.com'
Your own local Yarp
You can make this even faster by deploying your very own, local Yarp. Example install with the excellent Pow:
curl get.pow.cx | sh # unless you already have Pow git clone https://github.com/mezis/yarp.git ~/.yarp ln -s ~/.yarp ~/.pow/yarp
Then change your
Gemfile's' source line to:
source ENV.fetch('GEM_SOURCE', 'http://eu.yarp.io')
And add the GEM_SOURCE to your
Why the dance with
ENV.fetch? Simply because your codebase may be deployed
or used somewhere lacking
yarp.dev; this gives you a fallback to another
source of gems.
Edit the sources entry in your
--- :sources: - http://yarp.dev
assuming you've followed the Pow instructions above; or use one of the
yarp.io servers instead.
How it works & Caveats
Yarp caches calls to Rubygem's dependency API, spec files, and gems for 24
hours if using
(eu|us).yarp.io. It redirects all other calls to Rubygems
This means that when gems get released or updated, you'll lag a day behind.
Checkout, make sure you have a Memcache running,
$ bundle exec foreman run rackup
Thake a long look at the
.env file, as most
configuration options for Yarp are there.
Yarp is released under the MIT licence. Copyright (c) 2013 HouseTrip Ltd.