Giter Club home page Giter Club logo

faasd's Introduction

faasd - lightweight OSS serverless ๐Ÿณ

Build Status License: MIT OpenFaaS Downloads

faasd is the same OpenFaaS experience and ecosystem, but without Kubernetes. Functions and microservices can be deployed anywhere with reduced overheads whilst retaining the portability of containers and cloud-native tooling such as containerd and CNI.

About faasd

  • is a single Golang binary
  • can be set-up and left alone to run your applications
  • is multi-arch, so works on Intel x86_64 and ARM out the box
  • uses the same core components and ecosystem of OpenFaaS

demo

Demo of faasd running in KVM

What does faasd deploy?

You'll also need:

You can use the standard faas-cli along with pre-packaged functions from the Function Store, or build your own using any OpenFaaS template.

Tutorials

Get started on DigitalOcean, or any other IaaS

If your IaaS supports user_data aka "cloud-init", then this guide is for you. If not, then checkout the approach and feel free to run each step manually.

Run locally on MacOS, Linux, or Windows with Multipass.run

Get started on armhf / Raspberry Pi

You can run this tutorial on your Raspberry Pi, or adapt the steps for a regular Linux VM/VPS host.

Terraform for DigitalOcean

Automate everything within < 60 seconds and get a public URL and IP address back. Customise as required, or adapt to your preferred cloud such as AWS EC2.

A note on private repos / registries

To use private image repos, ~/.docker/config.json needs to be copied to /var/lib/faasd/.docker/config.json.

If you'd like to set up your own private registry, see this tutorial.

Beware that running docker login on MacOS and Windows may create an empty file with your credentials stored in the system helper.

Alternatively, use you can use the registry-login command from the OpenFaaS Cloud bootstrap tool (ofc-bootstrap):

curl -sLSf https://raw.githubusercontent.com/openfaas-incubator/ofc-bootstrap/master/get.sh | sudo sh

ofc-bootstrap registry-login --username <your-registry-username> --password-stdin
# (the enter your password and hit return)

The file will be created in ./credentials/

Logs for functions

You can view the logs of functions using journalctl:

journalctl -t openfaas-fn:FUNCTION_NAME


faas-cli store deploy figlet
journalctl -t openfaas-fn:figlet -f &
echo logs | faas-cli invoke figlet

Manual / developer instructions

See here for manual / developer instructions

Getting help

Docs

The OpenFaaS docs provide a wealth of information and are kept up to date with new features.

Function and template store

For community functions see faas-cli store --help

For templates built by the community see: faas-cli template store list, you can also use the dockerfile template if you just want to migrate an existing service without the benefits of using a template.

Workshop

The OpenFaaS workshop is a set of 12 self-paced labs and provides a great starting point

Community support

An active community of almost 3000 users awaits you on Slack. Over 250 of those users are also contributors and help maintain the code.

Backlog

Supported operations

  • faas login
  • faas up
  • faas list
  • faas describe
  • faas deploy --update=true --replace=false
  • faas invoke --async
  • faas invoke
  • faas rm
  • faas store list/deploy/inspect
  • faas version
  • faas namespace
  • faas secret
  • faas logs

Scale from and to zero is also supported. On a Dell XPS with a small, pre-pulled image unpausing an existing task took 0.19s and starting a task for a killed function took 0.39s. There may be further optimizations to be gained.

Other operations are pending development in the provider such as:

  • faas auth - supported for Basic Authentication, but OAuth2 & OIDC require a patch

Todo

Pending:

  • Add support for using container images in third-party public registries
  • Add support for using container images in private third-party registries
  • Monitor and restart any of the core components at runtime if the container stops
  • Bundle/package/automate installation of containerd - see bootstrap from k3s
  • Provide ufw rules / example for blocking access to everything but a reverse proxy to the gateway container
  • Provide simple Caddyfile example in the README showing how to expose the faasd proxy on port 80/443 with TLS

Done:

  • Provide a cloud-config.txt file for automated deployments of faasd
  • Inject / manage IPs between core components for service to service communication - i.e. so Prometheus can scrape the OpenFaaS gateway - done via /etc/hosts mount
  • Add queue-worker and NATS
  • Create faasd.service and faasd-provider.service
  • Self-install / create systemd service via faasd install
  • Restart containers upon restart of faasd
  • Clear / remove containers and tasks with SIGTERM / SIGINT
  • Determine armhf/arm64 containers to run for gateway
  • Configure basic_auth to protect the OpenFaaS gateway and faasd-provider HTTP API
  • Setup custom working directory for faasd /var/lib/faasd/
  • Use CNI to create network namespaces and adapters

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.