in the desert, without a camel
TRANSCRIPT
In the DesertWithout a Camel
A devops journey, with very little Perl
Steve [email protected] nick: hercynium
YAPC::NAJune 8, 2015
Salt Lake City, Utah
The person who approved this talk has
been sacked.
"It's not got much Perl in it!"
☺
"Senior Software Engineer"Data Warehouse Team
at TripAdvisor
My job title...
What people think I do:
What I actually spend most of my time doing:
The Best Tool for the Job
The Best Tool for the Job
Not Always
The Best Tool for the Job
Not Always
...but sometimes it is.
Get on with it!
Y U NO PERL?
redhat/centos
Solutions?
curl -L http://install.perlbrew.pl | bash
source ~/perl5/perlbrew/etc/bashrc
perlbrew install perl-5.22.0
perlbrew use perl-5.22.0
Insanely Simple:
perlbrew install-cpanm
For your convenience:
perlbrew install perl-5.12.5perlbrew use perl-5.12.5
Go ahead, have another!
perlbrew use 5.22cpan Moose # wait a little bit
perlbrew use 5.12.5cpan Moose # wait a bit longer
cpan Dist::Zilla # go out for lunch
Share with others:
export PERLBREW_ROOT=/opt/perlbrewexport PERLBREW_HOME=/tmp/.perlbrew
# put perlbrew perls under /opt to# share with multiple userscurl -L http://install.perlbrew.pl | bash
cpanm
fu-redhat
curl -L https://cpanmin.us | perl - App::cpanminus
WARNINGlocal::lib + perlbrew = pain
cpanminus++
carton
# On your development environment> cat cpanfilerequires 'Plack', '0.9980';requires 'Starman', '0.2000';
> carton install> git add cpanfile cpanfile.snapshot> git commit -m "add Plack and Starman"
# Other developer's machine,# or on a deployment box> carton install> carton exec starman -p 8080 myapp.psgi
(blatantly copied from carton's perldoc)
Chicken & Egg?
cpanm to the rescue!
miyagawa++x 1,000,000
"Please sir, I want some more"
fatpack
# "myscript" is using cpan deps that need to# be installed by the user first...
fatpack pack myscript.pl > myscript.packed.pl
# "myscript.packed" can just be run by anybody
chmod +x myscript.packed.pl./myscript.packed.pl
use the cpan to develop, but don't
make your users have to
Caveat: Pure-perl code *only*
mst++
PAR
Caveat: complex, but very powerful.
But can pack XS modules and even perl itself into a single-file
executable!!!!!!
audreyt++
Generating OS Packages
opt-perl.spechttps://gist.github.com/hercynium/7865220
what about modules?
fpm
https://github.com/jordansissel/fpm/wiki
https://github.com/jordansissel/fpm/wiki/Perl-Packaging-With-FPM
fpm -t rpm -s cpan \ --cpan-perl-lib-path \ /opt/perl-5.16.1/site_perl/5.16.1 \ Some::Module
Works with lots of languages!
Segue
NoPerl
Bow to the JVM
Snakes and Jewels
But... Systems Administration!
Y U NO PERL?
No Habla Perl
"DevOps"
"DevOps"
Systems Administration
unless ( Ops::Engineer->can("write_code") ) {
warn "Keep your filthy hands off my servers";
}
OutOfMemoryError
Thank You!