SlideShare une entreprise Scribd logo
1  sur  39
Télécharger pour lire hors ligne
Carton
                            Tatsuhiko Miyagawa
                           YAPC::Asia 2011 Tokyo




Friday, October 14, 2011
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 to use as many CPAN deps.




Friday, October 14, 2011
Fine.
                            Get them from CPAN,
                           install on your machine.



Friday, October 14, 2011
>	
  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
Test it...



Friday, October 14, 2011
Works? Ship it!



Friday, October 14, 2011
Deployment
                           Set up new production servers.
                                Install CPAN modules
                             (until the errors are gone)




Friday, October 14, 2011
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 modules
                             (until the errors are gone)




Friday, October 14, 2011
“Crap, Web::Framework has been
                              updated to 1.4 and many APIs
                           have been changed or deprecated!”




Friday, October 14, 2011
Rollback
                            Log in to the old web server.
                            Check Perl module versions.
                           Install them on the new server.




Friday, October 14, 2011
“Crap, this author deleted
                           the version 1.20 we want.
                             Let’s go to BackPAN...”




Friday, October 14, 2011
“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
and so on.



Friday, October 14, 2011
What was wrong?



Friday, October 14, 2011
• Dependency declaration
                     • Isolated Perl environments
                     • Version controls/history
                     • Dependency analysis
                     • Repeatable deployments
                     • etc.

Friday, October 14, 2011
Many existing solutions
                           MyCPAN, DPAN, CPAN::Mini::Inject,
                                OrePAN, Shipwright




Friday, October 14, 2011
None of those
                           didn’t quite work for me.
                                (Or I haven’t even tried)




Friday, October 14, 2011
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, including versions
                     • Locking module versions
                     • Easy Redeployment
                     • Single-file,VCS friendly
                     • Safe and easy rollback
Friday, October 14, 2011
Local perl environment
                                 Using local::lib and cpanm -L
                           Each app has an isolated local library path




Friday, October 14, 2011
Fast and safe install
                                       cpanm 1.5
                           Saves MYMETA.json and install meta info




Friday, October 14, 2011
Dep tree analysis
                      Rebuild the dependency tree from meta info
                        Checks if anything is missing/superflous




Friday, October 14, 2011
Locking versions
                           Versions are saved in carton.lock
                                including dependencies




Friday, October 14, 2011
Easy Redeployment
                           Reinstall exactly the same set of modules
                           on another prod/development machines.




Friday, October 14, 2011
Single-file,VCS friendly
                              You can add carton.lock to git
                           update whenever you update modules




Friday, October 14, 2011
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 working correctly (yet).




Friday, October 14, 2011
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

Contenu connexe

En vedette (9)

Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011
 
CPAN Realtime feed
CPAN Realtime feedCPAN Realtime feed
CPAN Realtime feed
 
Intro to PSGI and Plack
Intro to PSGI and PlackIntro to PSGI and Plack
Intro to PSGI and Plack
 
Tatsumaki
TatsumakiTatsumaki
Tatsumaki
 
Network Programming With Anyevent
Network Programming With AnyeventNetwork Programming With Anyevent
Network Programming With Anyevent
 
No Hugging, No Learning
No Hugging, No LearningNo Hugging, No Learning
No Hugging, No Learning
 
ZeroMQ in PHP
ZeroMQ in PHPZeroMQ in PHP
ZeroMQ in PHP
 
Wight: Phantom’s Perl friend - YAPC::Asia 2012
Wight: Phantom’s Perl friend - YAPC::Asia 2012Wight: Phantom’s Perl friend - YAPC::Asia 2012
Wight: Phantom’s Perl friend - YAPC::Asia 2012
 

Similaire à Carton CPAN dependency manager

Oop design magma rails 2011
Oop design   magma rails 2011Oop design   magma rails 2011
Oop design magma rails 2011
MagmaConf
 
Conquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JSConquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JS
Caridy Patino
 
Ruby hollywood
Ruby hollywoodRuby hollywood
Ruby hollywood
ehuard
 
WTF Is Messaging And Why You Should Use It?
WTF Is Messaging And Why You Should Use It?WTF Is Messaging And Why You Should Use It?
WTF Is Messaging And Why You Should Use It?
James Russell
 
Introduction to JavaScriptMVC
Introduction to JavaScriptMVCIntroduction to JavaScriptMVC
Introduction to JavaScriptMVC
Pedro Pimentel
 
JavaSE - The road forward
JavaSE - The road forwardJavaSE - The road forward
JavaSE - The road forward
eug3n_cojocaru
 

Similaire à Carton CPAN dependency manager (20)

DevOps Introduction @Cegeka
DevOps Introduction @CegekaDevOps Introduction @Cegeka
DevOps Introduction @Cegeka
 
Oop design magma rails 2011
Oop design   magma rails 2011Oop design   magma rails 2011
Oop design magma rails 2011
 
Caridy patino - node-js
Caridy patino - node-jsCaridy patino - node-js
Caridy patino - node-js
 
Conquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JSConquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JS
 
Puppet camp europe 2011 hackability
Puppet camp europe 2011   hackabilityPuppet camp europe 2011   hackability
Puppet camp europe 2011 hackability
 
Ruby hollywood
Ruby hollywoodRuby hollywood
Ruby hollywood
 
The Fast, The Slow and the Lazy
The Fast, The Slow and the LazyThe Fast, The Slow and the Lazy
The Fast, The Slow and the Lazy
 
Intro to Micro-frameworks
Intro to Micro-frameworksIntro to Micro-frameworks
Intro to Micro-frameworks
 
Debugging LAMP Apps on Linux/UNIX Using Open Source Tools - Jess Portnot - OS...
Debugging LAMP Apps on Linux/UNIX Using Open Source Tools - Jess Portnot - OS...Debugging LAMP Apps on Linux/UNIX Using Open Source Tools - Jess Portnot - OS...
Debugging LAMP Apps on Linux/UNIX Using Open Source Tools - Jess Portnot - OS...
 
WTF Is Messaging And Why You Should Use It?
WTF Is Messaging And Why You Should Use It?WTF Is Messaging And Why You Should Use It?
WTF Is Messaging And Why You Should Use It?
 
Introduction to JavaScriptMVC
Introduction to JavaScriptMVCIntroduction to JavaScriptMVC
Introduction to JavaScriptMVC
 
Groke
GrokeGroke
Groke
 
node.js for front-end developers
node.js for front-end developersnode.js for front-end developers
node.js for front-end developers
 
Secrets of the GWT
Secrets of the GWTSecrets of the GWT
Secrets of the GWT
 
Errors and handling them. YOW nights Sydney 2011
Errors and handling them. YOW nights Sydney 2011Errors and handling them. YOW nights Sydney 2011
Errors and handling them. YOW nights Sydney 2011
 
Error Handling Done Differently
Error Handling Done DifferentlyError Handling Done Differently
Error Handling Done Differently
 
JavaSE - The road forward
JavaSE - The road forwardJavaSE - The road forward
JavaSE - The road forward
 
Namesmatter
NamesmatterNamesmatter
Namesmatter
 
AppScale Talk at SBonRails
AppScale Talk at SBonRailsAppScale Talk at SBonRails
AppScale Talk at SBonRails
 
CommonJS Frameworks
CommonJS FrameworksCommonJS Frameworks
CommonJS Frameworks
 

Plus de Tatsuhiko Miyagawa

Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
Tatsuhiko Miyagawa
 
Asynchronous programming with AnyEvent
Asynchronous programming with AnyEventAsynchronous programming with AnyEvent
Asynchronous programming with AnyEvent
Tatsuhiko Miyagawa
 
Building a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQueryBuilding a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
 
Why Open Matters It Pro Challenge 2008
Why Open Matters It Pro Challenge 2008Why Open Matters It Pro Challenge 2008
Why Open Matters It Pro Challenge 2008
Tatsuhiko Miyagawa
 
20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked about
Tatsuhiko Miyagawa
 
Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8
Tatsuhiko Miyagawa
 

Plus de Tatsuhiko Miyagawa (20)

Plack at OSCON 2010
Plack at OSCON 2010Plack at OSCON 2010
Plack at OSCON 2010
 
cpanminus at YAPC::NA 2010
cpanminus at YAPC::NA 2010cpanminus at YAPC::NA 2010
cpanminus at YAPC::NA 2010
 
Plack at YAPC::NA 2010
Plack at YAPC::NA 2010Plack at YAPC::NA 2010
Plack at YAPC::NA 2010
 
PSGI/Plack OSDC.TW
PSGI/Plack OSDC.TWPSGI/Plack OSDC.TW
PSGI/Plack OSDC.TW
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
 
Plack - LPW 2009
Plack - LPW 2009Plack - LPW 2009
Plack - LPW 2009
 
Asynchronous programming with AnyEvent
Asynchronous programming with AnyEventAsynchronous programming with AnyEvent
Asynchronous programming with AnyEvent
 
Building a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQueryBuilding a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Remedie OSDC.TW
Remedie OSDC.TWRemedie OSDC.TW
Remedie OSDC.TW
 
Why Open Matters It Pro Challenge 2008
Why Open Matters It Pro Challenge 2008Why Open Matters It Pro Challenge 2008
Why Open Matters It Pro Challenge 2008
 
20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked about
 
Web::Scraper for SF.pm LT
Web::Scraper for SF.pm LTWeb::Scraper for SF.pm LT
Web::Scraper for SF.pm LT
 
Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8
 
Web::Scraper
Web::ScraperWeb::Scraper
Web::Scraper
 
XML::Liberal
XML::LiberalXML::Liberal
XML::Liberal
 
Test::Base
Test::BaseTest::Base
Test::Base
 
Hacking Vox and Plagger
Hacking Vox and PlaggerHacking Vox and Plagger
Hacking Vox and Plagger
 
Plagger the duct tape of internet
Plagger the duct tape of internetPlagger the duct tape of internet
Plagger the duct tape of internet
 
Tilting Google Maps and MissileLauncher
Tilting Google Maps and MissileLauncherTilting Google Maps and MissileLauncher
Tilting Google Maps and MissileLauncher
 
Writing Pluggable Software
Writing Pluggable SoftwareWriting Pluggable Software
Writing Pluggable Software
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Dernier (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Carton CPAN dependency manager

  • 1. Carton Tatsuhiko Miyagawa YAPC::Asia 2011 Tokyo Friday, October 14, 2011
  • 2. Managing CPAN Dependencies Friday, October 14, 2011
  • 3. Case Study: (Poor) Web Development Friday, 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.20 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, Shipwright Friday, 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/carton 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 rollback Friday, October 14, 2011
  • 27. Local perl environment Using local::lib and cpanm -L Each app has an isolated local library path Friday, October 14, 2011
  • 28. Fast and safe install cpanm 1.5 Saves MYMETA.json and install meta info Friday, October 14, 2011
  • 29. Dep tree analysis Rebuild the dependency tree from meta info Checks if anything is missing/superflous Friday, October 14, 2011
  • 30. Locking versions Versions are saved in carton.lock including dependencies Friday, 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 modules Friday, October 14, 2011
  • 33. Safe and easy rollback revert the lock file and redeploy Friday, October 14, 2011
  • 35. >  cpanm  Carton Friday, 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 #carton Friday, October 14, 2011
  • 39. Thanks! twitter.com/miyagawa Friday, October 14, 2011