Skip to content

Proposal: local-run to run multiple functions in a docker network #1010

Description

@alexellis

Description

Proposal: local-run to run multiple functions in a docker network

Today, if you have two functions that are inter-related, and may even talk to each other, you will need to deploy that to Kubernetes.

faas-cli local-run is an easy way to test out functions without having a license installed or a Kubernetes cluster - just by using Docker alone.

A docker network, plus some Go routines could enable local-run to run multiple functions at once, and allow them to communicate.

Example YAML file:

version: 1.0
provider:
  name: openfaas
  gateway: http://127.0.0.1:8080

functions:
  test:
    lang: golang-middleware
    handler: ./test
    image: test:latest

  test2:
    lang: golang-middleware
    handler: ./test2
    image: test2:latest

For multiple functions - local-run would run all functions in the file.

You could then filter back down with the --filter flag i.e. --filter test2

@welteki suggested a basic / dummy gateway that is also run as a container, which can avoid having to stub out or replace calls from functions to the http://gateway.openfaas:8080 etc

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions