SlideShare a Scribd company logo
1 of 45
Download to read offline
RUBYGEMS
...behind the gems
Roland Moriz ~ Moriz GmbH
Ruby User Group München 26.10.2010
http://moriz.de/
http://moriz.de/Rubygems behind the gems.
Hello blaaa bla Moriz GmbH bla bla Software Development
Services bla bla bla bla Consulting bla blaaaa bla blaaaaaa
bla Infrastructure Services bla bla Roland bla bla bla bla
professional software development since 1999 bla bla
Amazon Marketplace Deutschland bla bla bla Tiscali
Games bla bla FIFA WM 2006 bla Yahoo.de bla bla bla bla
two billion pageviews bla bla blala Allianz24.de/
Allsecur.de bla bla bla Ruby User Group München bla bla
blabla http://moriz.de/ bla blaaaba http://rails.io bla
http://boot.io blablabla recently hetzner-api gem bla bla
bla and the slides will be available @ http://moriz.de/talks/
rubygems.
;-)
http://moriz.de/Rubygems behind the gems.
RUBYGEMS MOVING PARTS
rubygems / cli gemcutter
gem
code / library, app, data, meta
http://moriz.de/Rubygems behind the gems.
RUBYGEMS MOVING PARTS
rubygems / cli gemcutter
$ gem
require ”rubygems“
http://rubygems.org/
(and extensions to the rubygems client)
distribution
creation, download, setup,
usage (index building, server)
http://moriz.de/Rubygems behind the gems.
RUBYGEMS FACTS
• used by nearly every ruby project
• the core of the ruby ecosystem
• standard lib (with MRI 1.9.x)
• 17.000+ gem projects
• 81.000+ gem files
• 23 GB+
http://moriz.de/
started at RubyConf 2003 by:
• Rich Kilmer
• Chad Fowler
• David Black
• Paul Brannan
• Jim Weirch
> http://rubyforge.org/projects/rubygems/
Rubygems behind the gems.
RUBYGEMS FACTS
http://moriz.de/Rubygems behind the gems.
GEM FACTS
• described by a .gemspec
• gem build my.gemspec
easier ways:
• bundler, jewler, newgem(?), ...
http://moriz.de/Rubygems behind the gems.
GEM FACTS
tar xvf rails-3.0.1.gem
x data.tar.gz
x metadata.gz
contents:
http://moriz.de/Rubygems behind the gems.
GEM FACTS
metadata.gz > gzipped YAML
data.tar.gz > payload
http://moriz.de/Rubygems behind the gems.
GEMCUTTER FACTS
• started in April 2009
• is now rubygems.org (rubygems 1.3.6+)
• replaced rubyforge
• manages uploads & downloads
• rails app using PostgreSQL +
rack middleware with sinatra
• by Nick Quaranto (@qrush) of Thoughtbot
> http://github.com/rubygems/gemcutter
http://moriz.de/Rubygems behind the gems.
BIG PICTURE: UPLOAD RELEASE
$ gem release hetzner-api.gemspec
Successfully built RubyGem
Name: hetzner-api
Version: 1.0.0
File: hetzner-api-1.0.0.gem
Pushing gem to RubyGems.org...
gem release
http://moriz.de/Rubygems behind the gems.
BIG PICTURE: UPLOAD RELEASE
cli
rubygems.org (gemcutter)
http://moriz.de/Rubygems behind the gems.
BIG PICTURE: UPLOAD RELEASE
cli
rubygems.org
AWS S3
gem file
http://moriz.de/Rubygems behind the gems.
BIG PICTURE: UPLOAD RELEASE
cli
rubygems.org
AWS S3 update specs
> database
> spec files to s3
spec files
http://moriz.de/Rubygems behind the gems.
BIG PICTURE: UPLOAD RELEASE
cli
rubygems.org
AWS S3 update specs
webhooks, rss, ...
http://rubygems.org/pages/api_docs
http://moriz.de/Rubygems behind the gems.
BIG PICTURE: DOWNLOAD
cli
rubygems.org AWS S3
http://moriz.de/Rubygems behind the gems.
SPECS AKA „THE INDEX“
$sudo gem install rails -V
GET http://gems.rubyforge.org/latest_specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
GET http://gems.rubyforge.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz
302 Found
GET http://production.s3.rubygems.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz
200 OK
GET http://gems.rubyforge.org/specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/specs.4.8.gz
200 OK
GET http://gems.rubyforge.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz
302 Found
GET http://production.s3.rubygems.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz
...
http://moriz.de/Rubygems behind the gems.
SPECS AKA „THE INDEX“no specific version
=> latest
$sudo gem install rails -V
GET http://gems.rubyforge.org/latest_specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
GET http://gems.rubyforge.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz
302 Found
GET http://production.s3.rubygems.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz
200 OK
GET http://gems.rubyforge.org/specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/specs.4.8.gz
200 OK
GET http://gems.rubyforge.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz
302 Found
GET http://production.s3.rubygems.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz
...
$sudo gem install rails -V
GET http://gems.rubyforge.org/latest_specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
GET http://gems.rubyforge.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz
302 Found
GET http://production.s3.rubygems.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz
200 OK
GET http://gems.rubyforge.org/specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/specs.4.8.gz
200 OK
GET http://gems.rubyforge.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz
302 Found
GET http://production.s3.rubygems.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz
...
http://moriz.de/Rubygems behind the gems.
SPECS AKA „THE INDEX“
Gem.marshal_version
=> Marshal::MAJOR_VERSION
Marshal::MINOR_VERSION
http://moriz.de/Rubygems behind the gems.
SPECS AKA „THE INDEX“
irb(main):001:0> x = {}
=> {}
irb(main):002:0> x['farbe'] = 'ananasblau'
=> "ananasblau"
irb(main):003:0> Marshal.dump x
=> "004b{006"nfarbe"017ananasblau"
etc.
> http://ruby-doc.org/core/classes/Marshal.html
$sudo gem install rails -V
GET http://gems.rubyforge.org/latest_specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
GET http://gems.rubyforge.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz
302 Found
GET http://production.s3.rubygems.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz
200 OK
GET http://gems.rubyforge.org/specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/specs.4.8.gz
200 OK
GET http://gems.rubyforge.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz
302 Found
GET http://production.s3.rubygems.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz
...
http://moriz.de/Rubygems behind the gems.
SPECS AKA „THE INDEX“
http://moriz.de/Rubygems behind the gems.
SPECS AKA „THE INDEX“
latest_specs:
lists the latest release number of all gems (~150 KB / 570 KB)
specs:
list of all gem releases (380 KB / 2.2 MB)
latest_specs = Marshal.load open 'latest_specs.4.8'
latest_specs.size
=> 17501
specs = Marshal.load open 'specs.4.8'; specs.size
=> 83490
(there‘s also a pre-release spec (remember „gem install rails --pre“) and others: see
rubygems source lib/rubygems/commands/generate_index_command.rb)
$sudo gem install rails -V
GET http://gems.rubyforge.org/latest_specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
GET http://gems.rubyforge.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz
302 Found
GET http://production.s3.rubygems.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz
200 OK
GET http://gems.rubyforge.org/specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/specs.4.8.gz
200 OK
GET http://gems.rubyforge.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz
302 Found
GET http://production.s3.rubygems.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz
...
http://moriz.de/Rubygems behind the gems.
SPECS AKA „THE INDEX“
xload + parse spec
dependencies
http://moriz.de/Rubygems behind the gems.
SPECS AKA „THE INDEX“
Gem::Specification.new do |s|
  s.authors = ["David Heinemeier Hansson"]
  s.date = Time.utc(2010, 10, 14)
  s.dependencies = [Gem::Dependency.new("activesupport",
    Gem::Requirement.new(["= 3.0.1"]),
    :runtime),
   Gem::Dependency.new("actionpack",
    Gem::Requirement.new(["= 3.0.1"]),
    :runtime),
   Gem::Dependency.new("activerecord",
    Gem::Requirement.new(["= 3.0.1"]),
    :runtime),
   Gem::Dependency.new("activeresource",
    Gem::Requirement.new(["= 3.0.1"]),
    :runtime),
   Gem::Dependency.new("actionmailer",
    Gem::Requirement.new(["= 3.0.1"]),
    :runtime),
   Gem::Dependency.new("railties",
    Gem::Requirement.new(["= 3.0.1"]),
    :runtime),
   Gem::Dependency.new("bundler",
    Gem::Requirement.new(["~> 1.0.0"]),
    :runtime)]
  s.description = "Ruby on Rails is a full-stack web framework optimized
Marshal.load Gem.inflate File.read 'rails-3.0.1.gemspec.rz'
http://moriz.de/Rubygems behind the gems.
SPECS AKA „THE INDEX“
$sudo gem install rails -V
GET http://gems.rubyforge.org/latest_specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
GET http://gems.rubyforge.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz
302 Found
GET http://production.s3.rubygems.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz
200 OK
GET http://gems.rubyforge.org/specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/specs.4.8.gz
200 OK
GET http://gems.rubyforge.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz
302 Found
GET http://production.s3.rubygems.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz
...
deps with explicit
version requirement =>
require full spec list
http://moriz.de/Rubygems behind the gems.
SPECS AKA „THE INDEX“
$sudo gem install rails -V
GET http://gems.rubyforge.org/latest_specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
GET http://gems.rubyforge.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz
302 Found
GET http://production.s3.rubygems.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz
200 OK
GET http://gems.rubyforge.org/specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/specs.4.8.gz
200 OK
GET http://gems.rubyforge.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz
302 Found
GET http://production.s3.rubygems.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz
...
for each dependency
then download and install the .gem files
http://moriz.de/Rubygems behind the gems.
PROBLEMS: WHAT IF?
cli
rubygems.org
AWS S3
http://moriz.de/Rubygems behind the gems.
PROBLEMS: WHAT IF?
cli
rubygems.org
AWS S3
Temporary Outage:
no new gem releases
no gem downloads (index missing)
!
new app deployments?
new server deployments?
http://moriz.de/Rubygems behind the gems.
PROBLEMS: WHAT IF?
cli
rubygems.org
AWS S3
Fatal Outage, reasons:
• Hardware
• Software (attack, fs corruption)
• Amazon
• account „deactivation“
• account deletion
• S3 data loss
• S3 bucket account theft/crack
• Sunny day kills all the clouds.
• Jeff Bezos‘ new bicy^Segw^Rocket.
http://moriz.de/Rubygems behind the gems.
PROBLEMS: WHAT IF?
cli
rubygems.org
AWS S3
Fatal Outage:
ALL GEMS LOST
http://moriz.de/Rubygems behind the gems.
PROBLEMS: WHAT IF?
cli
rubygems.org
AWS S3
Fatal Outage:
ALL GEMS LOST
try again. ^_^
http://moriz.de/Rubygems behind the gems.
PROBLEMS: MIRRORING
Infrastructure independence to save your
business from a rubygems desaster:
> Start your own mirror
Fallback for rubygems.org desaster?
> Use a public mirror
> Start your own mirror
http://moriz.de/Rubygems behind the gems.
PROBLEMS: PUBLIC MIRRORS
Comprehensive Perl Archive Network
2010-10-25 online since 1995-10-26
7770 MB 228 mirrors
8463 authors 18582 modules
228 independent public and free mirrors!
http://moriz.de/Rubygems behind the gems.
PROBLEMS: PUBLIC MIRRORS
Debian Mirror Sites: 445
http://www.debian.org/mirror/list
http://moriz.de/Rubygems behind the gems.
PROBLEMS: PUBLIC MIRRORS
„The Python Package Index is a
repository of software for the Python
programming language.
There are currently 11801 packages here“
http://moriz.de/Rubygems behind the gems.
PROBLEMS: PUBLIC MIRRORS
http://moriz.de/Rubygems behind the gems.
PROBLEMS: PUBLIC MIRRORS
0 active, public, free mirrors.
lost in migration (rubyforge > gemcutter)
http://moriz.de/Rubygems behind the gems.
PROBLEMS: MIRRORING
Mirroring stuff in rubygems is currently broken:
• „gem mirror“ misses some gems
& slow downloads: one gem at a time.
• index building is broken (see #362)
• reliability (#362, too)
http://help.rubygems.org/discussions/problems/362-cant-mirror-rubygems-
repo-incorrect-header-check
http://help.rubygems.org/discussions/problems/212-some-gems-and-specs-missing-that-are-in-the-index
Gemcutter already lost gems:
http://moriz.de/Rubygems behind the gems.
PROBLEMS: MIRRORING
There is also no easy way to mirror a S3 bucket:
• no ftp
• no rsync
• no file-list to use with e.g. wget
= you cannot even run a reliable private mirror :-(
http://moriz.de/Rubygems behind the gems.
SOLUTION
Provide rsync on master for sync-ability.
On EC2, Rackspace, does not matter if it‘s fast...
> NO custom mirroring software!
> most FOSS mirror sites use rsync
> use rsync, ask mirrors, problem solved.
> AWS cloudfront is NOT a solution
> not mirrorable, same vendor SPOFs.
http://moriz.de/Rubygems behind the gems.
SOLUTION
Provide rsync on master for sync-ability.
On EC2, Rackspace, does not matter if it‘s fast...
Provide a DNS based distribution (GeoDNS)
> a realiable base for (private) mirroring
> speed & latency improvements
> NO custom mirroring software needed!
> saves money (AWS and Rackspace fees)
> make use of the new mirrors!
http://moriz.de/Rubygems behind the gems.
SOLUTION
Why not?
> no „instant deploy“ (real-time mirroring)
> no download stats
http://moriz.de/Rubygems behind the gems.
SOLUTION
Why not?
Rubygems CLI could fallback to the rubygems.org
master if a gem version is not on the used mirror.
It already does if you configure it.
(current downside: d/l spec-lists from master everytime, looks fixable to me)
> no „instant deploy“ (real-time mirroring)
> no download stats
http://moriz.de/Rubygems behind the gems.
THINGS WILL FAIL...
just make sure you‘ve a working plan B
AND:
KISS & YAGNI. Keep it simple.
less moving parts > less things that will break.
Don‘t over-engineer.
http://moriz.de/Rubygems behind the gems.
HELP
OpenSource projects need your support.
Gemcutter/Rubygems, too.
Go contribute if you care about your ruby business.
The Gemcutter source is really awesome,
a good read for every developer.

More Related Content

Recently uploaded

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Recently uploaded (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Featured

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

Rubygems - behind the gems.

  • 1. RUBYGEMS ...behind the gems Roland Moriz ~ Moriz GmbH Ruby User Group München 26.10.2010 http://moriz.de/
  • 2. http://moriz.de/Rubygems behind the gems. Hello blaaa bla Moriz GmbH bla bla Software Development Services bla bla bla bla Consulting bla blaaaa bla blaaaaaa bla Infrastructure Services bla bla Roland bla bla bla bla professional software development since 1999 bla bla Amazon Marketplace Deutschland bla bla bla Tiscali Games bla bla FIFA WM 2006 bla Yahoo.de bla bla bla bla two billion pageviews bla bla blala Allianz24.de/ Allsecur.de bla bla bla Ruby User Group München bla bla blabla http://moriz.de/ bla blaaaba http://rails.io bla http://boot.io blablabla recently hetzner-api gem bla bla bla and the slides will be available @ http://moriz.de/talks/ rubygems. ;-)
  • 3. http://moriz.de/Rubygems behind the gems. RUBYGEMS MOVING PARTS rubygems / cli gemcutter gem code / library, app, data, meta
  • 4. http://moriz.de/Rubygems behind the gems. RUBYGEMS MOVING PARTS rubygems / cli gemcutter $ gem require ”rubygems“ http://rubygems.org/ (and extensions to the rubygems client) distribution creation, download, setup, usage (index building, server)
  • 5. http://moriz.de/Rubygems behind the gems. RUBYGEMS FACTS • used by nearly every ruby project • the core of the ruby ecosystem • standard lib (with MRI 1.9.x) • 17.000+ gem projects • 81.000+ gem files • 23 GB+
  • 6. http://moriz.de/ started at RubyConf 2003 by: • Rich Kilmer • Chad Fowler • David Black • Paul Brannan • Jim Weirch > http://rubyforge.org/projects/rubygems/ Rubygems behind the gems. RUBYGEMS FACTS
  • 7. http://moriz.de/Rubygems behind the gems. GEM FACTS • described by a .gemspec • gem build my.gemspec easier ways: • bundler, jewler, newgem(?), ...
  • 8. http://moriz.de/Rubygems behind the gems. GEM FACTS tar xvf rails-3.0.1.gem x data.tar.gz x metadata.gz contents:
  • 9. http://moriz.de/Rubygems behind the gems. GEM FACTS metadata.gz > gzipped YAML data.tar.gz > payload
  • 10. http://moriz.de/Rubygems behind the gems. GEMCUTTER FACTS • started in April 2009 • is now rubygems.org (rubygems 1.3.6+) • replaced rubyforge • manages uploads & downloads • rails app using PostgreSQL + rack middleware with sinatra • by Nick Quaranto (@qrush) of Thoughtbot > http://github.com/rubygems/gemcutter
  • 11. http://moriz.de/Rubygems behind the gems. BIG PICTURE: UPLOAD RELEASE $ gem release hetzner-api.gemspec Successfully built RubyGem Name: hetzner-api Version: 1.0.0 File: hetzner-api-1.0.0.gem Pushing gem to RubyGems.org... gem release
  • 12. http://moriz.de/Rubygems behind the gems. BIG PICTURE: UPLOAD RELEASE cli rubygems.org (gemcutter)
  • 13. http://moriz.de/Rubygems behind the gems. BIG PICTURE: UPLOAD RELEASE cli rubygems.org AWS S3 gem file
  • 14. http://moriz.de/Rubygems behind the gems. BIG PICTURE: UPLOAD RELEASE cli rubygems.org AWS S3 update specs > database > spec files to s3 spec files
  • 15. http://moriz.de/Rubygems behind the gems. BIG PICTURE: UPLOAD RELEASE cli rubygems.org AWS S3 update specs webhooks, rss, ... http://rubygems.org/pages/api_docs
  • 16. http://moriz.de/Rubygems behind the gems. BIG PICTURE: DOWNLOAD cli rubygems.org AWS S3
  • 17. http://moriz.de/Rubygems behind the gems. SPECS AKA „THE INDEX“ $sudo gem install rails -V GET http://gems.rubyforge.org/latest_specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/latest_specs.4.8.gz 200 OK GET http://gems.rubyforge.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz 302 Found GET http://production.s3.rubygems.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz 200 OK GET http://gems.rubyforge.org/specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/specs.4.8.gz 200 OK GET http://gems.rubyforge.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz 302 Found GET http://production.s3.rubygems.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz ...
  • 18. http://moriz.de/Rubygems behind the gems. SPECS AKA „THE INDEX“no specific version => latest $sudo gem install rails -V GET http://gems.rubyforge.org/latest_specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/latest_specs.4.8.gz 200 OK GET http://gems.rubyforge.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz 302 Found GET http://production.s3.rubygems.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz 200 OK GET http://gems.rubyforge.org/specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/specs.4.8.gz 200 OK GET http://gems.rubyforge.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz 302 Found GET http://production.s3.rubygems.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz ...
  • 19. $sudo gem install rails -V GET http://gems.rubyforge.org/latest_specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/latest_specs.4.8.gz 200 OK GET http://gems.rubyforge.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz 302 Found GET http://production.s3.rubygems.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz 200 OK GET http://gems.rubyforge.org/specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/specs.4.8.gz 200 OK GET http://gems.rubyforge.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz 302 Found GET http://production.s3.rubygems.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz ... http://moriz.de/Rubygems behind the gems. SPECS AKA „THE INDEX“ Gem.marshal_version => Marshal::MAJOR_VERSION Marshal::MINOR_VERSION
  • 20. http://moriz.de/Rubygems behind the gems. SPECS AKA „THE INDEX“ irb(main):001:0> x = {} => {} irb(main):002:0> x['farbe'] = 'ananasblau' => "ananasblau" irb(main):003:0> Marshal.dump x => "004b{006"nfarbe"017ananasblau" etc. > http://ruby-doc.org/core/classes/Marshal.html
  • 21. $sudo gem install rails -V GET http://gems.rubyforge.org/latest_specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/latest_specs.4.8.gz 200 OK GET http://gems.rubyforge.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz 302 Found GET http://production.s3.rubygems.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz 200 OK GET http://gems.rubyforge.org/specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/specs.4.8.gz 200 OK GET http://gems.rubyforge.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz 302 Found GET http://production.s3.rubygems.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz ... http://moriz.de/Rubygems behind the gems. SPECS AKA „THE INDEX“
  • 22. http://moriz.de/Rubygems behind the gems. SPECS AKA „THE INDEX“ latest_specs: lists the latest release number of all gems (~150 KB / 570 KB) specs: list of all gem releases (380 KB / 2.2 MB) latest_specs = Marshal.load open 'latest_specs.4.8' latest_specs.size => 17501 specs = Marshal.load open 'specs.4.8'; specs.size => 83490 (there‘s also a pre-release spec (remember „gem install rails --pre“) and others: see rubygems source lib/rubygems/commands/generate_index_command.rb)
  • 23. $sudo gem install rails -V GET http://gems.rubyforge.org/latest_specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/latest_specs.4.8.gz 200 OK GET http://gems.rubyforge.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz 302 Found GET http://production.s3.rubygems.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz 200 OK GET http://gems.rubyforge.org/specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/specs.4.8.gz 200 OK GET http://gems.rubyforge.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz 302 Found GET http://production.s3.rubygems.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz ... http://moriz.de/Rubygems behind the gems. SPECS AKA „THE INDEX“ xload + parse spec dependencies
  • 24. http://moriz.de/Rubygems behind the gems. SPECS AKA „THE INDEX“ Gem::Specification.new do |s|   s.authors = ["David Heinemeier Hansson"]   s.date = Time.utc(2010, 10, 14)   s.dependencies = [Gem::Dependency.new("activesupport",     Gem::Requirement.new(["= 3.0.1"]),     :runtime),    Gem::Dependency.new("actionpack",     Gem::Requirement.new(["= 3.0.1"]),     :runtime),    Gem::Dependency.new("activerecord",     Gem::Requirement.new(["= 3.0.1"]),     :runtime),    Gem::Dependency.new("activeresource",     Gem::Requirement.new(["= 3.0.1"]),     :runtime),    Gem::Dependency.new("actionmailer",     Gem::Requirement.new(["= 3.0.1"]),     :runtime),    Gem::Dependency.new("railties",     Gem::Requirement.new(["= 3.0.1"]),     :runtime),    Gem::Dependency.new("bundler",     Gem::Requirement.new(["~> 1.0.0"]),     :runtime)]   s.description = "Ruby on Rails is a full-stack web framework optimized Marshal.load Gem.inflate File.read 'rails-3.0.1.gemspec.rz'
  • 25. http://moriz.de/Rubygems behind the gems. SPECS AKA „THE INDEX“ $sudo gem install rails -V GET http://gems.rubyforge.org/latest_specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/latest_specs.4.8.gz 200 OK GET http://gems.rubyforge.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz 302 Found GET http://production.s3.rubygems.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz 200 OK GET http://gems.rubyforge.org/specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/specs.4.8.gz 200 OK GET http://gems.rubyforge.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz 302 Found GET http://production.s3.rubygems.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz ... deps with explicit version requirement => require full spec list
  • 26. http://moriz.de/Rubygems behind the gems. SPECS AKA „THE INDEX“ $sudo gem install rails -V GET http://gems.rubyforge.org/latest_specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/latest_specs.4.8.gz 200 OK GET http://gems.rubyforge.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz 302 Found GET http://production.s3.rubygems.org/quick/Marshal.4.8/rails-3.0.1.gemspec.rz 200 OK GET http://gems.rubyforge.org/specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/specs.4.8.gz 200 OK GET http://gems.rubyforge.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz 302 Found GET http://production.s3.rubygems.org/quick/Marshal.4.8/activesupport-3.0.1.gemspec.rz ... for each dependency then download and install the .gem files
  • 27. http://moriz.de/Rubygems behind the gems. PROBLEMS: WHAT IF? cli rubygems.org AWS S3
  • 28. http://moriz.de/Rubygems behind the gems. PROBLEMS: WHAT IF? cli rubygems.org AWS S3 Temporary Outage: no new gem releases no gem downloads (index missing) ! new app deployments? new server deployments?
  • 29. http://moriz.de/Rubygems behind the gems. PROBLEMS: WHAT IF? cli rubygems.org AWS S3 Fatal Outage, reasons: • Hardware • Software (attack, fs corruption) • Amazon • account „deactivation“ • account deletion • S3 data loss • S3 bucket account theft/crack • Sunny day kills all the clouds. • Jeff Bezos‘ new bicy^Segw^Rocket.
  • 30. http://moriz.de/Rubygems behind the gems. PROBLEMS: WHAT IF? cli rubygems.org AWS S3 Fatal Outage: ALL GEMS LOST
  • 31. http://moriz.de/Rubygems behind the gems. PROBLEMS: WHAT IF? cli rubygems.org AWS S3 Fatal Outage: ALL GEMS LOST try again. ^_^
  • 32. http://moriz.de/Rubygems behind the gems. PROBLEMS: MIRRORING Infrastructure independence to save your business from a rubygems desaster: > Start your own mirror Fallback for rubygems.org desaster? > Use a public mirror > Start your own mirror
  • 33. http://moriz.de/Rubygems behind the gems. PROBLEMS: PUBLIC MIRRORS Comprehensive Perl Archive Network 2010-10-25 online since 1995-10-26 7770 MB 228 mirrors 8463 authors 18582 modules 228 independent public and free mirrors!
  • 34. http://moriz.de/Rubygems behind the gems. PROBLEMS: PUBLIC MIRRORS Debian Mirror Sites: 445 http://www.debian.org/mirror/list
  • 35. http://moriz.de/Rubygems behind the gems. PROBLEMS: PUBLIC MIRRORS „The Python Package Index is a repository of software for the Python programming language. There are currently 11801 packages here“
  • 36. http://moriz.de/Rubygems behind the gems. PROBLEMS: PUBLIC MIRRORS
  • 37. http://moriz.de/Rubygems behind the gems. PROBLEMS: PUBLIC MIRRORS 0 active, public, free mirrors. lost in migration (rubyforge > gemcutter)
  • 38. http://moriz.de/Rubygems behind the gems. PROBLEMS: MIRRORING Mirroring stuff in rubygems is currently broken: • „gem mirror“ misses some gems & slow downloads: one gem at a time. • index building is broken (see #362) • reliability (#362, too) http://help.rubygems.org/discussions/problems/362-cant-mirror-rubygems- repo-incorrect-header-check http://help.rubygems.org/discussions/problems/212-some-gems-and-specs-missing-that-are-in-the-index Gemcutter already lost gems:
  • 39. http://moriz.de/Rubygems behind the gems. PROBLEMS: MIRRORING There is also no easy way to mirror a S3 bucket: • no ftp • no rsync • no file-list to use with e.g. wget = you cannot even run a reliable private mirror :-(
  • 40. http://moriz.de/Rubygems behind the gems. SOLUTION Provide rsync on master for sync-ability. On EC2, Rackspace, does not matter if it‘s fast... > NO custom mirroring software! > most FOSS mirror sites use rsync > use rsync, ask mirrors, problem solved. > AWS cloudfront is NOT a solution > not mirrorable, same vendor SPOFs.
  • 41. http://moriz.de/Rubygems behind the gems. SOLUTION Provide rsync on master for sync-ability. On EC2, Rackspace, does not matter if it‘s fast... Provide a DNS based distribution (GeoDNS) > a realiable base for (private) mirroring > speed & latency improvements > NO custom mirroring software needed! > saves money (AWS and Rackspace fees) > make use of the new mirrors!
  • 42. http://moriz.de/Rubygems behind the gems. SOLUTION Why not? > no „instant deploy“ (real-time mirroring) > no download stats
  • 43. http://moriz.de/Rubygems behind the gems. SOLUTION Why not? Rubygems CLI could fallback to the rubygems.org master if a gem version is not on the used mirror. It already does if you configure it. (current downside: d/l spec-lists from master everytime, looks fixable to me) > no „instant deploy“ (real-time mirroring) > no download stats
  • 44. http://moriz.de/Rubygems behind the gems. THINGS WILL FAIL... just make sure you‘ve a working plan B AND: KISS & YAGNI. Keep it simple. less moving parts > less things that will break. Don‘t over-engineer.
  • 45. http://moriz.de/Rubygems behind the gems. HELP OpenSource projects need your support. Gemcutter/Rubygems, too. Go contribute if you care about your ruby business. The Gemcutter source is really awesome, a good read for every developer.

Editor's Notes