Minimum Viable Docker: our journey towards orchestration

42
Minimum Viable Docker Our journey towards orchestration

Transcript of Minimum Viable Docker: our journey towards orchestration

Page 1: Minimum Viable Docker: our journey towards orchestration

Minimum Viable DockerOur journey towards orchestration

Page 2: Minimum Viable Docker: our journey towards orchestration

What this talk is about

How we’ve been surviving with Docker running in production withoutany orchestration tool.

What we have in store for the future.

Page 3: Minimum Viable Docker: our journey towards orchestration

To provide affordable and accessible

healthcare to everyone on earth

Page 4: Minimum Viable Docker: our journey towards orchestration
Page 5: Minimum Viable Docker: our journey towards orchestration
Page 6: Minimum Viable Docker: our journey towards orchestration

Very first version of the Chatbot

Micro Service Architecture

8 Stateless Applications

HTTP Based

Start simple. Build fast.

Page 7: Minimum Viable Docker: our journey towards orchestration

How should our applications artefacts look like ? How to deploy them ?

Criteria:

Multiple languages (Java, Python, …)

Good dependency management

Good artefact tracking

Separate build time / deploy time

Dev/Prod parity

Page 8: Minimum Viable Docker: our journey towards orchestration

How should our applications artefacts look like ? How to deploy them ?

Criteria:

Multiple languages (Java, Python, …)

Good dependency management

Good artefact tracking

Separate build time / deploy time

Dev/Prod parity

Page 9: Minimum Viable Docker: our journey towards orchestration

FROM python:3.6-alpineMAINTAINER "Jeremie Vallee" <[email protected]>

COPY . /app

WORKDIR /app

RUN pip install -r requirements.txt

ENTRYPOINT ["python"]

CMD ["app.py"]

Dockerfile

Page 10: Minimum Viable Docker: our journey towards orchestration

How to manage our Dockerized applications ?

Objectives:

Fast deployments

Service routing & Authentication

Monitoring

High Availability

Scalability

Page 11: Minimum Viable Docker: our journey towards orchestration

How to manage our Dockerized applications ?

Objectives:

Fast deployments

Service routing & Authentication

Monitoring

High Availability

Scalability

Constraints:

Time (of course)

Docker beginner level

No AWS/GCP

Limited resources

Page 12: Minimum Viable Docker: our journey towards orchestration

How to manage our Dockerized applications ?

Objectives:

Fast deployments

Service routing & Authentication

Monitoring

High Availability

Scalability

Constraints:

Time (of course)

Docker beginner level

No AWS/GCP

Limited resources

Page 13: Minimum Viable Docker: our journey towards orchestration

Keep it simple!

What is the minimum we need to run our applications with the objectives we have ?

Page 14: Minimum Viable Docker: our journey towards orchestration

Linux box

Docker

Page 15: Minimum Viable Docker: our journey towards orchestration

MyAppA Linux box

Docker

Page 16: Minimum Viable Docker: our journey towards orchestration

/usr/bin/docker run --rm \ -p 127.0.0.1:8805:7799 \  --env-file /opt/babylon/myapplicationA/environment \ --name myapplicationA myrepo.io/babylon/myapplicationA:master

Running myapplicationA

Page 17: Minimum Viable Docker: our journey towards orchestration

[Unit]Description=My Application ARequires=docker.serviceAfter=docker.service

[Service]Restart=alwaysTimeoutStartSec=0ExecStartPre=-/usr/bin/docker rm -f myapplicationAExecStartPre=-/usr/bin/docker pull myrepo.io/babylon/myapplicationA:master

ExecStart=/usr/bin/docker run --rm \ -p 127.0.0.1:8805:7799 \  --env-file /opt/babylon/myapplicationA/environment \ --name myapplicationA myrepo.io/babylon/myapplicationA:master

ExecStop=/usr/bin/docker stop myapplicationA

[Install]WantedBy=local.target

/etc/systemd/system/myapplicationA.service

Page 18: Minimum Viable Docker: our journey towards orchestration

[Unit]Description=My Application ARequires=docker.serviceAfter=docker.service

[Service]Restart=alwaysTimeoutStartSec=0ExecStartPre=-/usr/bin/docker rm -f myapplicationAExecStartPre=-/usr/bin/docker pull myrepo.io/babylon/myapplicationA:master

ExecStart=/usr/bin/docker run --rm \ -p 127.0.0.1:8805:7799 \  --env-file /opt/babylon/myapplicationA/environment \ --name myapplicationA myrepo.io/babylon/myapplicationA:master

ExecStop=/usr/bin/docker stop myapplicationA

[Install]WantedBy=local.target

/etc/systemd/system/myapplicationA.service

Page 19: Minimum Viable Docker: our journey towards orchestration

service myapplicationA start

/etc/systemd/system/myapplicationA.service

Start

service myapplicationA stop

Stop

service myapplicationA restart

Deploy

Page 20: Minimum Viable Docker: our journey towards orchestration

MyAppA

MyAppB

MyAppC

Easy deployments

Page 21: Minimum Viable Docker: our journey towards orchestration
Page 22: Minimum Viable Docker: our journey towards orchestration

MyAppA

MyAppB

MyAppC

https:// myendpoint / myapplicationA

https:// myendpoint / myapplicationB

https:// myendpoint / myapplicationC

MyAppA

MyAppB

MyAppC

Service routing

Page 23: Minimum Viable Docker: our journey towards orchestration

MyAppA

MyAppB

MyAppC

https:// myendpoint / myapplicationA

https:// myendpoint / myapplicationB

https:// myendpoint / myapplicationC

MyAppA

MyAppB

MyAppC

Service routing

Authentication

Page 24: Minimum Viable Docker: our journey towards orchestration

MyAppA

MyAppB

MyAppC

Easy deployments

Service routing

Authentication

Page 25: Minimum Viable Docker: our journey towards orchestration

MyAppA

MyAppB

MyAppC

Monitoring ?

All applications must have a health check endpoint

https:// myendpoint / myapplicationA / health

Page 26: Minimum Viable Docker: our journey towards orchestration
Page 27: Minimum Viable Docker: our journey towards orchestration

MyAppA

MyAppB

MyAppC

Monitoring ?

Logstash on the box to collectapplication logs and metrics

Data gets shipped to Elasticsearchand visualised with Kibana

Page 28: Minimum Viable Docker: our journey towards orchestration
Page 29: Minimum Viable Docker: our journey towards orchestration

MyAppA

MyAppB

MyAppC

Easy deployments

Service routing

Authentication

Monitoring

Page 30: Minimum Viable Docker: our journey towards orchestration

MyAppA

MyAppB

MyAppC

Easy deployments

Service routing

Authentication

Monitoring

High Availability ?

Scalability ?

Page 31: Minimum Viable Docker: our journey towards orchestration

MyAppA

MyAppB

MyAppC

Page 32: Minimum Viable Docker: our journey towards orchestration

MyAppA

MyAppB

MyAppC

MyAppA

MyAppB

MyAppC

Page 33: Minimum Viable Docker: our journey towards orchestration

MyAppA

MyAppB

MyAppC

MyAppA

MyAppB

MyAppC

Load Balancer

Page 34: Minimum Viable Docker: our journey towards orchestration

MyAppA

MyAppB

MyAppC

MyAppA

MyAppB

MyAppC

Load Balancer

Easy deployments

Service routing

Authentication

Monitoring

High Availability

Scalability

Page 35: Minimum Viable Docker: our journey towards orchestration

What was good about this design ?

Matched all our objectives

Very simple and fast to set up

Allowed us to learn a lot about Docker

Page 36: Minimum Viable Docker: our journey towards orchestration

What are the limitations ?

HTTP based applications only

External health checks limited with multiple servers

Each application must be deployed on all servers

Page 37: Minimum Viable Docker: our journey towards orchestration

THE FUTURE

Page 38: Minimum Viable Docker: our journey towards orchestration

New needs

50+ micro services

GPU Based Applications

Queue based Applications (Kafka)

gRPC

Internationalisation

Page 39: Minimum Viable Docker: our journey towards orchestration

The next generation of our Infrastructure

Calico

And much more …

Page 40: Minimum Viable Docker: our journey towards orchestration

In conclusion

Very simple architecture

Great solution if you face the same constraints as we did

Allowed us to quickly deliver our Medical Chatbot into the real world

We learned a lot

Ready to take it to the next level

Page 41: Minimum Viable Docker: our journey towards orchestration

We’re hiring!

Page 42: Minimum Viable Docker: our journey towards orchestration

Thank you!