Integrating RightScale, Windows, and .NET for Fun and Profit - RightScale Compute 2013


Published on

Patrick McClory - Solutions Architect, RightScale
Patrick Moore - Operations Manager, Koupon Media
Gordon Bailey - Lead Infrastructure Engineer, Koupon Media

RightScale offers a robust REST-based API and, while it is available to all, having platform-specific clients certainly helps in the process of consuming and working with any given programming interface. We’ll demonstrate the RightScale .NET API 1.5 wrapper project with a few examples of how it can help to automate your process, integrate with existing tools, and even make your life easier when implemented within your daily operating applications.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Integrating RightScale, Windows, and .NET for Fun and Profit - RightScale Compute 2013

  1. 1. april25-26sanfranciscocloud success starts hereIntegrating RightScale, Windows for Fun and ProfitGordon Bailey, Director of Technology/IT | Koupon MediaPatrick Moore, Director of Operations | Koupon MediaPatrick McClory, Solutions Architect | RightScale
  2. 2. #2#2#RightscaleComputeAgenda• API 1.5 Overview• RightScale.netClient Intro and Overview• Demos…• MSBuild and Dev/Test in the cloud• Advanced PowerShell Management with RightScale + API 1.5• PHB Demo• Insight from KouponMedia
  3. 3. #3#3#RightscaleComputeRightScale API 1.5• REST API with JSON and XML response types• RightScale core functionality exposed•
  4. 4. #4#4#RightscaleComputeMapping REST to .net
  5. 5. #5#5#RightscaleComputeRightScale.netClient Overview• Generic wrapper for the RightScale API 1.5 toolset• Media Types = Classes/Object Model• Resources = Static methods per class• A couple of assumptions made:• Generally, resources map to media types 1:1• For Resources with multiple urls, more descriptive names are better:• Instance.index() and Instance.index_ServerArray(serverArrayId)
  6. 6. #6#RightscaleComputeDemo – Dev/Test with MSBuildTFS + Windows Azure + RightScale
  7. 7. #7#7#RightscaleComputeUse Case/Scenario• We‘re running a .net shop using Team Foundation Services2012 (TFS) for source control• Standard web application being developed• We‘ll use the Mileage Stats demo app• Slightly modified to use Microsoft SQL Server instead of SQL CE• DB Backups and scripts available for download• Application is nearing time to be released to production• Ability to test in multiple environments rapidly is critical• Build from local consistently with how production builds arecreated
  8. 8. #8#8#RightscaleComputeGeneral SDLC WorkflowShameless plug… check out my SDLC/ALM blog post!
  9. 9. #9#RightscaleComputeDev/Test with MSBuildDemo
  10. 10. #10#10#RightscaleComputeOrganizing your build with MSBuild
  11. 11. #11#RightscaleComputeDev/Test with MSBuildDemo
  12. 12. #12#12#RightscaleComputeResources• Source code for reference app in github• Team Foundation Server or another MSBuild orchestrationutility like or TeamCity• Web Deploy 3.0 installed on all machines packaging builds• RightScale Support page on MSDeploy• Some more detail in another blog post
  13. 13. #13#RightscaleComputeDemo – Advanced PowerShellManagementPowerShell + RightScale
  14. 14. #14#14#RightscaleComputeUse Case/Scenario• Familiar platform for Windows Sysadmins• Leverage RightScale within other automation processes alreadyscripted• Manage our Dev/Test Environments from the MSBuild Demo• On the way out the door—let‘s make sure we tear the instances down• Build a scheduled task to stand them up again in the morning with thelatest stable build
  15. 15. #15#15#RightscaleComputeUsing PowerShell to build the environment
  16. 16. #16#RightscaleComputePowerShell + RightScale API 1.5Environment Tear-Down Demo
  17. 17. #17#17#RightscaleComputeResources• Cmdlet code is in Github• Also builds a package as a part of the post-build events on theRightScale.netClient solution• PowerShell API direct call examples on• Will give you examples from curl, PowerShell and sometimes theRightAPIClient ruby gem• Other PowerShell references•••
  18. 18. #18#RightscaleComputePHB DemoNetduino + RightScale + Windows Azure(among others)
  19. 19. #19#19#RightscaleComputeUse Case/Scenario• Disclaimer: this is not a serious demo• Let‘s explore a bit of what‘s possible now that we have acommon hook within the .net Framework (v4.5)• Taking a little inspiration from ‗Wally‘:• Let‘s figure out the craziest way to enable laziness• Need to not loose our jobs either—we‘ve got to get some work done• Goal: Whenever the boss is on the way, let‘s do something that looksimpressive
  20. 20. #20#20#RightscaleComputePatrick‘s Desk Situation
  21. 21. #21#21#RightscaleComputeReally going out of our way to ‗not work‘• We‘ve built a motion detector using a netduino and a few otherparts:• Netduino Plus 1• HC-SR04 Ultrasonic Distance Sensor• Microtivity IM 161 LCD display• HC-SR501 Human Sensor Module• Wireless network bridge• Some code to make it work• A .net Micro Framework console app to drive the sensors and logic• Netduino SDK 4.2.2• Netduino Plus 1 Firmware Upgrade to 4.2.0• A small service application to take input and do that ‗something‘ we needto be doing (i.e. launching a 3-tier stack for a developer)
  22. 22. #22#22#RightscaleComputeWhen triggered…
  23. 23. #23#RightscaleComputePHB DemoDemo
  24. 24. #24#24#RightscaleComputeResources• Demo code on github• Hardware as listed earlier• A patient boss (while you work out the glitches)
  25. 25. #25#RightscaleComputeKoupon MediaHow we‘ve grown with RightScale
  26. 26. #26#26#RightscaleComputeOperations Maturity• PAST – where we came from• Too long, too many doing too little, too much• Time• Servers• Cost• PRESENT – what we realized• Do more with less• Small company embracing cloud, mobility, and social solutions• Scalable solution• Easier, Efficient, Faster• FUTURE – how we can get better• Visibility for all• Never enough mentality
  27. 27. #27#27#RightscaleComputeRS Professional Experience• Learning to ride a bike for the first time• Training wheels, helmet, knee pads, elbow pads• Confidence comes from within…. AND those teaching us• Deployments, templates, scripts oh my!• ―Give a man a fish and you feed him for a day. Teach a man to fish andyou feed him for a lifetime.‖• Not just a face in the crowd• Personal, day-to-day service• ―People work with people they like‖•
  28. 28. #28#28#RightscaleComputeFactual Results: time & money• Actual results of all the who-ha• How much was our time worth?• Connecting time & money• Realizing where you need to adjust in order to grow• Spending what you need to not what you think you need to
  29. 29. #29#29#RightscaleComputeFactual Results: time & money• Time: sometimes the easy way is the Right way• PAST: 2-3 hours• Manual• Tedious• Human error• PRESENT: 45 mins – 1 hour• 4 steps• Consistent• FUTURE: 25 mins flat (our new PR goal)• Quick, easy, efficient
  30. 30. #30#30#RightscaleComputeFactual Results: time & money• Cost: cutting branches off the money tree• PAST: X servers costing $x.xx / month• Not utilizing full to even quarter of server capability• Not utilizing all of an already paid for service• PRESENT: Y servers cost = X servers cost• Fully customizable templates, scripts, servers• Utilizing more and more of a server / service• MSDN - Scheduler• FUTURE:• Not taking the shortcuts but understanding what we need compared to what we want
  31. 31. #31#31#RightscaleComputeContact Info• Gordon Bailey•• Patrick Moore•• Patrick McClory – Solutions Architect•• @patrickmcclory••
  32. 32. april25-26sanfranciscocloud success starts hereQuestions?
  33. 33. april25-26sanfranciscocloud success starts hereReference Slides
  34. 34. #34#34#RightscaleComputeRightScale.netClient status• Still in Alpha – not featurecomplete/parity with API 1.5 – 14Resources to complete• Demo-ready, feedback welcome, butnot production complete as of yet• Published on nuget and available ongithub• Lots of functional tests for existing workwithin a unit test project – dependenton some specific setup, but designedto test functionality
  35. 35., :id)
  36. 36. #36#36#RightscaleComputeRightScale.netClient Design/Architecture
  37. 37. #37#37#RightscaleComputeClass Design• GenericRightScaleObjectBase<T>• Derived base class fortaggable objects• Will likely expand asdevelopment continues tomanage globally usedconcepts• Tags• Actions• Other property-level itemsBase Class Management• Centralized logic for all APIcalls• Cached authenticationmechanism for all callswithin the same applicationscope• One and doneSingleton for Web Client
  38. 38. #38#38#RightscaleComputeRightScale.netClient.Base Classes• RightScaleObjectBase<T> handles genericproperties and actions• Type parameter is required to manage serialization anddeserialization of JSON objects• Handles single and list deserialization• Centralized place to parse and manage links collection• TaggableResourceBase<T>• For objects that are able to receive tags—separate baseclass derived from RightScaleObjectBase<T>
  39. 39. #39#39#RightscaleComputeRightScale.netClient.Core.APIClient• Single point of interaction for all HTTP methods• Handles username/password/account number orOAuth authentication for API 1.5• Automatically authenticates if not alreadyauthenticated• Auth information can be sored inapp.config/machine.config under specific keysSingleton Implementation for API Caller
  40. 40. #40#40#RightscaleComputePHB Detector