DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

35
Marc Ng, SAP SE November, 2016 SAP’s DevOps Journey: from building an app to building a cloud Public

Transcript of DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

Page 1: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

Marc Ng, SAP SENovember, 2016

SAP’s DevOps Journey:from building an app to building a cloud

Public

Page 2: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 2Public

About SAP

World leader in Enterprise Application Software Founded in 1972

Vision: Help the world run better Innovation focus: Cloud & In-memory computing,

IoT & Digital business

SAP’s customers produce: 78% of the world’s food

82% of the world’s medical devices

76% of the world’s transaction revenue touches an SAP system

Over 80,000 employees in 130+ countries (~50% in technology-related roles)

Over 310,000 customers, 190 countries

Over 110 million users of cloud software

Page 3: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 3Public

About Me

Location: Berlin, Germany

16 years with SAP

2014 – now: Cloud Engagement & ConsultingTeam responsible for delivering Cloud & DevOps platform for SAP’s internal & external Cloud portfolio

Prior: Product Architect for SAP IT Web Applications & KMTeam responsible for delivering SAP’s internal & external web applications, e.g. SAP Community Network (SCN)

Page 4: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 4Public

About the Journey …

Page 5: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 5Public

The Old Days (up to 2010)

SAP IT Web Team Good things:o Source code version controlo Issue trackingo Build automationo Monthly releases

Not so good things:o Months-long lead time for new hardwareo Labour-intensive QA cycleo Code deployed manually to physical hardware during downtimeo Development, Operations & Infrastructure in different business unitso No version control for configuration data

Page 6: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 6Public

2010 Development & Release Cycle (in theory)

4-week cycle:o 4 weeks of development per iterationo 2 weeks of testingo 1 weekend to deploy release to production o 6 weeks from request to deliveryo Release every 4 weeks

Dev QA PRN-1

Dev QA P

Dev QA P

RN

RN+1

4 wks dev

6 wks req > del

Page 7: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 7Public

2010 Development & Release Cycle (in practice)

4-week cycle:o 4 weeks of development for the first iterationo 2 weeks of testing & bugfixingo 1 day to deploy release to productiono 2 days (and one night) debugging the production deployment

1.5 weeks of development per 4-week cycle!

Dev QA PRN-1

RN

RN+1

4 weeks

Dev QA P!Bugfix

Dev QA P!Bugfix

Page 8: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 8Public

Why DevOps?

2010 capacity in SAP IT’s Web teamo 20000 PD of effort available (~100 staff)

2010 demand for SAP IT’s Web teamo Estimated 60000 PD of project effort

No budget for another 200 staff!

Page 9: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 9Public

It’s About the People: Vision & Cultural Change

Chief Architect Promoted concepts of Continuous Deliveryo Automate everything, especially testing & deploymento Version control everything

Bonus-relevant objective: “Read the book” Start with one pilot project: SAP ID Service

Director of SAP IT’s Web unit Provided trusto Agreed 10% of overall effort for a continuous delivery programme

Provided covero The 10% was “taxed” from individual project budgetso Not listed as an explicit line item

Page 10: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 10Public

Pilot project: SAP ID Service

Unified SAP web experience Solved problem: one SAP, many sites & logins Single account for SAP web users Seamless sign-on to all SAP sites Social sign-on and integration with 3rd party apps

Scale & reliability (eventually, not part of MVP) Millions of users Needs to stay up, or nobody can log in to SAP sites SAP Cloud Identity product:o Needs to stay up, or customers can’t access their cloud

software

Page 11: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 11Public

It’s About the People: SAP ID Service Project Team

Cross-functional team of 12: Product Owner Scrum Master UI / UX designers Java developers & architects (Dev) Infrastructure engineers (Ops) QA specialists Geographically distributed:

Germany Bulgaria UK Russia Israel

Page 12: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

Task 1: Test Coverage

Page 13: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 13Public

Cucumber: Behaviour-Driven Development

Describe, communicate and document system behaviour before a single line of code is written.

Product Owner collaborates with QA and Development.

User stories for the backlog are written in Gherkin:

@UserStory(“SAPID-1522”)Scenario: Log on a user trying to access their profile

Given I am a registered user

When I try to access my SAP ID Service profile Then I should see the “SAP ID Service" login overlay

When I login using my valid credentials Then I am logged in And the user profile page is displayed

Page 14: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 14Public

Gherkin: Automated Tests & Documentation

@When("^I login using my valid credentials$")public void login_using_valid_credentials() {

String loginName = getTestUserProfile().get(USER_PROFILE_ID);

String password = getTestUserProfile().get(USER_PROFILE_PASSWORD);

((LoginPage) getWebPage()).login(loginName, password);}

@UserStory(“SAPID-1522”)Scenario: Log on a user trying to access their profile

Given I am a registered user

When I try to access my SAP ID Service profile Then I should see the “SAP ID Service" login overlay

When I login using my valid credentials Then I am logged in And the user profile page is displayed

Gherkin lines correspond to Java or Ruby methods.

QA & Developers work together to code the test logic.

This gives us an executable specification.o More over it ensures the

specification is always in sync with the system it describes.

Page 15: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 15Public

Time is Money

Minimise the time from commit to green build.

Continuously monitor & improve build performance:o < 15 minutes for developer build and test on own machineo < 40 minutes for full build, integration test & deploy to QA

Parallelisation is key, especially for tests:o We have >1000 scenarios and >10000 stepso Aim to keep each suite of tests to < 3 minuteso If a suite exceeds this, split it into 2 suiteso Add test machines as number of suites grows

The Cloud is your friend: elastically scale the QA landscape

Page 16: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 16Public

It’s About the People: Culture & Collaboration

Goal: Improve automated test coverage.

Challenge:o Getting developers to write lots of automated tests with no previous culture of

test-driven development.o Assure QA they are not automating themselves out of their own jobs.

Result:o Developers focus mainly on “Happy Path”.o QA will always be required for manual exploratory testing and feel empowered

when taking the responsibility for writing tests for bugs they discover.

Challenge:o Different languages.

Result:o Collaboration, Preparedness, Shared Ownership.o All tests pass = Shared confidence to release.

Page 17: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

Task 2: Automate Deployment

Page 18: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 18Public

Chef: Configuration Management

Efficiency through reuse:o Write the script once in a generic manner

Scalability & Consistency:o Provision and configures instances quickly and simply

Idempotence:o Operations which can be applied multiple times without changing the

result beyond the initial application Infrastructure as Code:o Document & version control your landscape

Blue/Green Deployment:o Deploy latest release to alternate pool of servers

Testing > Confidence to Release Chef > Confidence to Deploy

Page 19: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 19Public

It’s About the People: Culture & Collaboration

Goal: Automate the end-to-end deployment.

Challenge:o All team members need to learn Chef and Ruby.

Result:o Cross-functional expertise.

Challenge:o Effort to migrate manual scripts and configuration manuals into Chef

recipes / cookbooks. Result:o Developers and Operations collaborate to write Chef recipes.

Page 20: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

Task 3: Keep Evolving

Page 21: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 21Public

DevOps 2010: Cocktail – Project Scale

Infrastructure tasks still manual operation:o Create virtual machineso Register each VM with Chef servero Execute chef-client o Validate the installationo Test behaviour with Cucumber

“Cocktail” was developed to automate all these actions:o Create a complex landscape with few commandso Deployment time reduced from hours to minutes

Monthly Deployment, now much closer to “4 weeks development” vision

Page 22: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 22Public

It’s About the People: Culture of Continuous Improvement

Proper Agile/Scrum coaching was really importanto Fundamentally different to learning by reading articles & blogso Learning by doing, playing, etc. is much more effectiveo Coach encouraged accountability, responsibility, experimentationo Team make-up

• Differing personalities and working styles• May need to shuffle a few people to get the best out of everyone

Team is always working to improve itselfo Evaluate new tools & techniqueso Encourage “spikes” to see if things work

Retrospective at the end of each sprinto Several improvement suggestions each time around – pick top 3o Focus on team behaviours, not product scope

Page 23: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

Task 4: Divide and Conquer

Page 24: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 24Public

DevOps 2011: Barkeeper – Department Scale

Allocate VMs via Cloud API (vSphere) Manage Chef servers Project self-service Web UI and REST API Everything under version control Install VMWare on bare metal, everything else is automated

Scheduled deployment every 2 weeks, but 2-3 times a week not uncommon

Page 25: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 25Public

It’s About the People: Spread the Word

Spread DevOps principles throughout several IT teams

Barkeeper used for a dozen or so web apps in SAP IT

Agile/Scrum coaching delivered throughout IT

Ops Engineers embedded in teams became the norm

Encourage shared ownership within teams

Encourage teams to share what they learn

Page 26: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 26Public

Challenge: Create a DevOps Platform for the Company

Page 27: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 27Public

DevOps 2013: Monsoon – Company Scale

The Product Custom developed private cloud & automation platformo IaaS layer roughly equivalent to OpenStacko Automation framework using Chef and MCollective

The Platform Ruby on Rails components running as microserviceso Git repos for Chef cookbooks and configuration databagso VMWare vSphere : Hypervisor & Block Storageo F5 BigIP Loadbalancers (providing self service ELB scenarios)

The Process 2 week development cycle, continuous integration and testing

Daily automated deployments

Page 28: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 28Public

Result: Cloud & DevOps Culture Throughout SAP

As of late 2015:

100s of internal apps and external cloud services running on the Monsoon platform:o SAP Anywhere, SAP Business One, Multiposting,

SuccessFactors, Afaria MobileSecure, SeeWhy,Ariba TradeWorld, Hybris, FieldGlass,SAP Cloud for Customer, SAP Cloud Identity, …

1000s of developers using the Monsoon platform

32000 VMs

67000 storage volumes

Deployed in 6 regions & 12 availability zones

Page 29: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 29Public

It’s About the People: Monsoon Team

The Core Team Ruby development & web design: 15-20 FTE Infrastructure Architecture: 2-3 FTE QA: 0.5 FTE

Working Mode ChatOps via internal IRC server UK & Germany, mix of home & office working Pairing & team meetings conducted virtually Every 3-6 months get together & break bread

First level support in overseas teamso Knowledge transfer from core teamo Overnight cover for Europe

Second level support in development teamo You build it, you run it: MOOPS (Monsoon Ops)o One team member always on “pager duty”o Weekly rotation

Page 30: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

Space AgeTo Boldly Go…

Page 31: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 31Public

DevOps 2016: Converged Cloud – Cloud Scale

The Platform Kubernetes (with Docker) running on baremetal nodes Openstack in containers (based on Kolla) Networking hardware (via OpenStack Neutron drivers) Loadbalancing (via Neutron LBaaS) Both VMWare & KVM Hypervisors Storage hardware (via OpenStack Cinder & Manila)

New automation framework (Arc / Lyra) New dashboard for OpenStack (Elektra)

Page 32: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 32Public

DevOps 2016: Converged Cloud – Cloud Scale

The Product OpenStack running in containers on Kubernetes across 13 Regions & 18+ datacenters Bare metal to scaled OpenStack cluster in < 60 minutes Platform for SAP cloud offerings and internal innovation Offering Bare metal, VMs and Container resources Monitoring, Logging, Alerting & Billing services Automation agent (Arc) being open-sourced

The Process 4 week sprint cycle, continuous integration and testing <10% new development, >90% open source enhancements Open source enhancements contributed back to community

(OpenStack, Kubernetes, Docker, Grafana, …)

Continuous automated deployment of infrastructure & code

Page 33: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 33Public

It’s About the People: Converged Cloud Team

The Teams OpenStack core DevOps: 10-15 FTE

Monitoring, Alerting & Billing: 5-10 FTE

User-facing & automation tools: 5-10 FTE

QA 0.5 FTE

First level support in overseas teams

Second level support in development teams

Managing Complexity 2x MOOPS, plus INFRAOPS & AUTOPS Cognitive overload from new technologieso Split into 3 sub-teamso Pairing within teamso Sharing sessions across teams

Learning from Open Source Behaviours Use GitHub pull requests for sharing & review Just enough documentation, stored in GitHub repo Use public GitHub where possible (github.com/sapcc) On-premise GitHub Enterprise for private repos (e.g. config) Engage with & contribute to open source projects (pros &

cons)

Page 34: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved. 34Public

And the Journey Continues …

Then & now: 2010 – Pilot project, 10-15 people involved 2016 – Global Cloud & DevOps platform, 20-30 people involved

Current challenges: Dealing with technology explosiono See Periodic table of DevOps tools

Dealing with knowledge explosiono Kubernetes, OpenStack, related tools, concepts & technologieso Need to spend time adding features & value in own areao Also need to know everyone else’s stuff for Ops duty shifts

Dealing with Open Source communitieso Not always easy to get changes merged upstreamo Stakeholders outside of the business may have different aims & priorities

Getting corporate HTTP proxy to work with open-source tools

Page 35: DOES16 San Francisco - Marc Ng - SAP’s DevOps Journey: From Building an App to Building a Cloud

© 2016 SAP SE or an SAP affiliate company. All rights reserved.

P.S. It’s About the People

Thank you

Contact information:

Marc NgCloud Infrastructure & AutomationSAP SE

[email protected]

Twitter: @ngmks