Rubyizing the devs and ops of an enterprise 1.0

33
Rubyizing the Devs and Ops of an Enterprise Yashasree Barve

description

My Presentation during RubyConf India 2011, presented on 28th / 29th May 2011 in Bangalore India

Transcript of Rubyizing the devs and ops of an enterprise 1.0

Page 1: Rubyizing the devs and ops of an enterprise 1.0

Rubyizing the Devs and Ops of an Enterprise

Yashasree Barve

Page 2: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

About me

Technologist @ TCS since last 13 years

An Agile Ruby developer since 2007

&

I'm lovin' it

Page 3: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Back in 2007

Who is this Ruby?

Page 4: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

A Rewarding Journey

2011

2007

Who is this Ruby?

I Love Ruby

Page 5: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

An Enterprise

Images created using wordle.net

Page 6: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Agile Enters the Enterprise

Page 7: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Page 8: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Let us try Ruby and Rails!

Page 9: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

But This is An Enterprise…

PerformanceHeterogeneity

Availability

Security

Scalability

Complexity

Reliability

Page 10: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

How to eat an Elephant?One bite at a time!

Page 11: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

THE RAILS WAY

Page 12: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Believe it or not,most big company security break-ins

involve your employees!

Page 13: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Security Plug in

Single Sign On Server

Apache PassengerApache Passenger

SecurityPlug in

Rails App

Login

Enterprise Directory ServerEnterprise Directory Server

Authenticate

Authorize

Page 14: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Microsoft ADSDomino LDAP

IBM ITDS

Support ALL of those!

Page 15: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Directory Server Plug in

Apache PassengerApache Passenger

LDAPPlug in

Rails App

> person = MyLdap::Person.find_name 'John Doe'> person.first_name #=> 'John'> person.last_name #=> 'Doe'> person.is_contractor? #=> true> person.is_in_group?('some_admins') #=> true> person.groups #=> ['some_admins', 'that_user']

> group = MyLdap::Group.find_by_name 'some_admins'> group.contains? person> #=> true

> Other ways to find a person:> MyLdap::Person.find_by_distinguished_name> MyLdap::Person.find_by_sso_name

> person = MyLdap::Person.find_name 'John Doe'> person.first_name #=> 'John'> person.last_name #=> 'Doe'> person.is_contractor? #=> true> person.is_in_group?('some_admins') #=> true> person.groups #=> ['some_admins', 'that_user']

> group = MyLdap::Group.find_by_name 'some_admins'> group.contains? person> #=> true

> Other ways to find a person:> MyLdap::Person.find_by_distinguished_name> MyLdap::Person.find_by_sso_name

Enterprise Directory ServerEnterprise Directory Server

Page 16: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

every Page you See

every Click you Make

Page 17: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Usage Tracking

Apache PassengerApache Passenger

TrackingPlug in

Rails App

enable_page_tracking to track who visited which page

link_to to send info about clicked link

Set defaults in environment.rb

Define app specific parameters in environment config

Rake task to include relevant files in the application

enable_page_tracking to track who visited which page

link_to to send info about clicked link

Set defaults in environment.rb

Define app specific parameters in environment config

Rake task to include relevant files in the application

Enterprise Usage TrackingExternal Server

Enterprise Usage TrackingExternal Server

HTTP

Page 18: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Plug ins that DRYed us

Page 19: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Hosting Internally

Gem Server

Enterprise Subversion

Server

C:\my_app\trunk>gem install –source http://mygemserver:8808/ distributeC:\my_app\trunk>gem install –source http://mygemserver:8808/ distribute

C:\my_app\trunk>ruby script/plugininstall my_security –source http://svn....com/ruby/plugins/my_security/trunk

C:\my_app\trunk>ruby script/plugininstall my_security –source http://svn....com/ruby/plugins/my_security/trunk

Page 20: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011 SOURCE: Source

RailsUp and Running

Page 21: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Create a Brand New Rails app that

• gets committed in SCM• configured on CI • branding, security, ldap, and so on installed • ready to be deployed with configured Capfile• defaults to rspec, mocha, cucumber

Page 22: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Way We Work

Keep it Simple.Keep it Simple.

Automated Tests, A part of life.

Automated Tests, A part of life.

ContinuouslyIntegrate,Release Often.

ContinuouslyIntegrate,Release Often.

Page 23: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Vibrant Rubyists Group

Team up Share Excel

Page 24: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Oops!

But what about theOps

Page 25: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

The BIG Task of Deployment

Powered by Capistrano and Passenger

C:\my_app\trunk>capd deploy:migrationstriggering start callbacks for `deploy:migrations'

Select Stage:1. production2. integration3. devutility4. qaPlease select:

C:\my_app\trunk>capd deploy:migrationstriggering start callbacks for `deploy:migrations'

Select Stage:1. production2. integration3. devutility4. qaPlease select:

> capd apache:configure> capd apache:passenger:configure> capd apache:restart> capd install> capd uninstall> capd deploy:bundle_gems

> capd deploy:minify_and_upload_assets> capd deploy:minify_erbs

> capd google:configure> capd ldap:configure> capd database:configure

> capd hoptoad:notify

> capd apache:configure> capd apache:passenger:configure> capd apache:restart> capd install> capd uninstall> capd deploy:bundle_gems

> capd deploy:minify_and_upload_assets> capd deploy:minify_erbs

> capd google:configure> capd ldap:configure> capd database:configure

> capd hoptoad:notify

Page 26: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Towards One Click deployment

Inspired by Heroku

Page 27: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Busting those Tickets!

Apache PassengerApache Passenger

Admin Rails App

Legacy Enterprise AppsLegacy Enterprise Apps

Page 28: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

More Transparency

SplunkSplunk

HoptoadHoptoad

Page 29: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Chef at work

Infrastructure as a codeand

The code is Ruby

Page 30: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Envisioning the Provisioning

• Monitor the App Performance

• Spin a virtual server to scale horizontally

Page 31: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Dev Ops

Page 32: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

This presentation would not have been possible without

My fellow RubyistsAmit Kumar

Thomas NewtonPatrick Shaughnessy

&My creative designer buddy

Mayura Sawant

Thanks mates!

Page 33: Rubyizing the devs and ops of an enterprise 1.0

RubyConf India 2011

Thank you all for being patient and hearing me out.

Hope this helps you!

Any questions?