Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Package anything with fpm cookery

1,258 views

Published on

Commonly in startups, you probably don't be worry about how your application artefacts are managed to be deployed in a server: compressed files or JAR/WAR files combined with a set of scripts. However, for larger companies that uses not only one or two servers, but a entire pool of machines, it requires some control and organisation to deploy apps. You can handle this case with some automation / configuration management tools like Ansible, Puppet, Chef, of course. But using a set of scripts can be hard to maintain all deployment steps, from artefact update to rollback.

If you distribute your software using a Operational System package manager like YUM (CentOS) or APT (Debian, Ubuntu), your deployment will be easier because these tools handles software changes in a good way. It sounds good, but package binaries is a pain for developers or newer sysadmins that don't have knowledge about how YUM/APT works. It requires creation of one or a lot of configuration files to be updated and when you have multiple artefacts probably packaging them will be a nightmare.

Here enter fpm-cookery, a Ruby gem responsible to package artefacts based on recipes, much easy to use. It will be your swiss knife for anything that you need to package, from common binaries not distributed in RPM/DEB formats to programming languages from source, compiling when needed.

Published in: Technology
  • DOWNLOAD FULL. BOOKS INTO AVAILABLE FORMAT, ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL. BOOKS INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Hi there! Get Your Professional Job-Winning Resume Here - Check our website! http://bit.ly/resumpro
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Package anything with fpm cookery

  1. 1. Package anything with fpm-cookery Marcelo Pinheiro http://salizzar.net - @salizzar
  2. 2. $ whoami • Fireman / Problem Solver / Programmer since 2000 • Ruby, Python, Golang, Java, C#, Classic ASP, PHP, Coldfusion, Erlang and others • DevOps Engineer @ Moip
  3. 3. In the beginning… • How software was updated on old times? • Tarballs (zip, tar.gz) • Transfer via FTP / SSH / Ctrl+c Ctrl+v • Common problems • A not-so maintained README explaining how to update it • Manual steps • Lack of rastreability (who updated glibc?)
  4. 4. … to some years ago • Package Manager concept • Dependency Resolution • Filesystem Standardisation • File Integrity • Central Package Repository • Transaction History
  5. 5. … and today • How software is updated today? • Configuration Management tool • Package Manager
  6. 6. Packaging is good? Why I need to use it?
  7. 7. “Heroku takes care for me!” – A hipster Ruby programmer
  8. 8. “Docker ships my container to production!” – A hipster Go programmer
  9. 9. “I can deploy tarballs using my CF tool, man!” – A darting sysadmin
  10. 10. “Packaging is good.” – I
  11. 11. Packaging is good • When your business grow, your software will too • From monolith app to microservices • You need to adopt a standard workflow to distribute software recognisable to all ops people • Package managers like APT/YUM are well-known • Deploy-friendly • You can use your custom solution, of course
  12. 12. Packaging is good • Configuration Management recipes that manages tarballs tends to be complex: • Manual dependency resolution • Can be a nightmare if requires compilation • Black magic recipes
  13. 13. Packaging is good • Configuration Management recipes have support for main package management tools in-a-box as a module • Recipes much more simpler
  14. 14. Packaging is good It sounds good, but…
  15. 15. It’s complex.
  16. 16. A LOT for newbies.
  17. 17. RPM Packaging: Challenges • RPM packaging • # yum install -y rpm-build • spec file • one file to rule all
  18. 18. DEB Packaging: Challenges • DEB packaging: • # apt-get install -y dpkg-tools • debian folder with the following files: • control • init • rules • preinst, postinst, conffiles, dirs, etc…
  19. 19. RPM / DEB: Challenges • Rich documentation, but… • $ man p0rn • Too many options • High learning curve
  20. 20. “Hnm, I didn’t like. Forget it.” – All of you here
  21. 21. fpm-cookery for the rescue C’mon, show me the code! >:(
  22. 22. fpm-cookery for the rescue • https://github.com/bernd/fpm-cookery • Bernd Ahlers • A tool to build and package anything • Abstraction to famous Jordan Sissel fpm gem
  23. 23. fpm-cookery for the rescue • Package is created with a recipe • class MyPackage < FPM::Cookery::Recipe • Two methods to implement: • build • install • It’s Ruby, man. Enjoy :)
  24. 24. fpm-cookery for the rescue • Download tarball with precompiled binaries • Download and compile from source code • Build dependency resolution with Chef gem • One recipe to package .rpm, .deb and.dmi • Helpers to create package filesystem as you need
  25. 25. fpm-cookery Live Demo • How I package a tarball containing binaries? • How I package a tarball with source code?
  26. 26. “It sounds good. But how I can package mundane things like web apps without need to write recipe for all of them?” – I, maybe you
  27. 27. Gordon: agnostic packaging • https://github.com/salizzar/ gordon • Very oppiniated tool to package web / standalone apps • No need to recipe, just use it as a CLI
  28. 28. Gordon: agnostic packaging • Some years ago I wrote a code generator to create Debian package build files • Code generator to create skeletons is great, but after some time you will get a problem when you need to change something • Some examples: • change init scripts to use systemd • add / remove files to project • Apps will change, developers without knowledge of standards will break it
  29. 29. Gordon: agnostic packaging • Foreman to generate init files • systemd • Other formats can be included • inittab • supervisord • upstart • Set of fpm-cookery generic recipes that handles most cases of web / standalone apps
  30. 30. Gordon: agnostic packaging • Generic recipes are based on years of application packaging following good conventions • Operational System standards (Debian, Red Hat / CentOS) • Nginx / Apache / Tomcat / Jetty directories • Application run using their non-interactive shell user or application server user (Tomcat) • Dedicated log directory • /var/run issue
  31. 31. Gordon: agnostic packaging • Languages supported • Ruby • Java • Plans to include • Node.js • Golang
  32. 32. Gordon Live Demo • How I package a Ruby web app?
  33. 33. Questions? O’rly?
  34. 34. Thank you! :)

×