Share
Embed
Does packaging really suck?
Following a "does packaging suck?" discussion at DevOpsDays London 2013, here is a short talk about two tools that help package and distribute apps in a simple way: pkgr and deb-s3.
crohr
November 12, 2013
Transcript
13 slides
-
(App) Packaging sucks? • Vendor all the things (omnibus) •
Package all the things (fpm) • Dockerize all the things • Step-by-step installation instructions (~Chef/Puppet) -
Middle ground? • Vendor some of the things (Ruby version,
bundler, gems, etc.) • Rely on system dependencies for “mostly stable” stuff (libxml, libmysqlclient, etc.) -
Heroku “Want to deploy an app? There is a buildpack
for that” https://github.com/heroku/heroku-buildpack-ruby.git https://github.com/heroku/heroku-buildpack-nodejs.git https://github.com/heroku/heroku-buildpack-java.git https://github.com/heroku/heroku-buildpack-play.git https://github.com/heroku/heroku-buildpack-python.git https://github.com/heroku/heroku-buildpack-php.git https://github.com/heroku/heroku-buildpack-clojure.git https://github.com/kr/heroku-buildpack-go.git https://github.com/miyagawa/heroku-buildpack-perl.git https://github.com/heroku/heroku-buildpack-scala https://github.com/igrigorik/heroku-buildpack-dart.git ... -
pkgr • https://github.com/crohr/pkgr • Heroku buildpacks + fpm = self-contained
.deb package • Friendly for developers -
pkgr $ gem install pkgr $ git clone https://github.com/discourse/discourse $
cd discourse/ $ pkgr package . --description "A platform for community discussion. Free, open, simple." --homepage "http://www.discourse.org/" --before-precompile ./packaging/debian/setup.sh [--dependencies postgresql-9.1 postgresql-contrib-9.1 redis-server] Let’s package Discourse -
$ pkgr package ... -----> Ruby app -----> Compiling Ruby/Rails
Booting in Rails 4 mode -----> Using Ruby version: ruby-2.0.0 -----> Installing dependencies using Bundler version 1.3.2 Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment Booting in Rails 4 mode Using rake (10.1.0) Using i18n (0.6.5) Using minitest (4.7.5) Using multi_json (1.8.2) Using atomic (1.1.14) Using thread_safe (0.1.3) ... -----> Writing config/database.yml to read from DATABASE_URL -----> Preparing app for Rails asset pipeline Running: rake assets:precompile ... > Copying non-digested versions of assets > Removing cache Asset precompilation completed (62.81s) -----> WARNINGS: Injecting plugin 'rails_log_stdout' Injecting plugin 'rails3_serve_static_assets' Add 'rails_12factor' gem to your Gemfile to skip plugin injection You have not declared a Ruby version in your Gemfile. To set your Ruby version add this line to your Gemfile: -
deb-s3 $ deb-‐s3 upload -‐-‐bucket my-‐bucket my-‐deb-‐package-‐1.0.0_amd64.deb >> Examining package
file my-‐deb-‐package-‐1.0.0_amd64.deb >> Retrieving existing package manifest >> Uploading package and new manifests to S3 -‐-‐ Transferring pool/m/my/my-‐deb-‐package-‐1.0.0_amd64.deb -‐-‐ Transferring dists/stable/main/binary-‐amd64/Packages -‐-‐ Transferring dists/stable/main/binary-‐amd64/Packages.gz -‐-‐ Transferring dists/stable/Release >> Update complete. -
Profit echo "deb http://deb.pkgr.io/crohr/discourse wheezy master" \ > /etc/apt/sources.list.d/pkgr.list apt-get
update apt-get install discourse discourse config:set DATABASE_URL=postgres://... discourse scale web=1 worker=1 # taken from Procfile service discourse start/stop/restart/status -
Thanks • @crohr • Hosted version at https://pkgr.io git push
... apt-get update && apt-get install your-app https://github.com/crohr/pkgr https://github.com/krobertson/deb-s3