-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
252 lines (223 loc) · 8.32 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AWS para tiesos, introducción a Serverless</title>
<meta name="description" content="AWS para tiesos, introducción a Serverless">
<meta name="author" content="Alberto Fernandéz Valiente">
<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">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/moon.css" id="theme">
<!-- Theme used for syntax highlighting of code -->
<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]-->
</head>
<body>
<div class="reveal">
<div class="slides">
<section data-background-image="img/ayesa.png" data-background-size="15%" data-background-position="75% 90%">
<h1>AWS para tiesos</h1>
<h3>Introducción a Serverless</h3>
<p>
<small>Por Alberto Fernández Valiente</small>
</p>
</section>
<section>
<h2>Primero un poco de historia</h2>
<ul class="fragment">
<li>Servidores tradicionales</li>
<li class="fragment">Servidores virtualizados</li>
<li class="fragment">La nube (IaaS)</li>
<li class="fragment">Contenedores</li>
<li class="fragment">Serverless (FaaS)</li>
</ul>
</section>
<section>
<h2>Contenedores VS Funciones</h2>
<p class="fragment">Mucho en común</p>
<ul class="fragment">
<li>Facilidad de escalado</li>
<li class="fragment">Autocontenido</li>
<li class="fragment">Simplicidad de administración</li>
</ul>
</section>
<section>
<h2>Contenedores VS Funciones</h2>
<table class="fragment">
<thead>
<th></th>
<th>Docker</th>
<th>Lambda</th>
</thead>
<tbody>
<tr>
<td>Actualizaciones de seguridad</td>
<td>Si</td>
<td>No</td>
</tr>
<tr class="fragment">
<td>Estandarización</td>
<td>Si</td>
<td>No (CNCF)</td>
</tr>
<tr class="fragment">
<td>Persistencia</td>
<td>Si</td>
<td>No</td>
</tr>
<tr class="fragment">
<td>Portabilidad</td>
<td>Si</td>
<td>No</td>
</tr>
<tr class="fragment">
<td>Estructura de coste</td>
<td>Autoescalable</td>
<td>Totalmente dinámica</td>
</tr>
</tbody>
</table>
</section>
<section>
<h2>¿Qué es Serverless?</h2>
<ul class="fragment">
<li>Orientado a eventos</li>
<li class="fragment">Sin estado</li>
<li class="fragment">Estructura de costes</li>
<li class="fragment">Microservicios o Nanoservicios</li>
</ul>
</section>
<section>
<h2>Proveedores FaaS</h2>
<ul>
<li>AWS Lambda</li>
<li>IBM Cloud Functions (Apache OpenWhisk)</li>
<li>Azure Functions (Experimental)</li>
<li>Google Cloud Functions (Beta)</li>
</ul>
</section>
<section>
<h2>Características de AWS Lambda</h2>
<ul class="fragment">
<li>Generosa capa gratuita</li>
<li class="fragment">Muchos origenes de eventos</li>
<li class="fragment">Serverless Application Repository</li>
</ul>
</section>
<section>
<h2>Limitaciones de AWS Lambda</h2>
<ul class="fragment">
<li>Duración máxima de 300 segundos</li>
<li class="fragment">Tamaño máximo de memoria 3008 MB</li>
<li class="fragment">Tamaño máximo de Zip 50 MB</li>
<li class="fragment">Carpeta temporal de 512 MB</li>
<li class="fragment">1000 ejecuciones concurrentes por región</li>
</ul>
</section>
<section>
<h2>Estructura</h2>
<pre>
+ demo-lambda
+ psycopg2
- exclude.lst
- create_and_publish.sh
- configure.sh
- deploy.sh
- invoke.sh
- handler.py
- connection.py
- logger.py
- test_connection.py
</pre>
</section>
<section>
<h2>Crear funciones a mano</h2>
<pre>
zip -r demo.zip * [email protected]
aws lambda create-function --function-name python-sevilla-demo
--runtime python3.6 --handler handler.handler
--role arn:aws:iam::xxxxxxxxxxxx:role/python-sevilla-role
--tags "Project=PythonSevilla, Service=Demo, Stage=DEV"
--description "Lambda de prueba"
--timeout 15 --publish --zip-file fileb://demo.zip
</pre>
</section>
<section>
<h2>Configurar funciones</h2>
<pre>
aws lambda update-function-configuration
--function-name python-sevilla-demo
--environment '{"Variables":{"CONN_STRING":"dbname=test host=test.xxxxxxxxxx.eu-west-1.rds.amazonaws.com port=5432 user=xxxxxxxx password=xxxxxxxxx"}}'
</pre>
</section>
<section>
<h2>Invocar la función</h2>
<pre>
aws lambda invoke --function-name python-sevilla-demo
--payload '{"campo_1":"test_1", "campo_2":"test_2", "campo_3":"test_3"}'
results.log
cat results.log
</pre>
</section>
<section>
<h2>Desplegar una nueva versión</h2>
<pre>
zip -r demo.zip * [email protected]
aws lambda update-function-code --function-name python-sevilla-demo
--publish --zip-file fileb://demo.zip
</pre>
</section>
<section>
<h2>Frameworks</h2>
<ul>
<li><a href="https://serverless.com/">serverless</a></li>
<li><a href="https://www.zappa.io/">zappa</a></li>
<li><a href="https://chalice.readthedocs.io/en/latest/">chalice</a></li>
<li><a href="http://apex.run/">apex</a></li>
</ul>
</section>
<section>
<h1>Enlaces</h1>
<p><a href="https://stacksense.io/krishnan/platforms/the-maturity-of-functions-as-a-service/">stacksense.io/krishnan/platforms/the-maturity-of-functions-as-a-service</a></p>
<p><a href="https://www.fullstackpython.com/serverless.html">www.fullstackpython.com/serverless.html</a></p>
<p><a href="https://blog.bluesoftglobal.com/microservices-on-aws/">blog.bluesoftglobal.com/microservices-on-aws</a></p>
<p><a href="https://serverless.email/">serverless.email</a></p>
<p><a href="https://github.com/voodmania/demo-lambda">demo</a></p>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// More info https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: false,
progress: true,
history: true,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// More info https://github.com/hakimel/reveal.js#dependencies
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, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true },
{ src: 'plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html>