cloudstack continuous delivery
DESCRIPTION
TRANSCRIPT
ThoughtForge.net
Noel King – 10 July 2013
CloudStack enabled
Continuous Delivery
ThoughtForge.net
Me
• Software engineer at Paddy Power
• Develop a PAAS solution for development teams
• Primarily Java developer• Mentor at CoderDojo
ThoughtForge.net
Agile
ThoughtForge.net
Lets review Dev process
ThoughtForge.net
Dev now focused on single user story
ThoughtForge.net
User story demo
ThoughtForge.net
2 … n weeks later regression testing .. and
then …
Think we have a major performance issue
ThoughtForge.net
Developer reaction!
ThoughtForge.net
Yes fixed it quickly!
ThoughtForge.net
Great its go live day
ThoughtForge.net
Or its …
ThoughtForge.net
Observations
• Business & Developers > Product to market quicker
• Go Lives still to big and risky• Production application
monitoring inadequate
ThoughtForge.net
Could we do better – Behavioral change
• Automated testing• Automate environment provisioning• Smaller incremental releasing• Implement proper application
monitoring• Blue / Green releasing
ThoughtForge.net
Use Case
haproxy > tomcat > mysql > app dynamics
ThoughtForge.net
Continuous DeliveryPart 1:
Automate environment provisioning
ThoughtForge.net
Automation with Cloudstack
• Create new VM’s as required• Bootstrap VM’s with the necessary
role• Update firewall rules as necessary• Scale based on demand• Automatically rebuild failed instances
ThoughtForge.net
Continuous DeliveryPart 2:
Orchestrate release management
ThoughtForge.net
Let’s automate from Check-in to Production
• Jenkins Build Pipeline plugin manages from check-in through to production– Unit tests– Integration test– Sonar– Artifactory– Acceptance– Performance– Live
• Every check-in is release candidate
ThoughtForge.net
The must haves
• Set version number and create new git branch• Compile and run unit tests with Maven• Clone workspace for other jobs• Run integration tests with Maven• Run sonar analysis• Publish binary to artifactory• Failed tests / Inadequate test coverage / Sonar
alerts break build
ThoughtForge.net
Acceptance + Performance
• Python Script– Create a new server with Cloudstack API– Retrieve IP address from Cloudstack API
• Chef – bootstrap server with role• Binaries from artifactory• Run acceptance tests using maven• Performance tests ran using JMeter• Teardown server with Cloudstack API
ThoughtForge.net
Sample CloudStack API Call in Jenkins
import urllibobj = eval(urllib.urlopen("http://192.168.1.110:8096/client/api?command=deployVirtualMachine&zoneid=98c822f1-ef7a-4f57-8bce-bf955779e5f7&templateId=92c2d4ae-f2b9-4028-a331-d1b77cba6f74&hypervisor=KVM&serviceOfferingId=15ed9345-9e6d-43ec-8508-186a261b30f7&displayname=acceptance-test&name=acceptanc-test&response=json").read());
deployVirtualMachine
ThoughtForge.net
Live
• Authorised promotion only• Can only be promoted if all
previous steps in the pipeline pass
• SSH onto production server and run a chef-client
ThoughtForge.net
Kick ass App monitoring
App Dynamics
ThoughtForge.net
Chef
"run_list": [ "recipe[mysql::server]", "recipe[mysql::runInitSql]", "recipe[java]", "recipe[appdynamicslite]", "recipe[tomcat]", "recipe[tomcat::jndi]", "recipe[tomcat::deployWar]", "recipe[haproxy]" ]
ThoughtForge.net
Why stop here, what’s next?
• Logstash• Auto scheduled scaling• Knife cloudstack• Jenkins jclouds pluginMaybe cache service
–Memcached
ThoughtForge.net
Questions
ThoughtForge.net
NEED YOUR VOTE
Vote for CoderDojo at
www.azuredevs.com