xspec in the cloud with diamonds - sandro cirulli · 2019-06-08 · serverless architecture a...

21
XSpec in the Cloud with Diamonds Sandro Cirulli XSpec Markup UK 2019 Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 1 / 21

Upload: others

Post on 28-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

XSpec in the Cloud with Diamonds

Sandro CirulliXSpec

Markup UK 2019

Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 1 / 21

Page 2: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

With Apologies to The Beatles. . .

By Source, Fair use, https://en.wikipedia.org/w/index.php?curid=142096

Page 3: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

Content

1 Introduction

2 AWS Lambda and Serverless Architecture

3 Demo

4 Benefits and Challenges

5 Summary

Page 4: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

About Me

Co-maintainer of XSpec since 2016

Lead Language Technologist at Oxford University Press

Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 4 / 21

Page 5: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

What is XSpec?

XSpec is an open source unit test and behaviour-driven development (BDD) frameworkfor XSLT, XQuery, and Schematron

XSpec v1.3.0 was released on 7th May 2019

XSpec is included in oXygen

Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 5 / 21

Page 6: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

Ways of Running XSpec

On a local machine via shell/batch scripts, oXygen XML editor, etc.

On a CI server like Jenkins, TeamCity, etc.

On an online CI service like Travis, AppVeyor, CircleCI, etc.

Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 6 / 21

Page 7: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

CI Servers vs Online CI Services

CI Servers

! Fine grained control

! Works on both public and private repos

% Requires a server

% Requires a sysadmin to maintain serverand software

Online CI Services

! Free and runs on the cloud

! No server/software maintenance

% Basic functionalities for public repos

% Charges for private repos

Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 7 / 21

Page 8: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

Wouldn’t it be nice to run testsfrom private repositorieswhile keeping costs low

and avoiding server and softwaremaintenance?

Page 9: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

Enter XSpec in the Cloud with Diamonds

Page 10: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

Running XSpec Tests in a Serverless Architecture

No servers to provision or maintain

No underlying software to patch

Works for both public and private repos

Cost based on usage

Serverless architecture based on AWS Lambda

Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 10 / 21

Page 11: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

AWS Lambda

Lambda is a compute service provided by Amazon Web Services (AWS)

AWS Lambda allows to run code without provisioning or managing servers

It can automatically scale from few requests per day to thousands requests per second

It charges for the compute time used (no use = no charge)

Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 11 / 21

Page 12: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

Serverless Architecture

A Serverless Architecture is a cloud architecture running a function inside a statelesscomputing environment

The function is triggered by an event

Lambda is used in conjunction with other AWS services to build a serverlessarchitecture

©Amazon Web Services, Inc.

Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 12 / 21

Page 13: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

Serverless Architecture for Running XSpec Tests

Page 14: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

Demo Time

Talk is cheap. Show me the code.

Linus Torvalds

Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 14 / 21

Page 15: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

Benefits of Serverless Architecture

No server provisioning

No server or software maintenance

Free up software engineering time

Scalability

Independent software components (microservices)

High availability

Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 15 / 21

Page 16: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

Memory and Time Execution Constraints

Parameters for memory allocation and timeout need to be adjusted according toworkload

Lambda can run a function for up to 15 minutes

Multiple lambda functions can be run in parallel

Break down XSpec tests into different groups and assign a lambda function for eachgroup of tests

Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 16 / 21

Page 17: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

Cost Optimization

Reduced operational costs

Monitor costs in the cloud and set billing alarms

AWS Lambda offers a generous free tier (1 million free requests and 400,000GB-seconds of compute time per month)

Watch out memory and timeout settings

Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 17 / 21

Page 18: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

Vendor Lock-in

Nowadays all major cloud providers offer similar offers (Azure Functions, Google CloudFunctions, etc.)

Building serverless applications with a cloud provider inevitably comes with a degree ofvendor lock-in

Most cloud services are proprietary and cannot be easily ported

Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 18 / 21

Page 19: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

Summary

I showed you an alternative approach for running XSpec tests using a serverlessarchitecture build on AWS

Suitable for both private and public repositories

Major benefits of this approach are reduced operational costs and no servermaintenance

I would be interested in helping anyone willing to implement this workflow

Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 19 / 21

Page 20: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

Links

Thank you for your attention!

Contact:[email protected]

sandrocirulli.net/contact

Slides:sandrocirulli.net/markupuk2019

Code:github.com/cirulls/markupuk2019

XSpec:github.com/xspec/xspec

github.com/xspec/xspec/wiki

Sandro Cirulli XSpec in the Cloud with Diamonds Markup UK 2019 20 / 21

Page 21: XSpec in the Cloud with Diamonds - Sandro Cirulli · 2019-06-08 · Serverless Architecture A Serverless Architecture is a cloud architecture running a function inside a stateless

And Thanks to The Beatles!