SlideShare a Scribd company logo
Continuous Integration and
Kamailio
Automating builds, deployments and tests for fast-moving projects
1Giacomo Vacca, Kamailio World 2016
About me
• 15 years “in the trenches cubicles”
• Developer of RTC (VoIP, IM, WebRTC) solutions
• Often dealing with DevOps topics
• Founder of RTCSoft in 2015
• Working with Orange Libon Voice Team
@giavac
https://github.com/giavac
gv@rtcsoft.net
2Giacomo Vacca, Kamailio World 2016
Material for the Workshop
• https://github.com/giavac/kamailio_ci
• rtpengine_build
• kamailio_testing
• (You can start preparing the base Docker images)
3Giacomo Vacca, Kamailio World 2016
Kamailio and the need for CI
• Several developers working on the same code base
• Not everybody uses stock packages (in-house builds)
• Save time (test continuously, so that the uncertainty on QA is low)
• Save money (reduce costs of building/testing machines)
• Release more often, with lower risks
4Giacomo Vacca, Kamailio World 2016
CI servers
• Most used CI platforms are OSS: Jenkins, Travis
• Automation of Build, Test, Deployment
• Integration with git and other tools
• Jenkins: typical for private CI infrastructures
• Travis: designed for Open Source projects
5Giacomo Vacca, Kamailio World 2016
Build automation
6Giacomo Vacca, Kamailio World 2016
CI infrastructure for builds
7Giacomo Vacca, Kamailio World 2016
Build environments
• Personal VM/Dedicated dev machine
• Jenkins with dedicated build machine (slave)
• Jenkins with Docker-based slaves
• Docker plugin
• Mesos cluster management
8Giacomo Vacca, Kamailio World 2016
Artefacts
• Packages, tarballs, Docker images, other files to be uploaded
• Private and public repos
• Use existing artefacts to reduce build time and improve consistency
• Build once, use many times
• Careful (and possibly unique) versioning
9Giacomo Vacca, Kamailio World 2016
How clean is your build environment?
• Full control of build requirements:
• Not sharing environments across apps
• Not reusing polluted environments (keep releases predictable)
• Clean up the build environment or…
• Create a new environment for each build
• Containers as light-weight “build machines”
• Build once, test until production (“non-event releases”)
10Giacomo Vacca, Kamailio World 2016
A huge opportunity: Docker
• Quick introduction to Docker
• Simulate a specific Linux distribution in seconds
• Virtualise, while keeping the host performances
• “A few dedicated build machines” vs “Many disposable build
containers”
• Keep builds reproducible by always creating clean environments
11Giacomo Vacca, Kamailio World 2016
Container-level virtualisation
Source: https://docs.docker.com/12Giacomo Vacca, Kamailio World 2016
Base build images for kamailio
• Pre-requirements
• Keeping the images small
• Many different distributions
• (Beware of container re-use)
13Giacomo Vacca, Kamailio World 2016
Dockerfile for base CentOS kamailio
FROM centos:7
RUN rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm && 
yum install -y gcc make bison flex libcurl libcurl-devel libunistring-devel 
openssl openssl-devel pcre-devel zlib-devel lua-5.1.4-14.el7 
lua-devel-5.1.4-14.el7 mysql-community-devel-5.6.26-2.el7 
libxml2-devel perl-ExtUtils-Embed net-snmp-devel memcached 
cyrus-sasl-devel && 
yum clean all
14Giacomo Vacca, Kamailio World 2016
Dockerfile step by step
• Define base image (FROM)
• Change this to the distribution needed, or to other base images
• Install dependencies packages (RUN - rpm/yum)
• Clean up yum configuration (limit image size)
15Giacomo Vacca, Kamailio World 2016
Build base image
$ cd kamailio_async_centos7/
$ docker build -t gvacca/kamailio_async:centos -f Dockerfile.centos7 .
$ docker images |grep kamailio_async
gvacca/kamailio_async centos7 3fa45a9c3c1e 3 days ago 393.8 MB
($ docker build -t USER/IMAGE:TAG [-f DOCKERFILE] .)
16
This base image will be used later as build host for kamailio
Giacomo Vacca, Kamailio World 2016
Good practices when using containers
• Avoid git checkout inside containers
• Do not copy sensitive data into images
• Make data available indirectly
(volumes)
• Clean up after yourself: keep images
small
• Limit the number of instructions (RUN)
• Careful about the caching system
• Define the “base build image”, to be reused
• Reduce unnecessary re-builds
• Ensure same pre-requisites are enforced
• Be careful about container re-usage (e.g.
“life time” in a Mesos cluster)
17Giacomo Vacca, Kamailio World 2016
Building kamailio
$ docker run -t --name kamailio_async_built_debian_4.4.1 -v ~/git/kamailio-devel/
kamailio:/root/kamailio -v $PWD/kamailio_async_debian/scripts:/root/scripts gvacca/
kamailio_async:debian /root/scripts/build.sh
($ docker run -t --name ${BUILT_KAMAILIO} -v ${KAMAILIO_SRC}:/root/kamailio -v $PWD/
kamailio_async_${TEST_DISTRIBUTION}/scripts:/root/scripts ${TEST_USER}/
kamailio_async:${TEST_DISTRIBUTION} /root/scripts/build.sh)
make distclean
make cfg include_modules=http_async_client
make all
# or create tarball/rpms
# and store artefacts
Build instruction:
/root/scripts/build.sh:
18Giacomo Vacca, Kamailio World 2016
Build job
• Uses the “base build image” as slave
• Maximise reproducibility of builds: re-use slaves carefully
19Giacomo Vacca, Kamailio World 2016
Base build images for rtpengine
• Stronger restrictions on the host kernel
• But doesn’t need to have the same as the target host
• Ensure the right kernel headers are in place
• Build and prepare artefacts as for other cases
20Giacomo Vacca, Kamailio World 2016
Dockerfile for rtpengine base image
FROM centos:7
RUN yum install -y make glib2-devel zlib-devel kmod hiredis-devel 
openssl-devel xmlrpc-c-devel iptables-devel git 
&& yum clean all
21Giacomo Vacca, Kamailio World 2016
Building rtpengine
$ cd $SRC
$ git clone https://github.com/sipwise/rtpengine
$ cd $PROJECT/rtpengine_build/
$ docker build -t gvacca/rtpengine:centos -f Dockerfile .
$ docker run -t --name rtpengine_built -v $PWD/:/root -v $SRC/rtpengine:/root/rtpengine 
gvacca/rtpengine:centos /root/build.sh
$ docker ps -a|grep rtpengine
78edf9e7412c gvacca/rtpengine:centos "/root/build.sh" 2 minutes ago
Exited (0) 27 seconds ago rtpengine_built
$ docker logs -f rtpengine_built
22Giacomo Vacca, Kamailio World 2016
Deployment automation
23Giacomo Vacca, Kamailio World 2016
Deploying from a CI platform
• Deploy on Production or other environments (dev, staging, etc)
• Deploy on test beds for the specific purpose of testing
• Validate release candidates with automatic tests after deployments
24Giacomo Vacca, Kamailio World 2016
Jenkins + Fabric + Puppet
• Puppet master is the ideal/common scenario
• Puppet standalone for “push” deployments
• Fabric to transfer Puppet manifests and execute remote deployment
• Good idea: clean up manifests after the application (as Ansible)
• Docker to host Fabric, its config and Puppet manifests for fast use and
encapsulation
• See brand new Puppet module for Homer: https://github.com/sipcapture/
homer-puppet
25Giacomo Vacca, Kamailio World 2016
From source to deployment
26Giacomo Vacca, Kamailio World 2016
Test automation
27Giacomo Vacca, Kamailio World 2016
A CI inftrastucture comes handy for…
• Unit testing
• Component testing
• Integration testing
• Load testing
We’ll see an example later of component/integration testing
28Giacomo Vacca, Kamailio World 2016
Putting it all together
29Giacomo Vacca, Kamailio World 2016
Case study: testing http_async_client
Asynchronous HTTP client for Kamailio, http://www.kamailio.org/docs/
modules/devel/modules/http_async_client.html
• Dockerise all the components (can be run anywhere)
• Test on multiple distributions
• Simulate web servers
• Trigger tests with sipp
30Giacomo Vacca, Kamailio World 2016
Test architecture for http_async_client
31Giacomo Vacca, Kamailio World 2016
Docker Compose to abstract the test architecture
• Docker Compose helps you defining a multi-container architecture
• Containers are “services”
• YAML to define base images, volumes, ports, commands, etc
• Internal naming system: no need to use IP addresses (like e.g.
‘docker network’), just use the service name
• docker-compose.yml supports natively environment variables
32Giacomo Vacca, Kamailio World 2016
docker-compose.yml
version: '2'
services:
nginx:
image: $TEST_USER/nginx_ssl
volumes:
- ./nginx_ssl/website/:/var/www/html/website/
- ./nginx_ssl/nginx/ssl/:/etc/nginx/ssl/
ports:
- 443:443
kamailio_async:
image: ${TEST_IMAGE}
volumes:
- $PWD/kamailio_async_${TEST_DISTRIBUTION}/scripts:/root/scripts
ports:
- 5060/UDP:5060/UDP
command: /root/scripts/run.sh
sipp:
image: $TEST_USER/sipp
volumes:
- ./sipp/scenarios/:/root/sipp/
command: tail -f /dev/null
depends_on:
- kamailio_async
33Giacomo Vacca, Kamailio World 2016
docker-compose.yml - Variables
• $TEST_USER
• $TEST_IMAGE
• $TEST_DISTRIBUTION
34Giacomo Vacca, Kamailio World 2016
kamailio.cfg under test
#!KAMAILIO
mpath="/usr/local/lib64/kamailio/modules/"
loadmodule "pv.so"
loadmodule "tm.so"
loadmodule "tmx.so"
loadmodule "textops.so"
loadmodule "xlog.so"
loadmodule "http_async_client.so"
modparam("http_async_client", "connection_timeout", 10000)
modparam("http_async_client", "tls_verify_host", 0)
modparam("http_async_client", "tls_verify_peer", 0)
debug=2
log_stderror=no
pv_buffer_size=4096
request_route {
xlog("L_ALERT", "Processing request...n");
if ($rm eq "MESSAGE") {
if(t_newtran()) {
xlog("L_ALERT", "$ci: requesting $hdr(P-Url)n");
http_async_query("$hdr(P-Url)", "http_reply");
}
}
}
route[http_reply] {
if ($http_ok) {
xlog("L_INFO", "route[HTTP_REPLY]: status $http_rsn");
xlog("L_INFO", "route[HTTP_REPLY]: body $http_rbn");
set_reply_body("$http_rb", "text/plain");
append_to_reply("P-Http-Status: $http_rsrn");
xlog("L_ALERT", "received response $http_rs <$http_rb> for trans $T(id_index):$T(id_label)n");
t_reply("200", "Ok");
} else {
xlog("L_INFO", "route[HTTP_REPLY]: error $http_err)n");
t_reply("500", "Something is wrong");
}
}
35Giacomo Vacca, Kamailio World 2016
Preparing base images for http_async_client
cd nginx_ssl/
docker build -t USER/nginx_ssl .
cd ../sipp/
docker build -t USER/sipp .
cd ../kamailio_async_centos7/
docker build -t USER/kamailio_async:centos7 -f Dockerfile.centos .
36Giacomo Vacca, Kamailio World 2016
Prepare and run tests
$./prepare_built_kamailio.sh gvacca debian ~/git/kamailio-devel/
kamailio 4.4
$ ./launch_tests.sh gvacca/kamailio_async:debian_4.4.1
$ docker logs -f kamailiotesting_kamailio_async_1
37Giacomo Vacca, Kamailio World 2016
Containers and network
$ docker ps
IMAGE COMMAND PORTS NAMES
gvacca/kamailio_async:ubuntu "sh /root/build_run.s" 0.0.0.0:5060->5060/udp kamailiotesting_kamailio_async_1
gvacca/nginx_ssl "/bin/sh -c nginx" 80/tcp, 0.0.0.0:443->443/tcp kamailiotesting_nginx_1
gvacca/sipp "tail -f /dev/null" kamailiotesting_sipp_1
$ python inspect_docker_network.py kamailiotesting_default
29d589f5db0c6f32973c58c05678094cf1f1f83d8dfcf43c4850a8fa3a3ccb39 '/kamailiotesting_sipp_1': 172.18.0.3/16
75a8139ea6b3102a844ee8becbc9ba7a26df86bb70a2f31589bfad8f86114032 '/kamailiotesting_nginx_1': 172.18.0.2/16
b9472f70cccdc968cc1d61c9caca02118ed2c1957fd13f2bb18fe2eaefd0e310 '/kamailiotesting_kamailio_async_1': 172.18.0.4/16
38Giacomo Vacca, Kamailio World 2016
Conclusions/future
• kamailio, as other apps, will run inside containers
• “Service Discovery” tools will be key
• Emulation of entire infrastructures on top of container-based platforms
• Lightweight distributions as simple containers infrastructure
• Continuous Integration/Delivery will be the norm
39Giacomo Vacca, Kamailio World 2016
Q&A
40Giacomo Vacca, Kamailio World 2016
References and useful sources
• https://www.kamailio.org/w/2015/11/building-kamailio-in-docker/
• “The Docker book”, J. Turnbull, http://www.amazon.co.uk/Docker-Book-Containerization-
new-virtualization-ebook/dp/B00LRROTI4
• “Using Docker”, A. Mouat,https://www.amazon.co.uk/Using-Docker-Adrian-Mouat/dp/
1491915765
• “Continuous Delivery”, J. Humble, http://www.amazon.com/Continuous-Delivery-
Deployment-Automation-Addison-Wesley/dp/0321601912
• “Building Microservices”, S. Newman, http://shop.oreilly.com/product/0636920033158.do
• "Docker Networking and Service Discovery", https://www.nginx.com/resources/library/
docker-networking/
41Giacomo Vacca, Kamailio World 2016
More presentations on this topic
• “Docker and Puppet for CI”, http://www.slideshare.net/GiacomoVacca/
docker-and-puppet-for-continuous-integration
• “Automatic Kamailio Deployments with Puppet”, Kamailio World 2014,
http://www.slideshare.net/GiacomoVacca/automatic-
kamailiodeploymentswithpuppet-33085423
42Giacomo Vacca, Kamailio World 2016
Thanks!
• Federico Cabiddu
• Camille Oudot
• Victor Seva
43Giacomo Vacca, Kamailio World 2016
Additional slides
44Giacomo Vacca, Kamailio World 2016
Docker inside docker
• Manage an environment of containers inside a container
• Powerful
• With disadvantages
• Consider the “sibling” approach, rather than the nested one
• Build networks of containers and command some of them via the
socket API
45Giacomo Vacca, Kamailio World 2016

More Related Content

What's hot

Kamailio :: A Quick Introduction
Kamailio :: A Quick IntroductionKamailio :: A Quick Introduction
Kamailio :: A Quick Introduction
Olle E Johansson
 
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
Astricon 10 (October 2013) - SIP over WebSocket on KamailioAstricon 10 (October 2013) - SIP over WebSocket on Kamailio
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
Crocodile WebRTC SDK and Cloud Signalling Network
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
Evan McGee
 
Scaling FreeSWITCH Performance
Scaling FreeSWITCH PerformanceScaling FreeSWITCH Performance
Scaling FreeSWITCH Performance
Moises Silva
 
Kamailio on Docker
Kamailio on DockerKamailio on Docker
Kamailio on Docker
Chien Cheng Wu
 
Using ARI and AGI to Connect Asterisk Instances
Using ARI and AGI to Connect Asterisk Instances Using ARI and AGI to Connect Asterisk Instances
Using ARI and AGI to Connect Asterisk Instances
Jöran Vinzens
 
Why is Kamailio so different? An introduction.
Why is Kamailio so different? An introduction.Why is Kamailio so different? An introduction.
Why is Kamailio so different? An introduction.
Olle E Johansson
 
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Fred Posner
 
Kamailio - SIP Routing in Lua
Kamailio - SIP Routing in LuaKamailio - SIP Routing in Lua
Kamailio - SIP Routing in Lua
Daniel-Constantin Mierla
 
FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker
Chien Cheng Wu
 
OpenSIPS Workshop
OpenSIPS WorkshopOpenSIPS Workshop
OpenSIPS Workshop
Saúl Ibarra Corretgé
 
Dave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMUDave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMU
Danny Abukalam
 
Kamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and YouKamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and You
Fred Posner
 
Kamailio - Secure Communication
Kamailio - Secure CommunicationKamailio - Secure Communication
Kamailio - Secure Communication
Daniel-Constantin Mierla
 
Kamailio - Load Balancing Load Balancers
Kamailio - Load Balancing Load BalancersKamailio - Load Balancing Load Balancers
Kamailio - Load Balancing Load Balancers
Daniel-Constantin Mierla
 
Qemu Introduction
Qemu IntroductionQemu Introduction
Qemu Introduction
Chiawei Wang
 
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
Three Ways Kamailio Can Help Your FreeSWITCH DeploymentThree Ways Kamailio Can Help Your FreeSWITCH Deployment
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
Fred Posner
 
FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker
建澄 吳
 
SR-IOV+KVM on Debian/Stable
SR-IOV+KVM on Debian/StableSR-IOV+KVM on Debian/Stable
SR-IOV+KVM on Debian/Stable
juet-y
 
SIPREC RTPEngine Media Forking
SIPREC RTPEngine Media ForkingSIPREC RTPEngine Media Forking
SIPREC RTPEngine Media Forking
Hossein Yavari
 

What's hot (20)

Kamailio :: A Quick Introduction
Kamailio :: A Quick IntroductionKamailio :: A Quick Introduction
Kamailio :: A Quick Introduction
 
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
Astricon 10 (October 2013) - SIP over WebSocket on KamailioAstricon 10 (October 2013) - SIP over WebSocket on Kamailio
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
 
Scaling FreeSWITCH Performance
Scaling FreeSWITCH PerformanceScaling FreeSWITCH Performance
Scaling FreeSWITCH Performance
 
Kamailio on Docker
Kamailio on DockerKamailio on Docker
Kamailio on Docker
 
Using ARI and AGI to Connect Asterisk Instances
Using ARI and AGI to Connect Asterisk Instances Using ARI and AGI to Connect Asterisk Instances
Using ARI and AGI to Connect Asterisk Instances
 
Why is Kamailio so different? An introduction.
Why is Kamailio so different? An introduction.Why is Kamailio so different? An introduction.
Why is Kamailio so different? An introduction.
 
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
 
Kamailio - SIP Routing in Lua
Kamailio - SIP Routing in LuaKamailio - SIP Routing in Lua
Kamailio - SIP Routing in Lua
 
FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker
 
OpenSIPS Workshop
OpenSIPS WorkshopOpenSIPS Workshop
OpenSIPS Workshop
 
Dave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMUDave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMU
 
Kamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and YouKamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and You
 
Kamailio - Secure Communication
Kamailio - Secure CommunicationKamailio - Secure Communication
Kamailio - Secure Communication
 
Kamailio - Load Balancing Load Balancers
Kamailio - Load Balancing Load BalancersKamailio - Load Balancing Load Balancers
Kamailio - Load Balancing Load Balancers
 
Qemu Introduction
Qemu IntroductionQemu Introduction
Qemu Introduction
 
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
Three Ways Kamailio Can Help Your FreeSWITCH DeploymentThree Ways Kamailio Can Help Your FreeSWITCH Deployment
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
 
FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker
 
SR-IOV+KVM on Debian/Stable
SR-IOV+KVM on Debian/StableSR-IOV+KVM on Debian/Stable
SR-IOV+KVM on Debian/Stable
 
SIPREC RTPEngine Media Forking
SIPREC RTPEngine Media ForkingSIPREC RTPEngine Media Forking
SIPREC RTPEngine Media Forking
 

Similar to Continuous Integration and Kamailio

Kamailio World 2018 - Workshop: kamailio-tests
Kamailio World 2018 - Workshop: kamailio-testsKamailio World 2018 - Workshop: kamailio-tests
Kamailio World 2018 - Workshop: kamailio-tests
Giacomo Vacca
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
Roman Rodomansky
 
Pod Sandbox workflow creation from Dockershim
Pod Sandbox workflow creation from DockershimPod Sandbox workflow creation from Dockershim
Pod Sandbox workflow creation from Dockershim
Victor Morales
 
Docker - From Walking To Running
Docker - From Walking To RunningDocker - From Walking To Running
Docker - From Walking To Running
Giacomo Vacca
 
Virtualization with Vagrant (ua.pycon 2011)
Virtualization with Vagrant (ua.pycon 2011)Virtualization with Vagrant (ua.pycon 2011)
Virtualization with Vagrant (ua.pycon 2011)
Dmitry Guyvoronsky
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and Jenkins
Micael Gallego
 
Testing fácil con Docker: Gestiona dependencias y unifica entornos
Testing fácil con Docker: Gestiona dependencias y unifica entornosTesting fácil con Docker: Gestiona dependencias y unifica entornos
Testing fácil con Docker: Gestiona dependencias y unifica entornos
Micael Gallego
 
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
Oracle Korea
 
WSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on Containers
WSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on ContainersWSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on Containers
WSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on Containers
Lakmal Warusawithana
 
Deploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on ContainersDeploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on Containers
Imesh Gunaratne
 
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemDocker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Van Phuc
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3
kognate
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
Giacomo Vacca
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and docker
Fabio Fumarola
 
PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoHannes Hapke
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
Docker, Inc.
 
Kubernetes 101 and Fun
Kubernetes 101 and FunKubernetes 101 and Fun
Kubernetes 101 and Fun
QAware GmbH
 
Kubernetes 101 and Fun
Kubernetes 101 and FunKubernetes 101 and Fun
Kubernetes 101 and Fun
Mario-Leander Reimer
 
DockerCon 2016 Seattle Recap
DockerCon 2016 Seattle RecapDockerCon 2016 Seattle Recap
DockerCon 2016 Seattle Recap
Philipp Garbe
 
Part 6 Docker Toolbox - Mac
Part 6 Docker Toolbox - MacPart 6 Docker Toolbox - Mac
Part 6 Docker Toolbox - Mac
Biswajit De
 

Similar to Continuous Integration and Kamailio (20)

Kamailio World 2018 - Workshop: kamailio-tests
Kamailio World 2018 - Workshop: kamailio-testsKamailio World 2018 - Workshop: kamailio-tests
Kamailio World 2018 - Workshop: kamailio-tests
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
Pod Sandbox workflow creation from Dockershim
Pod Sandbox workflow creation from DockershimPod Sandbox workflow creation from Dockershim
Pod Sandbox workflow creation from Dockershim
 
Docker - From Walking To Running
Docker - From Walking To RunningDocker - From Walking To Running
Docker - From Walking To Running
 
Virtualization with Vagrant (ua.pycon 2011)
Virtualization with Vagrant (ua.pycon 2011)Virtualization with Vagrant (ua.pycon 2011)
Virtualization with Vagrant (ua.pycon 2011)
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and Jenkins
 
Testing fácil con Docker: Gestiona dependencias y unifica entornos
Testing fácil con Docker: Gestiona dependencias y unifica entornosTesting fácil con Docker: Gestiona dependencias y unifica entornos
Testing fácil con Docker: Gestiona dependencias y unifica entornos
 
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
 
WSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on Containers
WSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on ContainersWSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on Containers
WSO2ConEU 2016 Tutorial - Deploying WSO2 Middleware on Containers
 
Deploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on ContainersDeploying WSO2 Middleware on Containers
Deploying WSO2 Middleware on Containers
 
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemDocker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and docker
 
PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize Django
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
Kubernetes 101 and Fun
Kubernetes 101 and FunKubernetes 101 and Fun
Kubernetes 101 and Fun
 
Kubernetes 101 and Fun
Kubernetes 101 and FunKubernetes 101 and Fun
Kubernetes 101 and Fun
 
DockerCon 2016 Seattle Recap
DockerCon 2016 Seattle RecapDockerCon 2016 Seattle Recap
DockerCon 2016 Seattle Recap
 
Part 6 Docker Toolbox - Mac
Part 6 Docker Toolbox - MacPart 6 Docker Toolbox - Mac
Part 6 Docker Toolbox - Mac
 

More from Giacomo Vacca

STUN protocol
STUN protocolSTUN protocol
STUN protocol
Giacomo Vacca
 
Modern VoIP in modern infrastructures
Modern VoIP in modern infrastructuresModern VoIP in modern infrastructures
Modern VoIP in modern infrastructures
Giacomo Vacca
 
RIPP Notes
RIPP NotesRIPP Notes
RIPP Notes
Giacomo Vacca
 
Modern VoIP in Modern Infrastructures
Modern VoIP in Modern InfrastructuresModern VoIP in Modern Infrastructures
Modern VoIP in Modern Infrastructures
Giacomo Vacca
 
An SFU/MCU integration for heterogeneous environments
An SFU/MCU integration for heterogeneous environmentsAn SFU/MCU integration for heterogeneous environments
An SFU/MCU integration for heterogeneous environments
Giacomo Vacca
 
Homer - Workshop at Kamailio World 2017
Homer - Workshop at Kamailio World 2017Homer - Workshop at Kamailio World 2017
Homer - Workshop at Kamailio World 2017
Giacomo Vacca
 
[workshop] The Revolutionary WebRTC
[workshop] The Revolutionary WebRTC[workshop] The Revolutionary WebRTC
[workshop] The Revolutionary WebRTC
Giacomo Vacca
 
Docker From Scratch
Docker From ScratchDocker From Scratch
Docker From Scratch
Giacomo Vacca
 
Top 5 Challenges To Add Web Calls to Truphone VoIP Platform
Top 5 Challenges To Add Web Calls to Truphone VoIP PlatformTop 5 Challenges To Add Web Calls to Truphone VoIP Platform
Top 5 Challenges To Add Web Calls to Truphone VoIP Platform
Giacomo Vacca
 
Automatic Kamailio Deployments With Puppet
Automatic Kamailio Deployments With PuppetAutomatic Kamailio Deployments With Puppet
Automatic Kamailio Deployments With Puppet
Giacomo Vacca
 

More from Giacomo Vacca (10)

STUN protocol
STUN protocolSTUN protocol
STUN protocol
 
Modern VoIP in modern infrastructures
Modern VoIP in modern infrastructuresModern VoIP in modern infrastructures
Modern VoIP in modern infrastructures
 
RIPP Notes
RIPP NotesRIPP Notes
RIPP Notes
 
Modern VoIP in Modern Infrastructures
Modern VoIP in Modern InfrastructuresModern VoIP in Modern Infrastructures
Modern VoIP in Modern Infrastructures
 
An SFU/MCU integration for heterogeneous environments
An SFU/MCU integration for heterogeneous environmentsAn SFU/MCU integration for heterogeneous environments
An SFU/MCU integration for heterogeneous environments
 
Homer - Workshop at Kamailio World 2017
Homer - Workshop at Kamailio World 2017Homer - Workshop at Kamailio World 2017
Homer - Workshop at Kamailio World 2017
 
[workshop] The Revolutionary WebRTC
[workshop] The Revolutionary WebRTC[workshop] The Revolutionary WebRTC
[workshop] The Revolutionary WebRTC
 
Docker From Scratch
Docker From ScratchDocker From Scratch
Docker From Scratch
 
Top 5 Challenges To Add Web Calls to Truphone VoIP Platform
Top 5 Challenges To Add Web Calls to Truphone VoIP PlatformTop 5 Challenges To Add Web Calls to Truphone VoIP Platform
Top 5 Challenges To Add Web Calls to Truphone VoIP Platform
 
Automatic Kamailio Deployments With Puppet
Automatic Kamailio Deployments With PuppetAutomatic Kamailio Deployments With Puppet
Automatic Kamailio Deployments With Puppet
 

Recently uploaded

Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 

Recently uploaded (20)

Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 

Continuous Integration and Kamailio

  • 1. Continuous Integration and Kamailio Automating builds, deployments and tests for fast-moving projects 1Giacomo Vacca, Kamailio World 2016
  • 2. About me • 15 years “in the trenches cubicles” • Developer of RTC (VoIP, IM, WebRTC) solutions • Often dealing with DevOps topics • Founder of RTCSoft in 2015 • Working with Orange Libon Voice Team @giavac https://github.com/giavac gv@rtcsoft.net 2Giacomo Vacca, Kamailio World 2016
  • 3. Material for the Workshop • https://github.com/giavac/kamailio_ci • rtpengine_build • kamailio_testing • (You can start preparing the base Docker images) 3Giacomo Vacca, Kamailio World 2016
  • 4. Kamailio and the need for CI • Several developers working on the same code base • Not everybody uses stock packages (in-house builds) • Save time (test continuously, so that the uncertainty on QA is low) • Save money (reduce costs of building/testing machines) • Release more often, with lower risks 4Giacomo Vacca, Kamailio World 2016
  • 5. CI servers • Most used CI platforms are OSS: Jenkins, Travis • Automation of Build, Test, Deployment • Integration with git and other tools • Jenkins: typical for private CI infrastructures • Travis: designed for Open Source projects 5Giacomo Vacca, Kamailio World 2016
  • 6. Build automation 6Giacomo Vacca, Kamailio World 2016
  • 7. CI infrastructure for builds 7Giacomo Vacca, Kamailio World 2016
  • 8. Build environments • Personal VM/Dedicated dev machine • Jenkins with dedicated build machine (slave) • Jenkins with Docker-based slaves • Docker plugin • Mesos cluster management 8Giacomo Vacca, Kamailio World 2016
  • 9. Artefacts • Packages, tarballs, Docker images, other files to be uploaded • Private and public repos • Use existing artefacts to reduce build time and improve consistency • Build once, use many times • Careful (and possibly unique) versioning 9Giacomo Vacca, Kamailio World 2016
  • 10. How clean is your build environment? • Full control of build requirements: • Not sharing environments across apps • Not reusing polluted environments (keep releases predictable) • Clean up the build environment or… • Create a new environment for each build • Containers as light-weight “build machines” • Build once, test until production (“non-event releases”) 10Giacomo Vacca, Kamailio World 2016
  • 11. A huge opportunity: Docker • Quick introduction to Docker • Simulate a specific Linux distribution in seconds • Virtualise, while keeping the host performances • “A few dedicated build machines” vs “Many disposable build containers” • Keep builds reproducible by always creating clean environments 11Giacomo Vacca, Kamailio World 2016
  • 13. Base build images for kamailio • Pre-requirements • Keeping the images small • Many different distributions • (Beware of container re-use) 13Giacomo Vacca, Kamailio World 2016
  • 14. Dockerfile for base CentOS kamailio FROM centos:7 RUN rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm && yum install -y gcc make bison flex libcurl libcurl-devel libunistring-devel openssl openssl-devel pcre-devel zlib-devel lua-5.1.4-14.el7 lua-devel-5.1.4-14.el7 mysql-community-devel-5.6.26-2.el7 libxml2-devel perl-ExtUtils-Embed net-snmp-devel memcached cyrus-sasl-devel && yum clean all 14Giacomo Vacca, Kamailio World 2016
  • 15. Dockerfile step by step • Define base image (FROM) • Change this to the distribution needed, or to other base images • Install dependencies packages (RUN - rpm/yum) • Clean up yum configuration (limit image size) 15Giacomo Vacca, Kamailio World 2016
  • 16. Build base image $ cd kamailio_async_centos7/ $ docker build -t gvacca/kamailio_async:centos -f Dockerfile.centos7 . $ docker images |grep kamailio_async gvacca/kamailio_async centos7 3fa45a9c3c1e 3 days ago 393.8 MB ($ docker build -t USER/IMAGE:TAG [-f DOCKERFILE] .) 16 This base image will be used later as build host for kamailio Giacomo Vacca, Kamailio World 2016
  • 17. Good practices when using containers • Avoid git checkout inside containers • Do not copy sensitive data into images • Make data available indirectly (volumes) • Clean up after yourself: keep images small • Limit the number of instructions (RUN) • Careful about the caching system • Define the “base build image”, to be reused • Reduce unnecessary re-builds • Ensure same pre-requisites are enforced • Be careful about container re-usage (e.g. “life time” in a Mesos cluster) 17Giacomo Vacca, Kamailio World 2016
  • 18. Building kamailio $ docker run -t --name kamailio_async_built_debian_4.4.1 -v ~/git/kamailio-devel/ kamailio:/root/kamailio -v $PWD/kamailio_async_debian/scripts:/root/scripts gvacca/ kamailio_async:debian /root/scripts/build.sh ($ docker run -t --name ${BUILT_KAMAILIO} -v ${KAMAILIO_SRC}:/root/kamailio -v $PWD/ kamailio_async_${TEST_DISTRIBUTION}/scripts:/root/scripts ${TEST_USER}/ kamailio_async:${TEST_DISTRIBUTION} /root/scripts/build.sh) make distclean make cfg include_modules=http_async_client make all # or create tarball/rpms # and store artefacts Build instruction: /root/scripts/build.sh: 18Giacomo Vacca, Kamailio World 2016
  • 19. Build job • Uses the “base build image” as slave • Maximise reproducibility of builds: re-use slaves carefully 19Giacomo Vacca, Kamailio World 2016
  • 20. Base build images for rtpengine • Stronger restrictions on the host kernel • But doesn’t need to have the same as the target host • Ensure the right kernel headers are in place • Build and prepare artefacts as for other cases 20Giacomo Vacca, Kamailio World 2016
  • 21. Dockerfile for rtpengine base image FROM centos:7 RUN yum install -y make glib2-devel zlib-devel kmod hiredis-devel openssl-devel xmlrpc-c-devel iptables-devel git && yum clean all 21Giacomo Vacca, Kamailio World 2016
  • 22. Building rtpengine $ cd $SRC $ git clone https://github.com/sipwise/rtpengine $ cd $PROJECT/rtpengine_build/ $ docker build -t gvacca/rtpengine:centos -f Dockerfile . $ docker run -t --name rtpengine_built -v $PWD/:/root -v $SRC/rtpengine:/root/rtpengine gvacca/rtpengine:centos /root/build.sh $ docker ps -a|grep rtpengine 78edf9e7412c gvacca/rtpengine:centos "/root/build.sh" 2 minutes ago Exited (0) 27 seconds ago rtpengine_built $ docker logs -f rtpengine_built 22Giacomo Vacca, Kamailio World 2016
  • 24. Deploying from a CI platform • Deploy on Production or other environments (dev, staging, etc) • Deploy on test beds for the specific purpose of testing • Validate release candidates with automatic tests after deployments 24Giacomo Vacca, Kamailio World 2016
  • 25. Jenkins + Fabric + Puppet • Puppet master is the ideal/common scenario • Puppet standalone for “push” deployments • Fabric to transfer Puppet manifests and execute remote deployment • Good idea: clean up manifests after the application (as Ansible) • Docker to host Fabric, its config and Puppet manifests for fast use and encapsulation • See brand new Puppet module for Homer: https://github.com/sipcapture/ homer-puppet 25Giacomo Vacca, Kamailio World 2016
  • 26. From source to deployment 26Giacomo Vacca, Kamailio World 2016
  • 27. Test automation 27Giacomo Vacca, Kamailio World 2016
  • 28. A CI inftrastucture comes handy for… • Unit testing • Component testing • Integration testing • Load testing We’ll see an example later of component/integration testing 28Giacomo Vacca, Kamailio World 2016
  • 29. Putting it all together 29Giacomo Vacca, Kamailio World 2016
  • 30. Case study: testing http_async_client Asynchronous HTTP client for Kamailio, http://www.kamailio.org/docs/ modules/devel/modules/http_async_client.html • Dockerise all the components (can be run anywhere) • Test on multiple distributions • Simulate web servers • Trigger tests with sipp 30Giacomo Vacca, Kamailio World 2016
  • 31. Test architecture for http_async_client 31Giacomo Vacca, Kamailio World 2016
  • 32. Docker Compose to abstract the test architecture • Docker Compose helps you defining a multi-container architecture • Containers are “services” • YAML to define base images, volumes, ports, commands, etc • Internal naming system: no need to use IP addresses (like e.g. ‘docker network’), just use the service name • docker-compose.yml supports natively environment variables 32Giacomo Vacca, Kamailio World 2016
  • 33. docker-compose.yml version: '2' services: nginx: image: $TEST_USER/nginx_ssl volumes: - ./nginx_ssl/website/:/var/www/html/website/ - ./nginx_ssl/nginx/ssl/:/etc/nginx/ssl/ ports: - 443:443 kamailio_async: image: ${TEST_IMAGE} volumes: - $PWD/kamailio_async_${TEST_DISTRIBUTION}/scripts:/root/scripts ports: - 5060/UDP:5060/UDP command: /root/scripts/run.sh sipp: image: $TEST_USER/sipp volumes: - ./sipp/scenarios/:/root/sipp/ command: tail -f /dev/null depends_on: - kamailio_async 33Giacomo Vacca, Kamailio World 2016
  • 34. docker-compose.yml - Variables • $TEST_USER • $TEST_IMAGE • $TEST_DISTRIBUTION 34Giacomo Vacca, Kamailio World 2016
  • 35. kamailio.cfg under test #!KAMAILIO mpath="/usr/local/lib64/kamailio/modules/" loadmodule "pv.so" loadmodule "tm.so" loadmodule "tmx.so" loadmodule "textops.so" loadmodule "xlog.so" loadmodule "http_async_client.so" modparam("http_async_client", "connection_timeout", 10000) modparam("http_async_client", "tls_verify_host", 0) modparam("http_async_client", "tls_verify_peer", 0) debug=2 log_stderror=no pv_buffer_size=4096 request_route { xlog("L_ALERT", "Processing request...n"); if ($rm eq "MESSAGE") { if(t_newtran()) { xlog("L_ALERT", "$ci: requesting $hdr(P-Url)n"); http_async_query("$hdr(P-Url)", "http_reply"); } } } route[http_reply] { if ($http_ok) { xlog("L_INFO", "route[HTTP_REPLY]: status $http_rsn"); xlog("L_INFO", "route[HTTP_REPLY]: body $http_rbn"); set_reply_body("$http_rb", "text/plain"); append_to_reply("P-Http-Status: $http_rsrn"); xlog("L_ALERT", "received response $http_rs <$http_rb> for trans $T(id_index):$T(id_label)n"); t_reply("200", "Ok"); } else { xlog("L_INFO", "route[HTTP_REPLY]: error $http_err)n"); t_reply("500", "Something is wrong"); } } 35Giacomo Vacca, Kamailio World 2016
  • 36. Preparing base images for http_async_client cd nginx_ssl/ docker build -t USER/nginx_ssl . cd ../sipp/ docker build -t USER/sipp . cd ../kamailio_async_centos7/ docker build -t USER/kamailio_async:centos7 -f Dockerfile.centos . 36Giacomo Vacca, Kamailio World 2016
  • 37. Prepare and run tests $./prepare_built_kamailio.sh gvacca debian ~/git/kamailio-devel/ kamailio 4.4 $ ./launch_tests.sh gvacca/kamailio_async:debian_4.4.1 $ docker logs -f kamailiotesting_kamailio_async_1 37Giacomo Vacca, Kamailio World 2016
  • 38. Containers and network $ docker ps IMAGE COMMAND PORTS NAMES gvacca/kamailio_async:ubuntu "sh /root/build_run.s" 0.0.0.0:5060->5060/udp kamailiotesting_kamailio_async_1 gvacca/nginx_ssl "/bin/sh -c nginx" 80/tcp, 0.0.0.0:443->443/tcp kamailiotesting_nginx_1 gvacca/sipp "tail -f /dev/null" kamailiotesting_sipp_1 $ python inspect_docker_network.py kamailiotesting_default 29d589f5db0c6f32973c58c05678094cf1f1f83d8dfcf43c4850a8fa3a3ccb39 '/kamailiotesting_sipp_1': 172.18.0.3/16 75a8139ea6b3102a844ee8becbc9ba7a26df86bb70a2f31589bfad8f86114032 '/kamailiotesting_nginx_1': 172.18.0.2/16 b9472f70cccdc968cc1d61c9caca02118ed2c1957fd13f2bb18fe2eaefd0e310 '/kamailiotesting_kamailio_async_1': 172.18.0.4/16 38Giacomo Vacca, Kamailio World 2016
  • 39. Conclusions/future • kamailio, as other apps, will run inside containers • “Service Discovery” tools will be key • Emulation of entire infrastructures on top of container-based platforms • Lightweight distributions as simple containers infrastructure • Continuous Integration/Delivery will be the norm 39Giacomo Vacca, Kamailio World 2016
  • 41. References and useful sources • https://www.kamailio.org/w/2015/11/building-kamailio-in-docker/ • “The Docker book”, J. Turnbull, http://www.amazon.co.uk/Docker-Book-Containerization- new-virtualization-ebook/dp/B00LRROTI4 • “Using Docker”, A. Mouat,https://www.amazon.co.uk/Using-Docker-Adrian-Mouat/dp/ 1491915765 • “Continuous Delivery”, J. Humble, http://www.amazon.com/Continuous-Delivery- Deployment-Automation-Addison-Wesley/dp/0321601912 • “Building Microservices”, S. Newman, http://shop.oreilly.com/product/0636920033158.do • "Docker Networking and Service Discovery", https://www.nginx.com/resources/library/ docker-networking/ 41Giacomo Vacca, Kamailio World 2016
  • 42. More presentations on this topic • “Docker and Puppet for CI”, http://www.slideshare.net/GiacomoVacca/ docker-and-puppet-for-continuous-integration • “Automatic Kamailio Deployments with Puppet”, Kamailio World 2014, http://www.slideshare.net/GiacomoVacca/automatic- kamailiodeploymentswithpuppet-33085423 42Giacomo Vacca, Kamailio World 2016
  • 43. Thanks! • Federico Cabiddu • Camille Oudot • Victor Seva 43Giacomo Vacca, Kamailio World 2016
  • 44. Additional slides 44Giacomo Vacca, Kamailio World 2016
  • 45. Docker inside docker • Manage an environment of containers inside a container • Powerful • With disadvantages • Consider the “sibling” approach, rather than the nested one • Build networks of containers and command some of them via the socket API 45Giacomo Vacca, Kamailio World 2016