Chef on Linux on POWER
Alex Manly
Solutions Architect
Email: am@chef.io
Twitter: @apmanly
16+ years experience in software engineering, design and architecture.
Previously worked at IBM GBS based in Southbank for 7 years.
Roles included developer, enterprise architect, VP product development
Speaker in all things Continuous – Deployment automation, testing
automation
Professional verticals have included financial (commercial and retail
banking), insurance, government and media
Based in London, UK
Who is Alex?
Contents
• What is Chef
• How Chef Works
• DevOps Rising
• The Chef Platform
• Porting to Linux on POWER
• Chef and IBM
• Chef on Linux on POWER Demo
Leader in next generation of automation solutions
Leading the DevOps movement
– Alignment between Infrastructure and Apps
Key partners: IBM, Amazon Web Services, Microsoft,
HP, Accenture, PWC, VMWare
100%+ Enterprise & Usage Growth Year over Year
Offices in Seattle, San Francisco, Atlanta, and London
What is Chef?
The New Face of Business
Chef is an automation and delivery platform
born in the service of velocity and scale.
In the data center
+ in the cloud
Infrastructure
+ applications
REQUIREMENTS
How Chef Works
• Define reusable resources and
infrastructure state as code
• Manages deployment and
on-going automation
• Community content available
for all common automation tasks
1 ▼ package “httpd” do
2 action :install
3 ▲ end
4
5 ▼ template “/etc/httpd/httpd.conf” do
6 source “httpd.conf.erb”
7 mode 0755
8 owner “root”
9 group “root”
10 ▲ end
11
12 ▼ service “httpd” do
13 action [:enable, :start]
14 done
15
1 ▼ windows_feature ‘IIS-WebServerRole’ do
2 action :install
3 ▲ end
4
5 ▼ windows_feature ‘IIS-ASPNET’ do
6 action :install
7 ▲ end
8
9 ▼ iis_pool FooBarPool do
10 runtime_version “4.0”
11 action :add
12 ▲ end
13
14 ▼ iis_site FooBarLTDSite do
15 protocol :http
16 port 80
17 path C:FooBarSite
18 action [:add, :start]
19 ▲ end
Chef Architecture
Code Revision
Control
System
Automation
Server
Nodes
Policy
State
Chef is Infrastructure as Code
Programmatically provision and
configure components
Treat it like any other code base
Reconstruct business from code
repository, data backup, and compute
resources
DevOps Rising
DevOps is a primary movement in the
growing trend to industrialize IT
service development and production.
IDC expects DevOps strategies will
increasingly dominate enterprise and
service provider strategies.
By 2016, DevOps will be employed by
25% of Global 2000 organizations.
DevOps technologies will achieve
revenue of $4B by 2018.
Chef is the leader of the DevOps market
Born with the DevOps movement
Partners with big web and the enterprise
Understands DevOps success patterns
Distilled these patterns into the Chef platform
Porting to Linux on POWER
• Actually very easy to do.
• Chef uses Omnibus to create cross platform chef clients for each platform.
• Followed x86 as much as possible, used GCC as the complier and not XLC.
• We had to make a few minor patches and upgrade to the latest versions of
everything for POWER, but it did "mostly just work”
• Chef Server uses OpenResty (a web server based on Nginx), OpenResty uses
Lua and we needed IBM to patch the LuaJIT for POWER support.
• Swapped the Oracle JRE to the IBM JRE.
• That’s all!!!
• By the way, POWER is the fastest kit we’ve worked on.
Chef and IBM
• Alpha versions of Chef Client 12 and Chef Server 12 available for Linux
on POWER for Ubuntu LE and Red Hat Enterprise 7 BE and LE. Beta
packages available by the end of June. Currently discussing adding
support for SLES and RHEL6.
• Official support Chef Client 12 on AIX versions 6.1 and 7.1 in December
2014. Has the ability to manage services, packages, file shares, user
and groups, cron jobs and file based resources. AIX cookbooks also
provides primitives to support other AIX services, such as initab and
inetd.
• Chef is core to IBMs OpenStack offering and IBM is very active in the
Chef OpenStack community. Use Chef to deploy and consume
OpenStack resources through knife-openstack, kitchen-openstack, Chef
Provisioning and OpenStack cookbooks.
Chef and IBM
• IBM’s SoftLayer Cloud also has great Chef support. The knife-
softlayer plugin allows you to easily launch, configure and manage
compute instances in the IBM SoftLayer Cloud. There is a Chef
Provisioning driver for SoftLayer written by an IBM employee:
https://github.com/IMC3ofC/chef-provisioning-softlayer
• IBM developed community cookbooks for managing IBM HTTP
Server, IBM Installation Manager, WebSphere Application Server,
WebSphere Liberty Profile and WebSphere eXtreme Scale.
• A Chef developed, soon to be open sourced, knife plugin that gives
knife the ability to create, bootstrap, and manage virtual machines
in a Linux Kernal-Based Virtual Machine (KVM) hypervisors such
as IBM PowerKVM. Plans for a kitchen and Chef provisioning
driver.
Chef on Linux on POWER Demo
Demo Steps.
• Make changes to application code.
• Locally test my changes:
• Lint testing – code correctness
• Unit testing
• System testing using a Docker container.
• Upload cookbook to hosted Chef Server.
• Bootstrap my Linux on POWER node with the Chef Client and register it with the
Chef Server.
• Assign the cookbooks to the run list of the Linux on POWER node.
• Converge the node.
ChefDK: TDI In a Box
Code Correctness
Unit Tests
Deploy sample environments
A wrapper to tie it all together
Not just syntactic correctness but quality gates too!
Rubocop
Because Ruby
• Identify potential Ruby errors
• Unclosed strings, etc.
• Identify style/convention that helps write better code
• Single quotes vs. double quotes
• This is useful for new Chefs, and helps make the code more readable
• Exclude rules that do not apply
• Not everyone is the same – some tests won’t work for your organization or for Chef code
• Run against static code, so tests are very fast (<5 seconds to run)
Code Correctness
Food Critic
Test Your “Chef Style”
• Flag problems that might cause your Chef cookbooks to fail
on converge
FC010: Invalid search syntax
• Identify style/convention that has been adopted by the Chef
community
FC004: Use a service resource to start and stop
services
• Create custom rules for your own organization’s
compliance/standards
COMP001: Do not allow recipes to mount disk volumes
• Run against static code, so tests are very fast (<5 seconds to
run)
Code Correctness
ChefSpec
Simulate Chef
• Did I send a properly formed piece of code to Chef?
• Especially important if there is mutability in your code
• This can cover things like feature flags, or behavior that changes on a
per-OS basis
• "If on Debian-based Linux I need to install package apache2, but on EL
variants I need to install package httpd.”
• Tests are very fast to run
• Even with simple code, it is useful for new Chefs to find simple errors
quickly
• Useful for regression testing – to make sure new changes
don’t break stuff that worked before.
Unit Tests
Test Kitchen
Let’s do this (almost) for real
• “Signal Out” testing for Chef code
• Just because I said something and it was interpreted correctly, doesn't mean that
what I said is what I meant.
• Executes your Chef code on an actual, factual node
• These nodes should be disposable (local virtualization – VMs /
Containers, cloud instances, etc.)
• Use any number of “signal out” testing products to ensure expected
results
• BATS
• ServerSpec
• Can pull in other cookbook dependencies as well, and execute against
a machine that looks the same as your standard image
Deploy sample environments
Infrastructure Change Control Pipeline
Demo Time
Thank You
Alex Manly
Email: am@chef.io
Twitter: @apmanly
Chef onlinuxonpower

Chef onlinuxonpower

  • 1.
    Chef on Linuxon POWER Alex Manly Solutions Architect Email: am@chef.io Twitter: @apmanly
  • 2.
    16+ years experiencein software engineering, design and architecture. Previously worked at IBM GBS based in Southbank for 7 years. Roles included developer, enterprise architect, VP product development Speaker in all things Continuous – Deployment automation, testing automation Professional verticals have included financial (commercial and retail banking), insurance, government and media Based in London, UK Who is Alex?
  • 3.
    Contents • What isChef • How Chef Works • DevOps Rising • The Chef Platform • Porting to Linux on POWER • Chef and IBM • Chef on Linux on POWER Demo
  • 4.
    Leader in nextgeneration of automation solutions Leading the DevOps movement – Alignment between Infrastructure and Apps Key partners: IBM, Amazon Web Services, Microsoft, HP, Accenture, PWC, VMWare 100%+ Enterprise & Usage Growth Year over Year Offices in Seattle, San Francisco, Atlanta, and London What is Chef?
  • 5.
    The New Faceof Business Chef is an automation and delivery platform born in the service of velocity and scale. In the data center + in the cloud Infrastructure + applications REQUIREMENTS
  • 6.
    How Chef Works •Define reusable resources and infrastructure state as code • Manages deployment and on-going automation • Community content available for all common automation tasks 1 ▼ package “httpd” do 2 action :install 3 ▲ end 4 5 ▼ template “/etc/httpd/httpd.conf” do 6 source “httpd.conf.erb” 7 mode 0755 8 owner “root” 9 group “root” 10 ▲ end 11 12 ▼ service “httpd” do 13 action [:enable, :start] 14 done 15 1 ▼ windows_feature ‘IIS-WebServerRole’ do 2 action :install 3 ▲ end 4 5 ▼ windows_feature ‘IIS-ASPNET’ do 6 action :install 7 ▲ end 8 9 ▼ iis_pool FooBarPool do 10 runtime_version “4.0” 11 action :add 12 ▲ end 13 14 ▼ iis_site FooBarLTDSite do 15 protocol :http 16 port 80 17 path C:FooBarSite 18 action [:add, :start] 19 ▲ end
  • 7.
  • 8.
    Chef is Infrastructureas Code Programmatically provision and configure components Treat it like any other code base Reconstruct business from code repository, data backup, and compute resources
  • 9.
    DevOps Rising DevOps isa primary movement in the growing trend to industrialize IT service development and production. IDC expects DevOps strategies will increasingly dominate enterprise and service provider strategies. By 2016, DevOps will be employed by 25% of Global 2000 organizations. DevOps technologies will achieve revenue of $4B by 2018.
  • 10.
    Chef is theleader of the DevOps market Born with the DevOps movement Partners with big web and the enterprise Understands DevOps success patterns Distilled these patterns into the Chef platform
  • 12.
    Porting to Linuxon POWER • Actually very easy to do. • Chef uses Omnibus to create cross platform chef clients for each platform. • Followed x86 as much as possible, used GCC as the complier and not XLC. • We had to make a few minor patches and upgrade to the latest versions of everything for POWER, but it did "mostly just work” • Chef Server uses OpenResty (a web server based on Nginx), OpenResty uses Lua and we needed IBM to patch the LuaJIT for POWER support. • Swapped the Oracle JRE to the IBM JRE. • That’s all!!! • By the way, POWER is the fastest kit we’ve worked on.
  • 13.
    Chef and IBM •Alpha versions of Chef Client 12 and Chef Server 12 available for Linux on POWER for Ubuntu LE and Red Hat Enterprise 7 BE and LE. Beta packages available by the end of June. Currently discussing adding support for SLES and RHEL6. • Official support Chef Client 12 on AIX versions 6.1 and 7.1 in December 2014. Has the ability to manage services, packages, file shares, user and groups, cron jobs and file based resources. AIX cookbooks also provides primitives to support other AIX services, such as initab and inetd. • Chef is core to IBMs OpenStack offering and IBM is very active in the Chef OpenStack community. Use Chef to deploy and consume OpenStack resources through knife-openstack, kitchen-openstack, Chef Provisioning and OpenStack cookbooks.
  • 14.
    Chef and IBM •IBM’s SoftLayer Cloud also has great Chef support. The knife- softlayer plugin allows you to easily launch, configure and manage compute instances in the IBM SoftLayer Cloud. There is a Chef Provisioning driver for SoftLayer written by an IBM employee: https://github.com/IMC3ofC/chef-provisioning-softlayer • IBM developed community cookbooks for managing IBM HTTP Server, IBM Installation Manager, WebSphere Application Server, WebSphere Liberty Profile and WebSphere eXtreme Scale. • A Chef developed, soon to be open sourced, knife plugin that gives knife the ability to create, bootstrap, and manage virtual machines in a Linux Kernal-Based Virtual Machine (KVM) hypervisors such as IBM PowerKVM. Plans for a kitchen and Chef provisioning driver.
  • 15.
    Chef on Linuxon POWER Demo
  • 16.
    Demo Steps. • Makechanges to application code. • Locally test my changes: • Lint testing – code correctness • Unit testing • System testing using a Docker container. • Upload cookbook to hosted Chef Server. • Bootstrap my Linux on POWER node with the Chef Client and register it with the Chef Server. • Assign the cookbooks to the run list of the Linux on POWER node. • Converge the node.
  • 17.
    ChefDK: TDI Ina Box Code Correctness Unit Tests Deploy sample environments A wrapper to tie it all together Not just syntactic correctness but quality gates too!
  • 18.
    Rubocop Because Ruby • Identifypotential Ruby errors • Unclosed strings, etc. • Identify style/convention that helps write better code • Single quotes vs. double quotes • This is useful for new Chefs, and helps make the code more readable • Exclude rules that do not apply • Not everyone is the same – some tests won’t work for your organization or for Chef code • Run against static code, so tests are very fast (<5 seconds to run) Code Correctness
  • 19.
    Food Critic Test Your“Chef Style” • Flag problems that might cause your Chef cookbooks to fail on converge FC010: Invalid search syntax • Identify style/convention that has been adopted by the Chef community FC004: Use a service resource to start and stop services • Create custom rules for your own organization’s compliance/standards COMP001: Do not allow recipes to mount disk volumes • Run against static code, so tests are very fast (<5 seconds to run) Code Correctness
  • 20.
    ChefSpec Simulate Chef • DidI send a properly formed piece of code to Chef? • Especially important if there is mutability in your code • This can cover things like feature flags, or behavior that changes on a per-OS basis • "If on Debian-based Linux I need to install package apache2, but on EL variants I need to install package httpd.” • Tests are very fast to run • Even with simple code, it is useful for new Chefs to find simple errors quickly • Useful for regression testing – to make sure new changes don’t break stuff that worked before. Unit Tests
  • 21.
    Test Kitchen Let’s dothis (almost) for real • “Signal Out” testing for Chef code • Just because I said something and it was interpreted correctly, doesn't mean that what I said is what I meant. • Executes your Chef code on an actual, factual node • These nodes should be disposable (local virtualization – VMs / Containers, cloud instances, etc.) • Use any number of “signal out” testing products to ensure expected results • BATS • ServerSpec • Can pull in other cookbook dependencies as well, and execute against a machine that looks the same as your standard image Deploy sample environments
  • 22.
  • 23.
  • 24.
    Thank You Alex Manly Email:am@chef.io Twitter: @apmanly