Top Banner
Organized by theCommunity,for theCommunity. HARNESS THE POWER OF CONTAINERS VASILIY FOMICHEV SOLUTIONS ARCHITECT
46

Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Apr 16, 2017

Download

Technology

SUGCON
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

HARNESS  THE  POWER  OF  CONTAINERS

VASILIY  FOMICHEVSOLUTIONS  ARCHITECT

Page 2: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.SUGCON  NORTH   AMERICA  2015SUGCON  NORTH   AMERICA  2015 2

VASILIY FOMICHEVSOLUTION ARCHITECTVERNDALE

• Sitecore Technology MVP

• Technology enthusiast• Passionate about

innovation• cmsbestpractices.com

https://www.linkedin.com/in/vasiliyfomichev

@vasiliyfomichev

INTRODUCTION

Page 3: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.SUGCON  NORTH   AMERICA  2015 3

WHAT  ARE  WE  LOOKING  AT?

TODAY’S  DEVELOPMENT   MODELWHAT  ARE  “CONTAINERS”HOW  CAN  DOCKER HELP  IN  THE  SITECORE WORLD?DOCKER  AND  DISTRIBUTED  DEVELOPMENT   MODELDEMOS

SOLR ON  DOCKERMONGO  ON  DOCKER

WHERE  IS  THIS  HEADED?

Page 4: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.SUGCON  NORTH   AMERICA  2015 4

WHAT’S  THE  PROBLEM?

Page 5: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

DEVOPS CHALLENGES

• Local  environment  setups  are  getting  more  complex• Environment  differences  allow  for  bugs  in  applications• Manual  setup  it  too  complex  and  time  consuming• Human  error• Scalability  issues  on  prem• Inability  to  reproduce  production  environment  locally  for  

debugging• Inability  to  easily  sync  all  Sitecore environments• Lack  of  QA  and  other  types  of  reproducibility

Page 6: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.SUGCON  NORTH   AMERICA  2015 6

WHAT  ARE  “CONTAINERS”?

Page 7: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

BEFORE  CONTAINER  STANDARDS

Page 8: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

SHIPPING  CONTAINERS  INVENTED

https://en.wikipedia.org/wiki/Malcom_McLean

In  1956,  most  cargo  was  loaded   and  unloaded   by  hand.  Hand-­‐loading   a  ship  cost  $5.86 a  ton.  

Malcom  McLean born   in  1913  developed   the  modern   intermodal  shipping   container,  which  revolutionized   transport  and  international   trade.  

McLean  knew  "A  ship  earns  money  only  when  she's  at  sea,"  and  based  his  business  on  that  efficiency.

Using  containers,   it  cost  only  16  cents a  ton,  a  39-­‐fold  savings.  Containerization   also  greatly  reduced  the  time  to  load  and  unload  ships,  improving   reliability.  

Page 9: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.SUGCON  NORTH   AMERICA  2015

Page 10: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

HOSTING  CONTAINERS

Page 11: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.SUGCON  NORTH   AMERICA  2015

Staging

PersistenceCachingFront  End

Logic

ProductionUAT

CachingFront  End

Logic

Front  End

Logic

Caching

Mobile  Field   Force  App

Persistence

CachingFront  End

Logic

Front  End

Logic

Logic

Caching

Persistence

Front  End

Logic

Caching

Warranty  Repair  App

Persistence

Front  End

Logic

Front  End

Image  Management

Persistence

Front  End

Image  Proc

Caching

Docker  Images

PersistenceCachingFront  End

Logic

Logic

Logic

PersistenceCachingFront  End

Logic PersistenceCachingFront  End

Logic

Page 12: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

Page 13: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

DOCKER  IS  GROWING  (18,000%  GROWTH)

Page 14: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

ENTERPRISES  RAPIDLY  ADOPTING  DOCKER

Small,  30%

Midsize,  15%

Large,  56%

Company  Sizes  Using  Docker

Page 15: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

CONTAINER  !=  VM

• VM’s– Full  instances  of  the  entire  OS– Not  easily  multi-­‐instanced  ~SysPrep

• Containers– Layered  elements  of  the  OS  +  Components– Easily  Duplicated,  Start/Stop– Lightweight  OS  (Tiny  Core  Linux  &  Windows  Server  Core)

Page 16: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

HOW  TINY  IS  TINY?

• ~24MB  download!  Whaaaat?!• Runs  completely  from  RAM• Minimal  Requirements:

– 46MB  of  RAM– i486DX  CPU  (introduced  in  1989,  50MHz,  8KB  cache)

• Recommended  Requirements:– 128MB+  of  RAM– Pentium  2  CPU

SUGCON  NORTH   AMERICA  2015 16

Page 17: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

SERVER  CORE  REQUIREMENTS

• Minimum  Requirement:– 256-­‐512MB  of  RAM– 1GHz  (x86)  or  1.4Ghz  (x64)CPU

• Recommended– 512MB+– 2GHz+  CPU

SUGCON  NORTH   AMERICA  2015 17

Page 18: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

CONTAINER  COMPARISON

• Immutable  infrastructure!• Fast  startup  (lightning  fast!)• Portable  &  light-­‐weight• A  unit  of  deployment• Ease  of  creation• Each  container  can  become  a  portion  of  the  entire  app

– May  have  multiple  containers  that  make  up  one  or  more  than  one  app

Page 19: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

WHY  CONTAINERS?

Developers

Enable  ‘write-­‐once,  run-­‐anywhere’  appsEnables  microservicearchitecturesGreat  for  dev/test  of  apps  and  services  (thousands  available  from  Docker)Reproducibility

Operations

Portability,  Portability,  PortabilityStandardized  development,  QA,  and  prod  environmentsAbstract  differences  in  OS  distributions  and  underlying  infrastructureEasily  scale-­‐up  and  scale-­‐down  in  response  to  changing  business  needs

DevOps

Page 20: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

HOSTING  CONTAINERS

Locally  with:• Docker  Toolbox   (Linux)

• Hyper  V   (Windows)

Physical  Servers• Linux   (Linux)

• Windows   2016  TP3  (Windows)

Clouds• Azure  (Linux  &  Windows)

AzureOn  Premises Service   ProviderLocally

Page 21: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

DOCKER  DISTRIBUTION

Page 22: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

DOCKERFILE

Page 23: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

WINDOWS  SERVER  CONTAINERS

Creation,  deployment,  and  management

Developers

Containers  pushed  tocentral  repository

Operationsautomates  deployment  and  monitors  

deployed  apps  from  central  repository

Operations collaborates  with  developers to  provide  app  metrics  and  insights

Developers  update,  iterate,  and  deploy  updated  containers

Page 24: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.SUGCON  NORTH   AMERICA  2015

Microsoft  CloudAzure On  Premises Service   Provider

Container  Technologies

Container  ManagementPowerShell OthersDocker

DevelopmentEnvironments

Others…

Page 25: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.SUGCON  NORTH   AMERICA  2015 25

SITECOREAND  CONTAINERS

Page 26: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

MONGOON  DOCKER

• Simple  configuration– Single  instance

– Replica  set  (development)

• Scaled  configuration– Scale  horizontally  

– Sharding

– Replica  sets

Page 27: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

SOLRON  DOCKER

• Simple  configuration– Single  instance– SolrCloud  (development)

• Scaled  Configuration– Scale  horizontally– Sharding– Replica  sets– Cloud

Page 28: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

SITECORE ON  DOCKER  (COMING!)

• Simple  Configuration

– Single  instance

– Scaled  CD/CM  environments  (development)

• Scaled  configuration

– Highly  scaled  infrastructure

– Load  balanced  server  instances

Page 29: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

DOCKER  HUB

• Docker  Hub– Base  repository– Private  vs  Public  – Solr for  Sitecore

Page 30: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.SUGCON  NORTH   AMERICA  2015 30

COMMON  QUESTIONS

Page 31: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

1. Docker  client  versus  host– Docker  client  is  a  command  line  interface  (CLI)  Docker– Docker  host  is  a  Linux/Windows  VM  running  Docker  daemon  

2. Docker  Linux  and  Windows  hosts  – You  can  only  create  the  same  container  as  the  underlying  host  VM  -­‐ Linux  host  =  Linux  containers

3. Docker  Image  vs  Docker  Container– Image  =  The  definition  – literally  a  single  file  [My  Website]– Container  – An  instance  of  an  image  [3  instances  of  My  Website]

4. Cloud  Registry  Service  and  Public  Image  Repos– Unlimited  public  repos,  one  free  private  or  buy  private  repos– 50,000+  images  -­‐Wordpress,  Nginx,  Redis,  MySQL,  Logstash,  and  your  images!– Docker  Trusted  Registry  –Dedicated  registry  application  deployable  on-­‐premiseor  direct  from  Azure  

Marketplace

5COMMON  DOCKER  QUESTIONS

Page 32: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

5COMMON  DOCKER  QUESTIONS

replace   update5.        Deployments  replace  instead  of  update

“Immutable  infrastructure”

Update  Website  

Update  your  app  using  Web  Deploy  or  CI/CD

Replace  Docker  

Replace  running  containers  using  CI/CD,  Don’t  update  the  old  

container

Page 33: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.SUGCON  NORTH   AMERICA  2015 33

MODULAR  DESIGN

Page 34: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

MOVING  TO  MODULAR  DESIGN

• How  will  you  move  your  website?

Page 35: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

THINK  CONTAINERS

• How  will  your  app  scale?

Page 36: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

Front  EndLogic

CachingPersistenc

e

IDENTIFY  THE  SCALING  BOUNDARIES

Page 37: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

IDENTIFY  THE  SCALING  BOUNDARIES

Email  CampaignsProduct  MgmntCustomer ServiceBasket  MgmntPayment  GatewayProduct  Info

Shopper  ProfileOrder  StatusLogic

Order  StatusBasket  MgmntCheckoutBackOffice

CustomerMgmntProduct  Info

Front  End

CachingPersistenc

e

Page 38: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

Basket  Mgmnt

Payment  Gateway

Product  Info

Shopper  Profile

Basket  Mgmnt

Checkout

Product  Info

Basket  Mgmnt

Payment  Gateway

Product  Info

Shopper  Profile

Basket  Mgmnt

Checkout

Product  Info

Caching

Persistence

Email  Campaigns

Product  Mgmnt

Customer Service

Order  Status

Order  Status

BackOffice

CustomerMgmnt

Basket  Mgmnt

Payment  Gateway

Product  Info

Shopper  Profile

Basket  Mgmnt

Checkout

Product  Info

IDENTIFY  THE  SCALING  BOUNDARIES

Page 39: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

PREPARE,  PREPARE,  PREPARE

• Think  Modular  Design• Think  “micro  services”• Think  “Composable”

Page 40: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.SUGCON  NORTH   AMERICA  2015 40

COMPLEMENTARY  TOOLS

Page 41: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

SOME  OTHER  DOCKER  CONCEPTS

ComposeDefine  and  deploy  a  multi-­‐container  application

SwarmPool  of  hosts  treated  as  a  single  unit,  control  over  multi-­‐container  environments

Page 42: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

DOCKER  COMPOSE  EXAMPLE

Page 43: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

DOCKER  SWARM

• Adds  a  collection  of  virtual  machines  into  one  logical  cluster.  

• Same  Docker  API• Elect  a  leader  to  receive  commands  and  send  to  cluster• Scheduler

– Constraints  – set  a  label  on  a  VM/Node  so  matching  containers  use  that  VM  (ex:  region=us-­‐west)

– Affinities  – Filters  for  labels,  image,  containers  – ex:  -­‐e  affinity:container==frontend)

• Various  Strategies

Page 44: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.

WRAPPING  UP

• Containers  Ease  Development  &  Ops• Force  a  conversation  of  scalable  design• Ease  of  movement  (On  Prem,  AWS,  Azure)• Immutable  Infrastructure• Use  Docker  Hub  repositories  for  base  images• Run  Solr and  Mongo  in  containers• Run  Sitecore in  containers  (coming  soon)  Really  soon!

Page 45: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.SUGCON  NORTH   AMERICA  2015

SM

45

THANK  YOU  TO  OUR  SPONSORS!

Page 46: Vasiliy Fomichev - Harness the Power of Containers - SUGCON

Organized  by  the  Community,  for  the  Community.SUGCON  NORTH   AMERICA  2015

THANK  YOU!

https://www.linkedin.com/in/vasiliyfomichev

@vasiliyfomichev

VASILIY  FOMICHEVSOLUTIONS  ARCHITECT

http://content.verndale.com/sugconvasiliyhttp://www.cmsbestpractices.comSpecial  thanks  to  Steve  Lasker,  Microsoft