1© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Landing the Docker
Kunpeng Yang & Mark Shao
2© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Agenda• Introduction of Docker
– What is Docker– What Docker is all about
• Our problems• Solution
– Solution with vSphere– Solution with Docker– Benefit/Limitation– Pagrant
• Tips to Share & Lesson learnt
3© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Docker is an open-source engine that automates the deployment of any application as a lightweight, portable, self-sufficient container that will run virtually anywhere.
4© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
What is Docker• Open Source engine to commoditize LXC• Using AUFS for quick provision• Standard format for containers: Layers• Allowing to create and share images
5© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
What Docker is all about• Deployment and Delivery• DevOps• Test• ...
6© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Our problems• 3000 automated test cases• 4-5 hours duration regression• Dirty data cause unreliable test result
7© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Solution with vSphere• Save VMs (Client, Server, DB) as
template• Use Soap-based ws to do
provision • Provision a couple of templates at
same time• Build code and transfer it to the
multiple client machine
Click icon to add picture
8© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Issues• Provision cost 1/3 time of regression• Big efforts to maintain template• Difficult to add dependency between VMs in
same template
9© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
One day we meet Docker
10© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Solution with Docker• Use containers instead of VMs• Invoke provision by REST in JSON• Share the folder between container and host
server• Handle libs dependency once and share it in all
containers• Share the xml report from slave with host
server
11© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Benefits/Limitation• Benefits
– Free & Open-source– Provision in seconds– Easy to maintain images (AUFS layers)– Add dependency by adding link between containers
• Limitation– Windows– Integration with IAAS
12© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Pagrant• A small tool we build to easily scale out the
slaver nodes• Easy to control both the master and slaver
nodes through Pagrant• Some other features for distributed test.
13© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
10
20
30
40
50
60
70
1 2 4 6
Benchmark node/time cost
14© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Tips to Share & Lesson learnt
15© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Private registry• The download speed too slow from `index`• Enterprise security• Easy to share the images internally• https://github.com/dotcloud/docker-registry
16© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Don’t be reluctant to report issue
17© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Community is always ready to help• Problem faced with linking containers• Link the containers via name• export the environment variables for service
host and port in the target container
18© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Community is always ready to help (cont)
19© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
TestNG support distributed execution?
20© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Patch on TestNG• Deprecate the huge serializable object during
communication• Dispatch according to Test by default• Accumulate the xml reports from slavers and
generate the final merged report at end
21© Copyright 2014 EMC Corporation. All rights reserved.© Copyright 2014 EMC Corporation. All rights reserved.
Docker has landed