"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
Infrastructure as Software - PuppetConf 2014
1. Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
INFRASTRUCTURE AASS SSOOFFTTWWAARREE
Dustin J. Mitchell
dustin@mozilla.com
Sept 24, 2014
1 of 37 09/24/2014 03:32 PM
2. Infrastructure as Software CCOODDEE http://people.v.igoro.us/~dustin/ias-slides/index.h...
2 of 37 09/24/2014 03:32 PM
3. CCOODDEE == SSNNIIPPPPEETT
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
var width=150; // width of the eyes in pixels
var colour="#06f"; // colour of the eye - bluey green in this case
var iris="#000"; // colour of the iris (normally black);
/***************************
* Moving Eyeballs Effect *
*(c)2012-3 mf2fm web-design *
* http://www.mf2fm.com/rv *
* DON'T EDIT BELOW THIS BOX *
***************************/
var swide=800;
function addLoadEvent(funky) {
var oldonload=window.onload;
if (typeof(oldonload)!='function') window.onload=funky;
else window.onload=function() {
...
3 of 37 09/24/2014 03:32 PM
4. CCOODDEE == SSNNIIPPPPEETT
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
# == Class: baseconfig
##
Performs initial configuration tasks for all Vagrant boxes.
# class baseconfig {
exec { 'apt-get update':
command => '/usr/bin/apt-get update';
}
host { 'hostmachine':
ip => '192.168.0.1';
}
file {
'/home/vagrant/.bashrc':
owner => 'vagrant',
group => 'vagrant',
mode => '0644',
source => 'puppet:///modules/baseconfig/bashrc';
}
}
4 of 37 09/24/2014 03:32 PM
6. “My friend Clift Norris has identified a fundamental constant
that I call Norris’ number, the average amount of code an
untrained programmer can write before he or she hits a wall. Clift
estimates this as 1,500 lines. Beyond that the code becomes so
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
tangled that the author cannot debug or modify it without
herculean effort.”
John D. Cook
--
6 of 37 09/24/2014 03:32 PM
7. SSOOFFTTWWAARREE IINN PPUUPPPPEETT??
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
Let me tell you a story..
7 of 37 09/24/2014 03:32 PM
8. tinyurl.MMEEEETT PPUUPPPPEETTAAGGAAIINN com/puppetagain
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
Open Source
Written in Puppet
Cross-Platform
Highly Available
Secure
Designed to Manage Job-Runners
8 of 37 09/24/2014 03:32 PM
10. OPENSTACK Infrastructure as Software AARRCCHHhttIIpTT://pEEeCoCplTTe.vUU.igRRoroEE.us/~dustin/ias-slides/index.h...
10 of 37 09/24/2014 03:32 PM
11. AAPPPPRROOAACCHHAABBIILLIITTYY
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
If I change this, what will happen?
Where should I start reading code?
11 of 37 09/24/2014 03:32 PM
12. PUPPETAGAIN: TTOOPPLLEEVVEELL
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
class toplevel::base {
include users::root
} class toplevel::server inherits toplevel::base {
include puppet::periodic
include cron
} class toplevel::server::mozpool inherits toplevel::server {
include bmm
include mozpool
}
12 of 37 09/24/2014 03:32 PM
13. PUPPETAGAIN: TTOOPPLLEEVVEELL
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
node "mobile-imaging1.p1.releng.scl3.mozilla.com" {
include toplevel::server::mozpool
}
13 of 37 09/24/2014 03:32 PM
14. PUPPETAGAIN: CCOONNFFIIGGUURRAATTIIOONN
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
# modules/config/manifests/base.pp
class config::base {
$ntp_server = ''
}#
manifests/moco-config.pp
class config inherits config::base {
$ntp_server = 'time.mozilla.org'
}
14 of 37 09/24/2014 03:32 PM
15. PUPPETAGAIN: CCOONNFFIIGGUURRAATTIIOONN
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
class ntp::config {
include ::config
if ($::config::ntp_server) {
..
}
}
15 of 37 09/24/2014 03:32 PM
16. SSOOFFTTWWAARREE
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
Architectural models
Controlled Interdependencies
16 of 37 09/24/2014 03:32 PM
17. Infrastructure as Software AAPPAACCHHEE:: MMOOhDDttUpU://LLpeEEopSSle.v.igoro.us/~dustin/ias-slides/index.h...
17 of 37 09/24/2014 03:32 PM
18. PPUUPPPPEETTAAGGAAIINN:: DDIIRRSS
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
class dirs::builds {
file { "/builds": ensure => directory; }
} class dirs::builds::slave {
include dirs::builds
file { "/builds/slave": ensure => directory; }
}
18 of 37 09/24/2014 03:32 PM
19. PPUUPPPPEETTAAGGAAIINN:: DDIIRRSS
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
class talos {
include dirs::builds::slave
file {
"/builds/slave/talos-slave":
ensure => directory;
}
}
19 of 37 09/24/2014 03:32 PM
20. SSOOFFTTWWAARREE
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
Architectural models
Controlled Interdependencies
Organizing Principles
20 of 37 09/24/2014 03:32 PM
21. PA: PRINCIPLE OOFF LLEEAASSTT SSUURRPPRRIISSEE
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
.. installs mig-agent .. or dies trying
include mig_agent::install
21 of 37 09/24/2014 03:32 PM
22. PA: PRINCIPLE OOFF LLEEAASSTT SSUURRPPRRIISSEE
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
class mig_agent::install {
case $operatingsystem {
CentOS: { .. }
default: {
fail("Cannot install on $operatingsystem")
}
}
}
22 of 37 09/24/2014 03:32 PM
23. SSOOFFTTWWAARREE
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
Architectural models
Controlled Interdependencies
Organizing Principles
Abstractions
23 of 37 09/24/2014 03:32 PM
24. PPUUPPPPEETT:: PPAACCKKAAGGEESS
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
Write once, run everywhere, right?
package {
'httpd':
ensure => '2.2.15';
}
24 of 37 09/24/2014 03:32 PM
28. CCHHAALLLLEENNGGEESS
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
Package repositories are part of the code
28 of 37 09/24/2014 03:32 PM
29. RREEPPOOSSIITTOORRIIEESS::
PPIINNNNIINNGG IISS HHAARRDD
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
Un-specified prerequisite packages aren't pinned
Can confuse package managers
Modifying the repo makes production changes
29 of 37 09/24/2014 03:32 PM
30. RREEPPOOSSIITTOORRIIEESS::
MMIIRRRROORRIINNGG IISS HHAARRDD
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
“Can we update mirrors now?”
“No.”
30 of 37 09/24/2014 03:32 PM
32. RREEPPOOSSIITTOORRIIEESS::
TTHHEEYY''RREE HHUUGGEE
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
[root@releng-puppet2.srv.releng.scl3.mozilla.com dmitchell]# df -h /data
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_relengpuppet2-lv_data
414G 315G 78G 81% /data
32 of 37 09/24/2014 03:32 PM
33. CCHHAALLLLEENNGGEESS
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
Package repositories are part of the code
Interactions are hard to model
33 of 37 09/24/2014 03:32 PM
34. MMOODDUULLEE IINNTTEERRAACCTTIIOONNSS
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
'httpd' module installs Apache
'rsyslog' module installs rsyslog
When both are installed, we want to send access logs to rsyslog
34 of 37 09/24/2014 03:32 PM
35. MMOODDUULLEE IINNTTEERRAACCTTIIOONNSS
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
Httpd has to know about rsyslog?
class httpd::logging {
include rsyslog::config_dir
file {
"${rsyslog::config_dir::dir}/httpd.conf":
content => template("${module_name}/rsyslogd_httpd.conf.erb");
}
}
35 of 37 09/24/2014 03:32 PM
36. CCHHAALLLLEENNGGEESS
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
Package repositories are part of the code
Interactions are hard to model
Acceptance-level testing is hard
36 of 37 09/24/2014 03:32 PM
37. GGOO FFOORRTTHH AANNDD
WWRRIITTEE SSOOFFTTWWAARREE
Infrastructure as Software http://people.v.igoro.us/~dustin/ias-slides/index.h...
37 of 37 09/24/2014 03:32 PM