automated infrastructure and application management

20
1 Automated Infrastructure and Application Management Clark Everetts, Zend Technologies, Inc. ZendCon - 30 Oct 2014

Upload: clark-everetts

Post on 25-Jun-2015

302 views

Category:

Technology


5 download

DESCRIPTION

Managing application infrastructure is an error prone, tedious, and often manual process leading to late hours spent troubleshooting self-inflicted oversights. Clark will introduce an open source Chef cookbook automating many steps, which utilizes a server side SDK to painlessly deploy PHP applications, and also show how the process can be managed leveraging Zend Server. Attendees will walk away with a complete toolset to implement quickly in their own projects.

TRANSCRIPT

Page 1: Automated Infrastructure and Application Management

1

Automated Infrastructure and Application Management

Clark Everetts, Zend Technologies, Inc. ZendCon - 30 Oct 2014

Page 2: Automated Infrastructure and Application Management

2

Hi!

Clark Everetts • Zend Technologies, Inc.

• Sr. Professional Services Consultant

– Software Architecture Audits / Performance Audits

– Continuous Delivery Assessments

– Migrations (PHP, ZF, etc.)

– Training: PHP, ZF

• Past Life: missile interceptor launch control ; C&DH for International Space Station

• Co-author with Michael Kimsal of php/architect’s PHP Job Hunter’s Handbook

Enough about me…

Page 3: Automated Infrastructure and Application Management

3

SO, WHAT’S YOUR PROBLEM?

Page 4: Automated Infrastructure and Application Management

4

Managing application infrastructure / apps

• Server maintenance/repair, application deployments

• Often manual process

• Dependencies, multiple people needed

• Tedious

• Error prone

• Late nights troubleshooting self-inflicted wounds

If your process is manual, at best it will be slow. At worst, it will be a living nightmare.

Page 5: Automated Infrastructure and Application Management

5

Stop the Madness! Automate!

Standardize, Make Repeatable & Reliable, Process: • Well-understood, built through collaboration

• Controlled through Versioning

• Testable in safe environments

• Infrastructure Solution: Chef Cookbook

• App Deployment Solution: CLI Client SDK

• Server and Application Management Solution: WebAPI

Zend Patterns offers Open-Source Plugins for Zend Server-based Infrastructures

Page 6: Automated Infrastructure and Application Management

6

Presentation Goals

What are we going to do today? • Look at Zend Patterns on GitHub - https://github.com/zend-patterns

• Set up a Zend Server-based development environment using ZendServerChefCookbook

• Deploy, (time-permitting: Update, Rollback) an Application using ZendServerSDK

• Time-permitting: Get information about the application using ZendServerWebApiModule (here, via ZendServerSDK)

Open Plugins for Zend Server-based Infrastructures

Page 7: Automated Infrastructure and Application Management

7

GITHUB TOUR: ZEND PATTERNS

Page 8: Automated Infrastructure and Application Management

8

CHEF COOKBOOK

Page 9: Automated Infrastructure and Application Management

9

Development Environment: ZendServerChefCookbook

Prerequisite Steps: • Install Vagrant - http://docs.vagrantup.com/v2/installation/index.html

• Install / update relevant Vagrant Plugins:

– vagrant-cachier (https://github.com/fgrehm/vagrant-cachier)

– vagrant-omnibus (https://github.com/opscode/vagrant-omnibus)

– vagrant-* (https://github.com/mitchellh?tab=repositories)

– Check for new plugins and also run vagrant plugin update

• Install VirtualBox (https://www.virtualbox.org/wiki/Downloads)

• Or, VMWare Fusion/Workstation, Docker, (Hyper-V - Avail. w/ Windows 8.1) – requires inexpensive plugin from Hashicorp.

• Install Chef (next slide)

Page 10: Automated Infrastructure and Application Management

10

Development Environment: ZendServerChefCookbook

Install Chef on Your “Workstation”: • System Requirements

(https://docs.getchef.com/chef_system_requirements.html)

• Supported Platforms (https://docs.getchef.com/supported_platforms.html)

• https://www.getchef.com/chef/choose-your-version/

• http://downloads.getchef.com/

• Chef Development Kit (http://www.getchef.com/downloads/chef-dk/)

– chef CLI tool, Client, Zero, Knife, Ohai, Berkshelf, Test Kitchen, ChefSpec, FoodCritic

– Omnibus Installer (https://docs.getchef.com/install_omnibus.html)

• ZendServerChefCookbook (https://github.com/zend-patterns/ZendServerChefCookbook)

Page 11: Automated Infrastructure and Application Management

11

Development Environment: ZendServerChefCookbook

Prerequisites for Node VM: • Vagrant Base Box

• Chef

• One way to get started is to get a Chef box from VagrantCloud

– https://vagrantcloud.com/chef

– https://github.com/opscode/bento

– https://github.com/opscode/vagrant-omnibus

– Can also create a base box

• E.g., config.vm.box = "ubuntu/trusty64“

• Configure Cookbook (sit tight; we’ll see it soon)

Page 12: Automated Infrastructure and Application Management

12

Development Environment: ZendServerChefCookbook

Need a vagrant box with Chef • Get a box without Chef and install the desired version yourself

• Install Chef

• One way to get started is to get a Chef box from VagrantCloud

– https://vagrantcloud.com/chef

– https://github.com/opscode/bento

– https://github.com/opscode/vagrant-omnibus

Page 13: Automated Infrastructure and Application Management

13

Development Environment: Vagrant and Chef

Where to get a vagrant box with Chef?

• Vagrant can be instructed to install Chef at runtime using the vagrant-omnibus plugin

– https://vagrantcloud.com/chef (in a catalog, updated easily)

• https://github.com/opscode/bento (Packer templates)

• https://github.com/opscode/vagrant-omnibus

• Download chef/ubuntu-14.04

• Get a box with Chef already included in the base box

– https://vagrantcloud.com/search?utf8=%E2%9C%93&sort=&provider=&q=chef

• Can also download or create a base box yourself

– https://vagrantcloud.com/ffuenf/boxes/ubuntu-14.04-server-amd64

– E.g., config.vm.box = "ubuntu/trusty64“

Page 14: Automated Infrastructure and Application Management

14

Development Environment: Vagrant Providers

If you chose the current title layout you should use it in all the slides layout: • VirtualBox (part of core) • AWS (ships in vagrant-aws plugin) • Rackspace (ships in vagrant-rackspace plugin)

• VMWare Fusion ($79, 2 computers, purchase from Hashicorp) • LXC (ships in vagrant-lxc) • OpenStack (ships in vagrant-openstack-plugin) • Digital Ocean (ships in vagrant-digitalocean) • Parallels Desktop (ships in vagrant-parallels) • Google Compute Engine (shell, Chef, Puppet)

Vagrant is an ever-growing ecosystem, supporting standalone and cloud.

Page 15: Automated Infrastructure and Application Management

15

Vagrant Cachier

A “common package cache among similar VM instances”: • http://fgrehm.viewdocs.io/vagrant-cachier • Run vagrant plugin install vagrant-cachier • Providers known to work (others might):

– Vagrant's built in VirtualBox and Docker providers – vagrant-lxc – VMware providers with NFS enabled – vagrant-libvirt – vagrant-kvm

Page 16: Automated Infrastructure and Application Management

16

COOKBOOK IN ACTION

Page 17: Automated Infrastructure and Application Management

17

DEPLOYMENT WITH ZENDSERVERSDK

Page 18: Automated Infrastructure and Application Management

18

What is this ZendServerSDK, anyway?

ZF2 CLI application for: • Creating zpk (deployment packages) • Accessing WebAPI via command line • WebAPI

– http://files.zend.com/help/Zend-Server/zend-server.htm#web_api_reference_guide.htm

• ZendServerSDK – https://github.com/zend-patterns/ZendServerSDK

• Let’s take a look… (github and in action)

Page 19: Automated Infrastructure and Application Management

19

ZendServerWebApiModule

ZF2 Module for accessing Zend Server’s WebAPI • Everything in the GUI is really just a front-end to API calls

– https://github.com/zend-patterns/ZendServerWebApiModule

• Let’s take a look… (github and in action)

Page 20: Automated Infrastructure and Application Management

20

Bye!

Clark Everetts • [email protected]

• @clarkphp

• https://github.com/clarkphp

• I will add a repository for this talk (with the code to create the VM image, and an updated version of these slides) to the above github account.

• The slides will be available (and updated) on Slideshare/SpeakerDeck.

Rate the talk at

https://joind.in/12206

And…keep in touch!