Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Application deployment on Openstack
using Containers and Docker
BOSTON OPENSTACK MEETUP:
September 12, 2013
Contents
• Introduction to Docker (10 min)
• Docker and OpenStack (5 min)
• Demo of Docker (15 minutes)
• Demo of Docker + OpenStack (10 minutes)
• Q&A
In the 5 months since we launched
• >60,000 pulls
• >6,500 github stars
• >150 significant contributors
• >150 projects built on top of docker
• UIs, mini-PaaS, Remote Desktop….
• 1000’s of Dockerized applications
• Memcached, Redis, Node.js…and Hadoop
• Integration in Jenkins, Travis, Chef,
Puppet, Vagrant and OpenStack
• Meetups arranged around the
world…with organizations like Ebay,
Cloudflare, and Rackspace presenting on
their use of Docker
Why all the excitement?
Static website
Web frontend
User DB
Queue Analytics DB
Background workers
API endpoint
nginx 1.5 + modsecurity + openssl + bootstrap 2
postgresql + pgv8 + v8
hadoop + hive + thrift + OpenJDK
Ruby + Rails + sass + Unicorn
Redis + redis-sentinel
Python 3.0 + celery + pyredis + libcurl + ffmpeg + libopencv + nodejs +
phantomjs
Python 2.7 + Flask + pyredis + celery + psycopg + postgresql-client
Development VM
QA server
Public Cloud
Disaster recovery
Contributor’s laptop
Production Servers
The ChallengeMultiplicityofStacks
Multiplicityof
hardware
environments
Production Cluster
Customer Data Center
Doservicesandapps
interact
appropriately?
CanImigrate
smoothlyand
quickly?
The Matrix From Hell
Static website
Web frontend
Background workers
User DB
Analytics DB
Queue
Development
VM
QA Server
Single Prod
Server
Onsite
Cluster
Public Cloud
Contributor’s
laptop
Customer
Servers
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
MultiplicityofGoods
Multipilicityof
methodsfor
transporting/storing
DoIworryabout
howgoodsinteract
(e.g.coffeebeans
nexttospices)
CanItransportquickly
andsmoothly
(e.g.fromboattotrain
totruck)
Cargo Transport Pre-1960
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
Also a matrix from hell
MultiplicityofGoods
Multiplicityof
methodsfor
transporting/storing
DoIworryabout
howgoodsinteract
(e.g.coffeebeans
nexttospices)
CanItransport
quicklyandsmoothly
(e.g.fromboatto
traintotruck)
Solution: Intermodal Shipping Container
…in between, can be loaded and
unloaded, stacked, transported
efficiently over long distances,
and transferred from one mode
of transport to another
A standard container that is
loaded with virtually any
goods, and stays sealed until
it reaches final delivery.
Static website Web frontendUser DB Queue Analytics DB
Development
VM
QA server Public Cloud Contributor’s
laptop
Docker is a shipping container system for codeMultiplicityofStacks
Multiplicityof
hardware
environments
Production
Cluster
Customer Data
Center
Doservicesandapps
interact
appropriately?
CanImigrate
smoothlyandquickly
…that can be manipulated using
standard operations and run
consistently on virtually any
hardware platform
An engine that enables any
payload to be encapsulated
as a lightweight, portable,
self-sufficient container…
Static website
Web frontend
Background workers
User DB
Analytics DB
Queue
Development
VM
QA Server
Single Prod
Server
Onsite
Cluster
Public Cloud
Contributor’s
laptop
Customer
Servers
Docker eliminates the matrix from Hell
Why Developers Care
• Build once…(finally) run anywhere*
• A clean, safe, hygienic and portable runtime environment for your app.
• No worries about missing dependencies, packages and other pain points during subsequent
deployments.
• Run each app in its own isolated container, so you can run various versions of libraries and
other dependencies for each app without worrying
• Automate testing, integration, packaging…anything you can script
• Reduce/eliminate concerns about compatibility on different platforms, either your own or your
customers.
• Cheap, zero-penalty containers to deploy services? A VM without the overhead of a VM?
Instant replay and reset of image snapshots? That’s the power of Docker
• * Today—we require a modern Linux kernel and AUFS. These requirements will be relaxed significantly with the 0.8 release of
Docker. See http://blog.docker.io/2013/08/getting-to-docker-1-0/
Why Devops Cares?
• Configure once…run anything
• Make the entire lifecycle more efficient, consistent, and repeatable
• Increase the quality of code produced by developers.
• Eliminate inconsistencies between development, test, production, and customer environments
• Support segregation of duties
• Significantly improves the speed and reliability of continuous deployment and continuous
integration systems
• Because the containers are so lightweight, address significant performance, costs, deployment,
and portability issues normally associated with VMs
App
A
Containers vs. VMs
Hypervisor (Type 2)
Host OS
Server
Guest
OS
Bins/
Libs
App
A’
Guest
OS
Bins/
Libs
App
B
Guest
OS
Bins/
Libs
AppA’
Docker
Host OS
Server
Bins/Libs
AppA
Bins/Libs
AppB
AppB’
AppB’
AppB’
VM
Container
Containers are isolated,
but share OS and, where
appropriate, bins/libraries
Guest
OS
Guest
OS
…result is significantly faster deployment,
much less overhead, easier migration,
faster restart
Why are Docker containers lightweight?
Bins/
Libs
App
A
Original App
(No OS to take
up space, resources,
or require restart)
AppΔ
Bins/
App
A
Bins/
Libs
App
A’
Guest
OS
Bins/
Libs
Modified App
Union file system allows
us to only save the diffs
Between container A
and container
A’
VMs
Every app, every copy of an
app, and every slight modification
of the app requires a new virtual server
App
A
Guest
OS
Bins/
Libs
Copy of
App
No OS. Can
Share bins/libs
App
A
Guest
OS
Guest
OS
VMs Containers
What are the basics of the Docker system?
Source
Code
Repository
Dockerfile
For
A
Docker Engine
Docker
Container
Image
Registry
Build
Docker
Host 2 OS (Linux)
ContainerA
ContainerB
ContainerC
ContainerA
Push
Search
Pull
Run
Host 1 OS (Linux)
Changes and Updates
Docker Engine
Docker
Container
Image
Registry
Docker Engine
Push
Update
Bins/
Libs
App
A
AppΔ
Bins/
Base
Container
Image
Host is now running A’’
Container
Mod A’’
AppΔ
Bins/
Bins/
Libs
App
A
Bins/
Bins/
Libs
App
A’’
Host running A wants to upgrade to A’’.
Requests update. Gets only diffs
Container
Mod A’
Docker Futures
• Stabilizing: Docker 0.8 in October
• Shrink and stabilize Core
• Provide stable, pluggable API
• Expanding runtime environments:
• OpenStack: announced
• Docker as various flavors of VM
(AMI, vdf, etc.)-This week
• Increase compatible kernel set-
October
• Increase compatible Union FS set-
October
• IaaS compatibility-Ongoing
• Dev/devops tools integrations:
Ongoing
• Chef, Puppet, Vagrant, GitHub,
Travis, Buildbot,
• Various flavors of PaaS & IDE
OpenStack / Docker
New hypervisor to enable Nova to deploy Linux containers
Why Docker + OpenStack
• Alternative to VMs within OpenStack-today
• Easier deployment of OpenStack itself-near future
• Cross cloud application deployment
• At OpenStack Summit we hope to show:
• Building and testing an application from source
• Running on a laptop
• Running it, without modification or noticeable downtime, on a public cloud
• Running it, without modification or noticeable downtime, on an openstack
cluster
• Doing all of the above using Nova and Horizon
Why a new hypervisor?
• Nova a computing controller for OpenStack
• Nova support for containers is minimal (via LibVirt)
• Enables control of Docker through OpenStack projects (ex: deploy
containers via Horizon Web UI)
HOW ABOUT A DOCKER DEMO?
HOW ABOUT A DOCKER /OPENSTACK DEMO?
New Nova hypervisor in Havana
Deploy Containers instead of VMs
by Sam Alba
@sam_alba
Sep 2013
What is all of that?
● Nova is a computing controller for OpenStack
● Havana is the name of the next release (10/17/2013)
● Nova already supports several hypervisors:
○ KVM (through qemu), Xen, VMWare, HyperV, PowerVM, etc...
○ Docker
Sep 2013
Nova is not just for Virtual Machines...
it’s a computing controller!
Under the hood...
Sep 2013
Source:
https://wiki.openstack.org/wiki/Docker
How to use it? (with DevStack)
Sep 2013
Prerequisites:
● Ubuntu Precise 12.04
● Kernel >3.2 supporting AUFS
● >=1GB of RAM available
● Check that socat and git installed
sudo apt-get install socat git
How to use it? (with DevStack)
Sep 2013
Install devstack and docker
… and test that everything went well
git clone https://github.com/openstack-dev/devstack.git
cd devstack
echo VIRT_DRIVER=docker >> localrc
./tools/docker/install_docker.sh
./stack.sh
./exercises/docker
How to use it? (with DevStack)
Sep 2013
Start a container!
cd devstack
. openrc
nova boot --image "docker-busybox:latest" 
--flavor m1.nano myinstance
nova show myinstance
docker ps
How to use it? (with DevStack)
Sep 2013
Use public images!
It requires to duplicate images to Glance (by using docker)
cd devstack
. openrc
docker pull vieux/goplay
HOST_IP=$(docker images | grep :5042/docker-busybox 
| cut -d: -f1)
docker tag vieux/goplay $HOST_IP:5042/vieux/goplay
docker push $HOST_IP:5042/vieux/goplay
Horizon (web UI)
Launch a
new
instance...
Sep 2013
Horizon (web UI)
Launch a new instance...
Sep 2013
Questions?
Sep 2013
Run it yourself!
Sep 2013
Read the documentation:
https://wiki.openstack.org/wiki/Docker
… and please ask for help:
#docker on irc.freenode.org
Want to learn more:
• www.docker.io:
• Documentation
• Getting started: interactive tutorial, installation instructions, getting started
guide,
• About: Introductory whitepaper: http://www.docker.io/the-whole-story/
• Github: dotcloud/docker
• IRC: freenode/#docker
• Google groups: groups.google.com/forum/#!forum/docker-user
• Twitter: follow @docker
• OpenStack Code:
• Meetups: Scheduled for Boston, San Francisco, Austin, London, Paris,
Boulder…and Nairobi. Go to website for details
www.docker.io

More Related Content

Docker Presentation at the OpenStack Austin Meetup | 2013-09-12

  • 1. Application deployment on Openstack using Containers and Docker BOSTON OPENSTACK MEETUP: September 12, 2013
  • 2. Contents • Introduction to Docker (10 min) • Docker and OpenStack (5 min) • Demo of Docker (15 minutes) • Demo of Docker + OpenStack (10 minutes) • Q&A
  • 3. In the 5 months since we launched • >60,000 pulls • >6,500 github stars • >150 significant contributors • >150 projects built on top of docker • UIs, mini-PaaS, Remote Desktop…. • 1000’s of Dockerized applications • Memcached, Redis, Node.js…and Hadoop • Integration in Jenkins, Travis, Chef, Puppet, Vagrant and OpenStack • Meetups arranged around the world…with organizations like Ebay, Cloudflare, and Rackspace presenting on their use of Docker
  • 4. Why all the excitement?
  • 5. Static website Web frontend User DB Queue Analytics DB Background workers API endpoint nginx 1.5 + modsecurity + openssl + bootstrap 2 postgresql + pgv8 + v8 hadoop + hive + thrift + OpenJDK Ruby + Rails + sass + Unicorn Redis + redis-sentinel Python 3.0 + celery + pyredis + libcurl + ffmpeg + libopencv + nodejs + phantomjs Python 2.7 + Flask + pyredis + celery + psycopg + postgresql-client Development VM QA server Public Cloud Disaster recovery Contributor’s laptop Production Servers The ChallengeMultiplicityofStacks Multiplicityof hardware environments Production Cluster Customer Data Center Doservicesandapps interact appropriately? CanImigrate smoothlyand quickly?
  • 6. The Matrix From Hell Static website Web frontend Background workers User DB Analytics DB Queue Development VM QA Server Single Prod Server Onsite Cluster Public Cloud Contributor’s laptop Customer Servers ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
  • 8. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Also a matrix from hell
  • 9. MultiplicityofGoods Multiplicityof methodsfor transporting/storing DoIworryabout howgoodsinteract (e.g.coffeebeans nexttospices) CanItransport quicklyandsmoothly (e.g.fromboatto traintotruck) Solution: Intermodal Shipping Container …in between, can be loaded and unloaded, stacked, transported efficiently over long distances, and transferred from one mode of transport to another A standard container that is loaded with virtually any goods, and stays sealed until it reaches final delivery.
  • 10. Static website Web frontendUser DB Queue Analytics DB Development VM QA server Public Cloud Contributor’s laptop Docker is a shipping container system for codeMultiplicityofStacks Multiplicityof hardware environments Production Cluster Customer Data Center Doservicesandapps interact appropriately? CanImigrate smoothlyandquickly …that can be manipulated using standard operations and run consistently on virtually any hardware platform An engine that enables any payload to be encapsulated as a lightweight, portable, self-sufficient container…
  • 11. Static website Web frontend Background workers User DB Analytics DB Queue Development VM QA Server Single Prod Server Onsite Cluster Public Cloud Contributor’s laptop Customer Servers Docker eliminates the matrix from Hell
  • 12. Why Developers Care • Build once…(finally) run anywhere* • A clean, safe, hygienic and portable runtime environment for your app. • No worries about missing dependencies, packages and other pain points during subsequent deployments. • Run each app in its own isolated container, so you can run various versions of libraries and other dependencies for each app without worrying • Automate testing, integration, packaging…anything you can script • Reduce/eliminate concerns about compatibility on different platforms, either your own or your customers. • Cheap, zero-penalty containers to deploy services? A VM without the overhead of a VM? Instant replay and reset of image snapshots? That’s the power of Docker • * Today—we require a modern Linux kernel and AUFS. These requirements will be relaxed significantly with the 0.8 release of Docker. See http://blog.docker.io/2013/08/getting-to-docker-1-0/
  • 13. Why Devops Cares? • Configure once…run anything • Make the entire lifecycle more efficient, consistent, and repeatable • Increase the quality of code produced by developers. • Eliminate inconsistencies between development, test, production, and customer environments • Support segregation of duties • Significantly improves the speed and reliability of continuous deployment and continuous integration systems • Because the containers are so lightweight, address significant performance, costs, deployment, and portability issues normally associated with VMs
  • 14. App A Containers vs. VMs Hypervisor (Type 2) Host OS Server Guest OS Bins/ Libs App A’ Guest OS Bins/ Libs App B Guest OS Bins/ Libs AppA’ Docker Host OS Server Bins/Libs AppA Bins/Libs AppB AppB’ AppB’ AppB’ VM Container Containers are isolated, but share OS and, where appropriate, bins/libraries Guest OS Guest OS …result is significantly faster deployment, much less overhead, easier migration, faster restart
  • 15. Why are Docker containers lightweight? Bins/ Libs App A Original App (No OS to take up space, resources, or require restart) AppΔ Bins/ App A Bins/ Libs App A’ Guest OS Bins/ Libs Modified App Union file system allows us to only save the diffs Between container A and container A’ VMs Every app, every copy of an app, and every slight modification of the app requires a new virtual server App A Guest OS Bins/ Libs Copy of App No OS. Can Share bins/libs App A Guest OS Guest OS VMs Containers
  • 16. What are the basics of the Docker system? Source Code Repository Dockerfile For A Docker Engine Docker Container Image Registry Build Docker Host 2 OS (Linux) ContainerA ContainerB ContainerC ContainerA Push Search Pull Run Host 1 OS (Linux)
  • 17. Changes and Updates Docker Engine Docker Container Image Registry Docker Engine Push Update Bins/ Libs App A AppΔ Bins/ Base Container Image Host is now running A’’ Container Mod A’’ AppΔ Bins/ Bins/ Libs App A Bins/ Bins/ Libs App A’’ Host running A wants to upgrade to A’’. Requests update. Gets only diffs Container Mod A’
  • 18. Docker Futures • Stabilizing: Docker 0.8 in October • Shrink and stabilize Core • Provide stable, pluggable API • Expanding runtime environments: • OpenStack: announced • Docker as various flavors of VM (AMI, vdf, etc.)-This week • Increase compatible kernel set- October • Increase compatible Union FS set- October • IaaS compatibility-Ongoing • Dev/devops tools integrations: Ongoing • Chef, Puppet, Vagrant, GitHub, Travis, Buildbot, • Various flavors of PaaS & IDE
  • 19. OpenStack / Docker New hypervisor to enable Nova to deploy Linux containers
  • 20. Why Docker + OpenStack • Alternative to VMs within OpenStack-today • Easier deployment of OpenStack itself-near future • Cross cloud application deployment • At OpenStack Summit we hope to show: • Building and testing an application from source • Running on a laptop • Running it, without modification or noticeable downtime, on a public cloud • Running it, without modification or noticeable downtime, on an openstack cluster • Doing all of the above using Nova and Horizon
  • 21. Why a new hypervisor? • Nova a computing controller for OpenStack • Nova support for containers is minimal (via LibVirt) • Enables control of Docker through OpenStack projects (ex: deploy containers via Horizon Web UI)
  • 22. HOW ABOUT A DOCKER DEMO?
  • 23. HOW ABOUT A DOCKER /OPENSTACK DEMO?
  • 24. New Nova hypervisor in Havana Deploy Containers instead of VMs by Sam Alba @sam_alba Sep 2013
  • 25. What is all of that? ● Nova is a computing controller for OpenStack ● Havana is the name of the next release (10/17/2013) ● Nova already supports several hypervisors: ○ KVM (through qemu), Xen, VMWare, HyperV, PowerVM, etc... ○ Docker Sep 2013 Nova is not just for Virtual Machines... it’s a computing controller!
  • 26. Under the hood... Sep 2013 Source: https://wiki.openstack.org/wiki/Docker
  • 27. How to use it? (with DevStack) Sep 2013 Prerequisites: ● Ubuntu Precise 12.04 ● Kernel >3.2 supporting AUFS ● >=1GB of RAM available ● Check that socat and git installed sudo apt-get install socat git
  • 28. How to use it? (with DevStack) Sep 2013 Install devstack and docker … and test that everything went well git clone https://github.com/openstack-dev/devstack.git cd devstack echo VIRT_DRIVER=docker >> localrc ./tools/docker/install_docker.sh ./stack.sh ./exercises/docker
  • 29. How to use it? (with DevStack) Sep 2013 Start a container! cd devstack . openrc nova boot --image "docker-busybox:latest" --flavor m1.nano myinstance nova show myinstance docker ps
  • 30. How to use it? (with DevStack) Sep 2013 Use public images! It requires to duplicate images to Glance (by using docker) cd devstack . openrc docker pull vieux/goplay HOST_IP=$(docker images | grep :5042/docker-busybox | cut -d: -f1) docker tag vieux/goplay $HOST_IP:5042/vieux/goplay docker push $HOST_IP:5042/vieux/goplay
  • 31. Horizon (web UI) Launch a new instance... Sep 2013
  • 32. Horizon (web UI) Launch a new instance... Sep 2013
  • 34. Run it yourself! Sep 2013 Read the documentation: https://wiki.openstack.org/wiki/Docker … and please ask for help: #docker on irc.freenode.org
  • 35. Want to learn more: • www.docker.io: • Documentation • Getting started: interactive tutorial, installation instructions, getting started guide, • About: Introductory whitepaper: http://www.docker.io/the-whole-story/ • Github: dotcloud/docker • IRC: freenode/#docker • Google groups: groups.google.com/forum/#!forum/docker-user • Twitter: follow @docker • OpenStack Code: • Meetups: Scheduled for Boston, San Francisco, Austin, London, Paris, Boulder…and Nairobi. Go to website for details