don’t talk to strangers: test isolation with containers
TRANSCRIPT
![Page 1: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/1.jpg)
Don’t talk to strangers
Test isolation with containers
Hristo Iliev, Georgi Sabev | SAP Labs 18-19 November, Sofia
![Page 2: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/2.jpg)
Hristo Iliev
ISTAcon.org 18-19 November, Sofia
SAP
• NetWeaver Application Server Java
• SAP HANA Cloud Platform
Open Source
• Eclipse Virgo
• Cloud Foundry (Diego & Abacus)
![Page 3: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/3.jpg)
Georgi Sabev
ISTAcon.org 18-19 November, Sofia
SAP
• SAP HANA Cloud Platform
Open Source
• Cloud Foundry (Diego & Abacus)
![Page 4: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/4.jpg)
PicturesCreative Commons @ Flickr
ISTAcon.org 18-19 November, Sofia
![Page 5: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/5.jpg)
Creating Working Software
ISTAcon.org 18-19 November, Sofia
Tests
Automation
Discipline
![Page 6: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/6.jpg)
Problems
ISTAcon.org 18-19 November, Sofia
![Page 7: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/7.jpg)
Test Pollution
ISTAcon.org 18-19 November, Sofia
Environment variables
Database records
Files
Programs / libraries
![Page 8: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/8.jpg)
Resource contention
ISTAcon.org 18-19 November, Sofia
Processes compete for
• CPU
• Memory
• I/O
![Page 9: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/9.jpg)
Multiple environments
ISTAcon.org 18-19 November, Sofia
OS
Mobile / Desktop
Cloud / Standalone
Databases
Versions
![Page 10: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/10.jpg)
Test problems summary
ISTAcon.org 18-19 November, Sofia
Test pollution
Resource contention
Multiple environments
![Page 11: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/11.jpg)
Solutions
ISTAcon.org 18-19 November, Sofia
Traditional
• Dedicated hardware
• Virtual machines
• Cloud: AWS, Azure
New tools
![Page 12: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/12.jpg)
Containersbuild, isolate, ship
ISTAcon.org 18-19 November, Sofia
![Page 13: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/13.jpg)
Container: Resource isolation
Tenant 1 Tenant 2 Tenant 3
Pro
cess
A
Pro
cess
B
Pro
cess
C
Pro
cess
D
Pro
cess
E
Pro
cess
F
CPU
Kernel
ISTAcon.org 18-19 November, Sofia
![Page 14: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/14.jpg)
Container: Resource isolation
Tenant 1 Tenant 2 Tenant 3
Pro
cess
A
Pro
cess
B
Pro
cess
C
Pro
cess
D
Pro
cess
E
Pro
cess
F
Kernel
A FEDCB
ISTAcon.org 18-19 November, Sofia
![Page 15: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/15.jpg)
Container: Resource isolation
Tenant 1 Tenant 2 Tenant 3
Pro
cess
A
Pro
cess
B
Pro
cess
C
Pro
cess
D
Pro
cess
E
Pro
cess
F
CPU
Kernel
A FEDCB
ISTAcon.org 18-19 November, Sofia
![Page 16: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/16.jpg)
Container: Resource isolation
Tenant 1 Tenant 2 Tenant 3
Pro
cess
A
Pro
cess
B
Pro
cess
C
Pro
cess
D
Pro
cess
E
Pro
cess
F
CPU
Kernel
A FEDCB
Linux Kernel
ISTAcon.org 18-19 November, Sofia
![Page 17: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/17.jpg)
Container: Namespace isolation
Tenant 1 Tenant 2 Tenant 3
Pro
cess
A
Pro
cess
B
Pro
cess
C
Pro
cess
A
Pro
cess
A
Pro
cess
B
PID, Network, Mount, User
Kernel
ISTAcon.org 18-19 November, Sofia
![Page 18: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/18.jpg)
Containerization = Lightweight Virtualization
ISTAcon.org 18-19 November, Sofia
Operating System
Hypervisor
Virtual Machine
Operating System
Bins / libs
App App
Virtual Machine
Operating System
Bins / libs
App App
Container Daemon
Container
Bins / libs
App App
Container
Bins / libs
App App
Virtualization Containerization
Operating System
Hardware Hardware
![Page 19: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/19.jpg)
Container
?
ISTAcon.org 18-19 November, Sofia
![Page 20: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/20.jpg)
Container
ISTAcon.org18-19 November, Sofia
Network
User
cgroups
PID
Isolation
![Page 21: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/21.jpg)
Container
+
Content
ISTAcon.org18-19 November, Sofia
Network
User
cgroups
PID
Isolation
![Page 22: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/22.jpg)
Container
++
Content Processes
ISTAcon.org18-19 November, Sofia
Network
User
cgroups
PID
Isolation
![Page 23: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/23.jpg)
Container
Network
User
cgroups
PID
ISTAcon.org 18-19 November, Sofia
![Page 24: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/24.jpg)
Container actions
Make me a container
ISTAcon.org 18-19 November, Sofia
![Page 25: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/25.jpg)
Container actions
Put this in itMake me a container
ISTAcon.org 18-19 November, Sofia
![Page 26: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/26.jpg)
Container actions
Put this in it Run this for meMake me a container
ISTAcon.org 18-19 November, Sofia
![Page 27: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/27.jpg)
Docker
ISTAcon.org 18-19 November, Sofia
“Build, Ship, Run” Containers
• Dockerfile
• Docker image
• Docker Hub
![Page 28: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/28.jpg)
Logos
ISTAcon.org 18-19 November, Sofia
Docker
Linux
Go lang
![Page 29: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/29.jpg)
Demo
ISTAcon.org 18-19 November, Sofia
![Page 30: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/30.jpg)
https://github.com/hsiliev/strangers
ISTAcon.org 18-19 November, Sofia
![Page 31: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/31.jpg)
Containers: Pros & Cons
ISTAcon.org 18-19 November, Sofia
Pros
• Isolation
• Reproducible environment
• Easy to maintain
Cons
• Multi-platform
• Discipline
![Page 32: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/32.jpg)
Software Production
ISTAcon.org 18-19 November, Sofia
Complexity
Tests
Automation
![Page 33: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/33.jpg)
PipelinesMultiple-builds
ISTAcon.org 18-19 November, Sofia
![Page 34: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/34.jpg)
Popular solutions
ISTAcon.org 18-19 November, Sofia
Build servers
Jenkins
Travis
…
Homegrown
![Page 35: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/35.jpg)
ConcourseCI, Pipelines, Delivery
ISTAcon.org 18-19 November, Sofia
![Page 36: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/36.jpg)
Concourse
ISTAcon.org 18-19 November, Sofia
Reproducible builds
Simple building blocks
Docker containers
![Page 37: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/37.jpg)
Concourse: Concepts
ISTAcon.org 18-19 November, Sofia
Resources
Tasks
Jobs
Build Job
ConfigureMakeInstall
Source Binary
![Page 38: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/38.jpg)
Concourse: Pipeline
ISTAcon.org 18-19 November, Sofia
resource
jobvalidated resource
![Page 39: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/39.jpg)
Demo
ISTAcon.org 18-19 November, Sofia
![Page 40: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/40.jpg)
https://github.com/hsiliev/strangers
ISTAcon.org 18-19 November, Sofia
![Page 41: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/41.jpg)
Concourse: Pros & Cons
ISTAcon.org 18-19 November, Sofia
Pros
• Reproducible environment
• Native pipeline support
• Release process modeling
Cons
• Maturity
• Scripting
![Page 42: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/42.jpg)
Q&AISTAcon.org 18-19 November, Sofia
![Page 43: Don’t talk to strangers: Test isolation with containers](https://reader030.vdocuments.us/reader030/viewer/2022021509/5885fee51a28ab0a3f8b51bd/html5/thumbnails/43.jpg)
Thank you!
Hristo Iliev, Georgi Sabev | SAP Labs 18-19 November, Sofia