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.
Carton
                            Tatsuhiko Miyagawa
                           YAPC::Asia 2011 Tokyo




Friday, October...
Managing CPAN
                            Dependencies


Friday, October 14, 2011
Case Study:
                           (Poor) Web Development




Friday, October 14, 2011
You’re writing a new web app.
                           You don’t wanna reinvent wheels.
                           Want ...
Fine.
                            Get them from CPAN,
                           install on your machine.



Friday, Octob...
>	
  cpanm	
  Web::Framework
               installed	
  LWP-­‐5.912
               installed	
  Plack-­‐0.9980
          ...
Test it...



Friday, October 14, 2011
Works? Ship it!



Friday, October 14, 2011
Deployment
                           Set up new production servers.
                                Install CPAN modules
...
Few weeks later...



Friday, October 14, 2011
Your website is popular!
                           Need more web servers!




Friday, October 14, 2011
Re-Deployment
                           Set up new production servers.
                                Install CPAN modul...
“Crap, Web::Framework has been
                              updated to 1.4 and many APIs
                           have ...
Rollback
                            Log in to the old web server.
                            Check Perl module versions....
“Crap, this author deleted
                           the version 1.20 we want.
                             Let’s go to B...
“Crap, version 1.20 doesn’t actually work
                      with the newer LWP 6 that we just
                   insta...
and so on.



Friday, October 14, 2011
What was wrong?



Friday, October 14, 2011
• Dependency declaration
                     • Isolated Perl environments
                     • Version controls/history...
Many existing solutions
                           MyCPAN, DPAN, CPAN::Mini::Inject,
                                OrePA...
None of those
                           didn’t quite work for me.
                                (Or I haven’t even trie...
So I wrote a new one.



Friday, October 14, 2011
Carton
                           https://github.com/miyagawa/carton




Friday, October 14, 2011
Inspired by...



Friday, October 14, 2011
Friday, October 14, 2011
• App-specific local environment
                     • Fast and safe install
                     • Dep-tree analysis, inc...
Local perl environment
                                 Using local::lib and cpanm -L
                           Each app ...
Fast and safe install
                                       cpanm 1.5
                           Saves MYMETA.json and in...
Dep tree analysis
                      Rebuild the dependency tree from meta info
                        Checks if anyth...
Locking versions
                           Versions are saved in carton.lock
                                including de...
Easy Redeployment
                           Reinstall exactly the same set of modules
                           on anoth...
Single-file,VCS friendly
                              You can add carton.lock to git
                           update whe...
Safe and easy rollback
                             revert the lock file and redeploy




Friday, October 14, 2011
DEMO



Friday, October 14, 2011
>	
  cpanm	
  Carton



Friday, October 14, 2011
WARNING
                           It is beta software, some features are
                           missing or not workin...
github.com/miyagawa/carton
                                irc.perl.org #carton




Friday, October 14, 2011
Questions?



Friday, October 14, 2011
Thanks!
                           twitter.com/miyagawa




Friday, October 14, 2011
You’ve finished this document.
Download and read it offline.
Upcoming SlideShare
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Next
Upcoming SlideShare
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Next
Download to read offline and view in fullscreen.

Share

Carton CPAN dependency manager

Download to read offline

Carton CPAN dependency manager

  1. 1. Carton Tatsuhiko Miyagawa YAPC::Asia 2011 Tokyo Friday, October 14, 2011
  2. 2. Managing CPAN Dependencies Friday, October 14, 2011
  3. 3. Case Study: (Poor) Web Development Friday, October 14, 2011
  4. 4. You’re writing a new web app. You don’t wanna reinvent wheels. Want to use as many CPAN deps. Friday, October 14, 2011
  5. 5. Fine. Get them from CPAN, install on your machine. Friday, October 14, 2011
  6. 6. >  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 Friday, October 14, 2011
  7. 7. Test it... Friday, October 14, 2011
  8. 8. Works? Ship it! Friday, October 14, 2011
  9. 9. Deployment Set up new production servers. Install CPAN modules (until the errors are gone) Friday, October 14, 2011
  10. 10. Few weeks later... Friday, October 14, 2011
  11. 11. Your website is popular! Need more web servers! Friday, October 14, 2011
  12. 12. Re-Deployment Set up new production servers. Install CPAN modules (until the errors are gone) Friday, October 14, 2011
  13. 13. “Crap, Web::Framework has been updated to 1.4 and many APIs have been changed or deprecated!” Friday, October 14, 2011
  14. 14. Rollback Log in to the old web server. Check Perl module versions. Install them on the new server. Friday, October 14, 2011
  15. 15. “Crap, this author deleted the version 1.20 we want. Let’s go to BackPAN...” Friday, October 14, 2011
  16. 16. “Crap, version 1.20 doesn’t actually work with the newer LWP 6 that we just installed! Have to downgrade this too...” Friday, October 14, 2011
  17. 17. and so on. Friday, October 14, 2011
  18. 18. What was wrong? Friday, October 14, 2011
  19. 19. • Dependency declaration • Isolated Perl environments • Version controls/history • Dependency analysis • Repeatable deployments • etc. Friday, October 14, 2011
  20. 20. Many existing solutions MyCPAN, DPAN, CPAN::Mini::Inject, OrePAN, Shipwright Friday, October 14, 2011
  21. 21. None of those didn’t quite work for me. (Or I haven’t even tried) Friday, October 14, 2011
  22. 22. So I wrote a new one. Friday, October 14, 2011
  23. 23. Carton https://github.com/miyagawa/carton Friday, October 14, 2011
  24. 24. Inspired by... Friday, October 14, 2011
  25. 25. Friday, October 14, 2011
  26. 26. • 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 Friday, October 14, 2011
  27. 27. Local perl environment Using local::lib and cpanm -L Each app has an isolated local library path Friday, October 14, 2011
  28. 28. Fast and safe install cpanm 1.5 Saves MYMETA.json and install meta info Friday, October 14, 2011
  29. 29. Dep tree analysis Rebuild the dependency tree from meta info Checks if anything is missing/superflous Friday, October 14, 2011
  30. 30. Locking versions Versions are saved in carton.lock including dependencies Friday, October 14, 2011
  31. 31. Easy Redeployment Reinstall exactly the same set of modules on another prod/development machines. Friday, October 14, 2011
  32. 32. Single-file,VCS friendly You can add carton.lock to git update whenever you update modules Friday, October 14, 2011
  33. 33. Safe and easy rollback revert the lock file and redeploy Friday, October 14, 2011
  34. 34. DEMO Friday, October 14, 2011
  35. 35. >  cpanm  Carton Friday, October 14, 2011
  36. 36. WARNING It is beta software, some features are missing or not working correctly (yet). Friday, October 14, 2011
  37. 37. github.com/miyagawa/carton irc.perl.org #carton Friday, October 14, 2011
  38. 38. Questions? Friday, October 14, 2011
  39. 39. Thanks! twitter.com/miyagawa Friday, October 14, 2011
  • awnstudio

    Mar. 3, 2015
  • escawk

    Oct. 3, 2012
  • _anaio

    Feb. 1, 2012
  • TakeshiWatanabe2

    Oct. 25, 2011
  • redhotpenguin

    Oct. 21, 2011
  • intervoice

    Oct. 18, 2011
  • jandubois

    Oct. 14, 2011
  • swordbreaker

    Oct. 14, 2011
  • masaki

    Oct. 14, 2011
  • ziguzagu

    Oct. 14, 2011
  • hsbt

    Oct. 14, 2011
  • dragon3

    Oct. 14, 2011

Views

Total views

8,425

On Slideshare

0

From embeds

0

Number of embeds

802

Actions

Downloads

13

Shares

0

Comments

0

Likes

12

×