Giter Site home page Giter Site logo

darkblaez / faas-composition-patterns Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fission/faas-composition-patterns

0.0 2.0 0.0 699 KB

Examples of different methods to compose FaaS functions together

Home Page: https://kccnceu18.sched.com/event/Dqvm/function-composition-in-a-serverless-world-erwin-van-eyk-timirah-james-platform9-intermediate-skill-level

License: Apache License 2.0

Python 100.00%

faas-composition-patterns's Introduction

FaaS Composition Patterns

Companion examples to this conference talk: https://kccnceu18.sched.com/event/Dqvm/function-composition-in-a-serverless-world-erwin-van-eyk-timirah-james-platform9-intermediate-skill-level

Deploying

Setup

You'll need a Kubernetes cluster setup, Fission installed, and Fission Workflows installed.

Install demo

fission env create --name python --image fission/python-env

fission spec apply

This will deploy all of the demo functions and triggers.

Run the demo

Demo the vision function:

On a picture of text:

curl -X POST -d "url=https://raw.githubusercontent.com/fission/faas-composition-patterns/master/test-images/ocrtest.png" http://$FISSION_ROUTER/vision
Hej Verden!

On a picture of a cat:

curl -X POST -d "url=https://raw.githubusercontent.com/fission/faas-composition-patterns/master/test-images/cat.jpg" http://$FISSION_ROUTER/vision
cat

Run the translation function:

curl -X POST -d "text=Hej&to=en" http://$FISSION_ROUTER/translation
Hello

Now run any of the combined functions:

Using the compiled function, Identify the cat picture and translate the label to Spanish:

curl -X POST -d "url=https://raw.githubusercontent.com/fission/faas-composition-patterns/master/test-images/cat.jpg&lang=es" http://$FISSION_ROUTER/compiled
gato

Using the coordinator, OCR a picture of text and translate it to English:

curl -X POST -d "url=https://raw.githubusercontent.com/fission/faas-composition-patterns/master/test-images/ocrtest.png&lang=en" http://$FISSION_ROUTER/coordinator
Hello World!

[There's a workflow function sample too under functions/workflow, but it's not tested yet]

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.