Code Monkey home page Code Monkey logo

faas-dcos's Introduction

faas-dcos

DC/OS plugin for OpenFaas

A more recent blog post describing the installation process can be found here: https://medium.com/@realrealbot/openfaas-on-dcos-9d5927f4e725

Prerequisites:

  1. a running DC/OS cluster accessible without authentication
  2. an external Marathon-LB service running
  3. DC/OS CLI installed and configured (installation instructions can be found here or in the Dashboard top-left corner)

A quick way to have a local DCOS cluster running is https://github.com/dcos/dcos-vagrant. Do not forget to:

  1. add option oauth_enabled: 'false' in etc/config-1.9.yaml config file to disable authentication
  2. set environment variable export DCOS_VERSION=1.9.2 in shell before running vagrant up.

Marathon-LB can be easily installed from DCOS Universe packages (the default configuration is okay, just click on INSTALL button):

Marathon-LB in Universe

Plugin has been tested with DC/OS version 1.9.2, 1.9.4 and 1.10.2 .

Installation

Once you have your cluster running, you can easily install OpenFaas components. From faas-dcos project root run the following command :

dcos marathon group add faas-dcos.json

You should see services being deployed and, after a few minutes, you should have something like this:

OpenFaas running

OpenFaaS Interface should be now be available at http://<public_node_address>:10012/ui/ where <public_node_address> is the cluster node accessible from outside, is the one running Marathon-LB by the way...

You can now deploy functions using the web interface, for instance using these values:

image: functions/nodeinfo:latest  
name: nodeinfo  
handler: node main.js

or alternatively you can use the CLI for OpenFaaS with the following YAML stack file (functions.yaml):

provider:
  name: faas
  gateway: http://<public_node_address>:10012

functions:
  nodeinfo:
    fprocess: node main.js
    image: functions/nodeinfo:latest
    skip_build: true

Remember to set the gateway to http://<public_node_address>:10012!

Then run this command to deploy your function:

$ faas-cli deploy -f ./functions.yml

Once the function has been created, you should see a new service running in DC/OS

Function running

and it will be available to be executed

Function invoked

TODO

  1. Handle authentication and token expiration (see #292)
  2. Marathon 1.5 compatibility (remove go-marathon or #324)

faas-dcos's People

Contributors

realbot avatar

Watchers

James Cloos avatar Raghu Vamshi Challa avatar  avatar

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.