SlideShare ist ein Scribd-Unternehmen logo
1 von 49
@sivachunduru
linkedin.com/in/chunduru
slideshare.net/sivachunduru
2
$> who am i
Siva Rama Krishna
Solution Specialist
Serverless and Fn Project
Introduction
3
Buzz around Serverless
● Serverless is an abstraction of infrastructure and its
operations including provisioning, scaling, patching, etc.
● Serverless architecture is when an app is built entirely on
Serverless components (compute, storage, networking)
● FaaS is the compute component in a Serverless
architecture
4
Functions - The serverless application programming model
5
In mathematics, a function is a
relation between a set of inputs
and a set of permissible outputs
with the property that each input
is related to exactly one output.
Function (mathematics) - Wikipedia
https://en.wikipedia.org/wiki/Function_(mathematics)
Characteristics of a Function
• Short Running – process live for a short amount of time
• Ephemeral – the outer container live for a single invocation
• Stateless – does not inherently hold any state
• Invoked – by defined events over protocols like HTTP, TCP etc
• Single Purpose – have clear & defined purpose with minimal API surface
• Autonomous – can run and serve it’s purpose by itself
6
A function packaged in a container gives us a new “atomic unit of computing”
Atomic Unit – relevant concepts
• Functions as Unit of Scaling
- Scale Up/Down at much finer grained precision (of single process) than machines
- Effective way of scaling of functions coupled with universal packaging/runtime of containers
• Functions as Unit of Billing
- No baseline on Servers or VMs
- Enables huge cost reduction of lightly used applications
• Functions as Unit of Design
- Functions in containers with their own contract are shareable, so that composite applications can be
built and reused
- This requires function orchestration tools
7
The ideal Functions platform
• Open Source—no vendor lock-in
• Platform Independent—laptop, server, cloud
• Approachable—easy for new users, low level controls for advanced users
• Docker Based—leverage Docker ecosystem
• Scheduler Independent—deploy to Kubernetes, Swarm, Mesos, etc.
8
Fn Project
9
www.fnproject.io
Supports all languages
10
11
Fn Project - Key Components
12
Fn Server Fn FlowJava FDK
Fn Project – More and more FDKs
13
FDKs
Fn Server Fn Flow
Example – Hello World
A small Java Function
14
Java Function
15
Function descriptor – func.yaml
16
Function deployment – Dockerfile generated
17
Function deployment process
1. Builds container (multi-stage) + bumps version
2. Pushes container to registry
3. Creates/updates function route (servers lazy load images)
18
MyFunc:0.0.2
MyFunc:0.0.2 MyFunc:0.0.2
Your code
Fn Service
myfunc →
/r/myapp/myfunc:0.0.2
1 2 3
Hello World Demo
Simple Java Function
19
Fn Platform
Architecture overview
20
Fn Platform Architecture
21
Fn LB
22
• Simple, fast load balancer that routes functions to certain nodes
consistently for hot function efficiency
• Scales each function independently based on traffic to any
particular function
• Can be used to scale Fn servers and infrastructure as well as it has
a view of global state of all fn servers
Request Flow in LB
23
Fn Server
24
• Handles CRUD operations for setting up routes and functions
• Executes sync functions, returning responses to clients
immediately
• Queues async function calls
• Executes async functions when capacity is available
• Written in Go, easy to extend via plugin module system
Request Flow in Fn Server
25
Supporting services
26
• DB, MQ, blob store are all pluggable modules that are thin wrappers
around their respective drivers.
– DB: MySQL, sqlite3, Postgres
– Queue: Redis, Kafka
– Registry: Any Docker v2-compliant, even private
• Metrics/Monitoring
– OpenTracing API for metrics
– Prometheus support, pluggable backends
– Logging via syslog
Metrics and Monitoring
27
Prometheus metrics generated by Fn server, visualized in Grafana
Fn Flow
Composing Functions
28
Composing Functions
What is required here?
• A coordination service
• A state machine
• An error handling mechanism
• Another language (for composition) and associated tooling
• A testing module
• A debugging module
• A management and orchestration service
• A glue code to plumb “response” of one function as “request” to another
Fn Flow
An example - Multiple Threads in one JVM in one Container
256px
512px
original px
128px
resize upload notify
notify
start
resize upload notify
resize upload notify
upload
notify
end
An example - Invoke Seperate Functions
256px
512px
original px
128px
upload notify
notify
start
upload notify
upload notify
upload
notify
end
resize
resize
resize
resize 128
resize 256
resize 512
An example - Invoke Separate Functions
256px
512px
original px
128px
upload notify
notify
start
upload notify
upload notify
upload
notify
end
resize
resize
resize
resize
256
resize
128
resize
512
Each function runs in a separate container,
resources are automatically obtained
An example - Invoke Separate Functions
When a function completes its resources are
deallocated and the calling function thread proceeds
256px
512px
original px
128px
upload notify
notify
start
upload notify
upload notify
upload
notify
end
resize
resize
resize
resize
128
resize
512
An example - Invoke Separate Functions
256px
512px
original px
128px
upload notify
notify
start
upload notify
upload notify
upload
notify
end
resize
resize
resize
Each function thread runs until completion
An example - Invoke Separate Functions
256px
512px
original px
128px
upload notify
notify
start
upload notify
upload notify
upload
notify
end
resize
resize
resize
Once all threads are done, a final action is performed
An example - Invoke Separate Functions
When function execution is complete the
container is destroyed, freeing resources
Fn Flow Demo
Saga Pattern
39
Saga Pattern
40
http://microservices.io/patterns/data/saga.html
Booking Use case
Monitoring
Prometheus and Grafana
42
Tooling for Monitoring
43
Possible Metrics – in Prometheus format
• Function counts: the # of functions that are currently
– queued or are running
– have completed successfully or failed since the server was last started
• Operation durations: represent the time taken
– to perform various operations
– to start the docker container in which it runs
• Docker metrics: various statistics from that container such as
– CPU and memory usage
44
Monitoring Demo
Using Prometheus and Grafana
45
● Fn is scheduler agnostic but lots
of optimization/management
work in process to optimize on
Kubernetes
● Helm chart available at
https://github.com/fnproject/fn-helm
● Thinking about deeper
Kubernetes integrations including
CRD’s to model functions
Kubernetes support
Fn Project
48
Serverless design with Fn project

Weitere ähnliche Inhalte

Was ist angesagt?

VMworld 2015: Build and Run Cloud Native Apps in your Software Defined Data C...
VMworld 2015: Build and Run Cloud Native Apps in your Software Defined Data C...VMworld 2015: Build and Run Cloud Native Apps in your Software Defined Data C...
VMworld 2015: Build and Run Cloud Native Apps in your Software Defined Data C...VMworld
 
Upgrade your InfoSec, Ops and Dev teams with PCF 1.12
Upgrade your InfoSec, Ops and Dev teams with PCF 1.12Upgrade your InfoSec, Ops and Dev teams with PCF 1.12
Upgrade your InfoSec, Ops and Dev teams with PCF 1.12VMware Tanzu
 
Cloud foundry architecture and deep dive
Cloud foundry architecture and deep diveCloud foundry architecture and deep dive
Cloud foundry architecture and deep diveAnimesh Singh
 
Efficient DevOps: Standardizing Chaotic Culture at NBCUniversal
Efficient DevOps:  Standardizing Chaotic Culture at NBCUniversalEfficient DevOps:  Standardizing Chaotic Culture at NBCUniversal
Efficient DevOps: Standardizing Chaotic Culture at NBCUniversalIBM UrbanCode Products
 
How to Scale Operations for a Multi-Cloud Platform using PCF
How to Scale Operations for a Multi-Cloud Platform using PCFHow to Scale Operations for a Multi-Cloud Platform using PCF
How to Scale Operations for a Multi-Cloud Platform using PCFVMware Tanzu
 
Pivotal Cloud Foundry 2.1: Making Transformation Real Webinar
Pivotal Cloud Foundry 2.1: Making Transformation Real WebinarPivotal Cloud Foundry 2.1: Making Transformation Real Webinar
Pivotal Cloud Foundry 2.1: Making Transformation Real WebinarVMware Tanzu
 
Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...
Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...
Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...VMware Tanzu
 
12 factor app an introduction
12 factor app an introduction12 factor app an introduction
12 factor app an introductionKrishna-Kumar
 
DevOps Digital Transformation: A real life use case enabled by Alien4Cloud
DevOps Digital Transformation: A real life use case enabled by Alien4CloudDevOps Digital Transformation: A real life use case enabled by Alien4Cloud
DevOps Digital Transformation: A real life use case enabled by Alien4CloudCloudify Community
 
Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...
Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...
Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...Daniel Oh
 
VMware Developer-Ready Transformation
VMware Developer-Ready TransformationVMware Developer-Ready Transformation
VMware Developer-Ready TransformationVMware Tanzu
 
Cloud and agile software projects: Overview and Benefits
Cloud and agile software projects: Overview and BenefitsCloud and agile software projects: Overview and Benefits
Cloud and agile software projects: Overview and BenefitsGuillaume Berche
 
Cloud Native Application
Cloud Native ApplicationCloud Native Application
Cloud Native ApplicationVMUG IT
 
App Development Evolution: What has changed?
App Development Evolution: What has changed? App Development Evolution: What has changed?
App Development Evolution: What has changed? Dev_Events
 
Cloud Native Patterns with Bluemix Developer Console
Cloud Native Patterns with Bluemix Developer ConsoleCloud Native Patterns with Bluemix Developer Console
Cloud Native Patterns with Bluemix Developer ConsoleMatthew Perrins
 
Building next gen applications and microservices
Building next gen applications and microservicesBuilding next gen applications and microservices
Building next gen applications and microservicesDev_Events
 
Using Blueprints to Overcome Multi-speed IT Challenges
Using Blueprints to Overcome Multi-speed IT ChallengesUsing Blueprints to Overcome Multi-speed IT Challenges
Using Blueprints to Overcome Multi-speed IT ChallengesIBM UrbanCode Products
 

Was ist angesagt? (20)

VMworld 2015: Build and Run Cloud Native Apps in your Software Defined Data C...
VMworld 2015: Build and Run Cloud Native Apps in your Software Defined Data C...VMworld 2015: Build and Run Cloud Native Apps in your Software Defined Data C...
VMworld 2015: Build and Run Cloud Native Apps in your Software Defined Data C...
 
Upgrade your InfoSec, Ops and Dev teams with PCF 1.12
Upgrade your InfoSec, Ops and Dev teams with PCF 1.12Upgrade your InfoSec, Ops and Dev teams with PCF 1.12
Upgrade your InfoSec, Ops and Dev teams with PCF 1.12
 
Cloud foundry architecture and deep dive
Cloud foundry architecture and deep diveCloud foundry architecture and deep dive
Cloud foundry architecture and deep dive
 
Efficient DevOps: Standardizing Chaotic Culture at NBCUniversal
Efficient DevOps:  Standardizing Chaotic Culture at NBCUniversalEfficient DevOps:  Standardizing Chaotic Culture at NBCUniversal
Efficient DevOps: Standardizing Chaotic Culture at NBCUniversal
 
Docker12 factor
Docker12 factorDocker12 factor
Docker12 factor
 
How to Scale Operations for a Multi-Cloud Platform using PCF
How to Scale Operations for a Multi-Cloud Platform using PCFHow to Scale Operations for a Multi-Cloud Platform using PCF
How to Scale Operations for a Multi-Cloud Platform using PCF
 
Pivotal Cloud Foundry 2.1: Making Transformation Real Webinar
Pivotal Cloud Foundry 2.1: Making Transformation Real WebinarPivotal Cloud Foundry 2.1: Making Transformation Real Webinar
Pivotal Cloud Foundry 2.1: Making Transformation Real Webinar
 
Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...
Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...
Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...
 
12 factor app an introduction
12 factor app an introduction12 factor app an introduction
12 factor app an introduction
 
DevOps Digital Transformation: A real life use case enabled by Alien4Cloud
DevOps Digital Transformation: A real life use case enabled by Alien4CloudDevOps Digital Transformation: A real life use case enabled by Alien4Cloud
DevOps Digital Transformation: A real life use case enabled by Alien4Cloud
 
Cloud, agile
Cloud, agileCloud, agile
Cloud, agile
 
Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...
Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...
Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...
 
VMware Developer-Ready Transformation
VMware Developer-Ready TransformationVMware Developer-Ready Transformation
VMware Developer-Ready Transformation
 
Cloud and agile software projects: Overview and Benefits
Cloud and agile software projects: Overview and BenefitsCloud and agile software projects: Overview and Benefits
Cloud and agile software projects: Overview and Benefits
 
Cache-Aside Cloud Design Pattern
Cache-Aside Cloud Design PatternCache-Aside Cloud Design Pattern
Cache-Aside Cloud Design Pattern
 
Cloud Native Application
Cloud Native ApplicationCloud Native Application
Cloud Native Application
 
App Development Evolution: What has changed?
App Development Evolution: What has changed? App Development Evolution: What has changed?
App Development Evolution: What has changed?
 
Cloud Native Patterns with Bluemix Developer Console
Cloud Native Patterns with Bluemix Developer ConsoleCloud Native Patterns with Bluemix Developer Console
Cloud Native Patterns with Bluemix Developer Console
 
Building next gen applications and microservices
Building next gen applications and microservicesBuilding next gen applications and microservices
Building next gen applications and microservices
 
Using Blueprints to Overcome Multi-speed IT Challenges
Using Blueprints to Overcome Multi-speed IT ChallengesUsing Blueprints to Overcome Multi-speed IT Challenges
Using Blueprints to Overcome Multi-speed IT Challenges
 

Ähnlich wie Serverless design with Fn project

Putting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OS
Putting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OSPutting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OS
Putting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OSLightbend
 
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 nutshellEugene Fedorenko
 
Open Source Serverless: a practical view. - Gabriele Provinciali Luca Postacc...
Open Source Serverless: a practical view. - Gabriele Provinciali Luca Postacc...Open Source Serverless: a practical view. - Gabriele Provinciali Luca Postacc...
Open Source Serverless: a practical view. - Gabriele Provinciali Luca Postacc...Codemotion
 
Distributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and ScalaDistributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and ScalaMax Alexejev
 
Free the Functions with Fn project!
Free the Functions with Fn project!Free the Functions with Fn project!
Free the Functions with Fn project!J On The Beach
 
Ankit Chohan - Java
Ankit Chohan - JavaAnkit Chohan - Java
Ankit Chohan - JavaAnkit Chohan
 
Node.js 101 with Rami Sayar
Node.js 101 with Rami SayarNode.js 101 with Rami Sayar
Node.js 101 with Rami SayarFITC
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Jérôme Petazzoni
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresDocker, Inc.
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Arun prasath
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101Rami Sayar
 
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...Athens Big Data
 
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...Patrick Chanezon
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for DevelopmentChris Tankersley
 
Cloudexpowest opensourcecloudcomputing-1by arun kumar
Cloudexpowest opensourcecloudcomputing-1by arun kumarCloudexpowest opensourcecloudcomputing-1by arun kumar
Cloudexpowest opensourcecloudcomputing-1by arun kumarArun Kumar
 
Cloudexpowest opensourcecloudcomputing-1by arun kumar
Cloudexpowest opensourcecloudcomputing-1by arun kumarCloudexpowest opensourcecloudcomputing-1by arun kumar
Cloudexpowest opensourcecloudcomputing-1by arun kumarArun Kumar
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014Hojoong Kim
 
Serverless forwardjs
Serverless forwardjsServerless forwardjs
Serverless forwardjsUpkar Lidder
 

Ähnlich wie Serverless design with Fn project (20)

Putting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OS
Putting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OSPutting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OS
Putting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OS
 
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
 
Open Source Serverless: a practical view. - Gabriele Provinciali Luca Postacc...
Open Source Serverless: a practical view. - Gabriele Provinciali Luca Postacc...Open Source Serverless: a practical view. - Gabriele Provinciali Luca Postacc...
Open Source Serverless: a practical view. - Gabriele Provinciali Luca Postacc...
 
Distributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and ScalaDistributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and Scala
 
Versioning for Developers
Versioning for DevelopersVersioning for Developers
Versioning for Developers
 
Free the Functions with Fn project!
Free the Functions with Fn project!Free the Functions with Fn project!
Free the Functions with Fn project!
 
Ankit Chohan - Java
Ankit Chohan - JavaAnkit Chohan - Java
Ankit Chohan - Java
 
Node.js 101 with Rami Sayar
Node.js 101 with Rami SayarNode.js 101 with Rami Sayar
Node.js 101 with Rami Sayar
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failures
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101
 
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
 
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
 
Cloudexpowest opensourcecloudcomputing-1by arun kumar
Cloudexpowest opensourcecloudcomputing-1by arun kumarCloudexpowest opensourcecloudcomputing-1by arun kumar
Cloudexpowest opensourcecloudcomputing-1by arun kumar
 
Cloudexpowest opensourcecloudcomputing-1by arun kumar
Cloudexpowest opensourcecloudcomputing-1by arun kumarCloudexpowest opensourcecloudcomputing-1by arun kumar
Cloudexpowest opensourcecloudcomputing-1by arun kumar
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014
 
Containers and Docker
Containers and DockerContainers and Docker
Containers and Docker
 
Serverless forwardjs
Serverless forwardjsServerless forwardjs
Serverless forwardjs
 

Kürzlich hochgeladen

Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 

Kürzlich hochgeladen (20)

Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 

Serverless design with Fn project

  • 1.
  • 3. Serverless and Fn Project Introduction 3
  • 4. Buzz around Serverless ● Serverless is an abstraction of infrastructure and its operations including provisioning, scaling, patching, etc. ● Serverless architecture is when an app is built entirely on Serverless components (compute, storage, networking) ● FaaS is the compute component in a Serverless architecture 4
  • 5. Functions - The serverless application programming model 5 In mathematics, a function is a relation between a set of inputs and a set of permissible outputs with the property that each input is related to exactly one output. Function (mathematics) - Wikipedia https://en.wikipedia.org/wiki/Function_(mathematics)
  • 6. Characteristics of a Function • Short Running – process live for a short amount of time • Ephemeral – the outer container live for a single invocation • Stateless – does not inherently hold any state • Invoked – by defined events over protocols like HTTP, TCP etc • Single Purpose – have clear & defined purpose with minimal API surface • Autonomous – can run and serve it’s purpose by itself 6 A function packaged in a container gives us a new “atomic unit of computing”
  • 7. Atomic Unit – relevant concepts • Functions as Unit of Scaling - Scale Up/Down at much finer grained precision (of single process) than machines - Effective way of scaling of functions coupled with universal packaging/runtime of containers • Functions as Unit of Billing - No baseline on Servers or VMs - Enables huge cost reduction of lightly used applications • Functions as Unit of Design - Functions in containers with their own contract are shareable, so that composite applications can be built and reused - This requires function orchestration tools 7
  • 8. The ideal Functions platform • Open Source—no vendor lock-in • Platform Independent—laptop, server, cloud • Approachable—easy for new users, low level controls for advanced users • Docker Based—leverage Docker ecosystem • Scheduler Independent—deploy to Kubernetes, Swarm, Mesos, etc. 8
  • 11. 11
  • 12. Fn Project - Key Components 12 Fn Server Fn FlowJava FDK
  • 13. Fn Project – More and more FDKs 13 FDKs Fn Server Fn Flow
  • 14. Example – Hello World A small Java Function 14
  • 16. Function descriptor – func.yaml 16
  • 17. Function deployment – Dockerfile generated 17
  • 18. Function deployment process 1. Builds container (multi-stage) + bumps version 2. Pushes container to registry 3. Creates/updates function route (servers lazy load images) 18 MyFunc:0.0.2 MyFunc:0.0.2 MyFunc:0.0.2 Your code Fn Service myfunc → /r/myapp/myfunc:0.0.2 1 2 3
  • 19. Hello World Demo Simple Java Function 19
  • 22. Fn LB 22 • Simple, fast load balancer that routes functions to certain nodes consistently for hot function efficiency • Scales each function independently based on traffic to any particular function • Can be used to scale Fn servers and infrastructure as well as it has a view of global state of all fn servers
  • 24. Fn Server 24 • Handles CRUD operations for setting up routes and functions • Executes sync functions, returning responses to clients immediately • Queues async function calls • Executes async functions when capacity is available • Written in Go, easy to extend via plugin module system
  • 25. Request Flow in Fn Server 25
  • 26. Supporting services 26 • DB, MQ, blob store are all pluggable modules that are thin wrappers around their respective drivers. – DB: MySQL, sqlite3, Postgres – Queue: Redis, Kafka – Registry: Any Docker v2-compliant, even private • Metrics/Monitoring – OpenTracing API for metrics – Prometheus support, pluggable backends – Logging via syslog
  • 27. Metrics and Monitoring 27 Prometheus metrics generated by Fn server, visualized in Grafana
  • 30. What is required here? • A coordination service • A state machine • An error handling mechanism • Another language (for composition) and associated tooling • A testing module • A debugging module • A management and orchestration service • A glue code to plumb “response” of one function as “request” to another
  • 32. An example - Multiple Threads in one JVM in one Container 256px 512px original px 128px resize upload notify notify start resize upload notify resize upload notify upload notify end
  • 33. An example - Invoke Seperate Functions 256px 512px original px 128px upload notify notify start upload notify upload notify upload notify end resize resize resize resize 128 resize 256 resize 512
  • 34. An example - Invoke Separate Functions 256px 512px original px 128px upload notify notify start upload notify upload notify upload notify end resize resize resize resize 256 resize 128 resize 512 Each function runs in a separate container, resources are automatically obtained
  • 35. An example - Invoke Separate Functions When a function completes its resources are deallocated and the calling function thread proceeds 256px 512px original px 128px upload notify notify start upload notify upload notify upload notify end resize resize resize resize 128 resize 512
  • 36. An example - Invoke Separate Functions 256px 512px original px 128px upload notify notify start upload notify upload notify upload notify end resize resize resize Each function thread runs until completion
  • 37. An example - Invoke Separate Functions 256px 512px original px 128px upload notify notify start upload notify upload notify upload notify end resize resize resize Once all threads are done, a final action is performed
  • 38. An example - Invoke Separate Functions When function execution is complete the container is destroyed, freeing resources
  • 39. Fn Flow Demo Saga Pattern 39
  • 44. Possible Metrics – in Prometheus format • Function counts: the # of functions that are currently – queued or are running – have completed successfully or failed since the server was last started • Operation durations: represent the time taken – to perform various operations – to start the docker container in which it runs • Docker metrics: various statistics from that container such as – CPU and memory usage 44
  • 46. ● Fn is scheduler agnostic but lots of optimization/management work in process to optimize on Kubernetes ● Helm chart available at https://github.com/fnproject/fn-helm ● Thinking about deeper Kubernetes integrations including CRD’s to model functions Kubernetes support
  • 47.

Hinweis der Redaktion

  1. Functions are small bits of code that do one thing well and are easy to understand and maintain As a service means no complicated plumbing, the system takes care of provisioning, scaling, patching, maintaining, etc. Each function scales independently.
  2. Single purpose - meaning it takes a reasonably short input, and provide a reasonably short output. Autonomous - Although it is likely just part of a broader grouping of functions, by itself, it can run independently as long as it gets it’s required input.
  3. …a lightweight Docker-based serverless functions platform you can run on your laptop, server, or cloud
  4. OK so have a great way to build small, scalable functions but what do we do when we want to write a more complex app. One that has long-lived workflows and fault cases that we need to handle gracefully? This workflow or composition problem is actually a general one that most serverless applications have once they reach some level of complexity. There are 2 naive approaches: - Write a blocking master function that runs one function, waits for the result, then runs the next etc. This might be easy to understand but we lose a lot of the nice characteristics of a serverless app when we do this. This master function is long-running and consumes resources for the whole time that the individual functions are running. When the booking processes take minutes this can get expensive. It's also not very reliable: if this master function dies then we've got no easy way of recovering. - Chain the next function by directly calling it. This ends up being a maintenance nightmare very quickly as all of a sudden each upstream function has to know about every downstream one so that it can gather and pass the right data down the chain. It's also very difficult to deal with errors. Fan-in / join is tricky. Details: ---------- Built on familiar CompletionStage interface from Java 8 Chain together many functions in an arbitrary graph Fan-out / fan-in, timeouts, exception handling Orchestrate complex workflows in one place Language native function orchestration—natural for developer Java initially with additional language support to follow
  5. Enter Fn Flow. It occurred to us that Java already has a mechanism for composing asynchronous functions. The CompletionStage API introduced in Java 8 and improved in Java 9 provides a really nice, type-safe promises-style API. This lets us compose a graph of asynchronous computations that lets you specify concurrency, fan-out, fan in and a bunch of other distributed programming primitives. What if could use this API, or something very like it, in our favorite language (Java of course) to compose serverless functions? So we wrote a service (that we call the completer) that can store and trigger the execution of these computation graphs. This is part of the Fn platform and shares the same scalability and reliability properties. We open sourced this along with the rest of the Fn platform. This service backs an API that's almost exactly like CompletionStage that you can use in your Java function to reliably compose other functions. Let's see what it looks like…