Carton CPAN dependency manager
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Carton CPAN dependency manager

on

  • 6,257 views

 

Statistics

Views

Total Views
6,257
Views on SlideShare
5,595
Embed Views
662

Actions

Likes
11
Downloads
10
Comments
0

7 Embeds 662

http://coderwall.com 401
http://yapcasia.org 187
http://paper.li 48
http://a0.twimg.com 16
http://us-w1.rockmelt.com 8
http://localhost 1
http://getpocket.com 1
More...

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Carton CPAN dependency manager Presentation Transcript

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