openfaas / openfaas/faas-cli

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

Open
#1,010 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
Go
Stars
816
Forks
230
Avg merge
6h 4m
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the faas-cli local-run command and review how it currently starts a single function with Docker. No file or test is named; the proposal's completion criteria are running multiple functions together, supporting --filter, and allowing communication over a Docker network, potentially through a containerized gateway.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.