A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless...

21
Globalcode – Open4education A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc.

Transcript of A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless...

Page 1: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

A Glance Over the Serverless Framework

Rafael ZottoSenior Software Architect, HP Inc.

Page 2: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Short Bio

Rafael Zotto

Holds a master degree in Computer Science focused in high performance computing. Specialized in parallel and distributed computing with special interest in mobile and web technologies. Works for HP Inc. for the past decade acting as senior software architect for print firmware and wearable technologies. Recently joined the Data Science research team in Porto Alegre, Brazil.

Page 3: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Agenda

Background

Serverless Framework: 10,000 Foot Overview

Installation

Demo

Page 4: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Background

* Image from “Getting Started with Serverless Architecture” presentation. Amazon Web Services.

Page 5: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Architect to be ServerlessFully Managed

No provisioning, zero administration, high-available

Developer ProductivityFocus on what matters, innovate quickly

Continuous ScalingUp and Down automatically

Page 6: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Serverless DefinitionPlatform to develop, run and manage applications without the complexity of building and maintaining infrastructure.

No free lunch!You will pay for it.

Sub-second billing

Page 7: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Serverless Framework

“The easy, open way to build serverless applications”

DatabasesDatabases FunctionsFunctions EndpointsEndpoints

Page 8: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Framework PillarsInfrastructure as Code

.yml file for definitions

Simple Serverless DevelopmentIntuitive CLI experience

Provider AgnosticMain Cloud Providers supported

Page 9: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Main FeaturesMulti Lingual

Pick your poison: python, node.js, java, go, scala, C#, ...

Robust EcosystemHundred of plugins

Cloud AgnosticAWS, Azure, IBM, Google Cloud,...

Streaming LogsEasy troubleshoot

Lifecycle ManagementLocal development, stages, rollback, ...

Page 10: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Getting Started

npm install –g serverless

serverless login

Choose your provider:

Page 11: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Create a new service

sls create --template %template_id%

Multiple templates available"aws-nodejs", "aws-nodejs-typescript", "aws-nodejs-ecma-script", "aws-python", "aws-python3", "aws-groovy-gradle", "aws-java-maven", "aws-java-gradle", "aws-kotlin-jvm-maven", "aws-kotlin-jvm-gradle", "aws-kotlin-nodejs-gradle", "aws-scala-sbt", "aws-csharp", "aws-fsharp", "aws-go", "aws-go-dep", "azure-nodejs", "fn-nodejs", "fn-go", "google-nodejs", "kubeless-python", "kubeless-nodejs", "openwhisk-java-maven", "openwhisk-nodejs", "openwhisk-php", "openwhisk-python", "openwhisk-swift", "spotinst-nodejs", "spotinst-python", "spotinst-ruby", "spotinst-java8", "webtasks-nodejs", "plugin" and "hello-world"

Page 12: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

What is Created?A “ready-to-go” service!

Lambda Function

API Gateway

Page 13: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

.yml Quick Peek Service Stack Name

Cloud Provider

Default Runtime

Functions

Events

Page 14: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

DeployDeploy, Test and Diagnose

Servicesls deploy -v

Functionsls deploy function -f %function_name%

Page 15: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Deploy, TestTest and Diagnose

Remote Invokesls invoke –f %function_name%

Local Invokesls invoke local –f %function_name%

Option to pass input data

Page 16: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Deploy, Test and DiagnoseDiagnose

Retrieve remote logssls logs –f %function_name%

Options to tail, filter and pooling.

Page 17: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Cleanup

Remove the stack completelysls remove

Heads Up!Removing and re-deploying cause the cloud IDs to change!

Page 18: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Changing Provider

Adjust .yml file

Page 19: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Changing Provider

Adjust entry point (handler)

Page 20: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education

Globalcode – Open4education

Useful Resources

https://serverless.com/framework/

https://serverless.com/framework/docs/getting-started/

https://github.com/serverless/examples

Page 21: A Glance Over the Serverless Framework - Amazon Web Services€¦ · A Glance Over the Serverless Framework Rafael Zotto Senior Software Architect, HP Inc. Globalcode – Open4education