Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
OpenFaaS framework
Serverless functions for Docker & Kubernetes
JEFFCONF - 29TH SEP
@alexellisuk / openfaas.com
What is Serverless?
MicroserviceMicroserviceMicroservice
Monolith
Microservice
Function
Serverless	evolu*on
“Alexa, how’s
the weather?”
{ “intent”:
“FindWeather” }
{ “speech”:
“It’s 70 degrees” }
Lambda
Function
“Alexa, how’s
the weather?”
{ “intent”:
“FindWeather” }
{ “speech”:
“It’s 70 degrees” }
+
#serverless
OpenFaaS
DRIVING FACTORS
Portability
For
Developers
Radical
Simplicity
Open
Platform
How did OpenFaaS come about?
STORY SO FAR
• “Lambda but with containers for Alexa”
• Dockercon Cool Hacks - “push Docker b...
OpenFaaS top contributors and influencers
You..
What are serverless use-cases?
ANYTHING
Image/Video
conversion
Machine
Learning
Mobile Back-
ends / IoT
HTTP
services
Chat...
What is OpenFaaS?
"A SERVERLESS FRAMEWORK BUILT ON CONTAINERS"
• Basic primitive: containers in OCI format
• Container sec...
Payroll S3	Minio
put	bonus.json
Calculate	Gross
get	bonus.json,

employees.json
MyAssistant
Comes in one flavor: Cloud Native
API Gateway Function Watchdog
Prometheus Swarm Kubernetes
HTTP
body
stdinrequest
stdoutresponse
“/usr/bin/node

handler.js”
headers
body
headers
Forked process
Function watchdog
Performance - fork vs After Burn
HELLO-WORLD & APACHE-BENCH
Deployed in 60 seconds
QUICK DEMO
Demos
• Deploy in 60 secs
• TensorFlow - whale or is it?
• CLI - new/build/deploy/invoke
• Derek - the community bot
• GIF...
Granular ownership + permissions
Derek
• Checks developer sign-off
• Assigns issues
• Manages labels
• Opens & closes issues
Let the robots take over..
CHI...
How do I write a function?
WRITE A HANDLER
def handler(req):
r = requests.get(req)
print(r.status_code)
handler.py
require...
What languages are available?
SHORT ANSWER - ANY
• Use supported templates
• Edit them or bring your own
• Or go “full Doc...
How do I arrange functions?
provider:
name: faas
gateway: http://localhost:31112
url-ping:
lang: python
handler: ./sample/...
Build, deploy, invoke
the GIF Maker
ffmpeg
gifsicle
FULL DOCKER EXAMPLE
the GIF Maker
FROM alpine:3.6
ADD https://github.com/alexellis/faas/releases/download/0.5.6-alpha/
fwatchdog /usr/bin/
RUN...
Auto-scaling
DEMO
Mirror East	CoastWest	Coast
Kubernetes native
VIA EXTERNAL PROVIDER
kubernetes
• Rich eco-system and user-base with
on-prem/hybrid deployments
• Simil...
Kubernetes native
VIA EXTERNAL PROVIDER
Gateway faas-netes
UI
CLI
Web
Func 1
Func 1
Func 2
faas-hyper
faas-ecs
Synchronous invocation
IN STORE RETURNS
marshal	request
Gateway Func: resizer
HTTP

200
Resize

Image
Asynchronous invocation
RETURN A PRODUCT BY MAIL
NATS Queue
marshal	request
Gateway Queue-worker
dequeue
Func: resizer
HTT...
Asynchronous concerns
ADDED COMPLEXITY
• Points	of	failure:	
• Func*on	
• Queue-worker	
• Queue	system
• Func*on	response	...
Asynchronous invocation
WITH A CALLBACK-URL
Gateway Func: resizer
HTTP

200
http://x.y.z
X-Callback-Url:	
hUp://x.y.z
X-Ca...
github.com/
openfaas/faas
FanClub GetAvatar
hUps://
Twitter
Fanclub
HOW IT WORKS
twitter.com/alexellisuk_bot
Providers, integrations and users
What’s next for OpenFaaS?
SET REPLICAS = 10,000
• Roadmap - supporting users
• Evaluating - ADP, Huawei, CodeFresh, MadGlo...
Where to start?
BLOGS AND GUIDES
• Introduction to OpenFaaS (15min)

https://blog.alexellis.io/introducing-functions-as-a-...
@open_faas
https://www.openfaas.com
OpenFaaS JeffConf 2017 - Milan
OpenFaaS JeffConf 2017 - Milan
Upcoming SlideShare
Loading in …5
×

OpenFaaS JeffConf 2017 - Milan

875 views

Published on

Extended slides - OpenFaaS serverless framework for Docker and Kubernetes

Published in: Internet

OpenFaaS JeffConf 2017 - Milan

  1. 1. OpenFaaS framework Serverless functions for Docker & Kubernetes JEFFCONF - 29TH SEP @alexellisuk / openfaas.com
  2. 2. What is Serverless? MicroserviceMicroserviceMicroservice Monolith Microservice Function Serverless evolu*on
  3. 3. “Alexa, how’s the weather?” { “intent”: “FindWeather” } { “speech”: “It’s 70 degrees” } Lambda Function
  4. 4. “Alexa, how’s the weather?” { “intent”: “FindWeather” } { “speech”: “It’s 70 degrees” } +
  5. 5. #serverless
  6. 6. OpenFaaS DRIVING FACTORS Portability For Developers Radical Simplicity Open Platform
  7. 7. How did OpenFaaS come about? STORY SO FAR • “Lambda but with containers for Alexa” • Dockercon Cool Hacks - “push Docker beyond what it was designed to do” • Major changes since Dockercon • Top trending Open Source project overall • > 5.7k stars • Kubernetes & external provider support • Asynchronous processing via NATS • CLI & templating • Regular contributors & Slack Community Commits: 876, Forks: 372 Stars: 6589OpenFaaS Org: 33 authors, 876 commits, 372 forks, 6589 stars, Slack - 160
  8. 8. OpenFaaS top contributors and influencers You..
  9. 9. What are serverless use-cases? ANYTHING Image/Video conversion Machine Learning Mobile Back- ends / IoT HTTP services Chat Bots Batch Jobs
  10. 10. What is OpenFaaS? "A SERVERLESS FRAMEWORK BUILT ON CONTAINERS" • Basic primitive: containers in OCI format • Container security • r/o filesystem, privilege drop, content trust • Manage functions with scheduler/orchestrator • Rich container eco-system - commercial & community • Anything can be a function - polyglot • Leverage existing skills in teams (including Windows) • Avoid vendor lock-in • Run anywhere - cloud or on-prem
  11. 11. Payroll S3 Minio put bonus.json Calculate Gross get bonus.json,
 employees.json MyAssistant
  12. 12. Comes in one flavor: Cloud Native API Gateway Function Watchdog Prometheus Swarm Kubernetes
  13. 13. HTTP body stdinrequest stdoutresponse “/usr/bin/node
 handler.js” headers body headers Forked process Function watchdog
  14. 14. Performance - fork vs After Burn HELLO-WORLD & APACHE-BENCH
  15. 15. Deployed in 60 seconds QUICK DEMO
  16. 16. Demos • Deploy in 60 secs • TensorFlow - whale or is it? • CLI - new/build/deploy/invoke • Derek - the community bot • GIF Maker *
  17. 17. Granular ownership + permissions
  18. 18. Derek • Checks developer sign-off • Assigns issues • Manages labels • Opens & closes issues Let the robots take over.. CHIEF MAINTAINER
  19. 19. How do I write a function? WRITE A HANDLER def handler(req): r = requests.get(req) print(r.status_code) handler.py requirements.txt Python Template Docker Image requests $ faas-cli new --lang python --name sample Container Registry
  20. 20. What languages are available? SHORT ANSWER - ANY • Use supported templates • Edit them or bring your own • Or go “full Docker”
  21. 21. How do I arrange functions? provider: name: faas gateway: http://localhost:31112 url-ping: lang: python handler: ./sample/url-ping image: alexellis/url-ping shrink-image: image: functions/resizer:latest fprocess: "convert - -resize 50% fd:1” environment: MAGICK_FONT_PATH: /fonts $ faas-cli build -f ./sample.yml $ faas-cli deploy -f ./sample.yml YAML STACK $ faas-cli new --name url-ping --lang python
  22. 22. Build, deploy, invoke
  23. 23. the GIF Maker ffmpeg gifsicle FULL DOCKER EXAMPLE
  24. 24. the GIF Maker FROM alpine:3.6 ADD https://github.com/alexellis/faas/releases/download/0.5.6-alpha/ fwatchdog /usr/bin/ RUN apk --no-cache add ffmpeg gifsicle WORKDIR /root/ COPY entry.sh . ENV fprocess=“./entry.sh" CMD ["fwatchdog"] DOCKERFILE https://github.com/openfaas/faas/tree/master/sample-functions/gif-maker
  25. 25. Auto-scaling DEMO Mirror East CoastWest Coast
  26. 26. Kubernetes native VIA EXTERNAL PROVIDER kubernetes • Rich eco-system and user-base with on-prem/hybrid deployments • Similar primitives to Docker Swarm • Kubernetes native
  27. 27. Kubernetes native VIA EXTERNAL PROVIDER Gateway faas-netes UI CLI Web Func 1 Func 1 Func 2 faas-hyper faas-ecs
  28. 28. Synchronous invocation IN STORE RETURNS marshal request Gateway Func: resizer HTTP
 200 Resize
 Image
  29. 29. Asynchronous invocation RETURN A PRODUCT BY MAIL NATS Queue marshal request Gateway Queue-worker dequeue Func: resizer HTTP
 200 HTTP
 200 Resize
 Image
  30. 30. Asynchronous concerns ADDED COMPLEXITY • Points of failure: • Func*on • Queue-worker • Queue system • Func*on response • Store in S3 or aDB • Poll for result • Callback to URL? Composable complexity
  31. 31. Asynchronous invocation WITH A CALLBACK-URL Gateway Func: resizer HTTP
 200 http://x.y.z X-Callback-Url: hUp://x.y.z X-Callback-Url Resize
 Image Queue etc
  32. 32. github.com/ openfaas/faas
  33. 33. FanClub GetAvatar hUps:// Twitter Fanclub HOW IT WORKS twitter.com/alexellisuk_bot
  34. 34. Providers, integrations and users
  35. 35. What’s next for OpenFaaS? SET REPLICAS = 10,000 • Roadmap - supporting users • Evaluating - ADP, Huawei, CodeFresh, MadGlory, IRT Saint Exupery • Community language templates, helm chart • AfterBurn optimisations • Guides, manual & tutorials for developer-clouds • Get SWAG and get involved github.com/openfaas/media • Contributors, sponsorship and finding a home • Speaking • JeffConf @ Milano! • Dockercon EU @ Copenhagen - October - use code “CaptainAlex” • KubeCon @ Austin, USA - December 6-8
  36. 36. Where to start? BLOGS AND GUIDES • Introduction to OpenFaaS (15min)
 https://blog.alexellis.io/introducing-functions-as-a-service/ • Your first Python function with OpenFaaS (10-20min)
 https://blog.alexellis.io/first-faas-python-function/ • Morning Coffee with the FaaS-CLI (5 min)
 https://blog.alexellis.io/quickstart-openfaas-cli/
  37. 37. @open_faas https://www.openfaas.com

×