SlideShare ist ein Scribd-Unternehmen logo
1 von 39
A Groovy Kind of Java
The Groovy Way to Manage Apps in the Cloud




                                             @natishalom
THE GOOD OLD APPLICATION PACKAGE
GOOD AS LONG AS…


  You assume the other components
   are managed (DB, LB, …)
  Everything in your app is Java-based
  Servers are statically deployed
THINGS HAVE CHANGED

• The world is heterogeneous
• Cloud - The new data center
• Tons of OSS projects
• Speed of change ->
  continuous delivery
• Reduced Boundaries
  between Dev and Ops
THE NEW APPLICATION STACK


    Distributed
   Dependencies
                                 Application




                           Pod                 DB
  Tomcat, Node.js, Ruby,
         NoSQL


                   Web
                                     LB
                  Server
THE NEW APPLICATION STACK
Packaging is just not enough...
What about the operational aspect?

Deployment                       Post Deployment


        Installation                                 Fail-over




Dependency       Configuration         Update /
                                       Maintenance



                                                          Monitoring
          Startup
…AND ALL THAT
NEEDS TO REMAIN
CONSISTENT ACROSS
THE STACK
We need a new way to describe and
      deploy these apps...
A DSL TO THE RESCUE




11          ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
RECIPES – THE NEW APPLICATION DEPLOYMENT DSL
                   Recipes define all the details needed to run an app:
                                         What middleware services to run
                                         Dependencies between services
                                         How to install services
                                         Where application and service binaries are
                                         When to spawn or terminate instances
                                         How to monitor each of the services.




12        ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
THE RUBY WAY...




13         ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
HOW CAN I DO THE SAME THING IN JAVA?




14             ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
GROOVY – GREAT FOR JAVA BASED DSL




Removes
Syntactical
Noise




15            ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
GROOVY – GREAT FOR JAVA BASED DSL




Extendable




16           ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
GROOVY – GREAT FOR JAVA BASED DSL




Readable




17         ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
CREATING A GROOVY-BASED APPLICATION
     RECIPE DSL – THE CLOUDIFY WAY




18            ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
CLOUDIFY RECIPE DOMAIN MODEL
 Application:
    Describes the
 application tiers and
 their dependencies               Application




                            Pod                 DB
                                                          Service:
                                                     Describe an individual tier
                                                     e.g. Tomcat, Node.js, Ruby, NoSQL

                    Web
                                      LB
                   Server
APPLICATION RECIPE

application {
      name="petclinic"
      service {
        name = "mongod"
      }
      service {
        name = "mongoConfig"
      }
      service {
        name = "apacheLB"
      }
      service {
        name = "mongos"
        dependsOn = ["mongoConfig", "mongod"]
      }
}




                        ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
SERVICE RECIPE: MACHINE TEMPLATES
service {
  name "mysql"
  icon "mysql.png"
  type "DATABASE"
            ...
}



 lifecycle{
   install "mysql_install.groovy"
   start "mysql_start.groovy"
   startDetectionTimeoutSecs 900
   startDetection "mysql_startDetection.groovy"
   stopDetection {
     !ServiceUtils.isPortOccupied(jdbcPort)
   }
   preStop ([
     "Win.*":"killAllMysql.bat",
     "Linux.*":"mysql_stop.groovy"
   21])
   shutdown ([
      "Linux.*":"mysql_uninstall.groovy"
   ])




                          ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
SERVICE RECIPE: SCALING RULES

  scalingRules ([
    scalingRule {
      serviceStatistics {
          metric "Total Requests Count"
          statistics
  Statistics.maximumThroughput
          movingTimeRangeInSeconds 20
      }
      highThreshold {
      value 1
      instancesIncrease 1
      }
      lowThreshold {
          value 0.2
          instancesDecrease 1
      }
    }
22])




                     ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
SERVICE RECIPE: CUSTOM METRICS
monitors {

  def ctxPath = ("default" ==
context.applicationName)?"":"${context.applicationName}“

     def metricNamesToMBeansNames = [
            "Current Http Threads Busy": ["Catalina:type=ThreadPool,name="http-bio-
            ${currHttpPort}"", "currentThreadsBusy"],
            "Current Http Thread Count": ["Catalina:type=ThreadPool,name="http-bio-
            ${currHttpPort}"", "currentThreadCount"],

      return getJmxMetrics("127.0.0.1",currJmxPort,metricNamesToMBeansNames)
}




23                   ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
SERVICE RECIPE: MACHINE TEMPLATES

        compute {
          template "SMALL_LINUX"
        }




SMALL_LINUX : template{                                                   SMALL_LINUX : template
  imageId "1234"                                                            imageId "us-east-1/ami-76f0061f“
  machineMemoryMB 3200                                                      remoteDirectory "/home/ec2-user/gs-files“
  hardwareId "103"                                                          machineMemoryMB 1600
  remoteDirectory "/root/gs-files"                                          hardwareId "m1.small"
  localDirectory "upload"                                                   locationId "us-east-1"
  keyFile "gigaPGHP.pem"                                                    localDirectory "upload"
  options ([                                                                keyFile "myKeyFile.pem"
    "openstack.securityGroup" : "default",
    "openstack.keyPair" : "gigaPGHP"                                        options ([
            ])                                                                    "securityGroups" : ["default"]as
            privileged true                                               String[],
}                                                                                 "keyPair" : "myKeyFile"
                                                                                ])
                                                                                overrides (["jclouds.ec2.ami-query":"",
                                                                                "jclouds.ec2.cc-ami-query":""])
                                                                                privileged true
                                                                          }


   24                       ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
INTEGRATING WITH CHEF
  service {
      extend "../../../services/chef"
      name "your service name"
                                                           Extending the Chef Recipe
      type "DATABASE"
      numInstances 1

      compute {                      Custom   Service Name
          template "SMALL_UBUNTU"
      }
      lifecycle {
          startDetectionTimeoutSecs 240                       Add Custom Start Detector
          startDetection {

            ServiceUtils.isPortOccupied(System.getenv()["CLOUDIFY_AGENT_ENV_PRIVATE
  _IP"], 3306)
          }
      }

  }
  runParams = [
  “param1": “value1”,
  “param2": [“key1”:”subvalue1”,…]
                                                Runtime   parameters
  …
  "run_list": ["recipe[cookbook_name::recipe_name]"]
  ]

                                                 Run list
                                                 (Recipes or Roles)
UNDER THE HOOD...




26            ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
LET’S START WITH A BASIC GROOVY FILE




27         ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
USE CONSTRUCTOR WITH NAMED PARAMETERS




28       ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
ADD IMPORT CUSTOMIZER TO GROOVY SHELL




29        ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
BETTER, BUT NEEDS A BIT MORE




30        ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
OVERRIDE SCRIPT BASE CLASS


    A Groovy script is compiled into a Java class.
    The Groovy commands runs in the run() method.
    The created Groovy class extends the groovy.lang.Script class.
    Default implementations of:
      get/setProperty
      invokeMethod
      println
 Use GroovyShell to replace default base script class with our
  own implementation.



31              ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
OVERRIDE SCRIPT BASE CLASS




 Tweak a few small things, like redirecting println() to Logger




32            ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
AND TWEAK SOME MORE


 Override invokeMethod() and setProperty()
 Map method names to domain objects
 If not a domain object, map to field name of current object




33           ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
LOAD AN OPTIONAL PROPERTIES FILE AND BIND TO SHELL



 Bind to Groovy Shell




34            ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
EASY TO READ, BUT STILL POWERFUL




35         ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
EXTENSIVE PLATFORM SUPPORT




36        ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
ON ANY CLOUD




                                                 Your Own
                                                Data Center




37       ® Copyright 2011 Gigaspaces Ltd. All Rights Reserved
Live Demo




38   ® Copyright 2011 Gigaspaces Ltd. All Rights Reserved
Get it today
      http://www.cloudifysource.org
http://github.com/CloudifySource/cloudify

Weitere ähnliche Inhalte

Was ist angesagt?

Maximize the power of OSGi
Maximize the power of OSGiMaximize the power of OSGi
Maximize the power of OSGiDavid Bosschaert
 
C fowler azure-dojo
C fowler azure-dojoC fowler azure-dojo
C fowler azure-dojosdeconf
 
Security and performance designs for client-server communications
Security and performance designs for client-server communicationsSecurity and performance designs for client-server communications
Security and performance designs for client-server communicationsWO Community
 
EWD 3 Training Course Part 20: The DocumentNode Object
EWD 3 Training Course Part 20: The DocumentNode ObjectEWD 3 Training Course Part 20: The DocumentNode Object
EWD 3 Training Course Part 20: The DocumentNode ObjectRob Tweed
 
May 2012 HUG: Oozie: Towards a scalable Workflow Management System for Hadoop
May 2012 HUG: Oozie: Towards a scalable Workflow Management System for HadoopMay 2012 HUG: Oozie: Towards a scalable Workflow Management System for Hadoop
May 2012 HUG: Oozie: Towards a scalable Workflow Management System for HadoopYahoo Developer Network
 
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and FelixProvisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and FelixDavid Bosschaert
 
Multi thread slave_performance_on_opc
Multi thread slave_performance_on_opcMulti thread slave_performance_on_opc
Multi thread slave_performance_on_opcShinya Sugiyama
 
Zookeeper In Simple Words
Zookeeper In Simple WordsZookeeper In Simple Words
Zookeeper In Simple WordsFuqiang Wang
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the TrenchesJonathan Wage
 
Storage Plug-ins
Storage Plug-ins Storage Plug-ins
Storage Plug-ins buildacloud
 
인피니스팬 데이터그리드 플랫폼
인피니스팬 데이터그리드 플랫폼인피니스팬 데이터그리드 플랫폼
인피니스팬 데이터그리드 플랫폼Jaehong Cheon
 
Automating Drupal Migrations
Automating Drupal MigrationsAutomating Drupal Migrations
Automating Drupal MigrationslittleMAS
 
What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)David Bosschaert
 
Cassandra 3.0 advanced preview
Cassandra 3.0 advanced previewCassandra 3.0 advanced preview
Cassandra 3.0 advanced previewPatrick McFadin
 
Advanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraAdvanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraDataStax Academy
 

Was ist angesagt? (17)

Maximize the power of OSGi
Maximize the power of OSGiMaximize the power of OSGi
Maximize the power of OSGi
 
C fowler azure-dojo
C fowler azure-dojoC fowler azure-dojo
C fowler azure-dojo
 
Security and performance designs for client-server communications
Security and performance designs for client-server communicationsSecurity and performance designs for client-server communications
Security and performance designs for client-server communications
 
EWD 3 Training Course Part 20: The DocumentNode Object
EWD 3 Training Course Part 20: The DocumentNode ObjectEWD 3 Training Course Part 20: The DocumentNode Object
EWD 3 Training Course Part 20: The DocumentNode Object
 
May 2012 HUG: Oozie: Towards a scalable Workflow Management System for Hadoop
May 2012 HUG: Oozie: Towards a scalable Workflow Management System for HadoopMay 2012 HUG: Oozie: Towards a scalable Workflow Management System for Hadoop
May 2012 HUG: Oozie: Towards a scalable Workflow Management System for Hadoop
 
Coursera Cassandra Driver
Coursera Cassandra DriverCoursera Cassandra Driver
Coursera Cassandra Driver
 
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and FelixProvisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
 
Multi thread slave_performance_on_opc
Multi thread slave_performance_on_opcMulti thread slave_performance_on_opc
Multi thread slave_performance_on_opc
 
Zookeeper In Simple Words
Zookeeper In Simple WordsZookeeper In Simple Words
Zookeeper In Simple Words
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
 
Storage Plug-ins
Storage Plug-ins Storage Plug-ins
Storage Plug-ins
 
Simple Jdbc With Spring 2.5
Simple Jdbc With Spring 2.5Simple Jdbc With Spring 2.5
Simple Jdbc With Spring 2.5
 
인피니스팬 데이터그리드 플랫폼
인피니스팬 데이터그리드 플랫폼인피니스팬 데이터그리드 플랫폼
인피니스팬 데이터그리드 플랫폼
 
Automating Drupal Migrations
Automating Drupal MigrationsAutomating Drupal Migrations
Automating Drupal Migrations
 
What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)
 
Cassandra 3.0 advanced preview
Cassandra 3.0 advanced previewCassandra 3.0 advanced preview
Cassandra 3.0 advanced preview
 
Advanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraAdvanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache Cassandra
 

Andere mochten auch

Mt Gox USDHS Wells Fargo account seizure warrant (executed)
Mt Gox USDHS Wells Fargo account seizure warrant (executed)Mt Gox USDHS Wells Fargo account seizure warrant (executed)
Mt Gox USDHS Wells Fargo account seizure warrant (executed)mcarney7
 
Simplicity CEO Ariel Friedler Resignation Letter
Simplicity CEO Ariel Friedler Resignation LetterSimplicity CEO Ariel Friedler Resignation Letter
Simplicity CEO Ariel Friedler Resignation Lettermcarney7
 
#DominateFund Pitch Deck 2012
#DominateFund Pitch Deck 2012#DominateFund Pitch Deck 2012
#DominateFund Pitch Deck 2012mcarney7
 
A Mutual Fund With An Economic Approach
A Mutual Fund With An Economic ApproachA Mutual Fund With An Economic Approach
A Mutual Fund With An Economic Approachdhannibal
 
AWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce Costs
AWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce CostsAWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce Costs
AWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce CostsAmazon Web Services
 
Realtime Big data Anaytics and Exampes of Daum (2013)
Realtime Big data Anaytics and Exampes of Daum (2013)Realtime Big data Anaytics and Exampes of Daum (2013)
Realtime Big data Anaytics and Exampes of Daum (2013)Channy Yun
 

Andere mochten auch (6)

Mt Gox USDHS Wells Fargo account seizure warrant (executed)
Mt Gox USDHS Wells Fargo account seizure warrant (executed)Mt Gox USDHS Wells Fargo account seizure warrant (executed)
Mt Gox USDHS Wells Fargo account seizure warrant (executed)
 
Simplicity CEO Ariel Friedler Resignation Letter
Simplicity CEO Ariel Friedler Resignation LetterSimplicity CEO Ariel Friedler Resignation Letter
Simplicity CEO Ariel Friedler Resignation Letter
 
#DominateFund Pitch Deck 2012
#DominateFund Pitch Deck 2012#DominateFund Pitch Deck 2012
#DominateFund Pitch Deck 2012
 
A Mutual Fund With An Economic Approach
A Mutual Fund With An Economic ApproachA Mutual Fund With An Economic Approach
A Mutual Fund With An Economic Approach
 
AWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce Costs
AWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce CostsAWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce Costs
AWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce Costs
 
Realtime Big data Anaytics and Exampes of Daum (2013)
Realtime Big data Anaytics and Exampes of Daum (2013)Realtime Big data Anaytics and Exampes of Daum (2013)
Realtime Big data Anaytics and Exampes of Daum (2013)
 

Ähnlich wie A Groovy Kind of Java (San Francisco Java User Group)

19th February 2013, AWS User Group UK, Meetup #3, Managing your apps on AWS: ...
19th February 2013, AWS User Group UK, Meetup #3, Managing your apps on AWS: ...19th February 2013, AWS User Group UK, Meetup #3, Managing your apps on AWS: ...
19th February 2013, AWS User Group UK, Meetup #3, Managing your apps on AWS: ...AWS User Group UK
 
Carrier Paas - CloudStack Collaboration Event 2012
Carrier Paas - CloudStack Collaboration Event 2012Carrier Paas - CloudStack Collaboration Event 2012
Carrier Paas - CloudStack Collaboration Event 2012Uri Cohen
 
Big Data in the Cloud
Big Data in the CloudBig Data in the Cloud
Big Data in the CloudNati Shalom
 
Introduction to Apache CloudStack by David Nalley
Introduction to Apache CloudStack by David NalleyIntroduction to Apache CloudStack by David Nalley
Introduction to Apache CloudStack by David Nalleybuildacloud
 
Big data (reversim)
Big data (reversim)Big data (reversim)
Big data (reversim)Nati Shalom
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStackPuppet
 
Building a Dev/Test Cloud with Apache CloudStack
Building a Dev/Test Cloud with Apache CloudStackBuilding a Dev/Test Cloud with Apache CloudStack
Building a Dev/Test Cloud with Apache CloudStackke4qqq
 
Monitoring your technology stack with New Relic
Monitoring your technology stack with New RelicMonitoring your technology stack with New Relic
Monitoring your technology stack with New RelicRonald Bradford
 
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013Amazon Web Services
 
Building a Dev/Test Cloud with Apache CloudStack
Building a Dev/Test Cloud with Apache CloudStackBuilding a Dev/Test Cloud with Apache CloudStack
Building a Dev/Test Cloud with Apache CloudStackke4qqq
 
Infrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and OpsInfrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and OpsMykyta Protsenko
 
Cloudify Open PaaS Stack for DevOps
Cloudify Open PaaS Stack for DevOps  Cloudify Open PaaS Stack for DevOps
Cloudify Open PaaS Stack for DevOps Nati Shalom
 
BeJUG Meetup - What's coming in the OSGi R7 Specification
BeJUG Meetup - What's coming in the OSGi R7 SpecificationBeJUG Meetup - What's coming in the OSGi R7 Specification
BeJUG Meetup - What's coming in the OSGi R7 SpecificationStijn Van Den Enden
 
Custom Runtimes for the Cloud
Custom Runtimes for the CloudCustom Runtimes for the Cloud
Custom Runtimes for the CloudCloudBees
 
대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016
대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016
대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016Amazon Web Services Korea
 
Stratalux Cloud Formation and Chef Integration Presentation
Stratalux Cloud Formation and Chef Integration PresentationStratalux Cloud Formation and Chef Integration Presentation
Stratalux Cloud Formation and Chef Integration PresentationJeremy Przygode
 
Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...Boris Kravtsov
 
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp BerlinTech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp BerlinLeanIX GmbH
 
Easy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applicationsEasy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applicationsJack-Junjie Cai
 

Ähnlich wie A Groovy Kind of Java (San Francisco Java User Group) (20)

19th February 2013, AWS User Group UK, Meetup #3, Managing your apps on AWS: ...
19th February 2013, AWS User Group UK, Meetup #3, Managing your apps on AWS: ...19th February 2013, AWS User Group UK, Meetup #3, Managing your apps on AWS: ...
19th February 2013, AWS User Group UK, Meetup #3, Managing your apps on AWS: ...
 
Carrier Paas - CloudStack Collaboration Event 2012
Carrier Paas - CloudStack Collaboration Event 2012Carrier Paas - CloudStack Collaboration Event 2012
Carrier Paas - CloudStack Collaboration Event 2012
 
Big Data in the Cloud
Big Data in the CloudBig Data in the Cloud
Big Data in the Cloud
 
Introduction to Apache CloudStack by David Nalley
Introduction to Apache CloudStack by David NalleyIntroduction to Apache CloudStack by David Nalley
Introduction to Apache CloudStack by David Nalley
 
Big data (reversim)
Big data (reversim)Big data (reversim)
Big data (reversim)
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStack
 
Building a Dev/Test Cloud with Apache CloudStack
Building a Dev/Test Cloud with Apache CloudStackBuilding a Dev/Test Cloud with Apache CloudStack
Building a Dev/Test Cloud with Apache CloudStack
 
Monitoring your technology stack with New Relic
Monitoring your technology stack with New RelicMonitoring your technology stack with New Relic
Monitoring your technology stack with New Relic
 
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
 
Building a Dev/Test Cloud with Apache CloudStack
Building a Dev/Test Cloud with Apache CloudStackBuilding a Dev/Test Cloud with Apache CloudStack
Building a Dev/Test Cloud with Apache CloudStack
 
Infrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and OpsInfrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and Ops
 
Cloudify Open PaaS Stack for DevOps
Cloudify Open PaaS Stack for DevOps  Cloudify Open PaaS Stack for DevOps
Cloudify Open PaaS Stack for DevOps
 
Beyond JEE
Beyond JEEBeyond JEE
Beyond JEE
 
BeJUG Meetup - What's coming in the OSGi R7 Specification
BeJUG Meetup - What's coming in the OSGi R7 SpecificationBeJUG Meetup - What's coming in the OSGi R7 Specification
BeJUG Meetup - What's coming in the OSGi R7 Specification
 
Custom Runtimes for the Cloud
Custom Runtimes for the CloudCustom Runtimes for the Cloud
Custom Runtimes for the Cloud
 
대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016
대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016
대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016
 
Stratalux Cloud Formation and Chef Integration Presentation
Stratalux Cloud Formation and Chef Integration PresentationStratalux Cloud Formation and Chef Integration Presentation
Stratalux Cloud Formation and Chef Integration Presentation
 
Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...
 
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp BerlinTech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
 
Easy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applicationsEasy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applications
 

Mehr von Nati Shalom

Cloudify and terraform integration
Cloudify and terraform integrationCloudify and terraform integration
Cloudify and terraform integrationNati Shalom
 
Why NFV and Digital Transformation Projects Fail!
Why NFV and Digital Transformation Projects Fail! Why NFV and Digital Transformation Projects Fail!
Why NFV and Digital Transformation Projects Fail! Nati Shalom
 
Cloudify and terraform integration
Cloudify and terraform integrationCloudify and terraform integration
Cloudify and terraform integrationNati Shalom
 
1 cloud, 2 clouds, 3 clouds, tons...
1 cloud, 2 clouds, 3 clouds, tons...1 cloud, 2 clouds, 3 clouds, tons...
1 cloud, 2 clouds, 3 clouds, tons...Nati Shalom
 
Open Stack Days israel Keynote 2017
Open Stack Days israel Keynote 2017Open Stack Days israel Keynote 2017
Open Stack Days israel Keynote 2017Nati Shalom
 
What A No Compromises Hybrid Cloud Looks Like
What A No Compromises Hybrid Cloud Looks Like What A No Compromises Hybrid Cloud Looks Like
What A No Compromises Hybrid Cloud Looks Like Nati Shalom
 
Running OpenStack in Production
Running OpenStack in Production Running OpenStack in Production
Running OpenStack in Production Nati Shalom
 
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...Nati Shalom
 
Real World Example of Orchestrating Docker, Node JS, NFV on OpenStack
Real World Example of Orchestrating Docker, Node JS, NFV on OpenStackReal World Example of Orchestrating Docker, Node JS, NFV on OpenStack
Real World Example of Orchestrating Docker, Node JS, NFV on OpenStackNati Shalom
 
Real World Application Orchestration Made Easy on VMware vCloud Air, vSphere ...
Real World Application Orchestration Made Easy on VMware vCloud Air, vSphere ...Real World Application Orchestration Made Easy on VMware vCloud Air, vSphere ...
Real World Application Orchestration Made Easy on VMware vCloud Air, vSphere ...Nati Shalom
 
OpenStack Juno The Complete Lowdown and Tales from the Summit
OpenStack Juno The Complete Lowdown and Tales from the SummitOpenStack Juno The Complete Lowdown and Tales from the Summit
OpenStack Juno The Complete Lowdown and Tales from the SummitNati Shalom
 
Application and Network Orchestration using Heat & Tosca
Application and Network Orchestration using Heat & ToscaApplication and Network Orchestration using Heat & Tosca
Application and Network Orchestration using Heat & ToscaNati Shalom
 
Introduction to Cloudify for OpenStack users
Introduction to Cloudify for OpenStack users Introduction to Cloudify for OpenStack users
Introduction to Cloudify for OpenStack users Nati Shalom
 
Software Defined Operator
Software Defined OperatorSoftware Defined Operator
Software Defined OperatorNati Shalom
 
Complex Analytics with NoSQL Data Store in Real Time
Complex Analytics with NoSQL Data Store in Real TimeComplex Analytics with NoSQL Data Store in Real Time
Complex Analytics with NoSQL Data Store in Real TimeNati Shalom
 
Is Orchestration the Next Big Thing in DevOps
Is Orchestration the Next Big Thing in DevOpsIs Orchestration the Next Big Thing in DevOps
Is Orchestration the Next Big Thing in DevOpsNati Shalom
 
When networks meets apps (open stack atlanta)
When networks meets apps (open stack atlanta)When networks meets apps (open stack atlanta)
When networks meets apps (open stack atlanta)Nati Shalom
 
Application Centric Approach to Devops
Application Centric Approach to DevopsApplication Centric Approach to Devops
Application Centric Approach to DevopsNati Shalom
 
Case Studies for moving apps to the cloud - DLD 2013
Case Studies for moving apps to the cloud - DLD 2013Case Studies for moving apps to the cloud - DLD 2013
Case Studies for moving apps to the cloud - DLD 2013Nati Shalom
 
Application Centric DevOps
Application Centric DevOpsApplication Centric DevOps
Application Centric DevOpsNati Shalom
 

Mehr von Nati Shalom (20)

Cloudify and terraform integration
Cloudify and terraform integrationCloudify and terraform integration
Cloudify and terraform integration
 
Why NFV and Digital Transformation Projects Fail!
Why NFV and Digital Transformation Projects Fail! Why NFV and Digital Transformation Projects Fail!
Why NFV and Digital Transformation Projects Fail!
 
Cloudify and terraform integration
Cloudify and terraform integrationCloudify and terraform integration
Cloudify and terraform integration
 
1 cloud, 2 clouds, 3 clouds, tons...
1 cloud, 2 clouds, 3 clouds, tons...1 cloud, 2 clouds, 3 clouds, tons...
1 cloud, 2 clouds, 3 clouds, tons...
 
Open Stack Days israel Keynote 2017
Open Stack Days israel Keynote 2017Open Stack Days israel Keynote 2017
Open Stack Days israel Keynote 2017
 
What A No Compromises Hybrid Cloud Looks Like
What A No Compromises Hybrid Cloud Looks Like What A No Compromises Hybrid Cloud Looks Like
What A No Compromises Hybrid Cloud Looks Like
 
Running OpenStack in Production
Running OpenStack in Production Running OpenStack in Production
Running OpenStack in Production
 
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
 
Real World Example of Orchestrating Docker, Node JS, NFV on OpenStack
Real World Example of Orchestrating Docker, Node JS, NFV on OpenStackReal World Example of Orchestrating Docker, Node JS, NFV on OpenStack
Real World Example of Orchestrating Docker, Node JS, NFV on OpenStack
 
Real World Application Orchestration Made Easy on VMware vCloud Air, vSphere ...
Real World Application Orchestration Made Easy on VMware vCloud Air, vSphere ...Real World Application Orchestration Made Easy on VMware vCloud Air, vSphere ...
Real World Application Orchestration Made Easy on VMware vCloud Air, vSphere ...
 
OpenStack Juno The Complete Lowdown and Tales from the Summit
OpenStack Juno The Complete Lowdown and Tales from the SummitOpenStack Juno The Complete Lowdown and Tales from the Summit
OpenStack Juno The Complete Lowdown and Tales from the Summit
 
Application and Network Orchestration using Heat & Tosca
Application and Network Orchestration using Heat & ToscaApplication and Network Orchestration using Heat & Tosca
Application and Network Orchestration using Heat & Tosca
 
Introduction to Cloudify for OpenStack users
Introduction to Cloudify for OpenStack users Introduction to Cloudify for OpenStack users
Introduction to Cloudify for OpenStack users
 
Software Defined Operator
Software Defined OperatorSoftware Defined Operator
Software Defined Operator
 
Complex Analytics with NoSQL Data Store in Real Time
Complex Analytics with NoSQL Data Store in Real TimeComplex Analytics with NoSQL Data Store in Real Time
Complex Analytics with NoSQL Data Store in Real Time
 
Is Orchestration the Next Big Thing in DevOps
Is Orchestration the Next Big Thing in DevOpsIs Orchestration the Next Big Thing in DevOps
Is Orchestration the Next Big Thing in DevOps
 
When networks meets apps (open stack atlanta)
When networks meets apps (open stack atlanta)When networks meets apps (open stack atlanta)
When networks meets apps (open stack atlanta)
 
Application Centric Approach to Devops
Application Centric Approach to DevopsApplication Centric Approach to Devops
Application Centric Approach to Devops
 
Case Studies for moving apps to the cloud - DLD 2013
Case Studies for moving apps to the cloud - DLD 2013Case Studies for moving apps to the cloud - DLD 2013
Case Studies for moving apps to the cloud - DLD 2013
 
Application Centric DevOps
Application Centric DevOpsApplication Centric DevOps
Application Centric DevOps
 

A Groovy Kind of Java (San Francisco Java User Group)

  • 1. A Groovy Kind of Java The Groovy Way to Manage Apps in the Cloud @natishalom
  • 2. THE GOOD OLD APPLICATION PACKAGE
  • 3. GOOD AS LONG AS…  You assume the other components are managed (DB, LB, …)  Everything in your app is Java-based  Servers are statically deployed
  • 4. THINGS HAVE CHANGED • The world is heterogeneous • Cloud - The new data center • Tons of OSS projects • Speed of change -> continuous delivery • Reduced Boundaries between Dev and Ops
  • 5. THE NEW APPLICATION STACK Distributed Dependencies Application Pod DB Tomcat, Node.js, Ruby, NoSQL Web LB Server
  • 7. Packaging is just not enough...
  • 8. What about the operational aspect? Deployment Post Deployment Installation Fail-over Dependency Configuration Update / Maintenance Monitoring Startup
  • 9. …AND ALL THAT NEEDS TO REMAIN CONSISTENT ACROSS THE STACK
  • 10. We need a new way to describe and deploy these apps...
  • 11. A DSL TO THE RESCUE 11 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 12. RECIPES – THE NEW APPLICATION DEPLOYMENT DSL Recipes define all the details needed to run an app:  What middleware services to run  Dependencies between services  How to install services  Where application and service binaries are  When to spawn or terminate instances  How to monitor each of the services. 12 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 13. THE RUBY WAY... 13 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 14. HOW CAN I DO THE SAME THING IN JAVA? 14 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 15. GROOVY – GREAT FOR JAVA BASED DSL Removes Syntactical Noise 15 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 16. GROOVY – GREAT FOR JAVA BASED DSL Extendable 16 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 17. GROOVY – GREAT FOR JAVA BASED DSL Readable 17 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 18. CREATING A GROOVY-BASED APPLICATION RECIPE DSL – THE CLOUDIFY WAY 18 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 19. CLOUDIFY RECIPE DOMAIN MODEL Application: Describes the application tiers and their dependencies Application Pod DB Service: Describe an individual tier e.g. Tomcat, Node.js, Ruby, NoSQL Web LB Server
  • 20. APPLICATION RECIPE application { name="petclinic" service { name = "mongod" } service { name = "mongoConfig" } service { name = "apacheLB" } service { name = "mongos" dependsOn = ["mongoConfig", "mongod"] } } ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 21. SERVICE RECIPE: MACHINE TEMPLATES service { name "mysql" icon "mysql.png" type "DATABASE" ... } lifecycle{ install "mysql_install.groovy" start "mysql_start.groovy" startDetectionTimeoutSecs 900 startDetection "mysql_startDetection.groovy" stopDetection { !ServiceUtils.isPortOccupied(jdbcPort) } preStop ([ "Win.*":"killAllMysql.bat", "Linux.*":"mysql_stop.groovy" 21]) shutdown ([ "Linux.*":"mysql_uninstall.groovy" ]) ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 22. SERVICE RECIPE: SCALING RULES scalingRules ([ scalingRule { serviceStatistics { metric "Total Requests Count" statistics Statistics.maximumThroughput movingTimeRangeInSeconds 20 } highThreshold { value 1 instancesIncrease 1 } lowThreshold { value 0.2 instancesDecrease 1 } } 22]) ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 23. SERVICE RECIPE: CUSTOM METRICS monitors { def ctxPath = ("default" == context.applicationName)?"":"${context.applicationName}“ def metricNamesToMBeansNames = [ "Current Http Threads Busy": ["Catalina:type=ThreadPool,name="http-bio- ${currHttpPort}"", "currentThreadsBusy"], "Current Http Thread Count": ["Catalina:type=ThreadPool,name="http-bio- ${currHttpPort}"", "currentThreadCount"], return getJmxMetrics("127.0.0.1",currJmxPort,metricNamesToMBeansNames) } 23 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 24. SERVICE RECIPE: MACHINE TEMPLATES compute { template "SMALL_LINUX" } SMALL_LINUX : template{ SMALL_LINUX : template imageId "1234" imageId "us-east-1/ami-76f0061f“ machineMemoryMB 3200 remoteDirectory "/home/ec2-user/gs-files“ hardwareId "103" machineMemoryMB 1600 remoteDirectory "/root/gs-files" hardwareId "m1.small" localDirectory "upload" locationId "us-east-1" keyFile "gigaPGHP.pem" localDirectory "upload" options ([ keyFile "myKeyFile.pem" "openstack.securityGroup" : "default", "openstack.keyPair" : "gigaPGHP" options ([ ]) "securityGroups" : ["default"]as privileged true String[], } "keyPair" : "myKeyFile" ]) overrides (["jclouds.ec2.ami-query":"", "jclouds.ec2.cc-ami-query":""]) privileged true } 24 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 25. INTEGRATING WITH CHEF service { extend "../../../services/chef" name "your service name" Extending the Chef Recipe type "DATABASE" numInstances 1 compute { Custom Service Name template "SMALL_UBUNTU" } lifecycle { startDetectionTimeoutSecs 240 Add Custom Start Detector startDetection { ServiceUtils.isPortOccupied(System.getenv()["CLOUDIFY_AGENT_ENV_PRIVATE _IP"], 3306) } } } runParams = [ “param1": “value1”, “param2": [“key1”:”subvalue1”,…] Runtime parameters … "run_list": ["recipe[cookbook_name::recipe_name]"] ] Run list (Recipes or Roles)
  • 26. UNDER THE HOOD... 26 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 27. LET’S START WITH A BASIC GROOVY FILE 27 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 28. USE CONSTRUCTOR WITH NAMED PARAMETERS 28 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 29. ADD IMPORT CUSTOMIZER TO GROOVY SHELL 29 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 30. BETTER, BUT NEEDS A BIT MORE 30 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 31. OVERRIDE SCRIPT BASE CLASS  A Groovy script is compiled into a Java class.  The Groovy commands runs in the run() method.  The created Groovy class extends the groovy.lang.Script class.  Default implementations of:  get/setProperty  invokeMethod  println  Use GroovyShell to replace default base script class with our own implementation. 31 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 32. OVERRIDE SCRIPT BASE CLASS  Tweak a few small things, like redirecting println() to Logger 32 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 33. AND TWEAK SOME MORE  Override invokeMethod() and setProperty()  Map method names to domain objects  If not a domain object, map to field name of current object 33 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 34. LOAD AN OPTIONAL PROPERTIES FILE AND BIND TO SHELL  Bind to Groovy Shell 34 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 35. EASY TO READ, BUT STILL POWERFUL 35 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 36. EXTENSIVE PLATFORM SUPPORT 36 ® Copyright 2012 GigaSpaces Ltd. All Rights Reserved
  • 37. ON ANY CLOUD Your Own Data Center 37 ® Copyright 2011 Gigaspaces Ltd. All Rights Reserved
  • 38. Live Demo 38 ® Copyright 2011 Gigaspaces Ltd. All Rights Reserved
  • 39. Get it today http://www.cloudifysource.org http://github.com/CloudifySource/cloudify

Hinweis der Redaktion

  1. This is a simpler method to show how to set a service than the previous slide
  2. Use wrapper class which is RunnableWe change the default base class from the default script class to our own extended script class – this enables us to add specific attributes and context to each element in the DSL.
  3. See reference below
  4. We needed to extend the invoke method to map between the service method and the service domain model using naming conventionThe dfferent between this method and monkey patching is that in this method can be called from a java code where monkey patching were adding modethods on the fly a feature that his not that intituive to use if your calling groovy from java.One of the differences is that in this mothod as appose to monkey patching the object meta data doesn’t change i.e. I will not be able to see a new method named service added to the class definition instead we have a defaul handler that will catch every undefined method and will invoke it through this handler.
  5. Note that in this DSL theimpage and preStartMessage are defined as properties
  6. Start local cloud Show recipe – install application – simple Show on ec2 Install Metrics LogsComparison charts