SlideShare a Scribd company logo
1 of 20
Me and lxc-containers
2011 Hyves (now part of TMG)
chat service - python service, single threaded (GIL)
Solution:
lxc-containers (since 2010!!!): 100+ instances
AUFS: advanced multi layered unification
filesystem
Gentoo: patched kernel
2013 SpilGames
a global network of online gaming platforms
(180 million active users each month) and
growing
Technology used:
Production: PHP, Erlang
Internally: Python
Platform: Scientific Linux
Private cloud: Openstack
Openstack at SpilGames

Swift in production since Diablo 2011
Swift - highly available, distributed, eventually
consistent object/blob store
Compute in production since Folsom end of 2012
Compute - cloud computing fabric controller
Goal: IaaS, migrate most of production
systems to private cloud

Ultimate Goal: PaaS, Autoscaling
SpilGames infrastructure today
Two locations: Amsterdam, Toronto
Two openstack availability zones
Both sites serve live traffic
Puppet Intro
$puppet apply test.pp

Manifest file test.pp:
file {'testfile':
path => '/tmp/testfile',
ensure => present,
mode => 0640,
content => "I'm a test file.",
}
service { 'ntp':
ensure => running,
enable => true,
}
Puppet in SpilGames
Every server has puppet role registered and assigned in
CMDB (Configuration Management Databse):
hadoop_datanode
gerrit_standalone
During puppet run, role gets resolved and mapped to the
puppet class with the same name:
class roles::hadoop_datanode
class roles::gerrit_standalone
Role classes are used as containers for the rest of puppet
classes which provide actual configuration:
class roles::gerrit_standalone inherits roles::spil_base {
class{ '::nginx':
port => 80,
}
class{ '::gerrit':
mysql_host
mysql_user
mysql_password
mysql_db
}

=> '127.0.0.1',
=> 'gerrit2',
=> 'gerrit2',
=> 'reviewdb',

class { '::mysql::server':}
mysql::db { 'reviewdb':}
Class['::nginx'] → Mysql::Db['reviewdb'] → Class['::Gerrit']
}
Role classes include "roles::spil_base" class
class roles::gerrit_standalone inherits
roles::spil_base {
...
}

This "spil_base" class provide minimal necessary
baseline configuration:
ntp, accounts, sysctl, security etc
Code Verification
We use Gerrit to run: syntax check (puppetlint), parser validation (puppet parser)
Syntax checks, code verification is very fast
(< 10 seconds) and initiated by Gerrit commit
hooks
Functional testing
Launch host -> Confgure host by applying specific puppet
module -> Verify result
Functional testing to be useful require:
1) Every single test has to be run inside isolated virtual
environments
2) Each module has to be tested on freshly provisioned host
3) Time to run tests should be minimal: < 5-7 min
4) Everything should be automated
Ideally we'd like to test modified puppet modules during Gerrit
verification.
Available tools
rspec-system - framework for creating system tests using the rspec
testing library
launch tests nodes
● copy test content and execute commands on such nodes to be tested
with standard rspec assertions within the standard rspec test format
●

Supports: Vagrant + VirtualBox/VSphere, Openstack

Problems:
●
both VirtualBox/VSphere and Openstack are slow and require
resource intensive virtaulziation
●
functionality is limited
Why Docker
lxc-containers – light, fast, resource efficient, possible to
bind external directories, support snapshots, good python
library

Puppet roles share same baseline configuration!
Main benefits:
●

●

Having SNAPSHOT of baseline system we can use it later
to spawn containers and use them to test the rest of the
modules.
Because of low resource overhead containers with tests
can be run in parallel
Prepare
Initial image
(ssh, puppet)

Test Baseline image
(roles::spil_base)
Snapshot
Baseline image

Test Module
(mysql_master)

Test Module
(nginx)

Analyze results

Test Module
(hadoop)
Jenkins build results
https://github.com/lruslan/puppet_test
Orchestration script has the following features:
●

●

●

●

●

●

‘full’ mode: find puppet modules, build base docker image
using base module and run tests for the rest of the modules
‘quick’ mode: reuse previously created base image and run
tests for the modules
parallel mode: it’s possible to specify the number of workers
(so multiple tests run in a parallel)
Jenkins integration: detect which Puppet modules have
been changed since last jenkins build
Results publishing: generates html report with results and
ability to see details (stdout/stderr) of every test
ability to set timer and stop containers if the test takes
longer than expected
Future plans
Our orchestration script is still proof of concept but already
serves us very well.
Next step would be bring similar functionality to one of
existing rspec tools used by community.
Ooops … rspec-system retired 10 days ago :(
Now official tool for the rspec tool is:
Beaker (beaker-rspec) https://github.com/puppetlabs/beaker
Docker + Stackato = PaaS ?
●

Stackato started in 2012

●

Stackato 3.0 switched to Docker containers

●

Uses Cloud Foundry v2 - open source
PaaS, developed by Vmware

Evaluating … to be continued
Spil Games are hiring

More Related Content

What's hot

Percona XtraDB Cluster before every release: Glimpse into CI testing
Percona XtraDB Cluster before every release: Glimpse into CI testingPercona XtraDB Cluster before every release: Glimpse into CI testing
Percona XtraDB Cluster before every release: Glimpse into CI testing
Raghavendra Prabhu
 

What's hot (20)

(1) cpp introducing the_cpp_programming_language
(1) cpp introducing the_cpp_programming_language(1) cpp introducing the_cpp_programming_language
(1) cpp introducing the_cpp_programming_language
 
Kernel Proc Connector and Containers
Kernel Proc Connector and ContainersKernel Proc Connector and Containers
Kernel Proc Connector and Containers
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" Edition
 
Performance is a feature! - London .NET User Group
Performance is a feature! - London .NET User GroupPerformance is a feature! - London .NET User Group
Performance is a feature! - London .NET User Group
 
Rapid Application Design in Financial Services
Rapid Application Design in Financial ServicesRapid Application Design in Financial Services
Rapid Application Design in Financial Services
 
ChainerUI v0.2, v0.3
ChainerUI v0.2, v0.3ChainerUI v0.2, v0.3
ChainerUI v0.2, v0.3
 
Infrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfraInfrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfra
 
Docker Athens: Docker Engine Evolution & Containerd Use Cases
Docker Athens: Docker Engine Evolution & Containerd Use CasesDocker Athens: Docker Engine Evolution & Containerd Use Cases
Docker Athens: Docker Engine Evolution & Containerd Use Cases
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to Kubernetes
 
Code review and automated testing for Puppet code
Code review and automated testing for Puppet codeCode review and automated testing for Puppet code
Code review and automated testing for Puppet code
 
Project Atomic-Nulecule
Project Atomic-NuleculeProject Atomic-Nulecule
Project Atomic-Nulecule
 
The State of containerd
The State of containerdThe State of containerd
The State of containerd
 
Kubernetes in 30 minutes (2017/03/10)
Kubernetes in 30 minutes (2017/03/10)Kubernetes in 30 minutes (2017/03/10)
Kubernetes in 30 minutes (2017/03/10)
 
Docker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshopDocker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshop
 
client-go: The Good, The Bad and The Ugly
client-go: The Good, The Bad and The Uglyclient-go: The Good, The Bad and The Ugly
client-go: The Good, The Bad and The Ugly
 
Twisted: a quick introduction
Twisted: a quick introductionTwisted: a quick introduction
Twisted: a quick introduction
 
Percona XtraDB Cluster before every release: Glimpse into CI testing
Percona XtraDB Cluster before every release: Glimpse into CI testingPercona XtraDB Cluster before every release: Glimpse into CI testing
Percona XtraDB Cluster before every release: Glimpse into CI testing
 
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s goingKernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
 
Introduction to Atomic: Tailoring a Trusted OS for Containers
Introduction to Atomic: Tailoring a Trusted OS for ContainersIntroduction to Atomic: Tailoring a Trusted OS for Containers
Introduction to Atomic: Tailoring a Trusted OS for Containers
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
 

Similar to Docker meetup

OpenNebulaConf 2014 - CentOS, QA and OpenNebula - Christoph Galuschka
OpenNebulaConf 2014 - CentOS, QA and OpenNebula - Christoph GaluschkaOpenNebulaConf 2014 - CentOS, QA and OpenNebula - Christoph Galuschka
OpenNebulaConf 2014 - CentOS, QA and OpenNebula - Christoph Galuschka
OpenNebula Project
 

Similar to Docker meetup (20)

Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakWorkflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
 
Workflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesWorkflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large Enterprises
 
Testing your infrastructure with litmus
Testing your infrastructure with litmusTesting your infrastructure with litmus
Testing your infrastructure with litmus
 
LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1
 
TechWiseTV Workshop: Catalyst Switching Programmability
TechWiseTV Workshop: Catalyst Switching ProgrammabilityTechWiseTV Workshop: Catalyst Switching Programmability
TechWiseTV Workshop: Catalyst Switching Programmability
 
GDG-MLOps using Protobuf in Unity
GDG-MLOps using Protobuf in UnityGDG-MLOps using Protobuf in Unity
GDG-MLOps using Protobuf in Unity
 
Strategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoringStrategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoring
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developer
 
OpenNebulaConf 2014 - CentOS, QA and OpenNebula - Christoph Galuschka
OpenNebulaConf 2014 - CentOS, QA and OpenNebula - Christoph GaluschkaOpenNebulaConf 2014 - CentOS, QA and OpenNebula - Christoph Galuschka
OpenNebulaConf 2014 - CentOS, QA and OpenNebula - Christoph Galuschka
 
EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4
 
Embedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayEmbedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops way
 
Elasticwulf Pycon Talk
Elasticwulf Pycon TalkElasticwulf Pycon Talk
Elasticwulf Pycon Talk
 
Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...
 
Api versioning w_docker_and_nginx
Api versioning w_docker_and_nginxApi versioning w_docker_and_nginx
Api versioning w_docker_and_nginx
 
Api Versioning with Docker and Nginx
Api Versioning with Docker and NginxApi Versioning with Docker and Nginx
Api Versioning with Docker and Nginx
 
Building A Sensor Network Controller
Building A Sensor Network ControllerBuilding A Sensor Network Controller
Building A Sensor Network Controller
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!
 
CIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops betterCIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops better
 
Fluo CICD OpenStack Summit
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack Summit
 

Docker meetup

  • 1.
  • 2. Me and lxc-containers 2011 Hyves (now part of TMG) chat service - python service, single threaded (GIL) Solution: lxc-containers (since 2010!!!): 100+ instances AUFS: advanced multi layered unification filesystem Gentoo: patched kernel
  • 3. 2013 SpilGames a global network of online gaming platforms (180 million active users each month) and growing Technology used: Production: PHP, Erlang Internally: Python Platform: Scientific Linux Private cloud: Openstack
  • 4. Openstack at SpilGames Swift in production since Diablo 2011 Swift - highly available, distributed, eventually consistent object/blob store Compute in production since Folsom end of 2012 Compute - cloud computing fabric controller
  • 5. Goal: IaaS, migrate most of production systems to private cloud Ultimate Goal: PaaS, Autoscaling
  • 6. SpilGames infrastructure today Two locations: Amsterdam, Toronto Two openstack availability zones Both sites serve live traffic
  • 7. Puppet Intro $puppet apply test.pp Manifest file test.pp: file {'testfile': path => '/tmp/testfile', ensure => present, mode => 0640, content => "I'm a test file.", } service { 'ntp': ensure => running, enable => true, }
  • 8. Puppet in SpilGames Every server has puppet role registered and assigned in CMDB (Configuration Management Databse): hadoop_datanode gerrit_standalone During puppet run, role gets resolved and mapped to the puppet class with the same name: class roles::hadoop_datanode class roles::gerrit_standalone
  • 9. Role classes are used as containers for the rest of puppet classes which provide actual configuration: class roles::gerrit_standalone inherits roles::spil_base { class{ '::nginx': port => 80, } class{ '::gerrit': mysql_host mysql_user mysql_password mysql_db } => '127.0.0.1', => 'gerrit2', => 'gerrit2', => 'reviewdb', class { '::mysql::server':} mysql::db { 'reviewdb':} Class['::nginx'] → Mysql::Db['reviewdb'] → Class['::Gerrit'] }
  • 10. Role classes include "roles::spil_base" class class roles::gerrit_standalone inherits roles::spil_base { ... } This "spil_base" class provide minimal necessary baseline configuration: ntp, accounts, sysctl, security etc
  • 11. Code Verification We use Gerrit to run: syntax check (puppetlint), parser validation (puppet parser) Syntax checks, code verification is very fast (< 10 seconds) and initiated by Gerrit commit hooks
  • 12. Functional testing Launch host -> Confgure host by applying specific puppet module -> Verify result Functional testing to be useful require: 1) Every single test has to be run inside isolated virtual environments 2) Each module has to be tested on freshly provisioned host 3) Time to run tests should be minimal: < 5-7 min 4) Everything should be automated Ideally we'd like to test modified puppet modules during Gerrit verification.
  • 13. Available tools rspec-system - framework for creating system tests using the rspec testing library launch tests nodes ● copy test content and execute commands on such nodes to be tested with standard rspec assertions within the standard rspec test format ● Supports: Vagrant + VirtualBox/VSphere, Openstack Problems: ● both VirtualBox/VSphere and Openstack are slow and require resource intensive virtaulziation ● functionality is limited
  • 14. Why Docker lxc-containers – light, fast, resource efficient, possible to bind external directories, support snapshots, good python library Puppet roles share same baseline configuration! Main benefits: ● ● Having SNAPSHOT of baseline system we can use it later to spawn containers and use them to test the rest of the modules. Because of low resource overhead containers with tests can be run in parallel
  • 15. Prepare Initial image (ssh, puppet) Test Baseline image (roles::spil_base) Snapshot Baseline image Test Module (mysql_master) Test Module (nginx) Analyze results Test Module (hadoop)
  • 17. https://github.com/lruslan/puppet_test Orchestration script has the following features: ● ● ● ● ● ● ‘full’ mode: find puppet modules, build base docker image using base module and run tests for the rest of the modules ‘quick’ mode: reuse previously created base image and run tests for the modules parallel mode: it’s possible to specify the number of workers (so multiple tests run in a parallel) Jenkins integration: detect which Puppet modules have been changed since last jenkins build Results publishing: generates html report with results and ability to see details (stdout/stderr) of every test ability to set timer and stop containers if the test takes longer than expected
  • 18. Future plans Our orchestration script is still proof of concept but already serves us very well. Next step would be bring similar functionality to one of existing rspec tools used by community. Ooops … rspec-system retired 10 days ago :( Now official tool for the rspec tool is: Beaker (beaker-rspec) https://github.com/puppetlabs/beaker
  • 19. Docker + Stackato = PaaS ? ● Stackato started in 2012 ● Stackato 3.0 switched to Docker containers ● Uses Cloud Foundry v2 - open source PaaS, developed by Vmware Evaluating … to be continued
  • 20. Spil Games are hiring