The Fn Project
Jesse Butler
Cloud Native Developer Advocate
Oracle Cloud Native Labs
cloudnative.oracle.com
Democratizing Serverless:
The Open Source, Cloud Agnostic Functions Platform
Safe Harbor
The following is intended to outline our general product
direction. It is intended for information purposes only, and
may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality,
and should not be relied upon in making purchasing
decisions. The development, release, and timing of any
features or functionality described for Oracle’s products
remains at the sole discretion of Oracle Corporation.
About Me
● Oracle via Sun Microsystems
● drivers -> deployment -> containers
● Responsible for Docker on Solaris, later on Oracle Linux
● Now a Cloud Native Advocate within the OCI organization
Setting the Stage
● Serverless is an abstraction of infrastructure and its operations
including host provisioning, software maintenance, scaling, etc.
● FaaS Functions as a Service, the compute component in a
serverless architecture
● Functions are small bits of code that do one thing well and are
easy to understand and maintain.
● Fn is an Open Source Serverless Compute Platform
Containers as Functions
Function is a container with a
set of known traits:
● Invoked
● Ephemeral
● Stateless
● Single intent
● Self-contained
Why Serverless?
● Powerful: Transparent and limitless scaling
● Faster: Deploy faster, iterate faster, innovate faster
● Simpler: Fix business problems, not infrastructure problems
● Frictionless: Focus on innovation and iteration == speed
For Developers
Why Serverless?
● Agile: Smaller teams, less dependencies
● Reliable: This becomes the platform’s responsibility
● Extensible: Use best-in-class and familiar components
● Efficient: Pay for execution only by 100ms blocks, reduce op-ex
For Operators
What about Microservices?
About the Fn Project
● Open Source Serverless Compute Platform
● Cloud-agnostic, or on your own metal
● Simple, elegant and extensible by design
● Containers are primitives, with Docker
● Native CloudEvents support
● Active w/ 3500+ commits across 70+ contributors
● Strong enterprise focus (security, scalability, observability):
major bank, telco and retail POC’s underway
For Developers
An Fn Function
● Ideally small bit of code, wrapped in a container image
● Gets input via STDIN and environment
● Produces output to STDOUT
● Logs to STDERR
The Fn server handles everything else, including the API gateway,
piping IO around, storing logs, etc
Function Development Kits (FDKs)
● Used to help with parsing input and writing output
● Familiar syntax for Lambda developers
● Simplifies writing hot functions (use ‘json’ format and an FDK)
● Simply write a `handler` function that adheres to the FDK’s
interface and it will parse STDIN and provide the input data to
your function and deal with writing the proper output format.
Fn CLI
● fn init --runtime go | python | java | ..
● fn run
● fn test
● fn deploy --app myapp
● fn call myapp myfunc
→ http://localhost:8080/r/myapp/myfunc
fn deploy details
1. Build container (multi-stage) + bumps version
2. Push container to registry (unless --local)
3. Create or update function route (servers lazy load images)
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
Fn UI
For Operators
Architecture
Fn LB
● 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 route
● Can be used to scale Fn servers and infrastructure, has a view
of global state of all Fn servers
Fn Server
● Handles CRUD operations for setting up routes and functions
● Executes sync functions, returning responses to clients
● Queues async function calls
● Executes async functions when capacity is available
● Written in Go, easy to extend via plugin module system
Supporting Services
● DB, MQ, blob store are all pluggable modules
○ DB: MySQL, sqlite3, Postgres
○ Queue: Redis, Kafka
○ Registry: Any Docker v2-compliant registry endpoint
● Metrics & Monitoring
○ OpenTracing API for metrics
○ Prometheus support, pluggable backends
○ Logging via syslog
Open Tracing and Prometheus
Kubernetes
● Fn is scheduler agnostic, but lots of optimization/management
work underway to optimize on Kubernetes
● Thinking about deeper Kubernetes integrations including
CRD’s to model functions
● Helm chart available at https://github.com/fnproject/fn-helm
Why not just k8s All The Things?
1. Speed
a. Pod launch time is too unpredictable for sync requests
b. Coordinating resource allocation is slow
c. We can preload + hot pod like we do with current scheduling but…
2. Scale
a. We run out of addressable network space quickly
b. Functions easily scale to the hundreds of thousands / millions
Fn Flow
Fn Flow
● Build long-running, reliable, scalable functions with rich sets of
language-specific primitives including fork-join, chaining, delays
and error handling
● Supports complex parallel processes that are readable and
testable (including unit tests) with standard programming tools
● Java support using CompletableFuture API from Java 8 with
JS, Python, Go language support on the way!
Plate Detect
Function
Draw
Function
Slack
Function
Twitter
Function
Scraper
Scraper
Plate Detect
Function
Draw
Function
Slack
Function
Twitter
Function
FlowFuture.invoke()
thenCompose()
thenCompose()
allOf()
whenComplete()
Scraper
Plate Detect
Function
Draw
Function
Slack
Function
Twitter
Function
FlowFuture.invoke()
thenCompose()
thenCompose()
allOf()
whenComplete()
Flow Function
1. Star the project: github.com/fnproject/fn
2. Join the conversation: slack.fnproject.io
3. Learn more about Fn: fnproject.io
4. Cloud Native Labs: cloudnative.oracle.com
Jesse Butler
Cloud Native Developer Advocate
Oracle Cloud Native Labs
@jlb13
Thank you!

The Fn Project by Jesse Butler

  • 1.
    The Fn Project JesseButler Cloud Native Developer Advocate Oracle Cloud Native Labs cloudnative.oracle.com Democratizing Serverless: The Open Source, Cloud Agnostic Functions Platform
  • 2.
    Safe Harbor The followingis intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle Corporation.
  • 3.
    About Me ● Oraclevia Sun Microsystems ● drivers -> deployment -> containers ● Responsible for Docker on Solaris, later on Oracle Linux ● Now a Cloud Native Advocate within the OCI organization
  • 4.
    Setting the Stage ●Serverless is an abstraction of infrastructure and its operations including host provisioning, software maintenance, scaling, etc. ● FaaS Functions as a Service, the compute component in a serverless architecture ● Functions are small bits of code that do one thing well and are easy to understand and maintain. ● Fn is an Open Source Serverless Compute Platform
  • 5.
    Containers as Functions Functionis a container with a set of known traits: ● Invoked ● Ephemeral ● Stateless ● Single intent ● Self-contained
  • 6.
    Why Serverless? ● Powerful:Transparent and limitless scaling ● Faster: Deploy faster, iterate faster, innovate faster ● Simpler: Fix business problems, not infrastructure problems ● Frictionless: Focus on innovation and iteration == speed For Developers
  • 7.
    Why Serverless? ● Agile:Smaller teams, less dependencies ● Reliable: This becomes the platform’s responsibility ● Extensible: Use best-in-class and familiar components ● Efficient: Pay for execution only by 100ms blocks, reduce op-ex For Operators
  • 8.
  • 9.
    About the FnProject ● Open Source Serverless Compute Platform ● Cloud-agnostic, or on your own metal ● Simple, elegant and extensible by design ● Containers are primitives, with Docker ● Native CloudEvents support ● Active w/ 3500+ commits across 70+ contributors ● Strong enterprise focus (security, scalability, observability): major bank, telco and retail POC’s underway
  • 10.
  • 11.
    An Fn Function ●Ideally small bit of code, wrapped in a container image ● Gets input via STDIN and environment ● Produces output to STDOUT ● Logs to STDERR The Fn server handles everything else, including the API gateway, piping IO around, storing logs, etc
  • 12.
    Function Development Kits(FDKs) ● Used to help with parsing input and writing output ● Familiar syntax for Lambda developers ● Simplifies writing hot functions (use ‘json’ format and an FDK) ● Simply write a `handler` function that adheres to the FDK’s interface and it will parse STDIN and provide the input data to your function and deal with writing the proper output format.
  • 13.
    Fn CLI ● fninit --runtime go | python | java | .. ● fn run ● fn test ● fn deploy --app myapp ● fn call myapp myfunc → http://localhost:8080/r/myapp/myfunc
  • 14.
    fn deploy details 1.Build container (multi-stage) + bumps version 2. Push container to registry (unless --local) 3. Create or update function route (servers lazy load images) 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
  • 15.
  • 16.
  • 17.
  • 18.
    Fn LB ● 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 route ● Can be used to scale Fn servers and infrastructure, has a view of global state of all Fn servers
  • 19.
    Fn Server ● HandlesCRUD operations for setting up routes and functions ● Executes sync functions, returning responses to clients ● Queues async function calls ● Executes async functions when capacity is available ● Written in Go, easy to extend via plugin module system
  • 20.
    Supporting Services ● DB,MQ, blob store are all pluggable modules ○ DB: MySQL, sqlite3, Postgres ○ Queue: Redis, Kafka ○ Registry: Any Docker v2-compliant registry endpoint ● Metrics & Monitoring ○ OpenTracing API for metrics ○ Prometheus support, pluggable backends ○ Logging via syslog
  • 21.
    Open Tracing andPrometheus
  • 22.
    Kubernetes ● Fn isscheduler agnostic, but lots of optimization/management work underway to optimize on Kubernetes ● Thinking about deeper Kubernetes integrations including CRD’s to model functions ● Helm chart available at https://github.com/fnproject/fn-helm
  • 23.
    Why not justk8s All The Things? 1. Speed a. Pod launch time is too unpredictable for sync requests b. Coordinating resource allocation is slow c. We can preload + hot pod like we do with current scheduling but… 2. Scale a. We run out of addressable network space quickly b. Functions easily scale to the hundreds of thousands / millions
  • 24.
  • 25.
    Fn Flow ● Buildlong-running, reliable, scalable functions with rich sets of language-specific primitives including fork-join, chaining, delays and error handling ● Supports complex parallel processes that are readable and testable (including unit tests) with standard programming tools ● Java support using CompletableFuture API from Java 8 with JS, Python, Go language support on the way!
  • 26.
  • 27.
  • 28.
  • 29.
    1. Star theproject: github.com/fnproject/fn 2. Join the conversation: slack.fnproject.io 3. Learn more about Fn: fnproject.io 4. Cloud Native Labs: cloudnative.oracle.com Jesse Butler Cloud Native Developer Advocate Oracle Cloud Native Labs @jlb13 Thank you!