faas shell - linux foundation events...apps azure functions twilio stackstorm ibm functions composer...

37
Naohiro Tamura Professional Engineer Fujitsu Limited FaaS Shell Multi-Cloud Portable Serverless Function Workflow Copyright 2018 FUJITSU LIMITED Open Source Summit Japan 2018 Thursday, June 21 • 12:00 - 12:40

Upload: others

Post on 30-May-2020

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Naohiro Tamura

Professional Engineer

Fujitsu Limited

FaaS ShellMulti-Cloud Portable Serverless Function Workflow

Copyright 2018 FUJITSU LIMITED

Open Source Summit Japan 2018

Thursday, June 21 • 12:00 - 12:40

Page 2: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

About me

Recent work

Apr. 2017 – Open Source PaaS, FaaS, Cloud Native Development (FaaS Shell)

Oct. 2014 – Mar. 2017 Open Source IaaS Development (OpenStack Ironic)

- Sep. 2014 Proprietary System and Resource Management Software Development

Expertise

System and Resource Management Software Development

Personal Interest

Functional and Logic Programming

1 Copyright 2018 FUJITSU LIMITED

FaaS Shell is written in Prolog

for agility, and also for joyful

Programming

Page 3: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

TOC

What is Function Workflow?

What is FaaS Shell and Why?

Demo

How does FaaS Shell work?

Summary

Q&A

2 Copyright 2018 FUJITSU LIMITED

Page 4: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

What is Function Workflow?

Serverless Function

Small for doing single task

Stateless and Immutable

Event Driven and Reactive

Auto scale

Pay per use

3 Copyright 2018 FUJITSU LIMITED

Functional Programming Language (FPL) Function

Small for doing single task

Stateless and Immutable

Good at Event Driven and Reactive

Good at Concurrent and Parallel

FPL main theme is how to compose function

sequential, conditional, repetition, parallel, exceptional handling, retry

Serverless Function requires Function Composition as well as FPL

⇒ That is Serverless Function Workflow

Very similar like twins

If we look at Serverless Function from FPL’s point of view…

Page 5: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Serverless Function Workflow

Consists of 3 elements, for example AWS case

Serverless Function : AWS Lambda

Serverless Function Workflow : Step Functions

Workflow Language : Amazon States Language

Workflow = Composition

Sequential

Conditional

Repetition

Parallel

Exceptional handling

Retry

Copyright 2018 FUJITSU LIMITED4

Page 6: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Amazon States Language (ASL)

State Machine

Pass

Task

Choice

Wait

Succeed

Fail

Parallel

5 Copyright 2018 FUJITSU LIMITED

{

"Comment": "A Hello World example of the Amazon States Language using a Task state",

"StartAt": "HelloWorld",

"States": {

"HelloWorld": {

"Type": "Task",

"Resource":"arn:aws:lambda:us-east-2:410388484666:function:hello",

"End": true

}

}

}

Specify AWS Lamda Function

in arn (Amazon Resource Name)

Task State

Entry State

JSON format

① Input {“name”: “FaaS Shell”}

② Output {“payload”: “Hello, FaaS Shell!”}

Page 7: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

TOC

What is Function Workflow?

What is FaaS Shell and Why?

Demo

How does FaaS Shell work?

Summary

Q&A

6 Copyright 2018 FUJITSU LIMITED

Page 8: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Google Cloud

Composer

What is FaaS Shell?

It’s a shell which enables to exploit Serverless Functions across Multiple Clouds

Covers major 4 FaaS Providers as well as reusable Functions

Works as abstraction layer with keeping agility for future changes

Copyright 2018 FUJITSU LIMITED7

FaaS Shell

Amazon State Language (ASL) Other Workflow Language

Abstraction Layer

AWS

Lambda

Google Cloud

Functions

AWS Step

Functions

Azure Logic

Apps

Azure

Functions

Twilio

StackStorm

IBM

Functions

Composer

IBM Cloud

Functions

Apache

OpenWhiskFission

Workflow

Fission

Page 9: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Why FaaS Shell?

Serverless Function Workflow Landscape - Serveless Silo

Each provider or platform has its own workflow service

There is no interoperability among providers

This situation will continue along with competing each other

8 Copyright 2018 FUJITSU LIMITED

AWS

LambdaAzure

Functions

Google Cloud

Functions

AWS Step

Functions

Azure Logic

Apps

IBM

Functions

Composer

IBM Cloud

Functions

Apache

OpenWhisk

Fission

Workflow

Fission

Google Cloud

Composer

Page 10: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Benefit of using FaaS Shell

1st Stage: Single Cloud Strategy

Commit to one cloud vendor after thorough investigation

Staying vendor lock-in state is nothing wrong if you and your customer are happy

2nd Stage: Multi Cloud Strategy

Serverless Function doesn’t cost at all unless called

Each Cloud has strengths and weaknesses, own characteristics, especially in AI area

Reusable FaaS such as IFTTT (if-this-then-that), Twilio, StackStorm, Node-RED, etc are available

Why not exploit the best part of each cloud and integrate them?

In fact, we actually have the fortune of selecting the most attractive features from each provider, to enable a multi-cloud strategy.

9 Copyright 2018 FUJITSU LIMITED

Demo Next

FaaS Shell helps us shift Single Strategy to Multi Cloud Strategy

Page 11: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

TOC

What is Function Workflow?

What is FaaS Shell and Why?

Demo

How does FaaS Shell work?

Summary

Q&A

10 Copyright 2018 FUJITSU LIMITED

Page 12: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Image RecognitionSpeech Recognition

Natural Language Processing

AI Services Evaluation Demo Background

11 Copyright 2018 FUJITSU LIMITED

TranslationAPI

Amazon

Lex

Amazon

Polly

Amazon

Rekognition

Vision API

Speech API

Natural Language API

Computer Vision

emotiontextanalyticsweb-language-

modelLanguage

understanding intelligent

service

recommendations

Speech

Amazon

Comprehend

Amazon

Translate

Amazon

Transcribe

translator

IBM

Visual

Recognition

Watson

Speech to Text

Text to Speech

Watson

Language

Translator

Watson

Language

Classifier

Watson

Tone

Analyzer

Watson

Personal

Insights

Which provider’s service is suitable for a specific app? We need evaluation!

Dataset and

Algorism are

different each

other

Page 13: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Translation Service Eval. Demo across Multiple Clouds

Evaluate Translation using an Ambiguous Sentence

very basic Natural Language Processing example

it may be that the professor is lecturing with the cat, or that the student has the cat.

See how each service translates it into other language and back to English

[1] “Structure and Interpretation of Computer Programs”

12 Copyright 2018 FUJITSU LIMITED

the professor lectures to the student with the cat. [1]

English Other Language Englishtranslate Translate back

Compare

Page 14: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Translation Evaluation Demo Workflow Graph

Total 26 States and 4 Parallel Transitions

13 Copyright 2018 FUJITSU LIMITED

Page 15: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Translation Evaluation Demo Deployment

14 Copyright 2018 FUJITSU LIMITED

Amazon

TranslateGoogle

TranslationAPI

Azure Translator Text

AWS

LambdaAzure

Functions

Google Cloud

Functions

IBM Cloud

Functions

Watson

Language

Translator

FaaS Shell

Translation Eval. WorkflowInput

Output

text

Serverless Function

translation Service

Authentication and

Authorization code

are required

RBAC setting only,

No auth coding

Page 16: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Demo Steps through REST Interface

Register Statemachine

Execute Statemachine

English to Arabic (ar), and back to English

English to Chinese (zh), and back to English

English to Japanese (ja), and back to English

Generate Statemachine Graph (Graphviz DOT)

15 Copyright 2018 FUJITSU LIMITED

Page 17: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

TOC

What is Function Workflow?

What is FaaS Shell and Why?

Demo

How does FaaS Shell work?

Summary

Q&A

16 Copyright 2018 FUJITSU LIMITED

Page 18: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

REST API

17 Copyright 2018 FUJITSU LIMITED

REST API Function

/ Get version number

/executions/{execution_id} Get background statemachine information

/activity/{activity_task} Get/Put/Heartbeat activity

/trigger/{event_state} Send Event

/faas/{function} List callable function information in each FaaS

/statemachine/{statemachine} Register/Execute/Delete/Graph statemachine

/shell/{dsl} Register/Execute/Delete Workflow DSL

Page 19: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

FaaS Shell Components

18 Copyright 2018 FUJITSU LIMITED

FaaS Shell Container

Flow DSLAmazon State

Language (ASL)

(JSON)

FaaS Shell API End Point

Cloud Provider

Plugin

Flow DSL Interpreter

Graphviz

(DOT)

GUI Editor

NoSQL DB

(CouchDB/Coudant)

Deploy

Fasshell REPL

(Interactive Shell)

Invoke

(REST)

Call

FaaS

Put

Get

DOT Generator

ASL Compiler

program definitionlibrary※FaaS Shell

AWS Lambda

Azure Functions

GCP Cloud Functions

AP

I End

Poin

t

IBM Cloud Functions

(Apache OpenWhisk)

K5, Fission, etc

API Gateway

packaging

Message Queue

(Kafka/built-in)

Message Queue

Plugin

IFTTT

(IF-This-Then-That)

Page 20: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

TOC

What is Function Workflow?

What is FaaS Shell and Why?

Demo

How does FaaS Shell?

Summary

Q&A

19 Copyright 2018 FUJITSU LIMITED

Page 21: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Summary

What is FaaS Shell?

FaaS Shell is a shell which enables to exploit Serverless Functions across Multiple Clouds

FaaS Shell helps us shift Single Strategy to Multi Cloud Strategy

Future Plan

Azure LogicApp Workflow Definition Language

Visit github “https://github.com/NaohiroTamura/faasshell” and Try demos

Especially if you are interested in Functional and Logic Programming

Welcome your feedback!

[email protected]

20 Copyright 2018 FUJITSU LIMITED

Page 22: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Q & A

21 Copyright 2018 FUJITSU LIMITED

Page 23: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Copyright 2018 FUJITSU LIMITED22

Page 24: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

APPENDIX

23 Copyright 2018 FUJITSU LIMITED

Page 25: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Translation Service Catalog Spec among Multiple Clouds

24 Copyright 2018 FUJITSU LIMITED

Cloud Service Name Current Supported Languages

(more than 6,000 languages on the planet)

AWS Amazon Translate 6 languages to and from English for Preview:

(Arabic, Simplified Chinese, French, German, Spanish, and Portuguese)

6 additional languages will be supported soon,

(Japanese, Russian, Italian, Traditional Chinese, Turkish, and Czech)

Azure Translator Text supports more than 60 languages

GCP Translation API supports more than 100 different languages

IBM Language Translator Support 14 languages

Arabic, Chinese (Simplified & Traditional), Dutch*, English, French, German,

Italian, Japanese, Korean, Polish*, Portuguese (Brazil), Russian*, Spanish,

and Turkish*

*These languages are supported with the early access preview

Not yet

Surprisingly, AWS is not the leader in this area at this moment

Doesn’t work

Page 26: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Comparison

Difference between Serverless Framework and FaaS Shell

Serverless Framework : Portable Solution for Serverless Function

FaaS Shell : Portable Solution for Serverless Function Workflow

Related work

Serverless Inc. OSS Event Gateway : Similar but different focus and approach

25 Copyright 2018 FUJITSU LIMITED

Page 27: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

FaaS Shell Complier and Workflow DSL

Compiler supported Amazon State Language at first

Generate Workflow DSL

fsm()

pass()

task()

choice()

wait()

succeed()

fail()

parallel()

26 Copyright 2018 FUJITSU LIMITED

{

"Comment": "A Hello World example using a Task state",

"StartAt": "HelloWorld",

"States": {

"HelloWorld": {

"Type": "Task",

"Resource":"arn:aws:lambda:us-east-2:410388484666:function:hello",

"End": true

}

}

}

fsm([task('HelloWorld',"arn:aws:lambda:us-east-2:410388484666:function:hello",[])])

Page 28: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

FaaS Shell Runtime

Execute Workflow DSL FSM (Finite State Machine)

Implemented as Meta Interpreter

Very concise code in language such asLisp or Prolog

This is important to keep agility forfuture changes

27 Copyright 2018 FUJITSU LIMITED

%%

%% reduce(+Dsl, +In, -Out, +EnvIn, -EnvOut)

%%

reduce(fsm(Dsl), I, O, EI, EO) :-

!,

reduce(Dsl, I, O, EI, EO).

reduce([], O, O, E, E) :-

!.

reduce([A|B], I, O, EI, EO) :-

!,

reduce(A, I, M, EI, EM),

reduce(B, M, O, EM, EO),

reduce(A, I, O, EI, EO) :-

call(A, I, O, EI, EO).

Entry

Exit

Recursive

Call State

Page 29: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

FaaS Shell Runtime Executes Workflow in Batch Mode

28 Copyright 2018 FUJITSU LIMITED

$ curl -ksX POST ${FAASSHELL_APIHOST}/statemachine/hello_world_task.json?blocking=true ¥

-H 'Content-Type: application/json' -d '{"input": {"name": "Curl"}}' -u $DEMO

{

"asl": {

"Comment":"A Hello World example of the Amazon States Language using a Task state",

"StartAt":"HelloWorld",

"States": {

"HelloWorld": {

"End":true,

"Resource":"arn:aws:lambda:us-east-2:410388484666:function:hello",

"Type":"Task"

}

}

},

"dsl":"fsm([task('HelloWorld',¥"arn:aws:lambda:us-east-2:410388484666:function:hello¥",[])])",

"input": {"name":"Curl"},

"name":"hello_world_task.json",

"namespace":"demo",

"output": {"payload":"Hello, Curl!"}

}

Page 30: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

How to resolve Function Input and Output Mismatch?

State Optional ParameterInputPath, ResultPath, OutputPath

29 Copyright 2018 FUJITSU LIMITED

"InputPath": "$.payload",

"ResultPath": "$.ifttt.value1",

"OutputPath": "$.ifttt",

{“payload”: “Hello, IFTTT!”}

{“value1”: “Hello, IFTTT!”}

HelloWorld

task output

SaveResult

task input

{

"Comment": “IFTTT as FaaS Demo",

"StartAt": "HelloWorld",

"States": {

"HelloWorld": {

"Type": "Task",

"Resource":"frn:wsk:functions:::function:hello",

"Next": "UpdateArg"

},

"UpdateArg": {

"Type": "Pass",

"InputPath": "$.payload",

"ResultPath": "$.ifttt.value1",

"OutputPath": "$.ifttt",

"Next": "SaveResult"

},

"SaveResult": {

"Type": "Task",

"Resource":"frn:ifttt:webhooks:::function:save_result",

"End": true

}

}

}

Page 31: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

FaaS Shell REPL Executes Workflow Interactively

Haskell REPL

ghic> hello = ¥e -> return (e+1)

ghic> update_arg= ¥e -> return (e*2)

ghic> save_result = ¥e -> return (e^2)

ghic> pure 1 >>= hello >>= update_arg >>= save_result

16

FaaS Shell REPL

faasshell> Hello = task('HelloWorld',"frn:wsk:functions:::function:hello",[]),

| UpdateArg = pass('UpdateArg',[result_path('$.ifttt.value1'),input_path('$.payload'),out_path('$.ifttt')]),

| SaveResult = task('SaveResult',"frn:ifttt:webhooks:::function:save_result",[]),

| startsm(_{name:"Repl"}), Hello, Pass, SaveResult.

Output=Congratulations! You've fired the save_result event30 Copyright 2018 FUJITSU LIMITED

FaaS Shell startsm corresponds Haskell pureFaaS shell comma operator ','

corresponds to Haskell bind operator '>> ='.

Page 32: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Devises for supporting Multiple Clouds

Function Name Resolution

Resource Naming (Direct Invocation)

Function Discovery (Indirect Invocation)

Event State

Supported Event State in Workflow DSL

CNCF WG-Serverless Whitepaper v1.0 [1] (P.32) pointed out:

> AWS provides “step function” primitives (state machine based primitives) for the user to

> specify its workflow, but step function does not allow specification of what event/events

> triggering what functions in the workflow.

Amazon States Language can handle Event through Activity Task, but it’s not straightforward.

[1] https://github.com/cncf/wg-serverless/blob/master/whitepaper/cncf_serverless_whitepaper_v1.0.pdf

31 Copyright 2018 FUJITSU LIMITED

Page 33: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Resource Naming - Function Name Resolution (1)

Resource Naming in Amazon States Language Specification [1] A Task State MUST include a “Resource” field, whose value MUST be a URI that uniquely identifies the

specific task to execute.

AWS Step Functions Implementation ARN (Amazon Resource Name)

"Resource":"arn:aws:lambda:us-east-2:410388484666:function:hello“

FaaS Shell Implementation FRN (FaaS Resource Name)

AWS “ Resource”:“frn:aws: …“ or “arn:aws: …“

Microsoft “ Resource”:“frn:azure: …“

Google “ Resource”:“frn:gcp: …“

IBM/OpenWhisk “Resource”:“frn:wsk: … “

IFTTT “ Resource”:“frn:ifttt: …“

Fujitsu “ Resource”:“frn:k5: …“

[1] https://states-language.net/spec.html

32 Copyright 2018 FUJITSU LIMITED

Either URN or URL

Page 34: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Function Discovery - Function Name Resolution (2)

Discover Function Semantically

Make use of Open Linked Data technology, OWL (Web Ontology Language)

FaaS Shell Implementation

"Resource": "https://naohirotamura.github.io/faasshell/ns/faas#hello"

Define Triple (Subject – Predicate – Object)

User owns Function

FaaS assigns FRN

FRN invokes Function

33 Copyright 2018 FUJITSU LIMITED

demo:User hello:Function

aws:FaaS

azure:FaaS

gcp:FaaS

wsk:FaaS

frn01:FRN

frn03:FRN

frn02:FRN

frn04:FRN

URI: Unique Identifier

https://naohirotamura.github.io/faasshell/ns/faas#hello

Page 35: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Function Discovery Cont. - Function Name Resolution (2)

There are several weather service on Internet

Assume reusable function “weather” open linked RDF data or SPARQL end point is available

"Resource": "https://weather.org/ns/faas#weatherβ"

Querying the linked data, we will figured out that “frn02”,”frn03”,”frn04” are callable using PublicUser “u1” account.

34 Copyright 2018 FUJITSU LIMITED

weatherβ:Weather

serviceA:FaaS

serviceB:FaaS

serviceC:FaaS

serviceD:FaaS

frn01:FRN

frn03:FRN

frn02:FRN

frn04:FRN

URI is just Identifier

u1:PublicUser weatherα:Weather

Function ClassUser Class

Page 36: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

Event State

35 Copyright 2018 FUJITSU LIMITED

{

"Comment": "A Hello Event example",

"StartAt": "HelloEvent",

"States": {

"HelloEvent": {

"Type": "Event",

"Resource": "frn::states:::event:test",

"End": true

},

}

}

Start

Event State

frn::states:::event:test

End

③ Function “hello”

arn:aws:lambda:us-east-2:410388484666:function:hello

② Event “frn::states:::event:test”

{“action”:”arn:aws:lambda:us-east-2:410388484666:function:hello”

① Input {“name”: “Event”}

④ Output {“payload”: “Hello, Event!”}

Page 37: FaaS Shell - Linux Foundation Events...Apps Azure Functions Twilio StackStorm IBM Functions Composer IBM Cloud Functions Apache OpenWhisk Fission Workflow Fission Why FaaS Shell? Serverless

FaaS Shell Deployment

36 Copyright 2018 FUJITSU LIMITED

Kubernetes/OpenShift

Service

End Point

FaaS Shell 1

(statefulset)

FaaS Shell 2

(statefulset)

Message Queue

(Kafka, Zookeeper)

NoSQL DB

(CouchDB)

FaaS Shell 3

(statefulset)

・・・

NoSQL DB

(CouchDB)

Message Queue

(Kafka, Zookeeper)Faasshell

name

space

Docker/Kubenetes/OptnShift

CouchDBFaaS Shell

① Development ② Horizontal Scale Out