docker internet money gateway

25
Docker in a Bitcoin broker infrastructure

Upload: mathieu-buffenoir

Post on 28-Jul-2015

654 views

Category:

Engineering


3 download

TRANSCRIPT

Page 1: Docker Internet Money Gateway

Docker in a Bitcoin broker infrastructure

Page 2: Docker Internet Money Gateway

Who Am I

Mathieu Buffenoir Co-founder of SBEX & Digithink

VP Bitcoin Association Switzerland

@Mbuffenoir [email protected]

Page 3: Docker Internet Money Gateway

SBEX

SBEX -> Swiss cryptocurrencies broker (Competitors: coinbase, circle, coinjar, safello ...)

We exchange crypto for fiat (€, CHF) We create services for our users to store and send money all around the world cheaply and

instantly

Page 4: Docker Internet Money Gateway

Our services

Online bitcoin buying

Our new wallet, multisig

Our remittance project

BTM Network (4 in Switzerland)

Page 5: Docker Internet Money Gateway

Tech stack

Python Django / Celery AngularJS PhP Postgres RabbitMQ Docker Ansible

Page 6: Docker Internet Money Gateway

Follow the “Twelve factor” app recommendations.

In particular:

Scalable, Continuous integration -> Docker

Cloud (Paas) + Hosted in Switzerland -> Exoscale

Choices

Page 7: Docker Internet Money Gateway

For developers

Each repo contains: ● 1 Vagrantfile ● 1 Dockerfile

Benefits: Same env for all devs, plateform independant Easy onboarding

Using webhooks certains branches are automatically build by docker hub

Page 8: Docker Internet Money Gateway

Environnments

● Prod – Exoscale multiple instances running several containers, firewall

● Staging – Exoscale Production mirror

● Dev – Digital Ocean One big server that hosts all containers Docker-compose (ex fig)

Page 9: Docker Internet Money Gateway

Prod / Staging

Ansible - docker module: Pulling containers from private hub

Creating configuration from templates Starting container

http://docs.ansible.com/docker_module.html

Page 10: Docker Internet Money Gateway
Page 11: Docker Internet Money Gateway
Page 12: Docker Internet Money Gateway

1.Setup DockerHub automated build

2.Push code changes to github / bitbucket

3.DockerHub sees changes and pulls/builds the image

4.DockerHub calls jenkins webhooks for image

5.DockerHUB module on Jenkins runs tests

Continuous integration

Page 13: Docker Internet Money Gateway

Continuous integration

Page 14: Docker Internet Money Gateway

Using docker compose to quickly create a new test server

Page 15: Docker Internet Money Gateway
Page 16: Docker Internet Money Gateway

PB: no “docker exec” support in compose

https://github.com/docker/compose/issues/593

Page 17: Docker Internet Money Gateway

Interesting docker functionalities we are using

Page 18: Docker Internet Money Gateway

Persisting data using data volumes containers:

Page 19: Docker Internet Money Gateway

Basically it sends to a syslog server all the logs you would normally see in “docker logs”

Your software need to be configured to send logs to stderr/out (This can be tricky!)

LogspoutLogspout is a log router for Docker containers that runs inside Docker. It attaches to all containers on a host, then routes their logs wherever you

want.

Page 20: Docker Internet Money Gateway

Install an ELK cluster in minutes

Start elasticsearch docker run -d -p 9200:9200 -p 9300:9300 --name es ehazlett/elasticsearch

Start Logstash docker run -d --name logstash -p 5000:5000 -p 5000:5000/udp --link es:elasticsearch ehazlett/logstash -f /etc/logstash.conf.sample

Start Kibana docker run --name kibana -d -p 80:80 ehazlett/kibana

Page 21: Docker Internet Money Gateway

How is it useful for our business model

We need a network of bitcoin broker around the world to create a robust and cheap remittance

network

With docker and Paas solutions we can deploy in a couple hours.

We will open source most of our code in the coming months

(Making money by selling extra services, as KYC and compliance tools)

Page 22: Docker Internet Money Gateway

Knows problems / new things to try

Ansible docker restart_policy new functionnality logging driver in docker 1.6

devmapper issue in 1.5 Official docker images can be buggy

Signing / hash of docker images

Page 23: Docker Internet Money Gateway

Thanks to: @sebgoa Docker Exoscale Ansible container42.com/

Page 24: Docker Internet Money Gateway

Questions ?

Page 25: Docker Internet Money Gateway