-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
502 lines (444 loc) · 14.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>It Works On My Machine</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/sky.css" id="theme">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match(/print-pdf/gi) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName('head')[0].appendChild(link);
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
<style>
.reveal section img {
background: none;
border: none;
box-shadow: none;
}
.logos img {
width: 25%
}
</style>
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h1>It Works On My Machine</h1>
<h3>Virtualizing Development</h3>
<p>
<small>by Eli Golding / <a href="mailto:eligolding@gmail.com">eligolding@gmail.com</a> / <a
href="http://twitter.com/eli_golding">@eli_golding</a></small>
</p>
</section>
<section>
<h1>Why Virtualize?</h1>
</section>
<section>
<section>
<h2>Traditional setup</h2>
<p>
Individual local development machines
</p>
</section>
<section>
<h2>new dev joins the team they must...</h2>
<p class="fragment roll-in">install web server (apache/nginx)...</p>
<p class="fragment roll-in">install PHP...</p>
<p class="fragment roll-in">install MySQL...</p>
<p class="fragment roll-in">install Redis, Memcache, NPM, RVM...</p>
<aside class="notes">If the dev is not a sysadmin, he might need a ton of help doing this.</aside>
</section>
<section>
<h2>we're not done...</h2>
<p class="fragment roll-in">configure all the things...</p>
<p class="fragment roll-in">get the code...</p>
<p class="fragment roll-in">attempt to serve the application...</p>
<p class="fragment roll-in">configure some more things to get it to work...</p>
</section>
<section>
<table>
<tr>
<td style="border-right: 1px #000000 solid">
<h3>Dev #1</h3>
<ul>
<li>Apache 2.2.15</li>
<li>PHP 5.5.4</li>
<li>MySQL 5.4.5</li>
</ul>
</td>
<td>
<h3>Dev #2</h3>
<ul>
<li>Apache 2.2.3</li>
<li>PHP 5.5.1</li>
<li>MySQL 5.4.3</li>
</ul>
</td>
</tr>
<tr>
<td style="border-right: 1px #000000 solid">
<h3>Dev #3</h3>
<ul>
<li>Apache 2.2.24</li>
<li>PHP 5.4.3</li>
<li>MySQL 5.2.5</li>
</ul>
</td>
<td>
<h3>Dev #4</h3>
<ul>
<li>Apache 2.1.8</li>
<li>PHP 5.3.24</li>
<li>MySQL 5.1.6</li>
</ul>
</td>
</tr>
</table>
</section>
</section>
<aside class="notes">
lets not forget about staging and production
</aside>
<aside class="notes">
and when they finally get a chance to code, the first push to prod results in...
</aside>
<section>
<img src="images/works-on-my-machine.jpg">
</section>
<section>
<img src="images/worked-in-dev.jpg">
</section>
<section>
<img src="images/automate-all-the-things.jpg">
</section>
<section class="logos">
<h2>IT Automation Tools</h2>
<img src="images/Puppet_Labs_Logo.png">
<img src="images/pic-chef-logo.png">
<img src="images/AnsibleLogo_transparent_web.png">
<aside class="notes">explain what a provisioner is!</aside>
</section>
<section>
<h2>Problems with using just a provisioner</h2>
<h3>Still bound to hardware</h3>
<p class="fragment">Can only have one setup</p>
<p class="fragment">Inflexible infrastructure</p>
<p class="fragment">Potential to cause problems with main OS</p>
<p class="fragment">Port conflicts</p>
<p class="fragment">Different type of machine than production</p>
<aside class="notes">explain what a provisioner is!</aside>
</section>
<section>
<img width="500" src="images/what-if-i-told-you.jpg">
</section>
<section>
<h2>Virtualization</h2>
<blockquote cite="http://en.wikipedia.org/wiki/Virtualization">
“Virtualization, in computing, refers to the act of creating a virtual (rather than actual)
version of something, including but not limited to a virtual computer hardware platform, operating
system (OS), storage device, or computer network resources.”
</blockquote>
<aside class="notes">A virtual machine is a software implementation of a computer, running a complete
operating system stack on a virtualizer. It is a full implementation of a computer with a virtual disk,
memory and CPU. The machine running the virtualizer is the Host system. The virtual machine running on
the virtualizer is the Guest system. As far as the Guest operating system is concerned, it is running on
real hardware. From the perspective of the Host, all of the Guest's resources are used by the virtualizer
program. A Box, or base image, is the prepackaged virtual machine that Vagrant will manage.</aside>
</section>
<section class="logos">
<h3>Virtualization Providers</h3>
<img src="images/VMware.png">
<img src="images/Virtualbox_logo.png">
<img src="images/docker-logo-long.png">
</section>
<section>
<h2>Virtualization the good parts</h2>
<ul style="vertical-align: middle; display: inline-block">
<li class="fragment">Multiple VMs on one machine</li>
<li class="fragment">Flexibility</li>
<li class="fragment">Doesn't mess up your host machine</li>
<li class="fragment">Dev == Production</li>
</ul>
</section>
<section>
<h2>Virtualization the not so good parts</h2>
<ul>
<li class="fragment">Setup is very time consuming</li>
<li class="fragment">Must distribute it</li>
<li class="fragment">Maintain and Update</li>
<li class="fragment">Redistribute</li>
</ul>
</section>
<section>
<img height="500" src="images/Vagrant.png">
</section>
<section>
<p>Vagrant is a command line tool that fully controls the creation and provisioning of virtual machines.</p>
<p class="fragment">Everything is configured in a single file (VagrantFile) that part of the project.</p>
<p class="fragment">Can be viewed as a wrapper around the VM provider and the provisioner.</p>
<p class="fragment">The VagrantFile is checked into version control, allowing for great portability.</p>
</section>
<section>
<h3>So now we have</h3>
<ul>
<li>Easy to share</li>
<li>Same exact version across all systems</li>
<li>Fast ramp up</li>
<li>"WORKS ON OUR MACHINE"</li>
</ul>
</section>
<section>
<section>
<h2>VagrantFile</h2>
<pre><code class="ruby" contenteditable>
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.synced_folder ".", "/var/www"
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get install -y apache2
SHELL
end
</code></pre>
</section>
<section>
<h2>Box</h2>
<pre><code class="ruby" contenteditable>
config.vm.box = "ubuntu/trusty64"
</code></pre>
<p>Configures the base box of the machine. Value should be the name of an installed box or a shorthand name of a box in HashiCorp's Atlas.</p>
<aside class="notes">box_url</aside>
</section>
<section>
<h2>Network</h2>
<pre><code class="ruby" contenteditable>
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "private_network", ip: "192.168.33.10"
</code></pre>
<p>Configures networks on the machine.</p>
</section>
<section>
<h2>Synced Folder</h2>
<pre><code class="ruby" contenteditable>
config.vm.synced_folder ".", "/var/www"
</code></pre>
<p>Synced folders enable Vagrant to sync a folder on the host machine to the guest machine, allowing
you to continue working on your project's files on your host machine.</p>
</section>
<section>
<h2>Provision</h2>
<pre><code class="ruby" contenteditable>
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get install -y apache2
SHELL
</code></pre>
<p>Set the Provisioners that will automatically install software, alter configurations, and more on the machine as part of the vagrant up process.</p>
</section>
</section>
<section>
<h2>Vagrant Commands</h2>
<ul style="list-style: none;">
<li class="fragment"><b><em>vagrant up:</em></b> start a new instance of the VM</li>
<li class="fragment"><b><em>vagrant suspend:</em></b> save state of the running VM</li>
<li class="fragment"><b><em>vagrant resume:</em></b> restart suspended VM</li>
<li class="fragment"><b><em>vagrant halt:</em></b> powers off VM</li>
<li class="fragment"><b><em>vagrant reload:</em></b> reboot VM</li>
<li class="fragment"><b><em>vagrant destroy:</em></b> Completely deletes the machine</li>
</ul>
</section>
<section>
<img src="images/live-coding.jpg">
</section>
<section>
<img src="images/pic-chef-logo.png">
<h2>Infrastructure as Code</h2>
</section>
<section>
<h2>Resource</h2>
<p>Represents a piece of your infrastructure and it's desired state.</p>
</section>
<section>
<section><h2>Common Resources</h2></section>
<section>
<h3>Running a Command</h3>
<pre><code class="ruby">
execute "composer-install" do
cwd '/var/www/app'
command "composer install"
end
</code></pre>
</section>
<section>
<h3>Changing directory permissions</h3>
<pre><code class="ruby">
directory "/vagrant/app/cache" do
owner "vagrant"
group "vagrant"
mode 0777
action :create
end
</code></pre>
</section>
<section>
<h3>Creating a symlink</h3>
<pre><code class="ruby">
link "/etc/nginx/sites-enabled/my-cool-site" do
to "/etc/nginx/sites-available/my-cool-site"
end
</code></pre>
</section>
<section>
<h3>Running apt-get update</h3>
<pre><code class="ruby">
execute "apt-get update" do
command "apt-get update"
end </code></pre>
</section>
<section>
<h3>Installing a package</h3>
<pre><code class="ruby">
apt_package "curl" do
action :install
end
</code></pre>
</section>
<section>
<h3>Installing multiple packages</h3>
<pre><code class="ruby">
php_packages = ['php5-cli','php5-curl','php5-mysql']
php_packages.each do |p|
apt_package p do
action :install
end
end
</code></pre>
</section>
<section>
<h3>Applying a template</h3>
<pre><code class="ruby">
template "/etc/nginx/sites-available/my-awesome-site" do
source "vhost.erb"
variables({
:doc_root => '/var/www',
:server_name => 'vagrant.rox'
})
action :create
notifies :restart, resources(:service => "nginx")
end
</code></pre>
<pre><code>
server {
listen 80;
root <%= @doc_root %>;
index index.html index.php;
server_name <%= @server_name %>;
location / {
try_files $uri $uri/ /index.php;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
</code></pre>
</section>
</section>
<section>
<h2>Recipe</h2>
<p>Configuration file that describes resources and their desired state.</p>
</section>
<section>
<h2>Cookbook</h2>
<p>Recipes are stored in cookbooks.</p>
<p>Cookbook contain recipes, template, files, custom resources, etc.</p>
</section>
<section>
<img src="images/live-coding.jpg">
</section>
<section>
<blockquote>"If you want to increase innovation, you have to lower the cost of failure."</blockquote>
<ul style="list-style: none;">
<li>Joi Ito</li>
<li>Director, MIT Media Lab</li>
</ul>
</section>
<section>
<img src="images/automate-all-the-things.jpg">
</section>
<section>
<h3>Questions?</h3>
<img style="width: 60%" src="images/questions.png">
</section>
<section>
<img src="images/thankyou_Arizona.png">
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [
{
src: 'lib/js/classList.js', condition: function () {
return !document.body.classList;
}
},
{
src: 'plugin/markdown/marked.js', condition: function () {
return !!document.querySelector('[data-markdown]');
}
},
{
src: 'plugin/markdown/markdown.js', condition: function () {
return !!document.querySelector('[data-markdown]');
}
},
{
src: 'plugin/highlight/highlight.js', async: true, condition: function () {
return !!document.querySelector('pre code');
}, callback: function () {
hljs.initHighlightingOnLoad();
}
},
{src: 'plugin/zoom-js/zoom.js', async: true},
{src: 'plugin/notes/notes.js', async: true}
]
});
</script>
</body>
</html>