Just Code or How I learned to write code and stop worrying about the environment
-
Upload
enrique-sanchez -
Category
Software
-
view
548 -
download
0
description
Transcript of Just Code or How I learned to write code and stop worrying about the environment
![Page 1: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/1.jpg)
Just CodeHow I learned to write code and stop worrying
about the environment
![Page 2: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/2.jpg)
¡Hola !
Enrique SánchezTester & Automation EngineerPhD Student
![Page 3: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/3.jpg)
• Technical Team Leader y Responsable Técnico del Área de Testing en
!!!• Más de 3 años de experiencia en testing en empresas como !!
!• Evangelista BDD y Agile
¿Quién soy?
![Page 4: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/4.jpg)
¿Por qué esta charla?
![Page 5: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/5.jpg)
¿Cuántas veces hemos intentado probar un “juguete” nuevo y hemos dejado el ordenador lleno de basura?
¿Cuántas veces tenemos que luchar contra configs porque tenemos una versión de SO “especial”?
![Page 6: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/6.jpg)
¿Por qué si intentamos subir a producción/integrado/el ordenador de al lado un código que en nuestro local funciona pero que mágicamente deja de funcionar?
![Page 7: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/7.jpg)
¿¿¡¡Por qué no puedo sólo programar!!??
![Page 8: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/8.jpg)
Pongamos un Caso PrácticoEl extraordinario caso de Joan y Enric
![Page 9: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/9.jpg)
Joan y Enric son dos colegas que tienen una idea…
![Page 10: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/10.jpg)
Crear un programa con las tecnologías más
hipsters del momento y vendérselo a
![Page 11: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/11.jpg)
![Page 12: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/12.jpg)
Enseguida empiezan a pensar y les salen unas cuantas tecnologías que pueden usar:
![Page 13: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/13.jpg)
Tras arduas discusiones deciden que usarán un SO concreto para desarrollar
!
!
Y llevarán su aplicación a Amazon Web Services
![Page 14: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/14.jpg)
¿Problemas?
![Page 15: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/15.jpg)
Hacer pruebas ahí es muy caro
Tienen que estar conectados por ssh constantemente
Es un engorro tener que pusiera constantemente a un repo para hacer pruebas en remoto. ¿Qué pasa si se rompe algo?
![Page 16: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/16.jpg)
Virtualización
![Page 17: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/17.jpg)
Enric investiga por Internet y descubre algo llamado
![Page 18: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/18.jpg)
¿Qué es Vagrant?
![Page 19: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/19.jpg)
Vagrant es un gestor de máquinas virtuales
Permite provisionar las máquinas mediante un archivo de configuración llamado Vagrantfile
![Page 20: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/20.jpg)
Puede ser provisionado usando: Bash,Puppet,Chef,Docker…
![Page 21: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/21.jpg)
Permite tener versionado la forma en la que se provisiona una máquina (virtual o física)
Pueden hacer pruebas en local sin miedo a romper nada
![Page 22: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/22.jpg)
Además descubre una cosa llamada
![Page 23: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/23.jpg)
¿Qué es Packer?
![Page 24: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/24.jpg)
Packer is a tool for creating identical machine images for multiple platforms from a single source
configuration.
![Page 25: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/25.jpg)
Packer permite crear una máquina virtual precompilada
Puedes tener la misma versión para producción (Amazon) y para local (Vagrant)
![Page 26: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/26.jpg)
Packer +Vagrant + Puppet
Demo I
![Page 27: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/27.jpg)
![Page 28: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/28.jpg)
Joan y Enric están muy felices y contentos, tienen un entorno para jugar y hacer experimentos
Joan se encargará del Front y Enric del Back
![Page 29: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/29.jpg)
Joan decide usar y
!
Enric piensa que NodeJS es muy bonito pero que prefiere y que mejor usa
![Page 30: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/30.jpg)
Joan y Enric se paran a pensar y dibujan un esbozo de cómo sería la arquitectura
![Page 31: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/31.jpg)
Fron
t End
Back
End
Hype
Queu
eDB
![Page 33: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/33.jpg)
¿Cómo metemos esto en una VM?
![Page 34: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/34.jpg)
¿Puppet, Chef, Bash? Están bien para pequeñas cosas pero levantar un servicio es un “poco” más complejo de lo que parece
Además, ¿qué pasa si queremos que las BBDD estén en otra máquina?
![Page 35: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/35.jpg)
![Page 36: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/36.jpg)
Docker is an open platform for developers and sysadmins to build, ship, and run distributed
applications.
![Page 37: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/37.jpg)
Extiende LXC (contenedores que corren en paralelo sobre la misma máquina anfitriona)
No emula una máquina virtual completa ni corre un sistema operativo íntegro dentro de ella, a costa de quedar “atado” al sistema operativo anfitrión, que se expone a las aplicaciones
![Page 38: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/38.jpg)
![Page 39: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/39.jpg)
¿Cómo gestionan el software?
![Page 40: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/40.jpg)
![Page 41: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/41.jpg)
flow
![Page 42: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/42.jpg)
Vagrant + Puppet + Docker + stack
Demo II
![Page 43: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/43.jpg)
![Page 44: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/44.jpg)
Pero el código aumenta y hackear en paralelo a ver qué se consigue deja de ser una opción si quieren conseguir algo más estable.
![Page 45: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/45.jpg)
Pero el código aumenta y hackear en paralelo a ver qué se consigue deja de ser una opción si quieren conseguir algo más estable.
Integración
Continua
![Page 46: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/46.jpg)
¿Qué es IC?
![Page 47: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/47.jpg)
Continuous Integration is a software development practice where members of a
team integrate their work frequently (…)
Each integration is verified by an automated build (including test) to detect integration errors
as quickly as possible
![Page 48: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/48.jpg)
![Page 49: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/49.jpg)
Un job para Máster …
otro que pruebe Release …
otro para Develop/Rama …
![Page 50: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/50.jpg)
otro para desplegar el código en los entornos
![Page 51: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/51.jpg)
Una vez que el software funciona hay que desplegarlo en Amazon…
![Page 52: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/52.jpg)
Una vez que el software funciona hay que desplegarlo en Amazon…
Artefactos, versiones del front…
![Page 53: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/53.jpg)
![Page 54: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/54.jpg)
![Page 55: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/55.jpg)
Rock’n’roll
Demo III
![Page 56: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/56.jpg)
![Page 57: Just Code or How I learned to write code and stop worrying about the environment](https://reader036.fdocuments.us/reader036/viewer/2022081404/557bca0ed8b42a063d8b485f/html5/thumbnails/57.jpg)
Preguntas?Gracias!