SlideShare a Scribd company logo
1 of 25
Download to read offline
Serverless Functions Made Simple
OpenFaaS
DOCKER CAMBRIDGE
@alexellisuk
What is Serverless?
MicroserviceMicroserviceMicroservice
Monolith
Microservice
Function
Serverless	evolu*on
OpenFaaS
DRIVING FACTORS
“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” }
+
What are serverless use-cases?
ANYTHING - WINDOWS/LINUX
Image/Video
conversion
Machine
Learning
Mobile Back-
ends / IoT
HTTP API /
Integrations
Chat Bots
Batch Jobs
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”
• Since May
• Top trending Open Source project overall
• > 8k stars
• Industry Award
• Production users
• Kubernetes, Nomad, Hyper.sh, Cattle
Commits: 876, Forks: 372 Stars: 6589
OpenFaaS top contributors and influencers
You..
1.3k commits, 60+ contributors, 533 forks
Comes in one flavor: Cloud Native
API Gateway Function Watchdog
Prometheus Swarm Kubernetes
HTTP
body
stdinrequest
stdoutresponse
“python3

main.py”
headers
body
headers
Forked process
Function watchdog
Performance - fork vs After Burn
HELLO-WORLD & APACHE-BENCH
OpenFaaS values
Portable
Developer-
First
Unsurprising UNIX-like
Operator-
Friendly
Community-
Centric
Framework
Developer
Love
Mobilized
Cloud Native
Building a Twitter bot
Building a Twitter bot
@COLORISEBOT
Gateway Colorise
Tweet-pic
Normalise-color
Minio
Tweet-listener
Deployed in 60 seconds
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 dockercon --lang python
Container Registry
How do I arrange functions?
provider:
name: faas
url-ping:
lang: python
handler: ./sample/url-ping
image: of/url-ping
environment:
http_proxy: http://corp1.com
notify-slack:
lang: python
handler: ./sample/notify-slack
image: of/notify-slack
$ faas-cli build -f ./sample.yml
$ faas-cli deploy -f ./sample.yml
YAML STACK
$ faas-cli new url-ping --lang python
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
HTTP

200
HTTP

200
Resize

Image
Asynchronous invocation
WITH A CALLBACK-URL
Gateway Func: resizer
HTTP

200
http://x.y.z
X-Callback-Url:	
hFp://x.y.z
X-Callback-Url
Resize

Image
Queue etc
github.com/openfaas/faas
Chaining demo
FanClub GetAvatar
hFps://
Twitter
Chaining demo - Fanclub
HOW IT WORKS
Polaroid
Chaining / workflows
AS FUNCTIONS
• Should be a function
• A can call B directly
• A can call B via gateway
• Async
• Director pattern (in documentation)
• Helper library available
Providers, integrations and users
DON’T TAKE MY WORD FOR IT
Follow @openfaas for more
https://www.openfaas.com

More Related Content

What's hot

DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...
Docker, Inc.
 

What's hot (20)

OpenFaaS JeffConf 2017 - Milan
OpenFaaS JeffConf 2017 - MilanOpenFaaS JeffConf 2017 - Milan
OpenFaaS JeffConf 2017 - Milan
 
Zero to #Serverless in 60 seconds, anywhere
Zero to #Serverless in 60 seconds, anywhereZero to #Serverless in 60 seconds, anywhere
Zero to #Serverless in 60 seconds, anywhere
 
Still waiting for IPv6? Try the inlets-operator
Still waiting for IPv6? Try the inlets-operatorStill waiting for IPv6? Try the inlets-operator
Still waiting for IPv6? Try the inlets-operator
 
TechXLR8 - XLR8 your cloud with Docker and Serverless FaaS
TechXLR8 - XLR8 your cloud with Docker and Serverless FaaSTechXLR8 - XLR8 your cloud with Docker and Serverless FaaS
TechXLR8 - XLR8 your cloud with Docker and Serverless FaaS
 
Immutable Infrastructure: Rise of the Machine Images
Immutable Infrastructure: Rise of the Machine ImagesImmutable Infrastructure: Rise of the Machine Images
Immutable Infrastructure: Rise of the Machine Images
 
Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...
Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...
Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...
 
Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - A...
Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - A...Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - A...
Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - A...
 
Running tests for every commit: Gerrit, Jenkins, Docker, AWS
Running tests for every commit: Gerrit, Jenkins, Docker, AWSRunning tests for every commit: Gerrit, Jenkins, Docker, AWS
Running tests for every commit: Gerrit, Jenkins, Docker, AWS
 
Ceylon From Here to Infinity: The Big Picture and What's Coming
Ceylon From Here to Infinity: The Big Picture and What's Coming Ceylon From Here to Infinity: The Big Picture and What's Coming
Ceylon From Here to Infinity: The Big Picture and What's Coming
 
OpenWhisk
OpenWhiskOpenWhisk
OpenWhisk
 
IoT in the DataCenter @ Container Camp, London
IoT in the DataCenter @ Container Camp, LondonIoT in the DataCenter @ Container Camp, London
IoT in the DataCenter @ Container Camp, London
 
Splunk user group - automating Splunk with Ansible
Splunk user group - automating Splunk with AnsibleSplunk user group - automating Splunk with Ansible
Splunk user group - automating Splunk with Ansible
 
Building Python Web Apps with Docker
Building Python Web Apps with DockerBuilding Python Web Apps with Docker
Building Python Web Apps with Docker
 
Continuous Integration on Steroids
Continuous Integration on SteroidsContinuous Integration on Steroids
Continuous Integration on Steroids
 
Kubernetes for Serverless - Serverless Summit 2017 - Krishna Kumar
Kubernetes for Serverless  - Serverless Summit 2017 - Krishna KumarKubernetes for Serverless  - Serverless Summit 2017 - Krishna Kumar
Kubernetes for Serverless - Serverless Summit 2017 - Krishna Kumar
 
Cloud native applications
Cloud native applicationsCloud native applications
Cloud native applications
 
DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...
 
Scaling Your First 1000 Containers with Docker
Scaling Your First 1000 Containers with DockerScaling Your First 1000 Containers with Docker
Scaling Your First 1000 Containers with Docker
 
Extending Alfresco Digital Workspace with Docusign
Extending Alfresco Digital Workspace with DocusignExtending Alfresco Digital Workspace with Docusign
Extending Alfresco Digital Workspace with Docusign
 
Tracking Huge Files with Git LFS
Tracking Huge Files with Git LFSTracking Huge Files with Git LFS
Tracking Huge Files with Git LFS
 

Similar to Docker Cambridge: Serverless Functions Made Simple with OpenFaaS

Netflix s2e1lightningtalk
Netflix s2e1lightningtalkNetflix s2e1lightningtalk
Netflix s2e1lightningtalk
aspyker
 
Build A Cloud Day London - Introduction
Build A Cloud Day London - IntroductionBuild A Cloud Day London - Introduction
Build A Cloud Day London - Introduction
ShapeBlue
 

Similar to Docker Cambridge: Serverless Functions Made Simple with OpenFaaS (20)

FaaS-and-Furious
FaaS-and-FuriousFaaS-and-Furious
FaaS-and-Furious
 
Staying on Topic - Invoke OpenFaaS functions with Kafka
Staying on Topic - Invoke OpenFaaS functions with KafkaStaying on Topic - Invoke OpenFaaS functions with Kafka
Staying on Topic - Invoke OpenFaaS functions with Kafka
 
Introduction to OpenFaas
Introduction to OpenFaasIntroduction to OpenFaas
Introduction to OpenFaas
 
Serverless brewbox
Serverless   brewboxServerless   brewbox
Serverless brewbox
 
OpenShift Enterprise 3.1 vs kubernetes
OpenShift Enterprise 3.1 vs kubernetesOpenShift Enterprise 3.1 vs kubernetes
OpenShift Enterprise 3.1 vs kubernetes
 
Building Serverless APIs (January 2017)
Building Serverless APIs (January 2017)Building Serverless APIs (January 2017)
Building Serverless APIs (January 2017)
 
(APP303) Lightning Fast Deploys with Docker Containers and AWS | AWS re:Inven...
(APP303) Lightning Fast Deploys with Docker Containers and AWS | AWS re:Inven...(APP303) Lightning Fast Deploys with Docker Containers and AWS | AWS re:Inven...
(APP303) Lightning Fast Deploys with Docker Containers and AWS | AWS re:Inven...
 
Netflix s2e1lightningtalk
Netflix s2e1lightningtalkNetflix s2e1lightningtalk
Netflix s2e1lightningtalk
 
First Look at Azure Logic Apps (BAUG)
First Look at Azure Logic Apps (BAUG)First Look at Azure Logic Apps (BAUG)
First Look at Azure Logic Apps (BAUG)
 
Going Serverless with OpenWhisk
Going Serverless with OpenWhiskGoing Serverless with OpenWhisk
Going Serverless with OpenWhisk
 
Build A Cloud Day London - Introduction
Build A Cloud Day London - IntroductionBuild A Cloud Day London - Introduction
Build A Cloud Day London - Introduction
 
The Decade of Open APIs
The Decade of Open APIsThe Decade of Open APIs
The Decade of Open APIs
 
Flare - tech-intro-for-paris-hackathon
Flare - tech-intro-for-paris-hackathonFlare - tech-intro-for-paris-hackathon
Flare - tech-intro-for-paris-hackathon
 
Made for Mobile - Let Office 365 Power Your Mobile Apps
Made for Mobile - Let Office 365 Power Your Mobile AppsMade for Mobile - Let Office 365 Power Your Mobile Apps
Made for Mobile - Let Office 365 Power Your Mobile Apps
 
Serverless APIs with Apache OpenWhisk
Serverless APIs with Apache OpenWhiskServerless APIs with Apache OpenWhisk
Serverless APIs with Apache OpenWhisk
 
Containers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshellContainers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshell
 
Docker and Cloud - Enables for DevOps - by ACA-IT
Docker and Cloud - Enables for DevOps - by ACA-ITDocker and Cloud - Enables for DevOps - by ACA-IT
Docker and Cloud - Enables for DevOps - by ACA-IT
 
'DOCKER' & CLOUD: ENABLERS For DEVOPS
'DOCKER' & CLOUD:  ENABLERS For DEVOPS'DOCKER' & CLOUD:  ENABLERS For DEVOPS
'DOCKER' & CLOUD: ENABLERS For DEVOPS
 
Practical PaaS presentation
Practical PaaS presentationPractical PaaS presentation
Practical PaaS presentation
 
Vert.X and MSA - DevOps
Vert.X and MSA - DevOpsVert.X and MSA - DevOps
Vert.X and MSA - DevOps
 

Recently uploaded

audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
lolsDocherty
 
Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptx
ChloeMeadows1
 

Recently uploaded (16)

How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case Study
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
 
Development Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of appsDevelopment Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of apps
 
Premier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdfPremier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdf
 
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
 
I’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 ShirtI’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 Shirt
 
Bug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideBug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's Guide
 
Pvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdf
 
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebiThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
 
GOOGLE Io 2024 At takes center stage.pdf
GOOGLE Io 2024 At takes center stage.pdfGOOGLE Io 2024 At takes center stage.pdf
GOOGLE Io 2024 At takes center stage.pdf
 
Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptx
 
Thank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirtsThank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirts
 
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital PresenceCyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
 
Reggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirts
 
Statistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdfStatistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdf
 

Docker Cambridge: Serverless Functions Made Simple with OpenFaaS