Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Carton at OSDC.TW 2012
Search
Tatsuhiko Miyagawa
April 14, 2012
Technology
7
1.1k
Carton at OSDC.TW 2012
Tatsuhiko Miyagawa
April 14, 2012
Tweet
Share
More Decks by Tatsuhiko Miyagawa
See All by Tatsuhiko Miyagawa
Carmel at YAPC::EU 2015
miyagawa
0
490
Carton at London Perl Workshop 2013
miyagawa
0
250
Managing CPAN dependencies with Carton
miyagawa
0
270
What's new in Carton and cpanm at YAPC::Asia 2013
miyagawa
6
1.2k
Carton 1.0 at OSCON 2013
miyagawa
11
2.2k
cpanm 1.6 at OSDC.TW
miyagawa
6
1.3k
10 more things to be ripped off
miyagawa
7
1.3k
Ruby; Exported
miyagawa
1
940
10 Years: LL, you and me
miyagawa
2
180
Other Decks in Technology
See All in Technology
生成AIとAWS CDKで実現! 自社ブログレビューの効率化
ymae
2
330
物価高なラスベガスでの過ごし方
zakky
0
380
Amazon FSx for NetApp ONTAPを利用するにあたっての要件整理と設計のポイント
non97
1
160
顧客が本当に必要だったもの - パフォーマンス改善編 / Make what is needed
soudai
24
6.8k
AWS re:Inventを徹底的に楽しむためのTips / Tips for thoroughly enjoying AWS re:Invent
yuj1osm
1
570
コンテンツを支える 若手ゲームクリエイターの アートディレクションの事例紹介 / cagamefi-game
cyberagentdevelopers
PRO
1
130
現地でMeet Upをやる場合の注意点〜反省点を添えて〜
shotashiratori
0
530
pandasはPolarsに性能面で追いつき追い越せるのか
vaaaaanquish
4
4.7k
Fargateを使った研修の話
takesection
0
120
2024-10-30-reInventStandby_StudyGroup_Intro
shinichirokawano
1
640
「 SharePoint 難しい」ってよく聞くけど、そんなに言うなら8歳の息子に試してもらった
taichinakamura
1
630
プロダクトエンジニアが活躍する環境を作りたくて 事業責任者になった話 ~プロダクトエンジニアの行き着く先~
gimupop
1
480
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Side Projects
sachag
452
42k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Happy Clients
brianwarren
97
6.7k
Measuring & Analyzing Core Web Vitals
bluesmoon
1
41
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
14
1.9k
Ruby is Unlike a Banana
tanoku
96
11k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
328
21k
Statistics for Hackers
jakevdp
796
220k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
167
49k
Transcript
Carton Tatsuhiko Miyagawa OSDC.TW 2012 Sunday, April 15, 12
ࣗݾհ • ٶ ୡ Tatsuhiko Miyagawa • github.com/miyagawa • Twitter
@miyagawa • Lives in San Francisco, CA Sunday, April 15, 12
Sunday, April 15, 12
Sunday, April 15, 12
Sunday, April 15, 12
Sunday, April 15, 12
Managing CPAN Dependencies Sunday, April 15, 12
Case Study: Web App Development Sunday, April 15, 12
You’re writing a new web app. You don’t wanna reinvent
wheels. Want to use as many CPAN deps. Sunday, April 15, 12
Fine. Get them from CPAN, install on your machine. Sunday,
April 15, 12
> 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
Test it... Sunday, April 15, 12
Works? Ship it! Sunday, April 15, 12
Deployment Set up new production servers. Install used CPAN modules
Sunday, April 15, 12
Few weeks later... Sunday, April 15, 12
Your website is popular! Need more web servers! Sunday, April
15, 12
Re-Deployment Set up new production servers. Install CPAN modules. Sunday,
April 15, 12
“Crap, Web::Framework has been updated to 1.4 and many APIs
have been changed or deprecated!” Sunday, April 15, 12
Rollback Log in to the old web server. Check Perl
module versions. Install them on the new server. Sunday, April 15, 12
“Crap, this author deleted the version 1.20 we want. Let’s
go to BackPAN...” Sunday, April 15, 12
“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
Sunday, April 15, 12
“Upgrading CPAN modules broke my app” Sunday, April 15, 12
What was wrong? Sunday, April 15, 12
• Dependency declaration • Isolated Perl environments • Version controls/history
• Dependency analysis • Repeatable deployments • etc. Sunday, April 15, 12
Many existing solutions MyCPAN, DPAN, CPAN::Mini::Inject, OrePAN, Shipwright Sunday, April
15, 12
None of those didn’t quite work for me. (Or I
haven’t even tried) Sunday, April 15, 12
So I wrote a new one. Sunday, April 15, 12
Carton https://github.com/miyagawa/carton Sunday, April 15, 12
Inspired by... Sunday, April 15, 12
Sunday, April 15, 12
• 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
Local perl environment Using local::lib and cpanm -L Each app
has an isolated local library path Sunday, April 15, 12
Fast and safe install cpanm 1.5 Saves MYMETA.json and install
meta info Sunday, April 15, 12
Dep tree analysis Rebuild the dependency tree from meta info
Checks if anything is missing/superfluous Sunday, April 15, 12
Locking versions Versions are saved in carton.lock including dependencies Sunday,
April 15, 12
Easy Redeployment Reinstall exactly the same set of modules on
another prod/development machines. Sunday, April 15, 12
Single-file, VCS friendly You can add carton.lock to git update
whenever you update modules Sunday, April 15, 12
Safe and easy rollback revert the lock file and redeploy
Sunday, April 15, 12
Declaring CPAN dependencies Sunday, April 15, 12
CPAN Distributions: Makefile.PL or Build.PL Sunday, April 15, 12
Carton apps: cpanfile Sunday, April 15, 12
cpanfile Module::Install + CPAN::Meta Sunday, April 15, 12
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
WHY • Your applications are not CPAN dists. • GitHub
scripts • PaaS • DotCloud • Heroku • Stackato Sunday, April 15, 12
DEMO Sunday, April 15, 12
> cpanm Carton Sunday, April 15, 12
ܯࠂ It is beta software, some features are missing or
not working correctly (yet). Sunday, April 15, 12
TODO / Roadmap • Update specific modules • Make install
and bundle faster • Inject old versions / patched versions • Install from git SHA Sunday, April 15, 12
github.com/miyagawa/carton irc.perl.org #carton Sunday, April 15, 12
Sunday, April 15, 12
ʁ Sunday, April 15, 12
ँँʂ speakerdeck.com/u/miyagawa Sunday, April 15, 12