Cloud Agnostic Serverless with
Fn Project
Todor Todorov | @totollygeek
DevOps Evangelist
Todor Todorov
@totollygeek
» .NET developer;
» clean code fanatic;
» DevOps evangelist;
» speaker;
» father of 3 boys;
» karaoke enthusiast;
The serverless explained
Credits: Matthew Gilliard
DIY Bare Metal PaaS K8s-aaS Serverless
Hardware
OS
Hypervisor
Virtual OS
Container
Orchestration
Application
Code
@totollygeek
Monolith
Microservice
Microservice
Microservice
Function
Function
Function
Function
Function
Function
Function
Function
Function
Function
@totollygeek
@totollygeek
Microservice
Monolith
Microservice
Microservice
Function
Function
Function
Function
Function
Function
Function
Function
Function
Function
@totollygeek
@totollygeek
 C#
 F#
 JavaScript
 Java (ver 2.x only)
 PowerShell (ver 2.x only)
 Python (ver 2.x only)
 TypeScript (ver 2.x only)
 some experimental
@totollygeek
 JavaScript
 Python
 Java (8, 11)
 C# (dotnetcore2.1)
 Go (1.x)
 Ruby (2.5)
@totollygeek
JavaScript
Go
Python
That’s it?!?
@totollygeek
@totollygeek
@totollygeek
What is Fn Project?
• Independent open-source
serverless compute platform
• Not tied to any cloud vendor
• Can be run on premises
• Supported by Oracle
• Containers are primitives
• Strong enterprise in mind
@totollygeek
What is a function
container?
• Sandboxed process
• Short running
• Event-driven
• Stateless (-ish)
@totollygeek
Anatomy of an Fn function
• Small chunk of code wrapped in a container
• Gets input from http-stream and environment
• Sends output to http-stream
• Logs to STDERR / syslog
@totollygeek
FDK (Function Development Kit) support
@totollygeek
Go Java Node.js Python Ruby
Officially
supported
C#
Community
supported
The Fn Server
• Runs in a container also
• Handles as an API gateway
• Exposes REST interface
• Storing logs
@totollygeek
The Fn CLI
• Of course we have a CLI!
• Used to interact with Fn Server
• Initialization
• Deployment
• Invocation
@totollygeek
Initialization of functions
• Calling fn init to create a boilerplate in a folder
• Does not do anything on the server
• Boilerplate includes: Dockerfile, func.yaml & code
@totollygeek
Invocation of functions
• From the CLI
• With HTTP request
• From the UI
@totollygeek
How deployment works
@totollygeek
1. Bumps function version
2.Builds container
3.Pushes it to registry
4.Creates or update function & trigger in server
Your code
MyFunc:0.0.2
1 & 2 3
MyFunc:0.0.2
MyFunc:0.0.2
Fn Service
4
@totollygeek
DEMO
See metrics
with
Grafana &
Prometheus
@totollygeek
@totollygeek
Source: https://fnproject.io/tutorials/grafana/
Using it in
Kubernetes
• Recommended
way of deployment
for production
• Helm chart
available on
GitHub
@totollygeek
Fn Flow
• Building scalable distributed applications out of functions
• Flows are functions also
• Support complex parallel processes with error handling, which is
testable
• Flow functions scale as normal functions
• Currently supports Java, hopefully more to come
@totollygeek
Fn Flow | Licence plate example
@totollygeek
Scraper
Plate detect
Plate detect
Plate detect
Draw
Draw
Draw
Post to
Twitter
Post to
Twitter
Post to
Twitter
Post to
Slack
Post to
Slack
Post to
Slack
Fn Flow | Licence plate example
@totollygeek
Scraper
Plate detect
Plate detect
Plate detect
Draw
Draw
Draw
Post to
Twitter
Post to
Twitter
Post to
Twitter
Post to
Slack
Post to
Slack
Post to
Slack
FlowFuture.invoke()
thenCompose()
thenCompose()
allOf()
whenComplete()
Fn Flow |
Licence
plate
example
@totollygeek
Fn Flow UI
@totollygeek
Source: https://github.com/fnproject/flow
@totollygeek
DEMO
Thank you! (●’◡’●)
Where to find me:
Todor Todorov
e: todor@todorov.bg / ttodorov@nemetschek.bg
b: www.todorov.bg
t: www.twitter.com/totollygeek
l: www.linkedin.com/in/totollygeek
g: www.github.com/totollygeek

Cloud agnostic serverless with fn project

Editor's Notes

  • #3 This is me My tagline from twitter I know what you ask yourself – aren’t you 20? I am 24 years and 120 months old.
  • #4 You saw that in every serverless session Because the Gods of serverless demand that explanation You pay just for execution
  • #6 Generally you have a Monolith, you break to Microservices Microservices are broken to functions I don’t completely agree, but that is the idea Different mindset
  • #7 Most likely this is what you have Face it – monoliths are not going anywhere any time soon This is OK
  • #12 When you think about it, it is a bit frustrating
  • #13 When you think about it, it is a bit frustrating
  • #14 DISCLAIMER: I do not work for Oracle I am not affiliated with Oracle in any way shape or form Views are my own
  • #15 Apache 2 Licensed, so you can use it however you want Running bit of your code on demand, based on triggers Anything that is a Linux process can be containerized and used as a function Why reinvent the wheel, when you can use already established tools and libraries For example use a NuGet package in a Function in Google cloud? Or ruby gem in a function in Azure?
  • #16 How many of you use containers on daily basis ? In production ? Hidden by other processes by a kernel namespacing mechanism You can run long running containers
  • #17 Used to use STDIN and STDOUT, but that was not easily supported by all
  • #18 FDKs handle the IN, OUT and Hot function support Recently added C# Still not “official”
  • #19 Used to use STDIN and STDOUT, but that was not easily supported by all
  • #20 Used to use STDIN and STDOUT, but that was not easily supported by all
  • #21 Used to use STDIN and STDOUT, but that was not easily supported by all
  • #22 Used to use STDIN and STDOUT, but that was not easily supported by all
  • #24 Show fn start Fn Init Fn Deploy Fn Invoke Fn UI
  • #31 Completable Future Used for Asynchronous programming in Java Kinda like task based programming in C#
  • #34 THANK YOU