November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution...

88
Robert Douglass, Chief DevRel Officer November 12, 2019

Transcript of November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution...

Page 1: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

Robert Douglass, Chief DevRel Officer

November 12, 2019

Page 2: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

» Development process

» Coding standards

» Code deployment

» Infrastructure

» Updates & maintenance

» Data

» Access

» Monitoring

Page 3: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Onboarding / offboarding developers

- Developer environments

- Stakeholder engagement

Page 4: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Make them install runtimes and services themselves

- Give them root access to production

- Have them download code- They can develop on all the sites

Page 5: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Give them access to a shared development server

- Checkout code from Subversion- They have to be added to each site

manually

Page 6: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Provide docker images- Provide a dedicated development

server for each developer- Give them Jira access for

triggering deployment- Run a Jenkins task to add them to

sites they should be able to develop on

Page 7: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Add them to the Github or Gitlab organization

- Clone production to local- Development environment for each

branch- Control which sites they can

develop on by adding them to the right team

Page 8: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Developers just use whatever is on their laptop. Nobody knows if the PHP version is the same, if configs are the same.

- Shared staging server. If there's one shared staging server where everyone dumps their code for testing… big problems.

- Use same environment for all sites

Page 9: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Vagrant or any similar solution for local.

- Ops manually builds cloud environments for the team

Page 10: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Someone builds and provides a Docker container for local

- Same Docker container can run in a container grid like Kubernetes

- Use different Docker containers for each site

Page 11: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- A fully automated system that reproduces the cloud environment locally, like Lando. https://lando.dev/

- A copy of the production infrastructure for every testing operation, with exact services, configuration, and data.

- Quickly switch locally, or in the cloud between distinct environments for each of the 1,000 sites.

Page 12: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Show the client on production

Page 13: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Show the client on the shared staging server

Page 14: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Send the client a URL that demonstrates a specific feature on a specific site.

- Have URLs to send for every feature for every developer, in isolation

- Have URLs to send for every feature for every site

Page 15: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- 3rd party libraries

- Code quality & Testing

Page 16: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Developers download libraries directly into the codebase

Page 17: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Developers use a build system like Composer and check the artefacts into Git.

Page 18: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Developers check the Composer.json and Composer.lock into Git, and the system applies a unified build pipeline across all developer projects.

Page 19: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Anything goes. If the application "works", code gets deployed

Page 20: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Unit testing can block a deploy- Code linting can block a deploy- Use of blacklisted code can block a

deploy- Hooks exist for

- regression testing- integration testing- performance testing

Page 21: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Deployment methodology

- Speed and frequency of deployment

- Interruption caused by deployment

- Deploying to a fleet

- Rolling back deployments

Page 22: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- SFTP- USB Sticks- Overwrite existing code

Page 23: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Git pull on the server

Page 24: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Git push triggers deployment to a test environment

- Git merge triggers deployment to production

- Old environment is not updated but replaced

Page 25: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- "We update the site twice a year"

Page 26: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Deployment at the end of each sprint

Page 27: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- "We deploy every day, many times, as soon as a feature passes testing"

- Even when the site is under load- Even on Black Friday (ecommerce)

Page 28: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- We post a "site offline" page when deploying

Page 29: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Freeze requests during the critical phase when database schemas are being updated

Page 30: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Customers never notice that we deploy. No downtime, whatsoever.

Page 31: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Deploy to each site, one at a time

Page 32: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Drupal multisite: deploy code, then have each database update run sequentially

Page 33: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- No multisite. - Jenkins to automate every step,

provide a list of sites

Page 34: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Sites pull updates automatically- Target groups of sites for updates- All sites independent and in

parallel

Page 35: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Once we deploy, the old site is gone

- Updating a server is a one-way street

Page 36: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- There's always the backup….

Page 37: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- We keep the old deployment around (eg symlink, or separate server) in case we're not happy with the deployment

- Use DNS or Loadbalancer to direct traffic

Page 38: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Codebase specifies not only the application but the infrastructure

- Rolling back code and infrastructure is done with a Git Revert

- Snapshots are taken before deployment and can be restored easily

Page 39: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Ease of provisioning

- Versioning

- Immutable

- Rollbacks

- Development parity

- Shared or isolated

- Disaster recovery

Page 40: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Ops ticket for new environments- Collect specifications- Order machines- Ops configures machines, installs

software- You get access, test

Page 41: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- VMs + Ansible / Puppet

Page 42: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Launch your Docker image

Page 43: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Define infrastructure in code- Infrastructure adapts automatically

every Git push- Create new projects one-click- Infrastructure scales automatically

Page 44: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- No versioning; someone goes in from time to time to "maintain" the infra.

Page 45: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Infrastructure obeys a template; Ansible, Puppet, Terraform

- Therefore the version of the infrastructure can be deduced from the template

Page 46: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Infrastructure is strongly linked to a deployment

- Infrastructure is created for a deployment

- The versioning of the deployment (Git hash) is thus the versioning of the infrastructure

Page 47: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Process of setting up development differs from process of setting up production in any way

- Developers are left to their own to get the software and services they need

Page 48: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Container images are prepared using guidelines that approximate parity with production:

- Docker- Lando- Vagrant

Page 49: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- The same build process that builds and deploys production infrastructure also builds development environments (cloud and local)

Page 50: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Server level access to multiple sites at once

- Sites share infrastructure and occupy same user space

- Multisite- Docroots with no

containerisation- Developers work simultaneously on

a shared environment

Page 51: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Environments are segregated by permissions, but not physically (RAM / CPU)

Page 52: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Containerisation provides guarantees about access, CPU, RAM segregation

Page 53: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Dedicated infrastructure for each site

- Scalability issues - too costly if sites are small.

Page 54: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Start from scratch, recreate site somewhere new

- Separate backups for various data sources

Page 55: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Guarantee exact copy of infrastructure in new location

- Redeploy code from Git- Restore latest backups

- Import DB- Move files into place

Page 56: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Automatic replacement of failed infrastructure

- Data attaches to new services automatically (service discovery)

- If data rollback is needed, can be done with API call

- Can be applied to 1 or 1000 sites with same process

- Underlying capacity guarantees (eg public cloud provider)

Page 57: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- You can change things on the server

Page 58: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Puppet (or similar) detects changes and reverts them, thus providing some guarantees of state

Page 59: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Builds are permanent and can't be changed.

- Read-only file systems- Disposable

Page 60: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Reverting to a previous Git commit reverts infrastructure to that state as well.

Page 61: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Upstream security

- Auditing the fleet

- Updating the fleet

Page 62: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Equifax

Page 63: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Security mailing lists

Page 64: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Code Vulnerability Monitoring tools:

https://techbeacon.com/app-dev-testing/13-tools-checking-security-risk-open-source-dependencies

Page 65: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Upstream updates are automatically pulled and prepared for testing on a regular basis

Page 66: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- How many sites run Drupal 8.6?- How many sites run Views module?- How many sites have an old version

of React.js?

Page 67: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Ask the site what versions it has, eg. Drupal Console

Page 68: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Audit Composer.lock for 1 or 1000 sites to identify vulnerability status

Page 69: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Drupal Multisite:- Inconsistent due to DB

updates- All-or-nothing

Page 70: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Push updates to 1 or more sites;- Sites grouped by business unit or

other similarities

Page 71: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Sites are self updating - Changes pushed only to upstreams- Depending on how sites are

composed, updates come from upstreams

Page 72: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Backup consistency

- Backup frequency and retention

- Backup accessibility

- Return-to-operations - did you test that?

Page 73: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Anything using zip, tar, rsync, or ftp

Page 74: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- All data, including uploaded files, database, search index is duplicated

Page 75: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- disk level snapshots

Page 76: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Incremental snapshots allow very granular rollback

- Retention is prescribed, and auditable.

- Different data types may require different retention plans.

https://docs.ceph.com/docs/giant/rbd/rbd-snapshot/

Page 77: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Physical media in the CTO's office

Page 78: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Tarballs that you have to download

Page 79: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Snapshots that can be applied to one Region

Page 80: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Snapshots, controlled by an API, globally applicable

Page 81: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Did you actually test that?

Page 82: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Teams & Organizations

- Authorization Granularity

Page 83: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Central authentication- SSO- Organization: For whom is

Developer X working?- Teams: On which functional team is

X working?- Organization + Team + Role

determines access permissions on 1 or 1000 sites.

Page 84: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Support for Stakeholder / Customer

- Project Manager- Auditor- Developer- Administrator

Page 85: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Uptime monitoring

- Application monitoring

Page 86: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- Multiple HTTP level checks, including authenticated, transactional processes

- Monitor API endpoints for availability, performance

Page 87: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds

- NewRelic- TideWays- Blackfire.io

Page 88: November 12, 2019 Robert Douglass, Chief DevRel Officer€¦ · - Vagrant or any similar solution for local. - Ops manually builds cloud environments for the team - Someone builds