Whim and Serverless DevOps with Mocha, Github and Travis

12
Building a DevOps pipeline for Serverless by using Mocha, GitHub and Travis Sami Pippuri CTO James Nguyen Software Developer Maas Global

Transcript of Whim and Serverless DevOps with Mocha, Github and Travis

Page 1: Whim and Serverless DevOps with Mocha, Github and Travis

BuildingaDevOpspipelineforServerlessbyusing

Mocha,GitHubandTravisSami Pippuri

CTOJames Nguyen

Software Developer

Maas Global

Page 2: Whim and Serverless DevOps with Mocha, Github and Travis

MaaS Global is building the future of mobility

Page 3: Whim and Serverless DevOps with Mocha, Github and Travis

System Goals

Goals

• Scalable, cloud-based• Mobile-first customerexperience• Utilizing readymade cloudAPIs• Infrastructure-as-code• Establish industrystandardAPIswhere they

don’texistyet• Openforecosystempartners• Createenthusiasm inthewiderecosystem–

enablee.g.Universities andsmallerdeveloperhousesaroundtheworld

Non-Goals

• Closedarchitecture orlock-ins (exceptAWS)

• Exclusive deals• Server infrastructure• Intermediate, all-

encompassingframeworks

• Something foreverybody

Page 4: Whim and Serverless DevOps with Mocha, Github and Travis

Loosely coupled Microservice API integrations –flexible inclusion into MaaS framework

Routing

TrafficOperatorTrafficOperatorTrafficOperatorTransportOperator

Weather

SubscriptionPayment

Identity

BusinessRules

CustomerSupport

Whimbackend

APIGW

WhimApps

Page 5: Whim and Serverless DevOps with Mocha, Github and Travis

Tech Stacks

MaaSCore

Lambda(Node.js4.x,ES6)

Serverless

AWSComponents*

RESTAPIs

Apps Backend Integrations

MaaSSchemas MaaS-API SBUS

*APIGW,S3,DynamoDB,RDS(psql),Route53,IoT,Cognito,CloudFront,CloudWatch,SNS,Kinesis,ML,SWF, IAM,ACM…

SWFbackgroundprocessing

SNS

REST

Page 6: Whim and Serverless DevOps with Mocha, Github and Travis

Infrastructure – Serverless, cloud-native

WhimApps

APIGatewayapi.maas.globalMaaSCore

MaaSTSP

TripMachine

Identity

Kinesisevents

DataStorage

RDSPostgres

Page 7: Whim and Serverless DevOps with Mocha, Github and Travis

What is Serverless?- Is:

- Opensource.

- Notreallyserver-less.

- AframeworkcentralizedinmanagingAWSLambda,APIGatewayandCloudFormation.

- Robust,auto-scaling,fastandreliable.

- Extensibleinitselfwithanicepluginsystemaswellashavingbigsupportsfromthecommunity

- Isnot:

- Aserver.

- Helpingyouwritingthecode.

- Yetpossibletoberunon-premise

Checkoutathttps://serverless.com/

Page 8: Whim and Serverless DevOps with Mocha, Github and Travis

Project Deployment

Serverless

autoinstall meta

mocha

Webpack

Basetoolstack

TravisCI

PROD(Alpha)

Unit&integrationtesting

Deploy tostages

(4ofthem)

PROD

DEVTEST

ContinuousDeployment(!)

Testharness

Depsripts

Localtestharness

Page 9: Whim and Serverless DevOps with Mocha, Github and Travis

Detailedworkflow

Featuredevelopment *

Codereview**

Openpullrequest**

Mergeonto master**

Releasealpha**

Releaseproduction**

Featuretesting *

Fieldtest***

Smoketests***

DevDeveloper’s fork

TestMasterbranch

AlphaAlphabranch

ProdProd branch

Taggingcandidates

Documentingreleases

Changelog

Bugfixes*

*Manualtesting **Automated test with Travis ***Application test

Page 10: Whim and Serverless DevOps with Mocha, Github and Travis

Autodeployment inaction!

Page 11: Whim and Serverless DevOps with Mocha, Github and Travis

SomeResources• MaaSTransport Service Provider API:http://www.maas-api.org• Serverless Mocha testplugin: https://github.com/SC5/serverless-mocha-plugin• MetaSync plugin: https://github.com/serverless/serverless-meta-sync (superceded insls 1.3)• Webpack plugin (fork) forfastercold starts:https://github.com/laurisvan/serverless-webpack-plugin• Request-promise-lite, smaller versionof request-promise tokeep Lambdasizedown: https://github.com/laurisvan/request-promise-lite

• Serverless v1.xboilerplate https://github.com/SC5/sc5-serverless-v1-boilerplate• Knex /Objection.js foraneasyORMonNodejs: http://vincit.github.io/objection.js/

Page 12: Whim and Serverless DevOps with Mocha, Github and Travis

SeeWhim Live

whimapp.comSAMI PIPPURI

CTO, MaaS Global [email protected]

+358 50 487 6829 / @pippuri

JAMES NGUYENDeveloper, MaaS Global [email protected]