We are living in a constantly changing world with increasing IT challenges both in size and complexity. Sorting out these challenges and turning them into opportunities requires a creative, adaptable, and effectively allocated team. Understanding underlying differences in diverse teams, such as differences in functional background, education, or personality, can facilitate creativity or group problem solving—but only when a group process is well defined. In this talk we will explore the idea of group process and diversity beyond race/ethnicity, gender, or age.
1. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
INTEGRATION TESTS &
CONTAINERS
A SUCCESS STORY!
2. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
3. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
INTEGRATION TESTS &
CONTAINERS
HEROIC DRAMA
4. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
INTEGRATION TESTS
5. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
6. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
LHC : Testing facilities
7. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
OCTOBER 2008
8. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
OCTOBER 2008
9. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
OCTOBER 2008
10. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
OCTOBER 2008
✓24 dipole magnets of 30
dipole magnets
11. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
CONTAINERS
12. “ “
@ i x c h e l r u i z # Vo x x e d D a y s B a n ff
Write once, run everywhere
WORE
13. “ “
@ i x c h e l r u i z # Vo x x e d D a y s B a n ff
Package Once, Deploy Anywhere
PODA
14. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
Development
Production
Tests
15. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
PROJECT “HYDRA”
PRODUCT
16. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
PROJECT “HYDRA” DATA SHEET
Server : Spring-boot v1.5.1
Client : (2) Webapps polymer v 0.5 - v 2.0
Product: Griffon 2.3.0 Application : JavaFX (UI)
Build tool : Gradle v3.5
Database: H2 & Postgresql 9.4
VC Database: Flyway
17. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
PROJECT “HYDRA” DATA SHEET
Server : Spring-boot v1.5.1
Client : (2) Webapps polymer v 0.5 - v 2.0
Product: Griffon 2.3.0 Application : JavaFX (UI)
Build tool : Gradle v3.5
Database: H2 & Postgresql 9.4
VC Database: Flyway
Production
Development
18. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
H2 POSTGRES
19. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
H2
✓In memory database
✓Spring-boot integration
✓Easy to setup
20. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
BUT
✓is not Production
✓(compatibility mode is not
enough)
21. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
USE POSTGRES
CONTAINERS
22. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
Development
Production
Tests
23. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
COMMAND LINE
24. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
$ docker run --name my_psql
→ -e POSTGRES_PASSWORD_FILE=/postgres_password
→ -e POSTGRES_USER=psql_user
→ -e POSTGRES_DB=psql_db
→ -v /Users/ixchelruiz/.config/postgres_passwd:/postgres_password
→ -p 5432:5432
→ -d postgres:9.4
25. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
DOCKER-COMPOSE
26. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
DOCKER-COMPOSE.YML
version: '3.1'
services:
db:
image: postgres:9.4
restart: always
environment:
POSTGRES_USER: psql_user
POSTGRES_PASSWORD_FILE: /postgres_password
POSTGRES_DB: psql_db
ports:
- "5432:5432"
volumes:
- /Users/ixchelruiz/.config/postgres_passwd:/postures_password
27. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
Success!
Developers
28. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
CLIENT ENVIRONMENTS
29. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
POSTGRESQL CONFIGURATION
30. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
CLIENT
✓Postgres configuration for
different environments
✓ Test
✓ User acceptance
✓ Production
31. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
REVIEW IDEAS
32. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
DEVOPS
33. “ “
@ i x c h e l r u i z # Vo x x e d D a y s B a n ff
Snowflake server vs Phoenix server
— Martin Fowler
Puppy
34. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
SNOWFLAKE PUPPY
✓Evolve with time
✓“unique and special”
✓Difficult to reproduce
✓ Nurse back to health
35. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
PHOENIX SERVER
✓Automatization tools
✓Security patches
✓Configuration
36. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
PHOENIX SERVER
✓Automatization tools
✓Security patches
✓Configuration
Base Images
37. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
GRADLE / MAVEN
DISCLAIMER
38. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
GRADLE-DOCKER-PLUGIN
39. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
https://github.com/bmuschko/gradle-docker-plugin
40. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
CREATE CUSTOM IMAGES
OVERKILL?
41. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
CREATE CUSTOM IMAGES
OVERKILL?
YEAH!! KIND OF.. BUT
42. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
apply plugin: 'com.bmuschko.docker-remote-api'
import com.bmuschko.gradle.docker.tasks.image.Dockerfile
import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
task createDockerfile(type: Dockerfile) {
destFile = project.file('build/mydockerfile/Dockerfile')
from 'ubuntu:12.04'
maintainer 'Benjamin Muschko "benjamin.muschko@gmail.com"'
}
task buildImage(type: DockerBuildImage) {
dependsOn createDockerfile
inputDir = createDockerfile.destFile.parentFile
tag = 'bmuschko/myimage:latest'
}
43. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
Success
Infrastructure
44. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
AND NOW
THE PROJECT
45. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
AND NOW
THE PROJECT
YAY!!
46. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
PROJECT “HYDRA” DATA SHEET
Server : Spring-boot v1.5.1
Client : (2) Webapps polymer v 0.5 - v 2.0
Product: Griffon 2.3.0 Application : JavaFX (UI)
Build tool : Gradle v3.5
Database: H2 & Postgresql 9.4
VC Database: Flyway
Production
Development
BO
M
47. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
FLYWAY
VERSION CONTROL FOR YOUR DATABASE.
48. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
MIGRATE
SCHEMA & DATA
49. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
MIGRATE
SCHEMA & DATA
50. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
✓ New Release
✓ Flyway migrating schemas &
data
51. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
OPPSSS!
✓ New Release
✓ Flyway migrating schemas &
data
✓I made a bubu
52. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
TEST
53. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
TEST
LOCALLY
54. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
TEST
LOCALLY
MIGRATION SCHEMA & DATA
55. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
TEST
LOCALLY
MIGRATION SCHEMA & DATA
SANITY CHECK
56. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
DOCKER-COMPOSE
57. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
DOCKER-COMPOSE.YML (VERSION 1)
version: '3.1'
services:
db:
image: postgres:9.4
restart: always
environment:
POSTGRES_USER: psql_user
POSTGRES_PASSWORD_FILE: /postgres_password
POSTGRES_DB: psql_db
ports:
- "5432:5432"
volumes:
- /Users/ixchelruiz/.config/postgres_passwd:/postures_password
healtcheck:
test: ["CMD-SHELL", "pg_isready -U postgres”]
web:
image: tomcat:8-jre8
ports: 8080
depends_on:
- db
58. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
OR
WAIT FOR IT!
59. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
DOCKER-COMPOSE.YML
version: '3.1'
services:
db:
image: postgres:9.4
restart: always
environment:
POSTGRES_USER: psql_user
POSTGRES_PASSWORD_FILE: /postgres_password
POSTGRES_DB: psql_db
ports:
- "5432:5432"
volumes:
- /Users/ixchelruiz/.config/postgres_passwd:/postures_password
web:
depends_on:
- db
command: ["./wait-for-it.sh", "db:5432", "--", “cmd"]
60. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
DOCKER-COMPOSE-PLUGIN
(GRADLE)
61. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
https://github.com/avast/gradle-docker-compose-plugin
62. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
buildscript {
dependencies {
classpath "com.avast.gradle:gradle-docker-compose-plugin:$version"
}
}
apply plugin: 'docker-compose'
dockerCompose.isRequiredBy(test)
63. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
Success
Developers
64. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
INTEGRATION TEST
CI : WITH A TWIST!
65. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
CI
✓Port conflict
✓Environment variables
66. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
DOCKER-COMPOSE-PLUGIN
(GRADLE)
67. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
buildscript {
dependencies {
classpath "com.avast.gradle:gradle-docker-compose-plugin:$version"
}
}
apply plugin: 'docker-compose'
dockerCompose.isRequiredBy(test)
test.doFirst {
// exposes "${serviceName}_HOST" and "${serviceName}_TCP_${exposedPort}" environment variables
dockerCompose.exposeAsEnvironment(test)
// exposes "${serviceName}.host" and "${serviceName}.tcp.${exposedPort}" system properties
dockerCompose.exposeAsSystemProperties(test)
// get information about container of service `web` (declared in docker-compose.yml)
def webInfo = dockerCompose.servicesInfos.web.'web_1'
// pass host and exposed TCP port 80 as custom-named Java System properties
systemProperty 'myweb.host', webInfo.host
}
68. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
CI
✓Zombie containers
✓Force compose down
✓Configuration it’s different
✓Development
✓Testing
69. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
70. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
✓ Automatic discovery of local docker environment
✓ Pull images or build from Dockerfile
✓ Start/stop container
✓ Wait for it to be ready (log string / listening port / protocol-
specific)
✓ Port mapping
✓ Clean up
71. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
✓ Manage Dockerized external dependencies via a Java object facade
✓ JUnit integration
✓ Starts/stops containers for each class/method
✓ Reliability:
✓ start from clean state
✓ isolated instances
✓ port randomisation
✓ tag-based versioning
✓ Java JUnit support; Spock, Scala and Python wrappers/forks
72. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
DEMO
73. @ i x c h e l r u i z # Vo x x e d D a y s B a n ff
THANK YOU
QUESTIONS OR FEEDBACK?
PLEASE FILL THE SURVEY! PING ME! TALK TO ME!