mirror of
https://github.com/openfaas/faas.git
synced 2025-06-10 01:06:47 +00:00
Adjust sizing
This commit is contained in:
parent
271f7a5ce9
commit
098123d544
33
README.md
33
README.md
@ -12,20 +12,20 @@ Minimum requirements:
|
|||||||
* Docker 1.13-RC (to support attachable overlay networks)
|
* Docker 1.13-RC (to support attachable overlay networks)
|
||||||
* At least a single host in Swarm Mode. (run `docker swarm init`)
|
* At least a single host in Swarm Mode. (run `docker swarm init`)
|
||||||
|
|
||||||
* Create an attachable network for the gateway and functions to join
|
#### Create an attachable network for the gateway and functions to join
|
||||||
|
|
||||||
```
|
```
|
||||||
# docker network create --driver overlay --attachable functions
|
# docker network create --driver overlay --attachable functions
|
||||||
```
|
```
|
||||||
|
|
||||||
* Start the gateway
|
#### Start the gateway
|
||||||
|
|
||||||
```
|
```
|
||||||
# docker pull alexellisio/faas-gateway:latest
|
# docker pull alexellisio/faas-gateway:latest
|
||||||
# docker rm -f gateway; docker run -d -v /var/run/docker.sock:/var/run/docker.sock --name gateway -p 8080:8080 --network=functions alexellisio/faas-gateway:latest
|
# docker rm -f gateway; docker run -d -v /var/run/docker.sock:/var/run/docker.sock --name gateway -p 8080:8080 --network=functions alexellisio/faas-gateway:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
* Start at least one of the serverless functions:
|
#### Start at least one of the serverless functions:
|
||||||
|
|
||||||
Here we start an echo service using the `cat` command found in a shell.
|
Here we start an echo service using the `cat` command found in a shell.
|
||||||
|
|
||||||
@ -33,30 +33,30 @@ Here we start an echo service using the `cat` command found in a shell.
|
|||||||
# docker service rm catservice ; docker service create --network=functions --name catservice alexellisio/faas-catservice:latest
|
# docker service rm catservice ; docker service create --network=functions --name catservice alexellisio/faas-catservice:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
* Now send an event to the API gateway
|
#### Now send an event to the API gateway
|
||||||
|
|
||||||
**Method 1 - use the service name as a URL:**
|
* Method 1 - use the service name as a URL:
|
||||||
|
|
||||||
```
|
```
|
||||||
# curl -X POST --data-binary @$HOME/.ssh/known_hosts -v http://localhost:8080/function/catservice
|
# curl -X POST --data-binary @$HOME/.ssh/known_hosts -v http://localhost:8080/function/catservice
|
||||||
```
|
```
|
||||||
|
|
||||||
**Method 2 - use the X-Function header:**
|
* Method 2 - use the X-Function header:
|
||||||
|
|
||||||
```
|
```
|
||||||
# curl -X POST -H 'x-function: catservice' --data-binary @$HOME/.ssh/known_hosts -v http://localhost:8080/
|
# curl -X POST -H 'x-function: catservice' --data-binary @$HOME/.ssh/known_hosts -v http://localhost:8080/
|
||||||
```
|
```
|
||||||
|
|
||||||
* Build your own function
|
#### Build your own function
|
||||||
|
|
||||||
Visit the accompanying blog post to find out how to build your own function in whatever programming language you prefer.
|
Visit the accompanying blog post to find out how to build your own function in whatever programming language you prefer.
|
||||||
|
|
||||||
[FaaS blog post](http://blog.alexellis.io/functions-as-a-service/)
|
[FaaS blog post](http://blog.alexellis.io/functions-as-a-service/)
|
||||||
|
|
||||||
## Overview
|
# Overview
|
||||||
|
|
||||||
|
## the gateway
|
||||||
|
|
||||||
gateway
|
|
||||||
=======
|
|
||||||
|
|
||||||
This container acts in a similar way to the API Gateway on AWS. Requests can be made to this endpoint with a JSON body.
|
This container acts in a similar way to the API Gateway on AWS. Requests can be made to this endpoint with a JSON body.
|
||||||
|
|
||||||
@ -75,8 +75,8 @@ Features:
|
|||||||
* [todo] unique URL routes for serverless functions
|
* [todo] unique URL routes for serverless functions
|
||||||
* instrumentation via Prometheus metrics at GET /metrics
|
* instrumentation via Prometheus metrics at GET /metrics
|
||||||
|
|
||||||
watchdog
|
## the watchdog
|
||||||
========
|
|
||||||
|
|
||||||
This binary fwatchdog acts as a watchdog for your function. Features:
|
This binary fwatchdog acts as a watchdog for your function. Features:
|
||||||
|
|
||||||
@ -86,8 +86,7 @@ This binary fwatchdog acts as a watchdog for your function. Features:
|
|||||||
* [todo] Only lets processes run for set duration i.e. 500ms, 2s, 3s.
|
* [todo] Only lets processes run for set duration i.e. 500ms, 2s, 3s.
|
||||||
* Language/binding independent
|
* Language/binding independent
|
||||||
|
|
||||||
Building a development environment:
|
## Building a development environment:
|
||||||
===================================
|
|
||||||
|
|
||||||
To use multiple hosts you should push your services (functions) to the Docker Hub or a registry accessible to all nodes.
|
To use multiple hosts you should push your services (functions) to the Docker Hub or a registry accessible to all nodes.
|
||||||
|
|
||||||
@ -112,8 +111,6 @@ Accessing the `cat` (read echo) service:
|
|||||||
# curl -X POST -H 'x-function: catservice' --data-binary @/etc/hostname -v http://localhost:8080/
|
# curl -X POST -H 'x-function: catservice' --data-binary @/etc/hostname -v http://localhost:8080/
|
||||||
```
|
```
|
||||||
|
|
||||||
Prometheus metrics / instrumentation
|
## Prometheus metrics / instrumentation
|
||||||
====================================
|
|
||||||
|
|
||||||
* Standard go metrics and function invocation count / duration are available at http://localhost:8080/metrics/
|
|
||||||
|
|
||||||
|
Standard go metrics and function invocation count / duration are available at http://localhost:8080/metrics/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user