30
Local testing of Containerized Distributed Systems Strange Group Meetup, Justin Carter (@bodymindarts) Berlin, Oct. 27. 2016 Stark & Wayne

Local testing of Containerized Distributed Systems

Embed Size (px)

Citation preview

Page 1: Local testing of Containerized Distributed Systems

Local testing of Containerized Distributed Systems

Strange Group Meetup, Justin Carter (@bodymindarts)

Berlin, Oct. 27. 2016 Stark & Wayne

Page 2: Local testing of Containerized Distributed Systems

Delmo

Delmo is a tool to test systems running within multiple docker containers

https://github.com/bodymindarts/delmo

Page 3: Local testing of Containerized Distributed Systems

30 staff, 7 countries

PaaS experts

Cloud Foundry experts

Page 4: Local testing of Containerized Distributed Systems

Plattforms

Dingo PostgreSQL

Delmo

Page 5: Local testing of Containerized Distributed Systems

http://www.slideshare.net/KarlIsenberg/cloud-surfing-kubernetes-on-mesos

Page 6: Local testing of Containerized Distributed Systems

The sophistication of our platform bounds the granularity of decomposition in our

systems

(also means more complexity to setup locally)

Page 7: Local testing of Containerized Distributed Systems

How much of the cloud stack do we want to run locally (if any)?

Platform on dev workstation? Dev env in the cloud?

Apps decoupled from platform?

Page 8: Local testing of Containerized Distributed Systems

Contract Driven Tests / Mocks add a lot of code to maintain.

Dealing with deps?

Do we need them?

Page 9: Local testing of Containerized Distributed Systems

Cloud dev workflowHow much of the stack do we want to run?

How do we want to run our deps?

How do we automate this and integrate into an efficient workflow?

Page 10: Local testing of Containerized Distributed Systems
Page 11: Local testing of Containerized Distributed Systems

When you can deploy 1000s of apps, you’d better be able to deploy 1000s

of dbs!

Platform consideration

Page 12: Local testing of Containerized Distributed Systems

PostgreSQL in Docker

Clustered with streaming replication

Continuously backed up

Automatic failover

Dingo PostgreSQL

https://github.com/dingotiles/dingo-postgresql-release

Page 13: Local testing of Containerized Distributed Systems

Dingo PostgreSQL Architecture

H A P r o x y

Deployed by BOSH

Client 1

Client 2

Page 14: Local testing of Containerized Distributed Systems

Critical FeaturesRe-configuration of PostgreSQL

Restart PostgreSQL

Streaming backups to S3

Page 15: Local testing of Containerized Distributed Systems

Changing Docker Image

Page 16: Local testing of Containerized Distributed Systems
Page 17: Local testing of Containerized Distributed Systems

Test independently of BOSH

Test smaller system boundary

Build and test containers locally

Goals

Page 18: Local testing of Containerized Distributed Systems

Postgres Leader

Postgres Replica

Example TestWill failover work?

Dingo PG

HAProxy

Query

Leader

etcd

Page 19: Local testing of Containerized Distributed Systems

AssertDid data get replicated?

Did reconfiguration / promotion work?

Are connections being accepted?

Page 20: Local testing of Containerized Distributed Systems

Given: System definition

When: Some failure

Then: Assert expected Behaviour

Test Case

Page 21: Local testing of Containerized Distributed Systems

Delmo

Declare system with docker-compose

Declare test cases

Run tests (locally or remotely)

Page 22: Local testing of Containerized Distributed Systems

patroni1

Docker Compose

patroni2

etcd

System Tasks

Tasks are packaged bash scripts that execute commands against the running system

Page 23: Local testing of Containerized Distributed Systems

System

Tasks

Cache

Page 24: Local testing of Containerized Distributed Systems

Delmo Config

Page 25: Local testing of Containerized Distributed Systems

Meta

Tests

Tasks

Page 26: Local testing of Containerized Distributed Systems

Demo!

https://github.com/bodymindarts/delmo-demo

Page 27: Local testing of Containerized Distributed Systems

Initialise

Start SystemRun TasksCleanup

Summary

Page 28: Local testing of Containerized Distributed Systems

MoreRun on a remote docker-machine

Run tasks in parallel

delmo-concourse image (for executing in CI/CD)

Page 29: Local testing of Containerized Distributed Systems

Next Steps

Better error output / validation

Network failure / partitioning

Support for other backends (bosh)?

Page 30: Local testing of Containerized Distributed Systems

Questions?

Justin Carter @bodymindarts github.com/bodymindarts github.com/bodymindarts/delmo