SlideShare a Scribd company logo
1 of 52
Download to read offline
Dockerizing Aurea
Lukasz Piatkowski, PhD
Chief Docker Architect
Matias Lespiau
Soft. Eng. Manager
Agenda
Dockerizing Aurea:
- Goals
- Results
- Technical challenges
Dockerization at Aurea
Goals
● #1 - Decrease computing expenses by
consolidation and simplification
● #2 - Improve Ops team productivity
through standardization
1 app, 1 host, 2 CPUs
1GB RAM
4x average to peak
utilization
500 containers, 1 host,
128 CPUs, 2TB RAM
1.2x average to peak
utilization
Goal #1 - decrease computing expenses
Goal #2 - standardize Ops interfaces for operating products
Node app
PHP app
Python app
Java app
Application Runbooks
Dockerfiles Docker
compose
files
Docker CLI commands
Standard interface
Dockerization at Aurea
● 1 year results
○ Replaced 2000+ VMs with 1900+ containers
○ Decrease infrastructure costs from 13M to 6M (53%)
○ Utilization increased from 5% to 72%
Ok, what’s edgy about
our case?
Dockerization at Aurea
● Focus on the basics
○ Tried out swarm, ECS and plain docker with EE basic
license.
○ Teams using plain docker reached our main goal
faster
■ Simpler to onboard Ops and Eng
■ Avoids re engineering apps
Dockerization at Aurea
● Simplify instead of lift and shift
○ Centralize basic services like databases and reverse
proxies
○ Legacy HA setups added complexity and very little
value in return (less than 1% contribution to uptime)
Dense consolidation
● 2000 instances -> 7 docker hosts
● Benefits:
○ Higher utilization
○ Simpler to manage
● Don’t do this at home:
○ Issues when running more than 100 containers per
node
○ Interested? Hallway track!
Technical challenges
Copyright: Daniel Stori - @turnoff_us
TO DEL - Monitoring tips
● Fetching metrics is a heavy API call
○ Always make it once, store in DB and fetch from there
○ Always use container and host level monitoring in
production
● Useful tools
○ Reporters: cadvisor or telegraf
○ DB, alarms and graphs: prometheus, alertmanager
and grafana
Performance and
resource sharing
Performance & host sharing
● Learn performance debugging tools
○ Great talk by Brendan Gregg: https://goo.gl/UW2mHV
Performance & host sharing
● The biggest enemy: a noisy neighbour
● Fight him with resource limits:
○ CPU: --cpu-period, --cpu-quota, --cpus
○ Memory: --memory, --memory-swap (turn on accounting!)
○ IO: --device-[read|write]-bps, --device-[read|write]-iops
Performance - lessons learned
● Containers are not Virtual Machines
○ cgroups are not hypervisor
○ Remember the JVM
● Always set container’s resource limits
● Always label your containers
○ Owners info and container’s importance
● But how to make users comply?
Configuration
compliance
Docker enforcer
● A tool to run validation rules against
containers and stop ‘bad ones’
● https://github.com/piontec/docker-enforcer
Docker enforcer - rules
“Dear users,
We have created a nice big disk for your
containers’ data at /opt/big. Please use
this location for any docker volumes.
Admins”
Demo
Docker enforcer - rules
● “No worries!”
○ docker run -d -v /optbig:/my-mysql
Docker enforcer - rules
● “No worries!”
○ docker run -d -v /optbig:/my mysql
● Rules written in python, as a series of
lambdas applied to each container
rules = [{
"name": "uses valid dirs for docker volumes",
"rule": lambda c: False if not 'Binds' in c.params['HostConfig'] or c.params['HostConfig']['Binds'] is None 
else any([not b.startswith("/opt/big") for b in c.params['HostConfig']['Binds']])
}]
Docker enforcer - rules
“Dear users,
Please always make sure your
containers are running with CPU and
memory resource limits.
Admins”
Demo
Docker enforcer - rules
● “No worries!”
○ docker run -d lets-mine-bitcoin:latest
Docker enforcer - rules
● “No worries!”
○ docker run -d lets-mine-bitcoin:latest
● Rule
{ "name": "must use less than 1 GiB of memory",
"rule": lambda c: c.params['HostConfig']['Memory'] == 0 or c.params['HostConfig']['Memory'] > 1074000000 },
{ "name": "must use less than 2 CPU cores",
"rule": lambda c: c.params['HostConfig']['CpuQuota'] == 0 
or (int(c.params['HostConfig']['CpuQuota']) / 
(100000 if c.params['HostConfig']['CpuPeriod'] == 0 else int(c.params['HostConfig']['CpuPeriod']))
) > 2}
Docker enforcer - rules
“Dear users,
Please be careful when you assign ports
to your containers. Don’t use ports
below 1024.
Admins”
Demo
Docker enforcer - rules
● “No worries!”
docker run -d -p 22:22 my-super-ssh
Docker enforcer - rules
● docker run -d -p 22:22 my-super-ssh
● rules = [{"name": "can't use ports below 1024 on the default IP",
"rule": lambda c: False if 'PortBindings' not in c.params['HostConfig'] 
or c.params['HostConfig']['PortBindings'] is None
else check_ports_on_default(c.params['HostConfig']['PortBindings'])
}]
def check_ports_on_default(bindings):
for pbs in bindings.values():
if pbs is None:
continue
if any(pb['HostPort'] != '' and int(pb['HostPort'].replace('/udp', '')) < 1024 for pb in pbs):
return True
return False
Docker enforcer - status API
● http://localhost:8888/
{
"last_full_check_run_time": "0:00:00.404284",
"detections":
[
{"id": "4c5..12b", "name": "/test", "violated_rule": "must have CPU limit", "count": 1,
"last_timestamp": "2017-09-17T13:55:04.851144" }
]}
● http://localhost:8888/config
{
"cache_params": true,
"disable_metrics": true, …
● http://localhost:8888/rules
rules = [...]
Docker enforcer - CLI call
$ docker run -d alpine true
docker: Error response from daemon: authorization
denied by plugin enforcer: must have CPU limit.
See 'docker run --help'.
Networking for legacy
applications
Networking - legacy
● Not HTTP+JSON microservices
○ Old friends: FTP, SMTP, SIP, …
● New requirements
○ Individual IPs for containers, but from different
subnets and preserving external (AWS VPC) IP
○ Exposing massive number of ports (SIP)
Networking - per container IPs
# interface
ip addr add 10.10.0.2/24 dev eth1
ip route add default via 10.10.0.1 dev eth1 table 101
ip route add 10.10.0.0/24 dev eth1 src 10.10.0.2 table 101
ip rule add from 10.10.0.2 lookup 101
# container
ip r a 172.17.0.0/16 dev docker0 tab 101
ip rule add from 172.17.0.20 lookup 101
iptables -t nat -I POSTROUTING -s 172.17.0.20 -j SNAT --to-source 10.10.0.2
Networking - port storm
● What will this command do?
○ docker run -d -p 2000-3000:2000-3000 alpine sh
Networking - port storm
● What will this command do?
○ docker run -d -p 2000-3000:2000-3000 alpine sh
● Don’t expose single ports at all, translate
whole IP in one go
○ docker run -d alpine sh
○ iptables -t nat -I PREROUTING -i eth1 
-d 10.10.0.3 -j DNAT 
--to-destination 172.17.0.20
[TO DEL] Dockerization
processDiscovery
Image
Validation
cutover
[TO DEL] Discovery
[TO DEL] Process management
Diagram - how signal handling works
[TO DEL] Image Quality
● Process management
○ Init / Process manager
○ Avoid process in containers getting in D state (check
for remote filesystem, etc)
○ Signal handling
○ Handle container main process restart/termination
[TO DEL] Building Docker
Images● Java
○ JVM limits CPU threads, memory
Recap
● Outcomes
○ Increase utilization from 5% to 72%
○ Decrease infrastructure costs from 13M to 6M
● Main challenges
○ Noisy neighbours
○ Configuration compliance
○ Networking
Roadmap
● Dockerize everything, our goal is to have 0 VMs out of our
CaaS platform
● New platform for stateless containers
○ Orchestration
○ Multi AZ on AWS Spot
● Invest in re-engeering non-dockerizable apps to make
them dockerizable and in dockerized app to make them
cloud enabled.
We’re hiring?
Hallway tracks:
● Docker Enforcer
● Running 100+ containers per node
Q & A?

More Related Content

What's hot

Redis As Job Cache In An Auto-Scaling Distributed Video Rendering Pipeline: P...
Redis As Job Cache In An Auto-Scaling Distributed Video Rendering Pipeline: P...Redis As Job Cache In An Auto-Scaling Distributed Video Rendering Pipeline: P...
Redis As Job Cache In An Auto-Scaling Distributed Video Rendering Pipeline: P...Redis Labs
 
Deep dive in Docker Overlay Networks
Deep dive in Docker Overlay NetworksDeep dive in Docker Overlay Networks
Deep dive in Docker Overlay NetworksLaurent Bernaille
 
Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)Julien SIMON
 
Living the Nomadic life - Nic Jackson
Living the Nomadic life - Nic JacksonLiving the Nomadic life - Nic Jackson
Living the Nomadic life - Nic JacksonParis Container Day
 
Tuning TCP and NGINX on EC2
Tuning TCP and NGINX on EC2Tuning TCP and NGINX on EC2
Tuning TCP and NGINX on EC2Chartbeat
 
Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Nicolas De Loof
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOpsОмские ИТ-субботники
 
IPTABLES Introduction
IPTABLES IntroductionIPTABLES Introduction
IPTABLES IntroductionHungWei Chiu
 
New bare-metal provisioning setup built around Collins
New bare-metal provisioning setup built around CollinsNew bare-metal provisioning setup built around Collins
New bare-metal provisioning setup built around Collinsleboncoin engineering
 
Containerize ovs ovn components
Containerize ovs ovn componentsContainerize ovs ovn components
Containerize ovs ovn componentsAliasgar Ginwala
 
Make Your Containers Faster: Linux Container Performance Tools
Make Your Containers Faster: Linux Container Performance ToolsMake Your Containers Faster: Linux Container Performance Tools
Make Your Containers Faster: Linux Container Performance ToolsKernel TLV
 
Understand the iptables step by step
Understand the iptables step by stepUnderstand the iptables step by step
Understand the iptables step by stepHungWei Chiu
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Praguetomasbart
 
New Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingNew Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingScyllaDB
 
Debugging linux issues with eBPF
Debugging linux issues with eBPFDebugging linux issues with eBPF
Debugging linux issues with eBPFIvan Babrou
 
Network OS Code Coverage demo using Bullseye tool
Network OS Code Coverage demo using Bullseye toolNetwork OS Code Coverage demo using Bullseye tool
Network OS Code Coverage demo using Bullseye toolVikram G Hosakote
 
GlusterFS As an Object Storage
GlusterFS As an Object StorageGlusterFS As an Object Storage
GlusterFS As an Object StorageKeisuke Takahashi
 

What's hot (20)

Redis As Job Cache In An Auto-Scaling Distributed Video Rendering Pipeline: P...
Redis As Job Cache In An Auto-Scaling Distributed Video Rendering Pipeline: P...Redis As Job Cache In An Auto-Scaling Distributed Video Rendering Pipeline: P...
Redis As Job Cache In An Auto-Scaling Distributed Video Rendering Pipeline: P...
 
Deep dive in Docker Overlay Networks
Deep dive in Docker Overlay NetworksDeep dive in Docker Overlay Networks
Deep dive in Docker Overlay Networks
 
Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)
 
Living the Nomadic life - Nic Jackson
Living the Nomadic life - Nic JacksonLiving the Nomadic life - Nic Jackson
Living the Nomadic life - Nic Jackson
 
Tuning TCP and NGINX on EC2
Tuning TCP and NGINX on EC2Tuning TCP and NGINX on EC2
Tuning TCP and NGINX on EC2
 
Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Breaking the RpiDocker challenge
Breaking the RpiDocker challenge
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
 
IPTABLES Introduction
IPTABLES IntroductionIPTABLES Introduction
IPTABLES Introduction
 
New bare-metal provisioning setup built around Collins
New bare-metal provisioning setup built around CollinsNew bare-metal provisioning setup built around Collins
New bare-metal provisioning setup built around Collins
 
Containerize ovs ovn components
Containerize ovs ovn componentsContainerize ovs ovn components
Containerize ovs ovn components
 
Make Your Containers Faster: Linux Container Performance Tools
Make Your Containers Faster: Linux Container Performance ToolsMake Your Containers Faster: Linux Container Performance Tools
Make Your Containers Faster: Linux Container Performance Tools
 
Chap 19 web
Chap 19 webChap 19 web
Chap 19 web
 
Understand the iptables step by step
Understand the iptables step by stepUnderstand the iptables step by step
Understand the iptables step by step
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 
New Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingNew Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using Tracing
 
CephFS Update
CephFS UpdateCephFS Update
CephFS Update
 
Jumbo Mumbo in OpenStack
Jumbo Mumbo in OpenStackJumbo Mumbo in OpenStack
Jumbo Mumbo in OpenStack
 
Debugging linux issues with eBPF
Debugging linux issues with eBPFDebugging linux issues with eBPF
Debugging linux issues with eBPF
 
Network OS Code Coverage demo using Bullseye tool
Network OS Code Coverage demo using Bullseye toolNetwork OS Code Coverage demo using Bullseye tool
Network OS Code Coverage demo using Bullseye tool
 
GlusterFS As an Object Storage
GlusterFS As an Object StorageGlusterFS As an Object Storage
GlusterFS As an Object Storage
 

Similar to DockerCon EU '17 - Dockerizing Aurea

Dockerizing Aurea - Docker Con EU 2017
Dockerizing Aurea - Docker Con EU 2017Dockerizing Aurea - Docker Con EU 2017
Dockerizing Aurea - Docker Con EU 2017Matias Lespiau
 
6 Months Sailing with Docker in Production
6 Months Sailing with Docker in Production 6 Months Sailing with Docker in Production
6 Months Sailing with Docker in Production Hung Lin
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013dotCloud
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Docker, Inc.
 
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, KyivKubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, KyivAleksey Asiutin
 
Swarm: Native Docker Clustering
Swarm: Native Docker ClusteringSwarm: Native Docker Clustering
Swarm: Native Docker ClusteringRoyee Tager
 
Tensorflow in Docker
Tensorflow in DockerTensorflow in Docker
Tensorflow in DockerEric Ahn
 
Best practices for optimizing Red Hat platforms for large scale datacenter de...
Best practices for optimizing Red Hat platforms for large scale datacenter de...Best practices for optimizing Red Hat platforms for large scale datacenter de...
Best practices for optimizing Red Hat platforms for large scale datacenter de...Jeremy Eder
 
Docker on docker leveraging kubernetes in docker ee
Docker on docker leveraging kubernetes in docker eeDocker on docker leveraging kubernetes in docker ee
Docker on docker leveraging kubernetes in docker eeDocker, Inc.
 
State of Containers and the Convergence of HPC and BigData
State of Containers and the Convergence of HPC and BigDataState of Containers and the Convergence of HPC and BigData
State of Containers and the Convergence of HPC and BigDatainside-BigData.com
 
Docker HK Meetup - 201707
Docker HK Meetup - 201707Docker HK Meetup - 201707
Docker HK Meetup - 201707Clarence Ho
 
Making kubernetes simple for developers
Making kubernetes simple for developersMaking kubernetes simple for developers
Making kubernetes simple for developersSuraj Deshmukh
 
Docker for mac & local developer environment optimization
Docker for mac & local developer environment optimizationDocker for mac & local developer environment optimization
Docker for mac & local developer environment optimizationRadek Baczynski
 
Perspectives on Docker
Perspectives on DockerPerspectives on Docker
Perspectives on DockerRightScale
 
Kubernetes at Datadog the very hard way
Kubernetes at Datadog the very hard wayKubernetes at Datadog the very hard way
Kubernetes at Datadog the very hard wayLaurent Bernaille
 
Start tracking your ruby infrastructure
Start tracking your ruby infrastructureStart tracking your ruby infrastructure
Start tracking your ruby infrastructureSergiy Kukunin
 
Infrastructure = Code
Infrastructure = CodeInfrastructure = Code
Infrastructure = CodeGeorg Sorst
 
Libvirt/KVM Driver Update (Kilo)
Libvirt/KVM Driver Update (Kilo)Libvirt/KVM Driver Update (Kilo)
Libvirt/KVM Driver Update (Kilo)Stephen Gordon
 
Docker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xDocker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xrkr10
 
[DockerCon 2020] Hardening Docker daemon with Rootless Mode
[DockerCon 2020] Hardening Docker daemon with Rootless Mode[DockerCon 2020] Hardening Docker daemon with Rootless Mode
[DockerCon 2020] Hardening Docker daemon with Rootless ModeAkihiro Suda
 

Similar to DockerCon EU '17 - Dockerizing Aurea (20)

Dockerizing Aurea - Docker Con EU 2017
Dockerizing Aurea - Docker Con EU 2017Dockerizing Aurea - Docker Con EU 2017
Dockerizing Aurea - Docker Con EU 2017
 
6 Months Sailing with Docker in Production
6 Months Sailing with Docker in Production 6 Months Sailing with Docker in Production
6 Months Sailing with Docker in Production
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
 
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, KyivKubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
 
Swarm: Native Docker Clustering
Swarm: Native Docker ClusteringSwarm: Native Docker Clustering
Swarm: Native Docker Clustering
 
Tensorflow in Docker
Tensorflow in DockerTensorflow in Docker
Tensorflow in Docker
 
Best practices for optimizing Red Hat platforms for large scale datacenter de...
Best practices for optimizing Red Hat platforms for large scale datacenter de...Best practices for optimizing Red Hat platforms for large scale datacenter de...
Best practices for optimizing Red Hat platforms for large scale datacenter de...
 
Docker on docker leveraging kubernetes in docker ee
Docker on docker leveraging kubernetes in docker eeDocker on docker leveraging kubernetes in docker ee
Docker on docker leveraging kubernetes in docker ee
 
State of Containers and the Convergence of HPC and BigData
State of Containers and the Convergence of HPC and BigDataState of Containers and the Convergence of HPC and BigData
State of Containers and the Convergence of HPC and BigData
 
Docker HK Meetup - 201707
Docker HK Meetup - 201707Docker HK Meetup - 201707
Docker HK Meetup - 201707
 
Making kubernetes simple for developers
Making kubernetes simple for developersMaking kubernetes simple for developers
Making kubernetes simple for developers
 
Docker for mac & local developer environment optimization
Docker for mac & local developer environment optimizationDocker for mac & local developer environment optimization
Docker for mac & local developer environment optimization
 
Perspectives on Docker
Perspectives on DockerPerspectives on Docker
Perspectives on Docker
 
Kubernetes at Datadog the very hard way
Kubernetes at Datadog the very hard wayKubernetes at Datadog the very hard way
Kubernetes at Datadog the very hard way
 
Start tracking your ruby infrastructure
Start tracking your ruby infrastructureStart tracking your ruby infrastructure
Start tracking your ruby infrastructure
 
Infrastructure = Code
Infrastructure = CodeInfrastructure = Code
Infrastructure = Code
 
Libvirt/KVM Driver Update (Kilo)
Libvirt/KVM Driver Update (Kilo)Libvirt/KVM Driver Update (Kilo)
Libvirt/KVM Driver Update (Kilo)
 
Docker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xDocker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12x
 
[DockerCon 2020] Hardening Docker daemon with Rootless Mode
[DockerCon 2020] Hardening Docker daemon with Rootless Mode[DockerCon 2020] Hardening Docker daemon with Rootless Mode
[DockerCon 2020] Hardening Docker daemon with Rootless Mode
 

Recently uploaded

Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 

Recently uploaded (20)

Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 

DockerCon EU '17 - Dockerizing Aurea

  • 1. Dockerizing Aurea Lukasz Piatkowski, PhD Chief Docker Architect Matias Lespiau Soft. Eng. Manager
  • 2. Agenda Dockerizing Aurea: - Goals - Results - Technical challenges
  • 3.
  • 4. Dockerization at Aurea Goals ● #1 - Decrease computing expenses by consolidation and simplification ● #2 - Improve Ops team productivity through standardization
  • 5. 1 app, 1 host, 2 CPUs 1GB RAM 4x average to peak utilization 500 containers, 1 host, 128 CPUs, 2TB RAM 1.2x average to peak utilization Goal #1 - decrease computing expenses
  • 6. Goal #2 - standardize Ops interfaces for operating products Node app PHP app Python app Java app Application Runbooks Dockerfiles Docker compose files Docker CLI commands Standard interface
  • 7. Dockerization at Aurea ● 1 year results ○ Replaced 2000+ VMs with 1900+ containers ○ Decrease infrastructure costs from 13M to 6M (53%) ○ Utilization increased from 5% to 72%
  • 8. Ok, what’s edgy about our case?
  • 9. Dockerization at Aurea ● Focus on the basics ○ Tried out swarm, ECS and plain docker with EE basic license. ○ Teams using plain docker reached our main goal faster ■ Simpler to onboard Ops and Eng ■ Avoids re engineering apps
  • 10. Dockerization at Aurea ● Simplify instead of lift and shift ○ Centralize basic services like databases and reverse proxies ○ Legacy HA setups added complexity and very little value in return (less than 1% contribution to uptime)
  • 11. Dense consolidation ● 2000 instances -> 7 docker hosts ● Benefits: ○ Higher utilization ○ Simpler to manage ● Don’t do this at home: ○ Issues when running more than 100 containers per node ○ Interested? Hallway track!
  • 13. Copyright: Daniel Stori - @turnoff_us
  • 14. TO DEL - Monitoring tips ● Fetching metrics is a heavy API call ○ Always make it once, store in DB and fetch from there ○ Always use container and host level monitoring in production ● Useful tools ○ Reporters: cadvisor or telegraf ○ DB, alarms and graphs: prometheus, alertmanager and grafana
  • 16. Performance & host sharing ● Learn performance debugging tools ○ Great talk by Brendan Gregg: https://goo.gl/UW2mHV
  • 17. Performance & host sharing ● The biggest enemy: a noisy neighbour ● Fight him with resource limits: ○ CPU: --cpu-period, --cpu-quota, --cpus ○ Memory: --memory, --memory-swap (turn on accounting!) ○ IO: --device-[read|write]-bps, --device-[read|write]-iops
  • 18. Performance - lessons learned ● Containers are not Virtual Machines ○ cgroups are not hypervisor ○ Remember the JVM ● Always set container’s resource limits ● Always label your containers ○ Owners info and container’s importance ● But how to make users comply?
  • 20. Docker enforcer ● A tool to run validation rules against containers and stop ‘bad ones’ ● https://github.com/piontec/docker-enforcer
  • 21. Docker enforcer - rules “Dear users, We have created a nice big disk for your containers’ data at /opt/big. Please use this location for any docker volumes. Admins”
  • 22. Demo
  • 23. Docker enforcer - rules ● “No worries!” ○ docker run -d -v /optbig:/my-mysql
  • 24. Docker enforcer - rules ● “No worries!” ○ docker run -d -v /optbig:/my mysql ● Rules written in python, as a series of lambdas applied to each container rules = [{ "name": "uses valid dirs for docker volumes", "rule": lambda c: False if not 'Binds' in c.params['HostConfig'] or c.params['HostConfig']['Binds'] is None else any([not b.startswith("/opt/big") for b in c.params['HostConfig']['Binds']]) }]
  • 25. Docker enforcer - rules “Dear users, Please always make sure your containers are running with CPU and memory resource limits. Admins”
  • 26. Demo
  • 27. Docker enforcer - rules ● “No worries!” ○ docker run -d lets-mine-bitcoin:latest
  • 28. Docker enforcer - rules ● “No worries!” ○ docker run -d lets-mine-bitcoin:latest ● Rule { "name": "must use less than 1 GiB of memory", "rule": lambda c: c.params['HostConfig']['Memory'] == 0 or c.params['HostConfig']['Memory'] > 1074000000 }, { "name": "must use less than 2 CPU cores", "rule": lambda c: c.params['HostConfig']['CpuQuota'] == 0 or (int(c.params['HostConfig']['CpuQuota']) / (100000 if c.params['HostConfig']['CpuPeriod'] == 0 else int(c.params['HostConfig']['CpuPeriod'])) ) > 2}
  • 29. Docker enforcer - rules “Dear users, Please be careful when you assign ports to your containers. Don’t use ports below 1024. Admins”
  • 30. Demo
  • 31. Docker enforcer - rules ● “No worries!” docker run -d -p 22:22 my-super-ssh
  • 32. Docker enforcer - rules ● docker run -d -p 22:22 my-super-ssh ● rules = [{"name": "can't use ports below 1024 on the default IP", "rule": lambda c: False if 'PortBindings' not in c.params['HostConfig'] or c.params['HostConfig']['PortBindings'] is None else check_ports_on_default(c.params['HostConfig']['PortBindings']) }] def check_ports_on_default(bindings): for pbs in bindings.values(): if pbs is None: continue if any(pb['HostPort'] != '' and int(pb['HostPort'].replace('/udp', '')) < 1024 for pb in pbs): return True return False
  • 33. Docker enforcer - status API ● http://localhost:8888/ { "last_full_check_run_time": "0:00:00.404284", "detections": [ {"id": "4c5..12b", "name": "/test", "violated_rule": "must have CPU limit", "count": 1, "last_timestamp": "2017-09-17T13:55:04.851144" } ]} ● http://localhost:8888/config { "cache_params": true, "disable_metrics": true, … ● http://localhost:8888/rules rules = [...]
  • 34. Docker enforcer - CLI call $ docker run -d alpine true docker: Error response from daemon: authorization denied by plugin enforcer: must have CPU limit. See 'docker run --help'.
  • 36. Networking - legacy ● Not HTTP+JSON microservices ○ Old friends: FTP, SMTP, SIP, … ● New requirements ○ Individual IPs for containers, but from different subnets and preserving external (AWS VPC) IP ○ Exposing massive number of ports (SIP)
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42. Networking - per container IPs # interface ip addr add 10.10.0.2/24 dev eth1 ip route add default via 10.10.0.1 dev eth1 table 101 ip route add 10.10.0.0/24 dev eth1 src 10.10.0.2 table 101 ip rule add from 10.10.0.2 lookup 101 # container ip r a 172.17.0.0/16 dev docker0 tab 101 ip rule add from 172.17.0.20 lookup 101 iptables -t nat -I POSTROUTING -s 172.17.0.20 -j SNAT --to-source 10.10.0.2
  • 43. Networking - port storm ● What will this command do? ○ docker run -d -p 2000-3000:2000-3000 alpine sh
  • 44. Networking - port storm ● What will this command do? ○ docker run -d -p 2000-3000:2000-3000 alpine sh ● Don’t expose single ports at all, translate whole IP in one go ○ docker run -d alpine sh ○ iptables -t nat -I PREROUTING -i eth1 -d 10.10.0.3 -j DNAT --to-destination 172.17.0.20
  • 47. [TO DEL] Process management Diagram - how signal handling works
  • 48. [TO DEL] Image Quality ● Process management ○ Init / Process manager ○ Avoid process in containers getting in D state (check for remote filesystem, etc) ○ Signal handling ○ Handle container main process restart/termination
  • 49. [TO DEL] Building Docker Images● Java ○ JVM limits CPU threads, memory
  • 50. Recap ● Outcomes ○ Increase utilization from 5% to 72% ○ Decrease infrastructure costs from 13M to 6M ● Main challenges ○ Noisy neighbours ○ Configuration compliance ○ Networking
  • 51. Roadmap ● Dockerize everything, our goal is to have 0 VMs out of our CaaS platform ● New platform for stateless containers ○ Orchestration ○ Multi AZ on AWS Spot ● Invest in re-engeering non-dockerizable apps to make them dockerizable and in dockerized app to make them cloud enabled.
  • 52. We’re hiring? Hallway tracks: ● Docker Enforcer ● Running 100+ containers per node Q & A?