SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler offline
Treat your servers like your Ruby
App: Infrastructure as Code
2015 March 27-28
Allan Espinosa
Platform as a Service Team
Global Operations Department
Rakuten, Inc.
http://www.rakuten.co.jp/
About me
 Allan Espinosa
 Technology Background
 Language Polyglot: Ruby, Node.js, Java, .NET
 Systems Polyglot: Docker, VMWare
 Automation Junkie: Chef, Jenkins
 Job Background
 “Private Heroku”
 Senior Systems Developer
Platform as a Service Team
Global Operations Department
@AllanEspinosa
Rakuten, Inc.
Agenda
 Audience Demographics
 Typical App TDD
 Introduction to Configuration Management
 Infrastructure as Code
 Evolved App and Infrastructure TDD
 Wrap-up
Audience Demographics
 Web application developers?
 Infrastructure engineers?
 Fullstack engineers?
 Unit Tests?
 Test Driven Development?
 Automated/ Push-button deployments?
 Post-deployment end-to-end tests?
Infrastructure as Code
 Reproducable servers
 Bring up a lot of servers
 Programmatically add servers to monitor/ load balancer
Server as cattle not pets
Reference: Test Driven Infrastructure with Chef
Unmaintained Infrastructure Code
 Where did I install ruby-2.0.0-p589 to?
 Which machines upgraded to ruby-2.1.1-p589?
 Have I upgraded libxml2 for nokogiri?
 Why is database.yml pointing to staging????
 Test and software engineering practices still relevant!
# FIXME:
…
# TODO:
…
Typical TDD Cycle
Make the test pass
Refactor
Write a failing test
Application
Ref: K. Beck, Test Driven Development by Example, 2003.
Extended TDD with Acceptance Tests
Pass the
unit test
Refactor
Write a failing
unit test
Write Failing
Acceptance Test
Application
Capybara.current_driver = :selenium
Capybara.app_host = ‘http://localhost:8000’
G. Adzic, Specification by Example, 2011.
Apply to your Infrastructure
Pass the
unit test
Refactor
Write a failing
unit test
Write Failing
Acceptance Test
Application
+
Servers
Capybara.current_driver = :selenium
Capybara.app_host = ‘http://actual-production.domain
Build our infrastructure!
.kitchen.yml
---
provisioner: chef_zero
platforms:
- freebsd-10.1
suites:
- name: app
 Write a failing test
 Test-kitchen
 Plain Minitest
 Make the test pass
 Chef Recipe
 Refactor
 Repeat!
 Roll out to servers
 Pass acceptance test!
test/integration/app/minitest/test_app.rb
class TestApp < Minitest::Unit::TestCase
def test_ruby_is_installed
assert File.exists
‘/usr/local/bin/ruby’, ‘Ruby should be
installed’
end
end
Failing Test!
-----> Running minitest test suite
/opt/chef/embedded/bin/ruby -I"/opt/chef/embedded/lib/ruby/2.1.0"
"/opt/chef/embedded/lib/ruby/2.1.0/rake/rake_test_loader.rb"
"/tmp/busser/suites/minitest/test_app.rb"
Run options: --seed 48374
# Running tests:
F
Finished tests in 0.001660s, 602.4866 tests/s, 602.4866 assertions/s.
1) Failure:
AppTest#test_ruby_should_be_installed [/tmp/busser/suites/minitest/test_app.rb:5]:
ruby is not installed
1 tests, 1 assertions, 1 failures, 0 errors, 0 skips
/opt/chef/embedded/lib/ruby/2.1.0/rake/testtask.rb:106:in `block (3 levels) in define':
Command failed with status (1): [ruby -I"/opt/chef/embedded/lib/ruby/2.1.0" "/opt/che
f/embedded/lib/ruby/2.1.0/rake/rake_test_loader.rb" "/tmp/busser/suites/minitest/test_app.rb" ]
(RuntimeError)
Build our infrastructure!
.kitchen.yml
---
provisioner: chef_zero
platforms:
- freebsd-10.1
suites:
- name: app
run_list:
- recipe[todo::app]
 Write a failing test
 Test-kitchen
 Plain Minitest
 Make the test pass
 Chef Recipe
 Refactor
 Repeat!
 Roll out to servers
 Pass acceptance test!
Build our infrastructure!
recipes/app.rb
execute ‘pkg update’
package ‘ruby’ do
action :install
end
metadata.rb
name ‘todo’
 Write a failing test
 Test-kitchen
 Plain Minitest
 Make the test pass
 Chef Recipe
 Refactor
 Repeat!
 Roll out to servers
 Pass acceptance test!
Make the test pass
resolving cookbooks for run list: ["todo::app"]
Synchronizing Cookbooks:
- todo
Compiling Cookbooks...
Converging 2 resources
Recipe: todo::app
* execute[pkg update] action run
- execute pkg update
* package[ruby] action install
- install version 2.0.0.598_2,1 of package ruby
Running handlers:
Running handlers complete
Chef Client finished, 2/2 resources updated in 47.595913304
seconds
Finished converging <app-freebsd-101> (0m55.78s).
GREEN! Make the test pass
Run options: --seed 4256
# Running tests:
.
Finished tests in 0.001526s, 655.4072 tests/s, 655.4072
assertions/s.
1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
Finished verifying <app-freebsd-101> (0m2.59s).
Conclusion
 Infrastructure express in code
 Leapfrog on software engineering disciplines
We’re Hiring!
Search for “Platform as a Service”
http://global.rakuten.com/corp/careers/engineering/
Thank you! Questions?

Mais conteúdo relacionado

Mais procurados

DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
Simplilearn
 
How To Become A DevOps Engineer | Who Is A DevOps Engineer? | DevOps Engineer...
How To Become A DevOps Engineer | Who Is A DevOps Engineer? | DevOps Engineer...How To Become A DevOps Engineer | Who Is A DevOps Engineer? | DevOps Engineer...
How To Become A DevOps Engineer | Who Is A DevOps Engineer? | DevOps Engineer...
Simplilearn
 
[Japan Selenium User Community in Remote] Test Automation Journey
[Japan Selenium User Community in Remote] Test Automation Journey[Japan Selenium User Community in Remote] Test Automation Journey
[Japan Selenium User Community in Remote] Test Automation Journey
Woohyeok Kim
 

Mais procurados (20)

Continuous Delivery vs Continuous Deployment | DevOps Methodology | Devops Tr...
Continuous Delivery vs Continuous Deployment | DevOps Methodology | Devops Tr...Continuous Delivery vs Continuous Deployment | DevOps Methodology | Devops Tr...
Continuous Delivery vs Continuous Deployment | DevOps Methodology | Devops Tr...
 
AgileDC15 I'm Using Chef So I'm DevOps Right?
AgileDC15 I'm Using Chef So I'm DevOps Right?AgileDC15 I'm Using Chef So I'm DevOps Right?
AgileDC15 I'm Using Chef So I'm DevOps Right?
 
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
 
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
 
PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...
PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...
PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...
 
CICD Pipeline - AWS Azure
CICD Pipeline - AWS AzureCICD Pipeline - AWS Azure
CICD Pipeline - AWS Azure
 
What manufacturing teaches about DevOps
What manufacturing teaches about DevOpsWhat manufacturing teaches about DevOps
What manufacturing teaches about DevOps
 
Simplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - Sydney
Simplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - SydneySimplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - Sydney
Simplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - Sydney
 
Кирилл Толкачев. Микросервисы: огонь, вода и девопс
Кирилл Толкачев. Микросервисы: огонь, вода и девопсКирилл Толкачев. Микросервисы: огонь, вода и девопс
Кирилл Толкачев. Микросервисы: огонь, вода и девопс
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build Pipeline
 
Mastering Cross-Browser Test Automation With Cypress and Selenium
Mastering Cross-Browser Test Automation With Cypress and SeleniumMastering Cross-Browser Test Automation With Cypress and Selenium
Mastering Cross-Browser Test Automation With Cypress and Selenium
 
How To Become A DevOps Engineer | Who Is A DevOps Engineer? | DevOps Engineer...
How To Become A DevOps Engineer | Who Is A DevOps Engineer? | DevOps Engineer...How To Become A DevOps Engineer | Who Is A DevOps Engineer? | DevOps Engineer...
How To Become A DevOps Engineer | Who Is A DevOps Engineer? | DevOps Engineer...
 
[Japan Selenium User Community in Remote] Test Automation Journey
[Japan Selenium User Community in Remote] Test Automation Journey[Japan Selenium User Community in Remote] Test Automation Journey
[Japan Selenium User Community in Remote] Test Automation Journey
 
Discovery delivery 中国软件技术大会2011
Discovery delivery 中国软件技术大会2011Discovery delivery 中国软件技术大会2011
Discovery delivery 中国软件技术大会2011
 
Ultimate Git Workflow - Seoul 2015
Ultimate Git Workflow - Seoul 2015Ultimate Git Workflow - Seoul 2015
Ultimate Git Workflow - Seoul 2015
 
DevOps Unicorns
DevOps UnicornsDevOps Unicorns
DevOps Unicorns
 
Introduction to DevOps Tools | DevOps Training | DevOps Tutorial for Beginner...
Introduction to DevOps Tools | DevOps Training | DevOps Tutorial for Beginner...Introduction to DevOps Tools | DevOps Training | DevOps Tutorial for Beginner...
Introduction to DevOps Tools | DevOps Training | DevOps Tutorial for Beginner...
 
Introduction to CICD
Introduction to CICDIntroduction to CICD
Introduction to CICD
 
Drupal Continuous Integration and devops - Beyond Jenkins
Drupal Continuous Integration and devops - Beyond JenkinsDrupal Continuous Integration and devops - Beyond Jenkins
Drupal Continuous Integration and devops - Beyond Jenkins
 
DevOps Pipeline for Liferay Application
DevOps Pipeline for Liferay ApplicationDevOps Pipeline for Liferay Application
DevOps Pipeline for Liferay Application
 

Semelhante a Treat your servers like your Ruby App: Infrastructure as Code

Muraliupdatedpersona150716
Muraliupdatedpersona150716Muraliupdatedpersona150716
Muraliupdatedpersona150716
Murali Krishna R
 
Muraliupdatedpersonal091215
Muraliupdatedpersonal091215Muraliupdatedpersonal091215
Muraliupdatedpersonal091215
Murali Krishna R
 
Appium mobile web+dev conference
Appium   mobile web+dev conferenceAppium   mobile web+dev conference
Appium mobile web+dev conference
Isaac Murchie
 

Semelhante a Treat your servers like your Ruby App: Infrastructure as Code (20)

DevOps and Chef
DevOps and ChefDevOps and Chef
DevOps and Chef
 
DevOps and Chef improve your life
DevOps and Chef improve your life DevOps and Chef improve your life
DevOps and Chef improve your life
 
Muraliupdatedpersona150716
Muraliupdatedpersona150716Muraliupdatedpersona150716
Muraliupdatedpersona150716
 
Test Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as CodeTest Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as Code
 
Vinayak_Sdet_DevOps_Bigdata_5_years
Vinayak_Sdet_DevOps_Bigdata_5_yearsVinayak_Sdet_DevOps_Bigdata_5_years
Vinayak_Sdet_DevOps_Bigdata_5_years
 
Muraliupdatedpersonal091215
Muraliupdatedpersonal091215Muraliupdatedpersonal091215
Muraliupdatedpersonal091215
 
Introduction to chef framework
Introduction to chef frameworkIntroduction to chef framework
Introduction to chef framework
 
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source ToolsTYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
 
OSDC 2017 - Mandi Walls - Building security into your workflow with inspec
OSDC 2017 - Mandi Walls - Building security into your workflow with inspecOSDC 2017 - Mandi Walls - Building security into your workflow with inspec
OSDC 2017 - Mandi Walls - Building security into your workflow with inspec
 
Adding Security to Your Workflow with InSpec (MAY 2017)
Adding Security to Your Workflow with InSpec (MAY 2017)Adding Security to Your Workflow with InSpec (MAY 2017)
Adding Security to Your Workflow with InSpec (MAY 2017)
 
Prescriptive System Security with InSpec
Prescriptive System Security with InSpecPrescriptive System Security with InSpec
Prescriptive System Security with InSpec
 
Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019
 
Chef Automate - Infracoders Canberra August 8, 2017
Chef Automate - Infracoders Canberra August 8, 2017Chef Automate - Infracoders Canberra August 8, 2017
Chef Automate - Infracoders Canberra August 8, 2017
 
Appium mobile web+dev conference
Appium   mobile web+dev conferenceAppium   mobile web+dev conference
Appium mobile web+dev conference
 
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi WallsOSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
 
Appium workship, Mobile Web+Dev Conference
Appium workship,  Mobile Web+Dev ConferenceAppium workship,  Mobile Web+Dev Conference
Appium workship, Mobile Web+Dev Conference
 
Automating AWS Compliance with InSpec
Automating AWS Compliance with InSpec Automating AWS Compliance with InSpec
Automating AWS Compliance with InSpec
 
Adding Security and Compliance to Your Workflow with InSpec
Adding Security and Compliance to Your Workflow with InSpecAdding Security and Compliance to Your Workflow with InSpec
Adding Security and Compliance to Your Workflow with InSpec
 
Chef Automate - Wellington DevOps August 2, 2017
Chef Automate - Wellington DevOps August 2, 2017Chef Automate - Wellington DevOps August 2, 2017
Chef Automate - Wellington DevOps August 2, 2017
 
DevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleDevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & Ansible
 

Mais de Rakuten Group, Inc.

Mais de Rakuten Group, Inc. (20)

コードレビュー改善のためにJenkinsとIntelliJ IDEAのプラグインを自作してみた話
コードレビュー改善のためにJenkinsとIntelliJ IDEAのプラグインを自作してみた話コードレビュー改善のためにJenkinsとIntelliJ IDEAのプラグインを自作してみた話
コードレビュー改善のためにJenkinsとIntelliJ IDEAのプラグインを自作してみた話
 
楽天における安全な秘匿情報管理への道のり
楽天における安全な秘匿情報管理への道のり楽天における安全な秘匿情報管理への道のり
楽天における安全な秘匿情報管理への道のり
 
What Makes Software Green?
What Makes Software Green?What Makes Software Green?
What Makes Software Green?
 
Simple and Effective Knowledge-Driven Query Expansion for QA-Based Product At...
Simple and Effective Knowledge-Driven Query Expansion for QA-Based Product At...Simple and Effective Knowledge-Driven Query Expansion for QA-Based Product At...
Simple and Effective Knowledge-Driven Query Expansion for QA-Based Product At...
 
DataSkillCultureを浸透させる楽天の取り組み
DataSkillCultureを浸透させる楽天の取り組みDataSkillCultureを浸透させる楽天の取り組み
DataSkillCultureを浸透させる楽天の取り組み
 
大規模なリアルタイム監視の導入と展開
大規模なリアルタイム監視の導入と展開大規模なリアルタイム監視の導入と展開
大規模なリアルタイム監視の導入と展開
 
楽天における大規模データベースの運用
楽天における大規模データベースの運用楽天における大規模データベースの運用
楽天における大規模データベースの運用
 
楽天サービスを支えるネットワークインフラストラクチャー
楽天サービスを支えるネットワークインフラストラクチャー楽天サービスを支えるネットワークインフラストラクチャー
楽天サービスを支えるネットワークインフラストラクチャー
 
楽天の規模とクラウドプラットフォーム統括部の役割
楽天の規模とクラウドプラットフォーム統括部の役割楽天の規模とクラウドプラットフォーム統括部の役割
楽天の規模とクラウドプラットフォーム統括部の役割
 
Rakuten Services and Infrastructure Team.pdf
Rakuten Services and Infrastructure Team.pdfRakuten Services and Infrastructure Team.pdf
Rakuten Services and Infrastructure Team.pdf
 
The Data Platform Administration Handling the 100 PB.pdf
The Data Platform Administration Handling the 100 PB.pdfThe Data Platform Administration Handling the 100 PB.pdf
The Data Platform Administration Handling the 100 PB.pdf
 
Supporting Internal Customers as Technical Account Managers.pdf
Supporting Internal Customers as Technical Account Managers.pdfSupporting Internal Customers as Technical Account Managers.pdf
Supporting Internal Customers as Technical Account Managers.pdf
 
Making Cloud Native CI_CD Services.pdf
Making Cloud Native CI_CD Services.pdfMaking Cloud Native CI_CD Services.pdf
Making Cloud Native CI_CD Services.pdf
 
How We Defined Our Own Cloud.pdf
How We Defined Our Own Cloud.pdfHow We Defined Our Own Cloud.pdf
How We Defined Our Own Cloud.pdf
 
Travel & Leisure Platform Department's tech info
Travel & Leisure Platform Department's tech infoTravel & Leisure Platform Department's tech info
Travel & Leisure Platform Department's tech info
 
Travel & Leisure Platform Department's tech info
Travel & Leisure Platform Department's tech infoTravel & Leisure Platform Department's tech info
Travel & Leisure Platform Department's tech info
 
OWASPTop10_Introduction
OWASPTop10_IntroductionOWASPTop10_Introduction
OWASPTop10_Introduction
 
Introduction of GORA API Group technology
Introduction of GORA API Group technologyIntroduction of GORA API Group technology
Introduction of GORA API Group technology
 
100PBを越えるデータプラットフォームの実情
100PBを越えるデータプラットフォームの実情100PBを越えるデータプラットフォームの実情
100PBを越えるデータプラットフォームの実情
 
社内エンジニアを支えるテクニカルアカウントマネージャー
社内エンジニアを支えるテクニカルアカウントマネージャー社内エンジニアを支えるテクニカルアカウントマネージャー
社内エンジニアを支えるテクニカルアカウントマネージャー
 

Último

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Último (20)

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 

Treat your servers like your Ruby App: Infrastructure as Code

  • 1. Treat your servers like your Ruby App: Infrastructure as Code 2015 March 27-28 Allan Espinosa Platform as a Service Team Global Operations Department Rakuten, Inc. http://www.rakuten.co.jp/
  • 2. About me  Allan Espinosa  Technology Background  Language Polyglot: Ruby, Node.js, Java, .NET  Systems Polyglot: Docker, VMWare  Automation Junkie: Chef, Jenkins  Job Background  “Private Heroku”  Senior Systems Developer Platform as a Service Team Global Operations Department @AllanEspinosa
  • 4. Agenda  Audience Demographics  Typical App TDD  Introduction to Configuration Management  Infrastructure as Code  Evolved App and Infrastructure TDD  Wrap-up
  • 5. Audience Demographics  Web application developers?  Infrastructure engineers?  Fullstack engineers?  Unit Tests?  Test Driven Development?  Automated/ Push-button deployments?  Post-deployment end-to-end tests?
  • 6. Infrastructure as Code  Reproducable servers  Bring up a lot of servers  Programmatically add servers to monitor/ load balancer Server as cattle not pets Reference: Test Driven Infrastructure with Chef
  • 7. Unmaintained Infrastructure Code  Where did I install ruby-2.0.0-p589 to?  Which machines upgraded to ruby-2.1.1-p589?  Have I upgraded libxml2 for nokogiri?  Why is database.yml pointing to staging????  Test and software engineering practices still relevant! # FIXME: … # TODO: …
  • 8. Typical TDD Cycle Make the test pass Refactor Write a failing test Application Ref: K. Beck, Test Driven Development by Example, 2003.
  • 9. Extended TDD with Acceptance Tests Pass the unit test Refactor Write a failing unit test Write Failing Acceptance Test Application Capybara.current_driver = :selenium Capybara.app_host = ‘http://localhost:8000’ G. Adzic, Specification by Example, 2011.
  • 10. Apply to your Infrastructure Pass the unit test Refactor Write a failing unit test Write Failing Acceptance Test Application + Servers Capybara.current_driver = :selenium Capybara.app_host = ‘http://actual-production.domain
  • 11. Build our infrastructure! .kitchen.yml --- provisioner: chef_zero platforms: - freebsd-10.1 suites: - name: app  Write a failing test  Test-kitchen  Plain Minitest  Make the test pass  Chef Recipe  Refactor  Repeat!  Roll out to servers  Pass acceptance test! test/integration/app/minitest/test_app.rb class TestApp < Minitest::Unit::TestCase def test_ruby_is_installed assert File.exists ‘/usr/local/bin/ruby’, ‘Ruby should be installed’ end end
  • 12. Failing Test! -----> Running minitest test suite /opt/chef/embedded/bin/ruby -I"/opt/chef/embedded/lib/ruby/2.1.0" "/opt/chef/embedded/lib/ruby/2.1.0/rake/rake_test_loader.rb" "/tmp/busser/suites/minitest/test_app.rb" Run options: --seed 48374 # Running tests: F Finished tests in 0.001660s, 602.4866 tests/s, 602.4866 assertions/s. 1) Failure: AppTest#test_ruby_should_be_installed [/tmp/busser/suites/minitest/test_app.rb:5]: ruby is not installed 1 tests, 1 assertions, 1 failures, 0 errors, 0 skips /opt/chef/embedded/lib/ruby/2.1.0/rake/testtask.rb:106:in `block (3 levels) in define': Command failed with status (1): [ruby -I"/opt/chef/embedded/lib/ruby/2.1.0" "/opt/che f/embedded/lib/ruby/2.1.0/rake/rake_test_loader.rb" "/tmp/busser/suites/minitest/test_app.rb" ] (RuntimeError)
  • 13. Build our infrastructure! .kitchen.yml --- provisioner: chef_zero platforms: - freebsd-10.1 suites: - name: app run_list: - recipe[todo::app]  Write a failing test  Test-kitchen  Plain Minitest  Make the test pass  Chef Recipe  Refactor  Repeat!  Roll out to servers  Pass acceptance test!
  • 14. Build our infrastructure! recipes/app.rb execute ‘pkg update’ package ‘ruby’ do action :install end metadata.rb name ‘todo’  Write a failing test  Test-kitchen  Plain Minitest  Make the test pass  Chef Recipe  Refactor  Repeat!  Roll out to servers  Pass acceptance test!
  • 15. Make the test pass resolving cookbooks for run list: ["todo::app"] Synchronizing Cookbooks: - todo Compiling Cookbooks... Converging 2 resources Recipe: todo::app * execute[pkg update] action run - execute pkg update * package[ruby] action install - install version 2.0.0.598_2,1 of package ruby Running handlers: Running handlers complete Chef Client finished, 2/2 resources updated in 47.595913304 seconds Finished converging <app-freebsd-101> (0m55.78s).
  • 16. GREEN! Make the test pass Run options: --seed 4256 # Running tests: . Finished tests in 0.001526s, 655.4072 tests/s, 655.4072 assertions/s. 1 tests, 1 assertions, 0 failures, 0 errors, 0 skips Finished verifying <app-freebsd-101> (0m2.59s).
  • 17. Conclusion  Infrastructure express in code  Leapfrog on software engineering disciplines
  • 18. We’re Hiring! Search for “Platform as a Service” http://global.rakuten.com/corp/careers/engineering/