Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Carton at OSDC.TW 2012

Carton at OSDC.TW 2012

Tatsuhiko Miyagawa

April 14, 2012
Tweet

More Decks by Tatsuhiko Miyagawa

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ • ٶ઒ ୡ඙ Tatsuhiko Miyagawa • github.com/miyagawa • Twitter

    @miyagawa • Lives in San Francisco, CA Sunday, April 15, 12
  2. You’re writing a new web app. You don’t wanna reinvent

    wheels. Want to use as many CPAN deps. Sunday, April 15, 12
  3. >  cpanm  Web::Framework installed  LWP-­‐5.912 installed  Plack-­‐0.9980 installed  Web-­‐Framework-­‐1.20 >

     cpanm  JSON::Fast installed  JSON-­‐Fast-­‐1.91 >  cpanm  MIME::Parser::XS installed  MIME-­‐Parser-­‐XS-­‐0.20 Sunday, April 15, 12
  4. “Crap, Web::Framework has been updated to 1.4 and many APIs

    have been changed or deprecated!” Sunday, April 15, 12
  5. Rollback Log in to the old web server. Check Perl

    module versions. Install them on the new server. Sunday, April 15, 12
  6. “Crap, this author deleted the version 1.20 we want. Let’s

    go to BackPAN...” Sunday, April 15, 12
  7. “Crap, version 1.20 doesn’t actually work with the newer LWP

    6 that we just installed! Have to downgrade this too...” Sunday, April 15, 12
  8. • Dependency declaration • Isolated Perl environments • Version controls/history

    • Dependency analysis • Repeatable deployments • etc. Sunday, April 15, 12
  9. None of those didn’t quite work for me. (Or I

    haven’t even tried) Sunday, April 15, 12
  10. • App-specific local environment • Fast and safe install •

    Dep-tree analysis, including versions • Locking module versions • Easy Redeployment • Single-file, VCS friendly • Safe and easy rollback Sunday, April 15, 12
  11. Local perl environment Using local::lib and cpanm -L Each app

    has an isolated local library path Sunday, April 15, 12
  12. Dep tree analysis Rebuild the dependency tree from meta info

    Checks if anything is missing/superfluous Sunday, April 15, 12
  13. Easy Redeployment Reinstall exactly the same set of modules on

    another prod/development machines. Sunday, April 15, 12
  14. Single-file, VCS friendly You can add carton.lock to git update

    whenever you update modules Sunday, April 15, 12
  15. requires  ‘Plack’,  0.99; on  ‘develop’  =>  sub  {    recommends

     ‘Devel::Cover’; }; test_requires  ‘Test::Warn’; requires  ‘Devel::NYTProf’,  ‘>=  3.2,  <  5’; conflicts  ‘MooseX::Declare’,  ‘<  0.99’; Sunday, April 15, 12
  16. WHY • Your applications are not CPAN dists. • GitHub

    scripts • PaaS • DotCloud • Heroku • Stackato Sunday, April 15, 12
  17. ܯࠂ It is beta software, some features are missing or

    not working correctly (yet). Sunday, April 15, 12
  18. TODO / Roadmap • Update specific modules • Make install

    and bundle faster • Inject old versions / patched versions • Install from git SHA Sunday, April 15, 12