Clocker	
  and	
  OpenStack	
  
Andrew	
  Kennedy,	
  Dave	
  Nielsen	
  and	
  Andrea	
  Turli	
  
OpenStack	
  Meetup,	
  19	
  August	
  2014	
  	
  
IntroducCon	
  
•  Speakers	
  
–  Andrew	
  Kennedy	
  and	
  Andrea	
  Turli	
  
–  Dave	
  Neilsen	
  
•  Overview	
  
–  Docker	
  
–  Brooklyn	
  
–  Campsite	
  
–  OpenStack	
  
Docker	
  
•  IntroducCon	
  
•  Popularity	
  
•  History	
  
•  Ecosystem	
  
Docker	
  
Docker	
  
•  Technical	
  
•  Containers	
  
•  Micro	
  Services	
  
•  Dockerfiles	
  
–  ConfiguraCon	
  
–  Volumes	
  
–  Composable	
  
Docker	
  
•  Cloud	
  Usage	
  
•  OpenStack	
  
•  Manual	
  Process	
  
–  CredenCals	
  and	
  Keys	
  
–  OperaCng	
  System	
  and	
  Hardware	
  
–  Download	
  and	
  InstallaCon	
  
–  ConfiguraCon	
  
–  Dockerfile	
  per	
  Service	
  
Brooklyn	
  
•  Brooklyn	
  
–  ApplicaCon	
  Management	
  PlaOorm	
  
–  Autonomic	
  CompuCng	
  
•  YAML	
  Blueprint	
  
–  Services	
  (EnCCes)	
  
–  ConfiguraCon	
  
–  ATributes	
  (Sensors)	
  
–  AcCons	
  (Effectors)	
  
Clocker	
  
•  Infrastructure	
  
–  Apache	
  jclouds	
  Supported	
  Cloud	
  with	
  CredenCals	
  
•  Docker	
  Host	
  
–  Running	
  the	
  Docker	
  Service	
  
–  REST	
  API	
  Access	
  Using	
  jclouds	
  1.8.0	
  Docker	
  Driver	
  
–  Virtual	
  Machine	
  Access	
  Using	
  SSH	
  
–  Cluster	
  of	
  Containers	
  
•  Docker	
  Container	
  
–  Running	
  Services	
  and	
  Commands	
  for	
  EnCty	
  
Clocker	
  
DemonstraCon	
  
Deploying	
  a	
  Docker	
  Cloud	
  
Clocker	
  
•  Demand	
  Side	
  
–  Create	
  a	
  New	
  Container	
  
–  Resize	
  Cluster	
  of	
  EnCCes	
  
–  AutoScaler	
  Policy	
  ATached	
  to	
  Cluster	
  
•  Supply	
  Side	
  
–  Placement	
  Strategies	
  for	
  Containers	
  
–  Depth	
  or	
  Breadth	
  First	
  
–  Affinity	
  Rules	
  
–  Resource	
  AllocaCon	
  (CPU	
  Shares,	
  Load,	
  Memory,	
  …)	
  
Clocker	
  
•  ApplicaCon	
  Deployment	
  
–  CAMP	
  Blueprint	
  in	
  YAML	
  
–  Java	
  Classes	
  
–  Mostly	
  Unchanged	
  
•  Docker	
  Specific	
  ConfiguraCon	
  
–  Affinity	
  Rules	
  or	
  Placement	
  Strategy	
  
–  Dockerfile	
  or	
  Image	
  ID	
  
–  CPU	
  or	
  Memory	
  Shares	
  
–  Docker	
  Volumes	
  
DemonstraCon	
  
ApplicaCons	
  on	
  the	
  Docker	
  Cloud	
  
Campsite	
  ApplicaCon	
  
•  GitHub	
  Repository	
  
•  Components	
  
–  PHP	
  Web	
  ApplicaCon	
  
–  Node.JS	
  RESTful	
  API	
  
–  MySQL	
  Database	
  
•  Cloud	
  Services	
  
–  Email	
  
–  Message	
  Queue	
  
–  Object	
  Store	
  
Campsite	
  Blueprint	
  
id:	
  campsite-­‐application	
  
locations:	
  
-­‐	
  jclouds:hpcloud-­‐compute	
  
services:	
  
-­‐	
  serviceType:	
  brooklyn.entity.database.mysql.MySqlNode	
  
-­‐	
  serviceType:	
  brooklyn.campsite.entity.CampsiteWebapp	
  
	
  	
  brooklyn.config:	
  
	
  	
  	
  	
  objectStorage:	
  AWSObjectStorage	
  
	
  	
  	
  	
  queueService:	
  AWS_SQS	
  
	
  	
  	
  	
  emailService:	
  AWS_SES	
  
	
  	
  	
  	
  databaseHost:	
  $brooklyn:component("mysql").attributeWhenReady("host.name")	
  
	
  	
  	
  	
  databasePort:	
  $brooklyn:component("mysql").attributeWhenReady("mysql.port")	
  
	
  	
  	
  	
  databaseUser:	
  "campsite"	
  
	
  	
  	
  	
  databasePassword:	
  "p4ssw0rd"	
  
	
  	
  	
  	
  domainName:	
  "campsite.org"	
  
-­‐	
  serviceType:	
  brooklyn.campsite.entity.CampsiteApi	
  
Campsite	
  Blueprint	
  
•  Java	
  Components	
  
–  CampsiteWebapp	
  PHP	
  EnCty	
  
–  CampsiteApi	
  Node.JS	
  EnCty	
  
•  Campsite	
  ApplicaCon	
  
–  ConfiguraCon	
  ProperCes	
  
–  Webapp,	
  API	
  and	
  MySQL	
  Database	
  EnCCes	
  
•  YAML	
  Blueprint	
  
DemonstraCon	
  
Campsite	
  Deployment	
  
Campsite	
  Cluster	
  
•  Add	
  Cluster	
  CapabiliCes	
  
•  No	
  Extra	
  Coding	
  
–  Just	
  Write	
  YAML	
  Blueprint	
  
–  CampsiteWebapp	
  Already	
  Set	
  Up	
  
–  Stateless	
  Service	
  (Uses	
  SQL	
  Database)	
  
–  Only	
  Run	
  Database	
  Create	
  and	
  Install	
  Once	
  
•  New	
  Services	
  
–  Nginx	
  Load	
  Balancer	
  EnCty	
  
–  Rabbit	
  MQ	
  Broker	
  EnCty	
  
DemonstraCon	
  
Campsite	
  Cluster	
  Blueprint	
  
Summary	
  
•  Docker	
  Containers	
  
–  Micro	
  Services	
  
•  LimitaCons	
  
–  MulCple	
  Hosts	
  
–  Management	
  
•  Clocker	
  
–  ApplicaCon	
  Blueprints	
  
–  OrchestraCon	
  
Web	
  Resources	
  
http://clocker.io/	
  
http://brooklyn.io/	
  
https://github.com/brooklyncentral/campsite/	
  
https://github.com/dnielsen/campapp/	
  
http://docker.io/	
  
http://davenielsen.wordpress.com	
  	
  

Clocker and OpenStack

  • 1.
    Clocker  and  OpenStack   Andrew  Kennedy,  Dave  Nielsen  and  Andrea  Turli   OpenStack  Meetup,  19  August  2014    
  • 2.
    IntroducCon   •  Speakers   –  Andrew  Kennedy  and  Andrea  Turli   –  Dave  Neilsen   •  Overview   –  Docker   –  Brooklyn   –  Campsite   –  OpenStack  
  • 3.
    Docker   •  IntroducCon   •  Popularity   •  History   •  Ecosystem  
  • 4.
  • 5.
    Docker   •  Technical   •  Containers   •  Micro  Services   •  Dockerfiles   –  ConfiguraCon   –  Volumes   –  Composable  
  • 6.
    Docker   •  Cloud  Usage   •  OpenStack   •  Manual  Process   –  CredenCals  and  Keys   –  OperaCng  System  and  Hardware   –  Download  and  InstallaCon   –  ConfiguraCon   –  Dockerfile  per  Service  
  • 7.
    Brooklyn   •  Brooklyn   –  ApplicaCon  Management  PlaOorm   –  Autonomic  CompuCng   •  YAML  Blueprint   –  Services  (EnCCes)   –  ConfiguraCon   –  ATributes  (Sensors)   –  AcCons  (Effectors)  
  • 8.
    Clocker   •  Infrastructure   –  Apache  jclouds  Supported  Cloud  with  CredenCals   •  Docker  Host   –  Running  the  Docker  Service   –  REST  API  Access  Using  jclouds  1.8.0  Docker  Driver   –  Virtual  Machine  Access  Using  SSH   –  Cluster  of  Containers   •  Docker  Container   –  Running  Services  and  Commands  for  EnCty  
  • 9.
  • 10.
    DemonstraCon   Deploying  a  Docker  Cloud  
  • 11.
    Clocker   •  Demand  Side   –  Create  a  New  Container   –  Resize  Cluster  of  EnCCes   –  AutoScaler  Policy  ATached  to  Cluster   •  Supply  Side   –  Placement  Strategies  for  Containers   –  Depth  or  Breadth  First   –  Affinity  Rules   –  Resource  AllocaCon  (CPU  Shares,  Load,  Memory,  …)  
  • 12.
    Clocker   •  ApplicaCon  Deployment   –  CAMP  Blueprint  in  YAML   –  Java  Classes   –  Mostly  Unchanged   •  Docker  Specific  ConfiguraCon   –  Affinity  Rules  or  Placement  Strategy   –  Dockerfile  or  Image  ID   –  CPU  or  Memory  Shares   –  Docker  Volumes  
  • 13.
    DemonstraCon   ApplicaCons  on  the  Docker  Cloud  
  • 14.
    Campsite  ApplicaCon   • GitHub  Repository   •  Components   –  PHP  Web  ApplicaCon   –  Node.JS  RESTful  API   –  MySQL  Database   •  Cloud  Services   –  Email   –  Message  Queue   –  Object  Store  
  • 15.
    Campsite  Blueprint   id:  campsite-­‐application   locations:   -­‐  jclouds:hpcloud-­‐compute   services:   -­‐  serviceType:  brooklyn.entity.database.mysql.MySqlNode   -­‐  serviceType:  brooklyn.campsite.entity.CampsiteWebapp      brooklyn.config:          objectStorage:  AWSObjectStorage          queueService:  AWS_SQS          emailService:  AWS_SES          databaseHost:  $brooklyn:component("mysql").attributeWhenReady("host.name")          databasePort:  $brooklyn:component("mysql").attributeWhenReady("mysql.port")          databaseUser:  "campsite"          databasePassword:  "p4ssw0rd"          domainName:  "campsite.org"   -­‐  serviceType:  brooklyn.campsite.entity.CampsiteApi  
  • 16.
    Campsite  Blueprint   • Java  Components   –  CampsiteWebapp  PHP  EnCty   –  CampsiteApi  Node.JS  EnCty   •  Campsite  ApplicaCon   –  ConfiguraCon  ProperCes   –  Webapp,  API  and  MySQL  Database  EnCCes   •  YAML  Blueprint  
  • 17.
  • 18.
    Campsite  Cluster   • Add  Cluster  CapabiliCes   •  No  Extra  Coding   –  Just  Write  YAML  Blueprint   –  CampsiteWebapp  Already  Set  Up   –  Stateless  Service  (Uses  SQL  Database)   –  Only  Run  Database  Create  and  Install  Once   •  New  Services   –  Nginx  Load  Balancer  EnCty   –  Rabbit  MQ  Broker  EnCty  
  • 19.
  • 20.
    Summary   •  Docker  Containers   –  Micro  Services   •  LimitaCons   –  MulCple  Hosts   –  Management   •  Clocker   –  ApplicaCon  Blueprints   –  OrchestraCon  
  • 21.
    Web  Resources   http://clocker.io/   http://brooklyn.io/   https://github.com/brooklyncentral/campsite/   https://github.com/dnielsen/campapp/   http://docker.io/   http://davenielsen.wordpress.com