SlideShare uma empresa Scribd logo
1 de 22
Baixar para ler offline
Our love for
Chef and Vagrant
Derek Szydlowski
&
Yosuke Tomita
Our setup
Why Chef and vagrant - Challenges
Starting project Knife vs Vagrant (Solo)
Best practice/code to define recipes for multiple environments
Problems with Vagrant / Chef
Development Flow
Recap and why it’s good for international office.
More external info sources add chef and vagrant link
OUTLINE
Intro
60 + production servers ( 120 total )
3 + environments
50 + repos
15 + active contributors
Challenges
作業記録なし
Manual Environments =
Unstable unscalable environments
バラバラな環境
CHALLENGE 1
テスト不可
単調な作業 の連続 → 人為的ミス
Devs and Devops not in sync
Chef meets Vagrant
CHALLENGE 2
開発者は実装にのみ集中しがち
Opsの作業時間がタスクに含まれていない
新メンバーが入った時、新しい技術を入れた時の
環境構築が大変
Chef / Chef-Solo: configuration management
tool
Chef Recipe/Cookbook: Chef configuration file
AWS EC2: Virtual Machine Cloud Service
VirtualBox: Virtual Machine for Local
Environments
Vagrant: wrapper for creating VirtualMachines,
delivering chef
recipes and runs Chef remotely
Knife-solo: Delivers recipes and runs chef
remotely.
Words and Terms
Workflow
Outline
Development Flow
Code Example
Let’s dip into the code and
see some ways to create a
dev vs production server.
Production/QA
Knife-Solo
roles/api.rb
run_list(
"role[base]",
"recipe[nginx]",
"recipe[python]",
"recipe[repos::api]",
"recipe[monit]",
"recipe[monit::nginx]",
"recipe[monit::api]"
)
Local
Vagrant
Vagrantfile
config.vm.provision :chef_solo do |chef|
chef.add_recipe "base::git"
chef.add_recipe "nginx"
chef.add_recipe "php_pack"
chef.add_recipe "python"
chef.add_recipe "repos::api"
end
Sharing recipe on local and servers
Changing server configuration in a template
cookbooks/repos/templates/api.erb
------
<%- case node[‘environment'] %>
<%- when "live" %>
api_url = 'http://api.gengo.com'
<%- when "qa" %>
api_url = 'http://yyy.api.gengo.com'
<%- when "dev" %>
api_url = 'http://xxx.api.gengo.com'
<%- end %>
------
Define in “node/xxx.json
or
Vagrantfile”
Changing server configuration via Attributes
cookbooks/repos/attributes/default.rb
------
if node['environment'] == 'live'
default['repos']['gengo_database'] = "database_live"
default[‘repos’][‘nginx_security_password’] = “true”
elseif node['environment'] == 'qa'
default['repos']['gengo_database'] = "database_qa"
default[‘repos’][‘nginx_security_password’] = “false”
------
cookbooks/repos/templates/api.erb
------
database = ‘<%= default['repos']['gengo_database'] %>’
------
Define in “node/xxx.json”
or
“Vagrantfile”
Changing Resource in a Recipe.
cookbooks/repos/recipes/api
if node['environment'] == "dev"
git "#{node['repos']['home']}/#{project}" do
repository "git@github.com:gengo/api.git"
ssh_wrapper "/tmp/private_code/wrap-ssh4git.sh"
action :checkout
notifies :restart, "service[#{project}]"
end
else
deploy "/mnt#{node['repos']['home']}/#{project}" do
ssh_wrapper "/tmp/private_code/wrap-ssh4git.sh"
repo 'git@github.com:gengo/api'
branch "#{node['repos']['branch']}"
migrate false
keep_releases 3
notifies :restart, "service[#{project}]"
end
end
Define in “node/xxx.json”
or
“Vagrantfile”
Hurdles
Chef and Vagrant Hurdles!
opsもコードに強くなる必要がある
 → Devと一緒にやると距離が縮まる
devになかなか使ってもらえない
様々な開発環境(Window, Mac, Ubuntu….)
バグを踏むこともある
 → コミュニティ
Bonus!
Any Questions?
Name 3 languages that Gengo has client library for?
@gengo, @gengo_ja
https://github.com/gengo
http://gengo.doorkeeper.jp
Devops days

Mais conteúdo relacionado

Mais procurados

DevOps Training | DevOps Training Video | DevOps Tools | DevOps Tutorial For ...
DevOps Training | DevOps Training Video | DevOps Tools | DevOps Tutorial For ...DevOps Training | DevOps Training Video | DevOps Tools | DevOps Tutorial For ...
DevOps Training | DevOps Training Video | DevOps Tools | DevOps Tutorial For ...
Simplilearn
 
QConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
QConSP 2014 - Continuous Delivery - Part 03 - Continuous IntegrationQConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
QConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
Rodrigo Russo
 

Mais procurados (20)

DevOps Training | DevOps Training Video | DevOps Tools | DevOps Tutorial For ...
DevOps Training | DevOps Training Video | DevOps Tools | DevOps Tutorial For ...DevOps Training | DevOps Training Video | DevOps Tools | DevOps Tutorial For ...
DevOps Training | DevOps Training Video | DevOps Tools | DevOps Tutorial For ...
 
Building a loosely coupled toolchain with Rundeck and Puppet
Building a loosely coupled toolchain with Rundeck and PuppetBuilding a loosely coupled toolchain with Rundeck and Puppet
Building a loosely coupled toolchain with Rundeck and Puppet
 
Bay Area Chef Meetup February
Bay Area Chef Meetup FebruaryBay Area Chef Meetup February
Bay Area Chef Meetup February
 
DevOps, Open Source e Microsoft
DevOps, Open Source e MicrosoftDevOps, Open Source e Microsoft
DevOps, Open Source e Microsoft
 
Node.js Build, Deploy and Scale Webinar
Node.js Build, Deploy and Scale WebinarNode.js Build, Deploy and Scale Webinar
Node.js Build, Deploy and Scale Webinar
 
GitHub Pull Request Builder for Drupal
GitHub Pull Request Builder for DrupalGitHub Pull Request Builder for Drupal
GitHub Pull Request Builder for Drupal
 
Steve Thair (DevOps Guys) - DevOps for Windows in the Wild
Steve Thair (DevOps Guys) - DevOps for Windows in the WildSteve Thair (DevOps Guys) - DevOps for Windows in the Wild
Steve Thair (DevOps Guys) - DevOps for Windows in the Wild
 
Azure devops
Azure devopsAzure devops
Azure devops
 
Intro to DevOps
Intro to DevOpsIntro to DevOps
Intro to DevOps
 
Michigan IT Symposium 2017 - CI/CD Workflow Tutorial
Michigan IT Symposium 2017 - CI/CD Workflow TutorialMichigan IT Symposium 2017 - CI/CD Workflow Tutorial
Michigan IT Symposium 2017 - CI/CD Workflow Tutorial
 
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...
 
Efi Merdler Kravitz - 7 things you should know before going serverless
Efi Merdler Kravitz - 7 things you should know before going serverlessEfi Merdler Kravitz - 7 things you should know before going serverless
Efi Merdler Kravitz - 7 things you should know before going serverless
 
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...
 
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
 
Agnostic Continuous Delivery
Agnostic Continuous DeliveryAgnostic Continuous Delivery
Agnostic Continuous Delivery
 
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...
 
QConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
QConSP 2014 - Continuous Delivery - Part 03 - Continuous IntegrationQConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
QConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
 
PuppetConf 2016: Keynote: Pulling the Strings to Containerize Your Life - Sco...
PuppetConf 2016: Keynote: Pulling the Strings to Containerize Your Life - Sco...PuppetConf 2016: Keynote: Pulling the Strings to Containerize Your Life - Sco...
PuppetConf 2016: Keynote: Pulling the Strings to Containerize Your Life - Sco...
 
Docker Enables DevOps
Docker Enables DevOpsDocker Enables DevOps
Docker Enables DevOps
 
Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)
 

Semelhante a Devops days

Using Chef and Vagrant at Gengo
Using Chef and Vagrant at GengoUsing Chef and Vagrant at Gengo
Using Chef and Vagrant at Gengo
Gengo
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
Aaron Eden
 
Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5
Chef
 

Semelhante a Devops days (20)

DevOps and Chef improve your life
DevOps and Chef improve your life DevOps and Chef improve your life
DevOps and Chef improve your life
 
Chef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS NewbiesChef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS Newbies
 
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In CodeIntroduction to Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
 
CI/CD using TFS Release Manager
CI/CD using TFS Release ManagerCI/CD using TFS Release Manager
CI/CD using TFS Release Manager
 
PowerShell DevOps Summit 2017 - TDD with Chef, DSC and Pester
PowerShell DevOps Summit 2017 - TDD with Chef, DSC and PesterPowerShell DevOps Summit 2017 - TDD with Chef, DSC and Pester
PowerShell DevOps Summit 2017 - TDD with Chef, DSC and Pester
 
Using Chef and Vagrant at Gengo
Using Chef and Vagrant at GengoUsing Chef and Vagrant at Gengo
Using Chef and Vagrant at Gengo
 
TDD with Chef, DSC and Pester - 2.0.26
TDD with Chef, DSC and Pester - 2.0.26TDD with Chef, DSC and Pester - 2.0.26
TDD with Chef, DSC and Pester - 2.0.26
 
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
 
DockerCon EU 2015: Stop Being Lazy and Test Your Software!
DockerCon EU 2015: Stop Being Lazy and Test Your Software!DockerCon EU 2015: Stop Being Lazy and Test Your Software!
DockerCon EU 2015: Stop Being Lazy and Test Your Software!
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
Putting the DOT in .NET - Dev/Ops/Test
Putting the DOT in .NET - Dev/Ops/TestPutting the DOT in .NET - Dev/Ops/Test
Putting the DOT in .NET - Dev/Ops/Test
 
Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5
 
Consistent Development Environment using Vagrant and Chef
Consistent Development Environment using Vagrant and ChefConsistent Development Environment using Vagrant and Chef
Consistent Development Environment using Vagrant and Chef
 
Chef, Devops, and You
Chef, Devops, and YouChef, Devops, and You
Chef, Devops, and You
 
DevOps
DevOpsDevOps
DevOps
 
Stop Being Lazy and Test Your Software
Stop Being Lazy and Test Your SoftwareStop Being Lazy and Test Your Software
Stop Being Lazy and Test Your Software
 
TOP DEVOPS INTERVIEW QUESTIONS AND ANSWERS 2022
TOP DEVOPS INTERVIEW QUESTIONS AND ANSWERS 2022TOP DEVOPS INTERVIEW QUESTIONS AND ANSWERS 2022
TOP DEVOPS INTERVIEW QUESTIONS AND ANSWERS 2022
 
미들웨어 엔지니어의 클라우드 탐방기
미들웨어 엔지니어의 클라우드 탐방기미들웨어 엔지니어의 클라우드 탐방기
미들웨어 엔지니어의 클라우드 탐방기
 
How to become a chef
How to become a chefHow to become a chef
How to become a chef
 

Último

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Último (20)

ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptxBT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 

Devops days

  • 1.
  • 2. Our love for Chef and Vagrant Derek Szydlowski & Yosuke Tomita
  • 3. Our setup Why Chef and vagrant - Challenges Starting project Knife vs Vagrant (Solo) Best practice/code to define recipes for multiple environments Problems with Vagrant / Chef Development Flow Recap and why it’s good for international office. More external info sources add chef and vagrant link OUTLINE
  • 5. 60 + production servers ( 120 total ) 3 + environments 50 + repos 15 + active contributors
  • 7. 作業記録なし Manual Environments = Unstable unscalable environments バラバラな環境 CHALLENGE 1 テスト不可 単調な作業 の連続 → 人為的ミス
  • 8. Devs and Devops not in sync Chef meets Vagrant CHALLENGE 2 開発者は実装にのみ集中しがち Opsの作業時間がタスクに含まれていない 新メンバーが入った時、新しい技術を入れた時の 環境構築が大変
  • 9. Chef / Chef-Solo: configuration management tool Chef Recipe/Cookbook: Chef configuration file AWS EC2: Virtual Machine Cloud Service VirtualBox: Virtual Machine for Local Environments Vagrant: wrapper for creating VirtualMachines, delivering chef recipes and runs Chef remotely Knife-solo: Delivers recipes and runs chef remotely. Words and Terms
  • 13. Code Example Let’s dip into the code and see some ways to create a dev vs production server.
  • 14. Production/QA Knife-Solo roles/api.rb run_list( "role[base]", "recipe[nginx]", "recipe[python]", "recipe[repos::api]", "recipe[monit]", "recipe[monit::nginx]", "recipe[monit::api]" ) Local Vagrant Vagrantfile config.vm.provision :chef_solo do |chef| chef.add_recipe "base::git" chef.add_recipe "nginx" chef.add_recipe "php_pack" chef.add_recipe "python" chef.add_recipe "repos::api" end Sharing recipe on local and servers
  • 15. Changing server configuration in a template cookbooks/repos/templates/api.erb ------ <%- case node[‘environment'] %> <%- when "live" %> api_url = 'http://api.gengo.com' <%- when "qa" %> api_url = 'http://yyy.api.gengo.com' <%- when "dev" %> api_url = 'http://xxx.api.gengo.com' <%- end %> ------ Define in “node/xxx.json or Vagrantfile”
  • 16. Changing server configuration via Attributes cookbooks/repos/attributes/default.rb ------ if node['environment'] == 'live' default['repos']['gengo_database'] = "database_live" default[‘repos’][‘nginx_security_password’] = “true” elseif node['environment'] == 'qa' default['repos']['gengo_database'] = "database_qa" default[‘repos’][‘nginx_security_password’] = “false” ------ cookbooks/repos/templates/api.erb ------ database = ‘<%= default['repos']['gengo_database'] %>’ ------ Define in “node/xxx.json” or “Vagrantfile”
  • 17. Changing Resource in a Recipe. cookbooks/repos/recipes/api if node['environment'] == "dev" git "#{node['repos']['home']}/#{project}" do repository "git@github.com:gengo/api.git" ssh_wrapper "/tmp/private_code/wrap-ssh4git.sh" action :checkout notifies :restart, "service[#{project}]" end else deploy "/mnt#{node['repos']['home']}/#{project}" do ssh_wrapper "/tmp/private_code/wrap-ssh4git.sh" repo 'git@github.com:gengo/api' branch "#{node['repos']['branch']}" migrate false keep_releases 3 notifies :restart, "service[#{project}]" end end Define in “node/xxx.json” or “Vagrantfile”
  • 19. Chef and Vagrant Hurdles! opsもコードに強くなる必要がある  → Devと一緒にやると距離が縮まる devになかなか使ってもらえない 様々な開発環境(Window, Mac, Ubuntu….) バグを踏むこともある  → コミュニティ
  • 21. Any Questions? Name 3 languages that Gengo has client library for? @gengo, @gengo_ja https://github.com/gengo http://gengo.doorkeeper.jp