Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Update to work under 2.6.3 #17

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,10 @@ YARP_FILECACHE_PATH=tmp/cache

# Where to redirect/fetch from. this can be another instance of Yarp, or
# Rubygems.
YARP_UPSTREAM=http://eu.yarp.io
YARP_UPSTREAM=https://rubygems.org

# Comma-separated list of host:port entries
MEMCACHIER_SERVERS=localhost:11211

# The port on which to run the Rack application
PORT=24591

# The following only apply if you run Unicorn locally
# not if running Pow or Rackup directly
UNICORN_KEEPALIVE=20
UNICORN_THREADS=10
UNICORN_TIMEOUT=30
UNICORN_WORKERS=2
PORT=8080
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
tmp/
log/
/.bundle
/tmp
7 changes: 0 additions & 7 deletions .powrc

This file was deleted.

2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.5
ruby-2.6.3
20 changes: 9 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
source ENV.fetch('GEM_SOURCE', 'http://rubygems.org')
ruby '2.1.5'
# frozen_string_literal: true

gem 'sinatra' # lightweight web framework
gem 'foreman' # process watchdog
gem 'rainbows' # threaded webserver
gem 'dalli' # memcache adapter

gem 'pry' # a better ruby shell
gem 'pry-nav'
gem 'pry-remote'
source ENV.fetch('GEM_SOURCE', 'https://rubygems.org')

gem 'newrelic_rpm' # app monitoring
gem 'dalli' # memcache adapter
gem 'dotenv'
gem 'puma'
gem 'sinatra' # lightweight web framework

gem 'term-ansicolor'

gem 'pry' # a better ruby shell
gem 'pry-byebug'
77 changes: 32 additions & 45 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,59 +1,46 @@
GEM
remote: http://eu.yarp.io/
remote: https://rubygems.org/
specs:
coderay (1.1.0)
dalli (2.7.2)
dotenv (0.11.1)
dotenv-deployment (~> 0.0.2)
dotenv-deployment (0.0.2)
foreman (0.75.0)
dotenv (~> 0.11.1)
thor (~> 0.19.1)
kgio (2.9.2)
method_source (0.8.2)
newrelic_rpm (3.9.7.266)
pry (0.10.1)
byebug (11.0.1)
coderay (1.1.2)
dalli (2.7.10)
dotenv (2.7.2)
method_source (0.9.2)
mustermann (1.0.3)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pry-nav (0.2.4)
pry (>= 0.9.10, < 0.11.0)
pry-remote (0.1.8)
pry (~> 0.9)
slop (~> 3.0)
rack (1.5.2)
rack-protection (1.5.3)
method_source (~> 0.9.0)
pry-byebug (3.7.0)
byebug (~> 11.0)
pry (~> 0.10)
puma (3.12.1)
rack (2.0.7)
rack-protection (2.0.5)
rack
rainbows (4.6.2)
kgio (~> 2.5)
rack (~> 1.1)
unicorn (~> 4.8)
raindrops (0.13.0)
sinatra (1.4.5)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (~> 1.3, >= 1.3.4)
slop (3.6.0)
term-ansicolor (1.3.0)
sinatra (2.0.5)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.5)
tilt (~> 2.0)
term-ansicolor (1.7.1)
tins (~> 1.0)
thor (0.19.1)
tilt (1.4.1)
tins (1.3.3)
unicorn (4.8.3)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
tilt (2.0.9)
tins (1.20.2)

PLATFORMS
ruby

DEPENDENCIES
dalli
foreman
newrelic_rpm
dotenv
pry
pry-nav
pry-remote
rainbows
pry-byebug
puma
sinatra
term-ansicolor

RUBY VERSION
ruby 2.6.3p62

BUNDLED WITH
2.0.1
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

91 changes: 56 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,66 @@

!! README IS WORK IN PROGRESS !!

## Yet Another Rubygems Proxy

> Yarp is a small [Sinatra](http://www.sinatrarb.com) app that makes your
> [bundler](http://bundler.io) faster. You'll love it if you update your
> apps a lot... or simply deploy a lot.

On a example medium-sizes application with 34 direct gems dependencies, Yarp
makes my `bundle` commands up to 80% faster:


<table>
<tr>
<td></td>
<td>direct Rubygems</td>
<td>with `yarp.io`</td>
<td>local Yarp</td>
</tr>
<tr>
<td>bundle install (1 gem missing)</td>
<td>170 s</td>
<td>51 s</td>
<td>24 s</td>
</tr>
<tr>
<td>bundle update (73 updates)</td>
<td>140 s</td>
<td>65 s</td>
<td>45 s</td>
</tr>
<tr>
<td>bundle update (no change)</td>
<td>26 s</td>
<td>13 s</td>
<td>8.5 s</td>
</tr>
</table>

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!
## Performance

Given gemfile

```
+ $ cat Gemfile
#source "http://localhost:9292"
source "https://rubygems.org"

gem "nanoc"
gem "pry"
gem "rack"
gem "rspec"
```

Running against rubygems:

```
$ bundle install --path .bundle/vendor --jobs 1
...
Bundle complete! 4 Gemfile dependencies, 42 gems now installed.
Bundled gems are installed into `./.bundle/vendor`

real 0m14.263s
user 0m4.648s
sys 0m0.856s

Running with cleaned caches:

```
$ bundle install --path .bundle/vendor --jobs 1
...
Bundle complete! 4 Gemfile dependencies, 42 gems now installed.
Bundled gems are installed into `./.bundle/vendor`

real 0m16.803s
user 0m3.876s
sys 0m0.664s
```

And after it was all cached:

```
$ bundle install --path .bundle/vendor --jobs 1
...
Bundle complete! 4 Gemfile dependencies, 42 gems now installed.
Bundled gems are installed into `./.bundle/vendor`

real 0m5.329s
user 0m4.498s
sys 0m0.809s
```

So it can get significantly faster after things were cached.

### Installation and usage

Expand Down
6 changes: 2 additions & 4 deletions config.ru
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
lib = File.expand_path('../', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
# frozen_string_literal: true

require 'dotenv'
Dotenv.load!

require 'yarp/app'
require 'yarp/initializers/new_relic'
require_relative 'yarp/app'

run Yarp::App
79 changes: 0 additions & 79 deletions rainbows.rb

This file was deleted.

2 changes: 0 additions & 2 deletions yarp.rb

This file was deleted.

Loading