orchestrated, consistent, and deterministic deployment: what does it mean and how to get there...

46
OCD Deployment Obsessive about successful web-applications With examples from Robert Douglass VP Customer Success, Platform.sh October 5, 2016

Upload: ez-systems

Post on 14-Apr-2017

186 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

OCD DeploymentObsessive about successful

web-applications

With examples from

Robert DouglassVP Customer Success, Platform.shOctober 5, 2016

Page 2: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)
Page 3: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

A web application is:

Page 4: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

Deployment means:@local

@dev

@stage @prod

Page 5: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

Deployment means:@bob-local @feature1

@prod

@jim-local @theme

@sue-local @feature2

@stage@auto-test

@uat@sprint3

Page 6: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

“How to migrate from test environment to production environment?”

Page 7: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

“Broken Image links after migrating a site from Local Machine to Live Server”

Page 8: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

“Home page missing theme and css after migrating to a VPS host”

Page 9: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

“Updating to PHP 5.4 breaks my site”

Page 10: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

“Dealing with Solr indexes on development and live environments”

“best practices to deal with Search on different environments, dev, stage prod? i.e. - Not indexing / corrupting live Solr indexes when testing on dev and

staging.”

Page 11: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)
Page 12: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

Orchestrated

Consistent

Deterministic

Page 13: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

“Planned to produce a desired result”

Orchestrated

Page 14: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

Orchestrated• Resolve dependencies

• Build code

• Provision servers, storage, I/O

• Launch and configure services (eg MySQL)

• Manage data

Page 15: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

OrchestratedFor HA Applications, you must provide and configure the following services:

• HA Proxy / Load balancing

• Nginx

• PHP-FPM

• MariaDB (PostgreSQL)

• Solr (ElasticSearch)

• Redis

Page 16: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

Orchestrated• Guarantee high availability for all services

• Guarantee disaster recovery for all services

• Guarantee change management for all services

• For every developer and tester, as well as production.

Page 17: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

Orchestrated• Persistent storage:

• Unique needs for mount points, eg. applications need public, private, and temporary directories that the web server can write to

• Don't allow storage to be a single point of failure! Are you using a high-availability, distributed file system? (eg. GlusterFS, CEPH)

Page 18: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

OrchestratedSecurity Security Security!

• Read-only code deployments

• ACLS

• Physical and network access

• Change management (that guy you just fired)

• Patch levels and vulnerability reactivity: You actually have to read [email protected]

Page 19: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

Orchestrated

Page 20: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

Orchestrated

Page 21: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

Orchestrated

Page 22: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

Modern Languages

Page 23: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

Modern Services

Page 24: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

Multiple Clouds

Page 25: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

“acting or done in the same way over time”

Consistent

Page 26: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)
Page 27: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

ConsistentAn OCD Deployment will guarantee that you always:

• Use the same tools to deploy, on every environment

• Know from deploying to (@local / @dev / @test / @stage / @UAT ) that deploying to @production will work.

• Consistent infrastructure, Actual data

Page 28: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

Consistent

Know from one deployment that deployment to @prod will work:

• Deployment to @local, @stage, @prod etc *all* use the same tools.

• Weak link: @local

Page 29: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

ConsistentWork on actual data

• 99% of the time, the data needs to come from @prod

• Data = SQL, uploaded files, Solr index, any other permanent data store

• When does synchronisation become problematic? 10G? 100G? 1T?

• Sanitise sensitive data outside of @prod

Page 30: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

Consistent

Page 31: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

“for every event there exist conditions that could cause no

other event”

Deterministic

Page 32: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

DeterministicThe goal: For a given Git repository (hash), exactly the same application code and infrastructure should be deployed, every time it is pushed to any environment.

Page 33: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

DeterministicCode is assembled with build and make files using technologies like:

• Composer

• NPM

• PIP

• Ruby Gems

• Maven or Ant

Page 34: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

DeterministicCode-assets are generated

$ compass compile --production

Page 35: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

DeterministicDeterministic Infrastructure:

• Obvious: use the same services in the same configuration on every environment you deploy to (local, dev, staging, testing, UAT, production)

• Less obvious: changing the infrastructure needs to be a repeatable, reversible action

Page 36: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

DeterministicActual Data:

Data is easily partitioned and fragmented. Examples:

• Files that are in the DB but not on the filesystem.

• Documents not indexed into Solr

• Databases so large they take hours to import/export/transfer over the wire

Page 37: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

DeterministicActual Data:

An OCD Deployment is NOT:

• Mysql Dump / Mysql Import

• rsync for files

• Re-indexing Solr

Page 38: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

Benefits of You get deployment that is:

• Simple to execute

• Testable

• Repeatable

• Reversible

Page 39: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

?

Can eZ Platform be

Page 40: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)
Page 41: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)
Page 42: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)
Page 43: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

https://github.com/platformsh/platformsh-example-ezplatform

Page 44: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)
Page 45: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)

LIVE DEMO!!!!

Page 46: Orchestrated, Consistent, and Deterministic Deployment: What Does it Mean and How to Get There (presented by Robert Douglass, VP Customer Success, Platform.sh at eZ Conference 2016)