carton
cph.pm, 2013-01-29
lars@thegler.dk
server




         app
server




         app   app
server




         modules



             app   app
server

         perl

                modules



                    app   app
Parent’s dilemma


“Mommy, I want perl-5.8.8 and Mason!”
“But *I* want Mojolicius! And perl-5.10.1! And a pony!”
<sigh> “Can’t you two just stop fighting for 5 minutes?”
Dependency management


Divide & conquer
Keep it simple, stupid
Don’t trample the other’s feet
server         server         physical
                              virtual
                              - VMWare
                              - jails
 perl           perl          - Xen
                              - Virtualbox

 modules        modules


         app            app
server

  perl         perl         perlbrew
                            plenv

   modules      modules



         app          app
server

         perl

           modules    modules   local::lib
                                Fatpacker
                                carton


                app     app
carton

miyagawa-ware

alpha! ☠

Last commit in github: 2012-05-11 ☹
A great software that definitely needs more love from
the author. It's not "stalled" per se.
                                 -- miyagawa, 2013-01-25
carton


Latest version 0.9.4
Latest dev version 0.9_7 (read: 0.9.7)
carton philosophy

project-private module repo
repeatable module versions
wrapper around cpanm
mix’n’match with perlbrew & local::lib
Tracking dependencies
           # cpanfile
           requires 'Plack', 0.9980;
           requires 'Starman', 0.2000;

           $ carton install



Modules installed into ./local/ dir.
Dependency info saved in ./carton.lock file.
Deployment
Copy tree to remote location,
skipping ./local/ dir

         $ carton install
Carton now installs versions
set in ./carton.lock file,
into ./local/ dir.
Bundling

Don’t even need to have net access:
$ carton bundle
fetches tarballs into ./local/cache/ dir
Copy tree to remote location, and:
$ carton install --cached
installs from there
Bundling, with DarkPAN

Add your own tarballs to ./local/cache/ dir
Copy tree to remote location, and:
$ carton install --cached
installs from there, with your own DPAN modules
Housekeeping

$ carton list
 List tracked deps in carton.lock file
$ carton check
 Check for missing and unsused modules
$ carton install Foo:Bar
 Fetch & install module ad-hoc
Trial by fire

 $ carton exec -- perl myscript.pl
  Execute in isolated carton local environment
  Excludes .../site-perl/...
  Adds local/lib/perl5/ and .
perlbrew and local::lib

 Development environment
   perlbrew lib (using local::lib)
 Co-development and production environment
   carton
Thanks


Yes, slides will be on slideshare
Other questions?

Carton

  • 1.
  • 2.
  • 3.
    server app app
  • 4.
    server modules app app
  • 5.
    server perl modules app app
  • 6.
    Parent’s dilemma “Mommy, Iwant perl-5.8.8 and Mason!” “But *I* want Mojolicius! And perl-5.10.1! And a pony!” <sigh> “Can’t you two just stop fighting for 5 minutes?”
  • 7.
    Dependency management Divide &conquer Keep it simple, stupid Don’t trample the other’s feet
  • 8.
    server server physical virtual - VMWare - jails perl perl - Xen - Virtualbox modules modules app app
  • 9.
    server perl perl perlbrew plenv modules modules app app
  • 10.
    server perl modules modules local::lib Fatpacker carton app app
  • 11.
    carton miyagawa-ware alpha! ☠ Last commitin github: 2012-05-11 ☹ A great software that definitely needs more love from the author. It's not "stalled" per se. -- miyagawa, 2013-01-25
  • 12.
    carton Latest version 0.9.4 Latestdev version 0.9_7 (read: 0.9.7)
  • 13.
    carton philosophy project-private modulerepo repeatable module versions wrapper around cpanm mix’n’match with perlbrew & local::lib
  • 14.
    Tracking dependencies # cpanfile requires 'Plack', 0.9980; requires 'Starman', 0.2000; $ carton install Modules installed into ./local/ dir. Dependency info saved in ./carton.lock file.
  • 15.
    Deployment Copy tree toremote location, skipping ./local/ dir $ carton install Carton now installs versions set in ./carton.lock file, into ./local/ dir.
  • 16.
    Bundling Don’t even needto have net access: $ carton bundle fetches tarballs into ./local/cache/ dir Copy tree to remote location, and: $ carton install --cached installs from there
  • 17.
    Bundling, with DarkPAN Addyour own tarballs to ./local/cache/ dir Copy tree to remote location, and: $ carton install --cached installs from there, with your own DPAN modules
  • 18.
    Housekeeping $ carton list List tracked deps in carton.lock file $ carton check Check for missing and unsused modules $ carton install Foo:Bar Fetch & install module ad-hoc
  • 19.
    Trial by fire $ carton exec -- perl myscript.pl Execute in isolated carton local environment Excludes .../site-perl/... Adds local/lib/perl5/ and .
  • 20.
    perlbrew and local::lib Development environment perlbrew lib (using local::lib) Co-development and production environment carton
  • 21.
    Thanks Yes, slides willbe on slideshare Other questions?