KEMBAR78
Serverless Pune meetup 3 | PPTX
SERVERLESS WITH FUNKTION
PUNE SERVERLESS MEETUP - 3
HTTPS://WWW.MEETUP.COM/SERVERLESS-FUNCTION-AS-A-SERVICE-PUNE
13 MAY 2017
VISHAL BIYANI
CTO & Founder at
infraCloud technologies (www.infracloud.io )
2004
Java, PLM, JSP,
Servlets, Java
Swing,
2004-2009
eMatrix, PLM, J2EE,
Database, architecture,
Shell, Windchill, jUnit,
Oracle,
2010 - 2013: Spring,
Maven, Jenkins,
ElasticSearch, CloudFoundry,
Google App Engine, APIs, CI
2013: Puppet, Chef, Ansible,
CD/CI, DevOps Coach, Docker,
API Mgmt, Microservices, Infra
as code, Artifactory, Nexuus,
Integration as a Service
Now:
Containers,
Kubernetes, Mesos,
Salt, Scale,
Distributed, Serverless
https://twitter.com/vishal_biyani
https://www.vishalbiyani.com
ANNOUNCEMENT TIME
We will host a meetup every month and cover more
advanced topics
We also conduct a Kubernetes meetup every month - Join on
https://www.meetup.com/Kubernetes-Pune
A Kubernetes 101 & Openshift 101 workshop to be
launched in Pune soon
PLEASE RAISE HANDS
• If you have worked with either of AWS
Lambda/Azure Functions/Google Cloud
Functions?
• Heard of OpenWhisk/Fission/Funktion?
• Work on Go language?
Source: https://github.com/Miserlou/Zappa
TABLE OF FUNCTIONS (PUN INTENDED).. ..
• Defining Serverless - evolving definitions
• BaaS (Backend As a Service)
• FaaS (Function as a Service)
• Serverless
• Frameworks
• Architecture
• Benefits & Challenges
• Funktion introduction & Demo
EVOLVING DEFINITIONS
SERVERLESS
What is Serverless?
Backend as a Service
Use third party systems
as much as possible and
build systems. Algolia,
oAuth are prime
examples
Reference & highly reccomended read:
https://martinfowler.com/articles/serverl
ess.html
What is Serverless?
Backend as a Service
Completely managed
backend - and you
write rich logic in
front end
Reference & highly reccomended read:
https://martinfowler.com/articles/serverl
ess.html
What is Serverless?
Function as a Service
(FaaS)
You only write
backend functions
Deploying, scaling and
managing functions is
done by platform
Client is stil rich - may
be not as rich as in
case of BaaS
You only write a function; a function can be in any language as long as it can be called from
Linux CLI
You provide function to the FaaS provider and everything else - deploying, scaling on demand
and running function is taken care by the provider
Front end is relatively aware of various functions but the implementation is hidden from front
end.
AWS Lambda Google Cloud Functions Azure Functions
Commercial frameworks
OpenSource or
OpenSource+Managed
frameworks
Enabling Frameworks/
Toolkits
Apache OpenWhisk Fission - Platform9 Fabric8- Funktion IronIO - Function
Enables Easy deploy to
AWS & openwhisk
Apex - deploy to AWS
Lambda
Python Apps on
AWS Lambda
SERVERLESS - 100K VIEW
Event/Trigger Functions ServicesClient/Apps
API Gateway
Object Storage
Monitoring
System
Voice
Nodejs Function Microservice
Java Function
Python Function
Database
Analytics
Object Storage
External API
Another function
SERVERLESS: KEY ARCHITECTURAL CONSIDERATIONS
State
• There is no state you
maintain beyond
execution of a function
Execution
• They are intended to be
short lived (AWS puts a 5
minute timeout on a
function)
Startup - fast?
• There might be some
latency in startup - as the
execution instance is
created on the fly
API Management
• Managing the API gateway
is an important aspect -
weather it is a HTTP or
voice or FTP gateway
How to CI/CD,
development?
• At the moment tooling is
still evolving and is an
important aspect
Typical servers in business and
enterprise data centers deliver between
5 and 15 percent of their maximum
computing output on average over the
course of the year.
http://www.forbes.com/sites/benkepes/2015/06/03/30-of-servers-are-sitting-comatose-according-to-
research/#6861ea9f2c2e
SERVERLESS: BENEFITS & CHALLENGES
Benefits
Saves $$ - you pay per execution
Easy to bootstrap new ideas
You literally pay as you scale
Lesser operation overhead
Challenges
Same login in multiple functions
Where to store configs?
Not easy to test
How to manage 100s of functions, deploy &
version?
Discovery, monitoring and debugging is not yet
easy
HOW TO DEPLOY SERVERLESS ON PREMISE/HYBRID?
• Apache OpenWhisk, Iron Functions, Fission, Fabric.io Funktion can be deployed on
premise/any machine cluster
• The projects are incubating and maturing fast. Many of them are targetting
Kubernetes as their target (Ease of creating routes & spining up containers etc.)
• You might need additional framework/infra such as messaging queue etc. based on
where you deploy!
FUNKTION
FUNKTION
• Part of larger Fabric8 platform
• Enables lambda style development and deployment on
Kubernetes
REMEMBER 4 THINGS
• Funktion - the actual function
• Runtime - The language/platform runtime
• Connector - Connect stuff
• Flow - Make a flow from functions and connectors
FUNKTION INSTALLATION
• Install
funktion install platform --namespace default
• Verify
kubectl get pod
• If you want to use Fabric8 platform
funktion install operator
RUNTIMES & CONNECTORS
• funktion install runtime
• funktion install connector http4 timer twitter
• funktion install connector --list
CREATING FIRST FUNCTION
• funktion create fn -f hello.js
• funktion create fn -n hello -s 'module.exports = function(context,
callback) { callback(200, "Hello, world!n"); }’
• funktion get fn
• funktion url fn hello
FLOW
• A set of functions in pipeline
• funktion create flow timer://bar?period=5000
http://ip.jsontest.com/
WHAT NEXT > NEXT MEETUPS
• Deeper dive and hands on demos on some frameworks
• Hands on sessions on AWS Lambda, Google Functions
& Azure functions
• Hackathons - where we will hack together some use
cases and develop some frameworks together
ধন্যবাদ!
Dank je!
Kiitos!
આભાર!
धन्यवाद!
Grazie!
Je vous remercie!
ありがとうございました!
ਤੁਹਾਡਾ ਧੰਨਵਾਦ!
நன்றி!
ధన్యవాదాలు!
നന്ദി!
THANK YOU!
Thanks to Redhat
India for hosting us
Thanks a lot to you
the audience who
made this possible

Serverless Pune meetup 3

  • 1.
    SERVERLESS WITH FUNKTION PUNESERVERLESS MEETUP - 3 HTTPS://WWW.MEETUP.COM/SERVERLESS-FUNCTION-AS-A-SERVICE-PUNE 13 MAY 2017
  • 2.
    VISHAL BIYANI CTO &Founder at infraCloud technologies (www.infracloud.io ) 2004 Java, PLM, JSP, Servlets, Java Swing, 2004-2009 eMatrix, PLM, J2EE, Database, architecture, Shell, Windchill, jUnit, Oracle, 2010 - 2013: Spring, Maven, Jenkins, ElasticSearch, CloudFoundry, Google App Engine, APIs, CI 2013: Puppet, Chef, Ansible, CD/CI, DevOps Coach, Docker, API Mgmt, Microservices, Infra as code, Artifactory, Nexuus, Integration as a Service Now: Containers, Kubernetes, Mesos, Salt, Scale, Distributed, Serverless https://twitter.com/vishal_biyani https://www.vishalbiyani.com
  • 3.
    ANNOUNCEMENT TIME We willhost a meetup every month and cover more advanced topics We also conduct a Kubernetes meetup every month - Join on https://www.meetup.com/Kubernetes-Pune A Kubernetes 101 & Openshift 101 workshop to be launched in Pune soon
  • 4.
    PLEASE RAISE HANDS •If you have worked with either of AWS Lambda/Azure Functions/Google Cloud Functions? • Heard of OpenWhisk/Fission/Funktion? • Work on Go language?
  • 5.
  • 6.
    TABLE OF FUNCTIONS(PUN INTENDED).. .. • Defining Serverless - evolving definitions • BaaS (Backend As a Service) • FaaS (Function as a Service) • Serverless • Frameworks • Architecture • Benefits & Challenges • Funktion introduction & Demo
  • 7.
  • 8.
    What is Serverless? Backendas a Service Use third party systems as much as possible and build systems. Algolia, oAuth are prime examples Reference & highly reccomended read: https://martinfowler.com/articles/serverl ess.html
  • 9.
    What is Serverless? Backendas a Service Completely managed backend - and you write rich logic in front end Reference & highly reccomended read: https://martinfowler.com/articles/serverl ess.html
  • 10.
    What is Serverless? Functionas a Service (FaaS) You only write backend functions Deploying, scaling and managing functions is done by platform Client is stil rich - may be not as rich as in case of BaaS You only write a function; a function can be in any language as long as it can be called from Linux CLI You provide function to the FaaS provider and everything else - deploying, scaling on demand and running function is taken care by the provider Front end is relatively aware of various functions but the implementation is hidden from front end.
  • 11.
    AWS Lambda GoogleCloud Functions Azure Functions Commercial frameworks OpenSource or OpenSource+Managed frameworks Enabling Frameworks/ Toolkits Apache OpenWhisk Fission - Platform9 Fabric8- Funktion IronIO - Function Enables Easy deploy to AWS & openwhisk Apex - deploy to AWS Lambda Python Apps on AWS Lambda
  • 12.
    SERVERLESS - 100KVIEW Event/Trigger Functions ServicesClient/Apps API Gateway Object Storage Monitoring System Voice Nodejs Function Microservice Java Function Python Function Database Analytics Object Storage External API Another function
  • 13.
    SERVERLESS: KEY ARCHITECTURALCONSIDERATIONS State • There is no state you maintain beyond execution of a function Execution • They are intended to be short lived (AWS puts a 5 minute timeout on a function) Startup - fast? • There might be some latency in startup - as the execution instance is created on the fly API Management • Managing the API gateway is an important aspect - weather it is a HTTP or voice or FTP gateway How to CI/CD, development? • At the moment tooling is still evolving and is an important aspect
  • 14.
    Typical servers inbusiness and enterprise data centers deliver between 5 and 15 percent of their maximum computing output on average over the course of the year. http://www.forbes.com/sites/benkepes/2015/06/03/30-of-servers-are-sitting-comatose-according-to- research/#6861ea9f2c2e
  • 15.
    SERVERLESS: BENEFITS &CHALLENGES Benefits Saves $$ - you pay per execution Easy to bootstrap new ideas You literally pay as you scale Lesser operation overhead Challenges Same login in multiple functions Where to store configs? Not easy to test How to manage 100s of functions, deploy & version? Discovery, monitoring and debugging is not yet easy
  • 16.
    HOW TO DEPLOYSERVERLESS ON PREMISE/HYBRID? • Apache OpenWhisk, Iron Functions, Fission, Fabric.io Funktion can be deployed on premise/any machine cluster • The projects are incubating and maturing fast. Many of them are targetting Kubernetes as their target (Ease of creating routes & spining up containers etc.) • You might need additional framework/infra such as messaging queue etc. based on where you deploy!
  • 17.
  • 18.
    FUNKTION • Part oflarger Fabric8 platform • Enables lambda style development and deployment on Kubernetes
  • 19.
    REMEMBER 4 THINGS •Funktion - the actual function • Runtime - The language/platform runtime • Connector - Connect stuff • Flow - Make a flow from functions and connectors
  • 20.
    FUNKTION INSTALLATION • Install funktioninstall platform --namespace default • Verify kubectl get pod • If you want to use Fabric8 platform funktion install operator
  • 21.
    RUNTIMES & CONNECTORS •funktion install runtime • funktion install connector http4 timer twitter • funktion install connector --list
  • 22.
    CREATING FIRST FUNCTION •funktion create fn -f hello.js • funktion create fn -n hello -s 'module.exports = function(context, callback) { callback(200, "Hello, world!n"); }’ • funktion get fn • funktion url fn hello
  • 23.
    FLOW • A setof functions in pipeline • funktion create flow timer://bar?period=5000 http://ip.jsontest.com/
  • 24.
    WHAT NEXT >NEXT MEETUPS • Deeper dive and hands on demos on some frameworks • Hands on sessions on AWS Lambda, Google Functions & Azure functions • Hackathons - where we will hack together some use cases and develop some frameworks together
  • 25.
    ধন্যবাদ! Dank je! Kiitos! આભાર! धन्यवाद! Grazie! Je vousremercie! ありがとうございました! ਤੁਹਾਡਾ ਧੰਨਵਾਦ! நன்றி! ధన్యవాదాలు! നന്ദി! THANK YOU! Thanks to Redhat India for hosting us Thanks a lot to you the audience who made this possible