The document discusses OpenFaaS, an open source serverless framework that allows users to build and deploy functions using Docker containers. It can run functions on Kubernetes as well as Docker Swarm. OpenFaaS aims to provide a simple way to develop and deploy serverless applications using containers. The document outlines how OpenFaaS works, how to write functions using different languages, and how to deploy and manage functions on Kubernetes or Docker Swarm. It also discusses asynchronous processing using queues and provides examples of serverless applications that have been built with OpenFaaS.
6. How did OpenFaaS come about?
STORY SO FAR
• “Lambda but on 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
• > 5k stars
• Kubernetes & external provider support
• Asynchronous processing via NATS
• CLI & templating
• Regular contributors & Slack Community
8. What are serverless use-cases?
ANYTHING
Image/Video
conversion
Machine
Learning
Mobile Back-
ends / IoT
HTTP
services
Chat Bots
Batch Jobs
9. 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
15. 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
16. What languages are available?
SHORT ANSWER - ANY
• Use supported templates
• Edit them or bring your own
• Or go “full Docker”
20. Kubernetes support
VIA EXTERNAL PROVIDER
kubernetes
• Rich eco-system
• Large user-base with existing on-prem/
hybrid deployments
• Similar primitives to Docker Swarm
23. Asynchronous invocation
RETURN A PRODUCT BY MAIL
NATS Queue
marshal request
Gateway Queue-worker
dequeue
Func: resizer
HTTP
200
HTTP
200
Resize
Image
24. Asynchronous concerns
ADDED COMPLEXITY
• Points of failure:
• Func*on
• Queue-worker
• Queue server
• Func*on response
• Store in S3 or aDB
• Poll for result
• Callback to URL?
25. Asynchronous invocation
WITH A CALLBACK-URL
Gateway Func: resizer
HTTP
200
http://x.y.z
X-Callback-Url:
hTp://x.y.z
X-Callback-Url
Resize
Image
Queue etc
28. What’s next for OpenFaaS?
SET REPLICAS = 10,000
• Roadmap - supporting users
• Evaluating - ADP, Huawei, CodeFresh, Microsoft, IRT Saint Exupery
• Building - Huawei, Hyper.sh, Kong
• Additional language templates & AfterBurn
• Guides, manual & tutorials for developer-clouds
• Get SWAG and get involved
• Contributors, sponsorship and finding a home
• Speaking
• LinuxCon, L.A. - Sept
• JeffConf, Milan - Sept
• Dockercon EU, Copenhagen - October