Asterisk & the Docker revolution Some lessons from the trenches

Similar documents
[Docker] Containerization

Docker A FRAMEWORK FOR DATA INTENSIVE COMPUTING

containerization: more than the new virtualization

Docker und IBM Digital Experience in Docker Container

Who is Docker and how he can help us? Heino Talvik

Think Small to Scale Big

4 Effective Tools for Docker Monitoring. By Ranvijay Jamwal

Getting Started With Containers

Cross platform enablement for the yocto project with containers. ELC 2017 Randy Witt Intel Open Source Technology Center

Investigating Containers for Future Services and User Application Support

Travis Cardwell Technical Meeting

Introduction to Containers

CS-580K/480K Advanced Topics in Cloud Computing. Container III

An introduction to Docker

Spring 2017 :: CSE 506. Introduction to. Virtual Machines. Nima Honarmand

Kubernetes The Path to Cloud Native

Docker. Master the execution environment of your applications. Aurélien Dumez. Inria Bordeaux - Sud-Ouest. Tuesday, March 24th 2015

UP! TO DOCKER PAAS. Ming

OS Virtualization. Linux Containers (LXC)

SAINT LOUIS JAVA USER GROUP MAY 2014

Best Practices for Developing & Deploying Java Applications with Docker

Docker and Security. September 28, 2017 VASCAN Michael Irwin

Engineering Robust Server Software

Quick Prototyping+CI with LXC and Puppet

The failure of Operating Systems,

ISLET: Jon Schipp, AIDE jonschipp.com. An Attempt to Improve Linux-based Software Training

Kuber-what?! Learn about Kubernetes

Leveraging Docker and CoreOS to provide always available Cassandra at Instaclustr

The Long Road from Capistrano to Kubernetes

FIVE REASONS YOU SHOULD RUN CONTAINERS ON BARE METAL, NOT VMS

Code: Slides:

MySQL As A Service. Operationalizing 19 Years of Infrastructure at GoDaddy

Containerizing GPU Applications with Docker for Scaling to the Cloud

Presented By: Gregory M. Kurtzer HPC Systems Architect Lawrence Berkeley National Laboratory CONTAINERS IN HPC WITH SINGULARITY

USING DOCKER FOR MXCUBE DEVELOPMENT AT MAX IV

docker & HEP: containerization of applications for development, distribution and preservation

Follow me!

Persistent Storage with Docker in production - Which solution and why?

Kubernetes 101. Doug Davis, STSM September, 2017

Improving User Accounting and Isolation with Linux Kernel Features. Brian Bockelman Condor Week 2011

Running MarkLogic in Containers (Both Docker and Kubernetes)

AGILE DEVELOPMENT AND PAAS USING THE MESOSPHERE DCOS

Docker 101 Workshop. Eric Smalling - Solution Architect, Docker

CS197U: A Hands on Introduction to Unix

DevOps in the Cloud A pipeline to heaven?! Robert Cowham BCS CMSG Vice Chair

Container-based virtualization: Docker

Introduction to containers

Choosing the Right Container Infrastructure for Your Organization

High Performance Containers. Convergence of Hyperscale, Big Data and Big Compute

Using DC/OS for Continuous Delivery

Docker for Sysadmins: Linux Windows VMware

VM Migration, Containers (Lecture 12, cs262a)

A review of AIX Container Technology: with perspectives on. Docker Management Operations. Zeyuan Zhu. AIX Development Engineer

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

WHITE PAPER. RedHat OpenShift Container Platform. Benefits: Abstract. 1.1 Introduction

One year of Deploying Applications for Docker, CoreOS, Kubernetes and Co.

How Container Runtimes matter in Kubernetes?

An Overview of the Architecture of Juno: CHPC s New JupyterHub Service By Luan Truong, CHPC, University of Utah

Allowing Users to Run Services at the OLCF with Kubernetes

STATUS OF PLANS TO USE CONTAINERS IN THE WORLDWIDE LHC COMPUTING GRID

CONTAINERS AND MICROSERVICES WITH CONTRAIL

Open Containers of Champagne

PVS Deployment in the Cloud. Last Updated: June 17, 2016

Container Adoption for NFV Challenges & Opportunities. Sriram Natarajan, T-Labs Silicon Valley Innovation Center

Flip the Switch to Container-based Clouds

agenda PAE Docker Docker PAE

Portable, lightweight, & interoperable Docker containers across Red Hat solutions

Con$nuous Deployment with Docker Andrew Aslinger. Oct

16 Sharing Main Memory Segmentation and Paging

Hedvig as backup target for Veeam

GitLab-CI and Docker Registry

Docker for HPC? Yes, Singularity! Josef Hrabal

Microsoft Cloud Workshop. Containers and DevOps Hackathon Learner Guide

The new Docker networking put into action to spin up a SLURM cluster

Lessons Learned: Deploying Microservices Software Product in Customer Environments Mark Galpin, Solution Architect, JFrog, Inc.

Going Journey to Docker Production. Add picture here. Bret Fisher. DevOps Consultant Docker Captain Author of Udemy's Docker Mastery

Buenos Aires 31 de Octubre de 2018

LSST software stack and deployment on other architectures. William O Mullane for Andy Connolly with material from Owen Boberg

Introduction to Container Technology. Patrick Ladd Technical Account Manager April 13, 2016

/ Cloud Computing. Recitation 5 September 26 th, 2017

VNS3 3.5 Container System Add-Ons

Deployment Patterns using Docker and Chef

Java Without the Jitter

FROM MONOLITH TO DOCKER DISTRIBUTED APPLICATIONS

VMware vsphere with ESX 4.1 and vcenter 4.1

Developing and Testing Java Microservices on Docker. Todd Fasullo Dir. Engineering

Distributed Systems 27. Process Migration & Allocation

Can t Believe It s Linux. a totally different and hypothetical linux distribution

Run containerized applications from pre-existing images stored in a centralized registry

Network softwarization Lab session 2: OS Virtualization Networking

Advanced Continuous Delivery Strategies for Containerized Applications Using DC/OS

ovirt and Docker Integration

/ Cloud Computing. Recitation 5 February 14th, 2017

Building A Better Test Platform:

Docker and the Database Factory

It s probably the most popular containerization technology on Linux these days

Fixing the "It works on my machine!" Problem with Docker

Operating Systems 4/27/2015

Optimizing and Enhancing VM for the Cloud Computing Era. 20 November 2009 Jun Nakajima, Sheng Yang, and Eddie Dong

TEN LAYERS OF CONTAINER SECURITY. Kirsten Newcomer Security Strategist

Transcription:

Asterisk & the Docker revolution Some lessons from the trenches Asterisk Africa Johannesburg - March 14, 2018 Presented by: Lenz Emilitri Founder, Loway @lenz

Today s presentation Docker Benefits How it works Pros & cons Asterisk on Docker Why and why not Pitfalls & pain points Lessons learnt 2

Why me? In 2012 I started thinking about hosted service for QueueMetrics Found Docker in 2013 First beta customers in 2014 Launched as public product in October 2015 http://queuemetrics-live.com Expect to have ~2000 instances by end of 2018 3

What is Docker? Docker is an engine and ecosystem built to run containers Containers run images stand-alone executable packages that include everything needed to function You can think of containers as micro-vms That s what they were designed for...but maybe you shouldn t.

Why is Docker a revolution? Improves server density Bare metal VM Container Installation simplicity ISO Package manager Container Reduces TCO You manage a server you kill a container

How does Docker work? Uses Linux LXC: cgroups, namespaces and iptables LXC (LinuX Containers) available since 2008 Similar in spirit to FreeBSD jails Private perspective of Kernel resources PIDs Network File-systems

Docker: PIDs Processes running in the same container see each other Processes are visible from the host container A container works like a stand-alone VM Container can apply/enforce resource limits You can join a container (run process or even a shell)

Docker: Networking Expose a set of inbound TCP/UPD ports on the host that will tunnel to a specific Docker instance Can use fixed IP addresses Can create different types of networks, even spanning multiple hosts and resolving DNS queries

Docker: Filesystems Docker uses overlay filesystems Usually mounts all layers read-only but the last ones Flexible mount policy Big performance hit compared to normal FS Defaults not suitable for production Can mount data volumes and local dirs

Docker: Images & Base images Images: a complete, installed, ready-to-run file-system Made of multiple layers of customization, from a base image Live on private or public registry servers Striving for minimum size is it worth it? Big images are shared The container only runs your own processes Sane environment helps troubleshooting

Docker: creating an image Create an image by defining a Dockerfile Starts from a base image Does stuff (downloads, compiles and installs packages, copies config files) Exposes a process to be run, a set of ports/services and mount points Repeat and throw away until satisfied. Push to a repository for consumption

Docker: Running Install Docker (CentOS 7 1.12): yum install -y docker-io From a system running Docker, just run: docker run -p 12345:5038 -P -d lenz/asterisk-load-test-13 Magic just happens Behaves as a single black-box

Docker: What goes on You can see a container from its host: You can see the proxies that allow network comunication

Docker: Listing Check the state of a container you just run: CONTAINER ID e18626543d15 IMAGE lenz/asterisk-load-test13 COMMAND "/ww/run" CREATED 9 seconds ago STATUS Up 7 seconds PORTS 0.0.0.0:12345->5038/tcp, 0.0.0.0:32768->8088/tcp NAMES nostalgic_mccarthy

Docker: Joining Entering a container: docker exec -it nostalgic_mccarthy bash [root@e18626543d15 /]# ps PID TTY TIME CMD 160? 00:00:00 bash 172? 00:00:00 ps [root@e18626543d15 /]# exit

Docker: Monitoring Resource usage: docker stats CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS e186263d15 1.19% 28.69 MiB / 1.797 GiB 1.56% 1.527 kb / 804 B 106.1 MB / 454.7 kb 0 Processes in container: docker top

Docker: Stopping / Removing To stop a container: # docker stop nostalgic_mccarthy nostalgic_mccarthy Container appears as: Exited (137) 6 seconds ago Remove container (purges storage): # docker rm e18626543d15 e18626543d15

Example: Data Transformer Non-persistent process Avoid installation / dependency hell Stuff in Stuff out Don t care how it s done Very common: compile pipelines, transcoding, watermarking...

Docker pro s Easy to run No configuration mismatches Disposable mentality for upgrades Encourages decomposition Use different base distros as needed Performance Little overhead and latency compared to VM IO / Networking generally adequate

Docker cons Managing state / distributed state Managing data volumes Managing product life-cycle Production monitoring What actually happens within a third-party container?

Today s presentation Docker Benefits How it works Pros&cons Asterisk on Docker Why and why not Pitfalls & pain points Lessons learnt 21

Why Asterisk on Docker Organizational advantages: Rationalize deployment Simplify testing and development Simplify upgrades and rollbacks Simplify production environment Technical advantages: Lower latency compared to VM Horizontal scalability

Asterisk: rationalize & tame Asterisk is a prime example of pet vs cattle Few, hand-tweaked servers Local configuration Sometimes compiled locally Often exposed to clients (phones/providers) Just works Opportunity: rationalize deployment 23

Asterisk: simpler development Simplify development / testing Use same production image Easier to run system tests Capture environment differences explicitly Less painful than spinning up a full VM Way less painful than installing from ISO 24

Asterisk: better upgrades Easier and cleaner management of upgrades Expected downtime measured in seconds Simple to implement Blue/Green scenarios Easy roll-back in case upgrades abort! 25

Asterisk as a part of production Asterisk is only a part of a real-world solution: Reporting Log storage Dialers Recordings CRM...you name it All of them can benefit from Docker 26

Asterisk: latency A container has better latency than a VM Native scheduler Native clock / interrupts A container pre-empts less resources than a VM

Asterisk: horizontal scalability Pool of Asterisks + Kamailios: can grow quite a lot Favours a mindset of many, simple, replaceable and not monoliths

When NOT to use Need access to specific hardware Need an all-in-one distro or app that is not available in Docker 29

Pitfalls & pain points Asterisk specific Networking / configuration Docker specific Orchestration Organization 30

Pitfalls: Asterisk specific Networking: prefer host networking and attach to specific IP expose AMI, ARI, SIP/RTP check transport_udp in pjsip.conf RTP: proxy very slow reduce port range in rtp.conf (1000s) Resources & limits: set ulimit for open files can control CPU/IO/memory limits 31

Pitfalls: Asterisk file system Filesystem has five logical layers: Image (read only) Write layer on top of image (RW / slow) State you need to run Configuration & AstDB State you want to keep Logs Recordings 32

Pitfalls: Managing state Planning Try centralizing state: Who does what Who talks to whom Need external services: Private registry Notify containers (etcd) Backup containers (S3) Monitoring (Influx/Grafana) 33

Pitfalls: Data volumes No hot migration Data-heavy containers tied to data: Easier to define Hot-Backup policy Will discover early if something missing! Data volumes or data directories? Master state (only one - migrated) Logs (one per run) Resources (mounted externally) 34

Pitfalls: Application life-cycle For Docker an instance is UP when started This may or may not be the case Life-cycle is not managed Workaround: developed Whaleware in 2015 Managed life-cycle Gathering of statistics Self-healing when possible Still need to notify dependent services 35

Today s presentation Docker Benefits How it works Pros&cons Asterisk on Docker Why and why not Pitfalls & pain points Lessons learnt 36

Lessons learnt Docker may make your life easier Strive for simplicity Stay away from bleeding edge Orchestration can work for you or against you. Ansible for effective management of host servers 37

Links Excellent Asterisk Docker image by Doug Smith: https://github.com/dougbtv/docker-asterisk with HA example based on Kamailio Whaleware: managed life-cycle for Docker: https://github.com/l3nz/whaleware with Asterisk examples for AMI/ARI load-testing Dockbooker: https://github.com/l3nz/dockbooker 38

Thanks for attending! Pro Tip: You can run QueueMetrics and WombatDialer right out of Docker! 39