40
april25-26 sanfrancisco cloud success starts here Integrating RightScale, Windows and .net for Fun and Profit Gordon Bailey, Director of Technology/IT | Koupon Media Patrick Moore, Director of Operations | Koupon Media Patrick McClory, Solutions Architect | RightScale

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

Embed Size (px)

Citation preview

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

april25-26

sanfrancisco

cloud success starts here

Integrating RightScale, Windows and

.net for Fun and ProfitGordon Bailey, Director of Technology/IT | Koupon Media

Patrick Moore, Director of Operations | Koupon Media

Patrick McClory, Solutions Architect | RightScale

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

#2#2

#RightscaleCompute

Agenda

• 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

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

#3#3

#RightscaleCompute

RightScale API 1.5

• REST API with JSON and XML response types

• RightScale core functionality exposed

• http://reference.rightscale.com/api1.5/index.html

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

#4#4

#RightscaleCompute

Mapping REST to .net

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

#5#5

#RightscaleCompute

RightScale.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)

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

#6

#RightscaleCompute

Demo – Dev/Test with MSBuild

TFS + Windows Azure + RightScale

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

#7#7

#RightscaleCompute

Use Case/Scenario

• We‘re running a .net shop using Team Foundation Services

2012 (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 are

created

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

#8#8

#RightscaleCompute

General SDLC Workflow

Shameless plug… check out my SDLC/ALM blog post!

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

#9

#RightscaleCompute

Dev/Test with MSBuild

Demo

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

#10#10

#RightscaleCompute

Organizing your build with MSBuild

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

#11

#RightscaleCompute

Dev/Test with MSBuild

Demo

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

#13

#RightscaleCompute

Demo – Advanced PowerShell

ManagementPowerShell + RightScale

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

#14#14

#RightscaleCompute

Use Case/Scenario

• Familiar platform for Windows Sysadmins

• Leverage RightScale within other automation processes already

scripted

• 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 the

latest stable build

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

#15#15

#RightscaleCompute

Using PowerShell to build the environment

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

#16

#RightscaleCompute

PowerShell + RightScale API 1.5

Environment Tear-Down Demo

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

#17#17

#RightscaleCompute

Resources

• Cmdlet code is in Github

• Also builds a package as a part of the post-build events on the

RightScale.netClient solution

• PowerShell API direct call examples on support.rightscale.com

• Will give you examples from curl, PowerShell and sometimes the

RightAPIClient ruby gem

• Other PowerShell references

• ss64.com/ps

• http://www.microsoft.com/en-us/download/details.aspx?id=7097

• http://www.jonoble.com/blog/2011/12/12/powershell-quick-reference-

guides-and-cheat-sheets.html

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

#18

#RightscaleCompute

PHB DemoNetduino + RightScale + Windows Azure

(among others)

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

#19#19

#RightscaleCompute

Use Case/Scenario

• Disclaimer: this is not a serious demo

• Let‘s explore a bit of what‘s possible now that we have a

common 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 looks

impressive

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

#20#20

#RightscaleCompute

Patrick‘s Desk Situation

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

#21#21

#RightscaleCompute

Really going out of our way to ‗not work‘

• We‘ve built a motion detector using a netduino and a few other

parts:

• 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 need

to be doing (i.e. launching a 3-tier stack for a developer)

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

#22#22

#RightscaleCompute

When triggered…

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

#23

#RightscaleCompute

PHB Demo

Demo

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

#24#24

#RightscaleCompute

Resources

• Demo code on github

• Hardware as listed earlier

• A patient boss (while you work out the glitches)

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

#25

#RightscaleCompute

Koupon Media

How we‘ve grown with RightScale

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

#26#26

#RightscaleCompute

Operations 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

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

#27#27

#RightscaleCompute

RS 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 and

you feed him for a lifetime.‖

• Not just a face in the crowd

• Personal, day-to-day service

• ―People work with people they like‖• http://www.rightscale.com/about_us/top-ten-myths-about-working-at-rightscale.php

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

#28#28

#RightscaleCompute

Factual 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

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

#29#29

#RightscaleCompute

Factual 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

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

#30#30

#RightscaleCompute

Factual 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

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

#31#31

#RightscaleCompute

Contact Info

• Gordon Bailey• [email protected]

• Patrick Moore• [email protected]

• Patrick McClory – Solutions Architect• [email protected]

• @patrickmcclory

• http://www.linkedin.com/in/patrickmcclory

• https://github.com/patrickmcclory/

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

april25-26

sanfrancisco

cloud success starts here

Questions?

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

april25-26

sanfrancisco

cloud success starts here

Reference Slides

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

#34#34

#RightscaleCompute

RightScale.netClient status

• Still in Alpha – not feature

complete/parity with API 1.5 – 14

Resources to complete

• Demo-ready, feedback welcome, but

not production complete as of yet

• Published on nuget and available on

github

• Lots of functional tests for existing work

within a unit test project – dependent

on some specific setup, but designed

to test functionality

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

#35#35

#RightscaleCompute

VolumeTypes.show(:cloudid, :id)

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

#36#36

#RightscaleCompute

RightScale.netClient Design/Architecture

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

#37#37

#RightscaleCompute

Class Design

• Generic RightScaleObjectBase<T>

• Derived base class for

taggable objects

• Will likely expand as

development continues to

manage globally used

concepts

• Tags

• Actions

• Other property-level items

Base Class Management

• Centralized logic for all API

calls

• Cached authentication

mechanism for all calls

within the same application

scope

• One and done

Singleton for Web Client

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

#38#38

#RightscaleCompute

RightScale.netClient.Base Classes

• RightScaleObjectBase<T> handles generic

properties and actions

• Type parameter is required to manage serialization and

deserialization 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 base

class derived from RightScaleObjectBase<T>

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

#39#39

#RightscaleCompute

RightScale.netClient.Core.APIClient

• Single point of interaction for all HTTP methods

• Handles username/password/account number or

OAuth authentication for API 1.5

• Automatically authenticates if not already

authenticated

• Auth information can be sored in

app.config/machine.config under specific keys

Singleton Implementation for API Caller

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

#40#40

#RightscaleCompute

PHB Detector