In the desert, without a camel

57
In the Desert Without a Camel A devops journey, with very little Perl Steve Scaffidi [email protected] irc nick: hercynium YAPC::NA June 8, 2015 Salt Lake City, Utah

Transcript of In the desert, without a camel

Page 1: In the desert, without a camel

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

Page 2: In the desert, without a camel

The person who approved this talk has

been sacked.

Page 3: In the desert, without a camel

"It's not got much Perl in it!"

Page 4: In the desert, without a camel

Page 5: In the desert, without a camel

"Senior Software Engineer"Data Warehouse Team

at TripAdvisor

My job title...

Page 6: In the desert, without a camel

What people think I do:

Page 7: In the desert, without a camel

What I actually spend most of my time doing:

Page 8: In the desert, without a camel

The Best Tool for the Job

Page 9: In the desert, without a camel

The Best Tool for the Job

Not Always

Page 10: In the desert, without a camel

The Best Tool for the Job

Not Always

...but sometimes it is.

Page 11: In the desert, without a camel

Get on with it!

Page 12: In the desert, without a camel

Y U NO PERL?

Page 13: In the desert, without a camel

redhat/centos

Page 14: In the desert, without a camel

Solutions?

Page 15: In the desert, without a camel

perlbrew

http://perlbrew.pl

Page 16: In the desert, without a camel

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:

Page 17: In the desert, without a camel

perlbrew install-cpanm

For your convenience:

Page 18: In the desert, without a camel

perlbrew install perl-5.12.5perlbrew use perl-5.12.5

Go ahead, have another!

Page 19: In the desert, without a camel

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

Page 20: In the desert, without a camel

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

Page 21: In the desert, without a camel

cpanm

Page 22: In the desert, without a camel

fu-redhat

Page 23: In the desert, without a camel

curl -L https://cpanmin.us | perl - App::cpanminus

Page 24: In the desert, without a camel

WARNINGlocal::lib + perlbrew = pain

Page 25: In the desert, without a camel

cpanminus++

Page 26: In the desert, without a camel

carton

Page 27: In the desert, without a camel

# 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)

Page 28: In the desert, without a camel

Chicken & Egg?

Page 29: In the desert, without a camel

cpanm to the rescue!

Page 30: In the desert, without a camel

miyagawa++x 1,000,000

Page 31: In the desert, without a camel

"Please sir, I want some more"

Page 32: In the desert, without a camel

fatpack

Page 33: In the desert, without a camel

# "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

Page 34: In the desert, without a camel

use the cpan to develop, but don't

make your users have to

Page 35: In the desert, without a camel

Caveat: Pure-perl code *only*

Page 36: In the desert, without a camel

mst++

Page 37: In the desert, without a camel

PAR

Page 38: In the desert, without a camel

Caveat: complex, but very powerful.

But can pack XS modules and even perl itself into a single-file

executable!!!!!!

Page 39: In the desert, without a camel

audreyt++

Page 40: In the desert, without a camel

Generating OS Packages

Page 41: In the desert, without a camel

opt-perl.spechttps://gist.github.com/hercynium/7865220

Page 42: In the desert, without a camel

what about modules?

Page 43: In the desert, without a camel

fpm

https://github.com/jordansissel/fpm/wiki

https://github.com/jordansissel/fpm/wiki/Perl-Packaging-With-FPM

Page 44: In the desert, without a camel

fpm -t rpm -s cpan \ --cpan-perl-lib-path \ /opt/perl-5.16.1/site_perl/5.16.1 \ Some::Module

Page 45: In the desert, without a camel

Works with lots of languages!

Page 46: In the desert, without a camel

Segue

Page 47: In the desert, without a camel

NoPerl

Page 48: In the desert, without a camel

Bow to the JVM

Page 49: In the desert, without a camel

Snakes and Jewels

Page 50: In the desert, without a camel

But... Systems Administration!

Page 51: In the desert, without a camel

Y U NO PERL?

Page 52: In the desert, without a camel

No Habla Perl

Page 53: In the desert, without a camel

"DevOps"

Page 54: In the desert, without a camel

"DevOps"

Page 55: In the desert, without a camel

Systems Administration

unless ( Ops::Engineer->can("write_code") ) {

warn "Keep your filthy hands off my servers";

}

Page 56: In the desert, without a camel

OutOfMemoryError

Page 57: In the desert, without a camel

Thank You!