-
Notifications
You must be signed in to change notification settings - Fork 227
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