Remove non-async deployment option

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis
2017-12-21 20:34:24 +00:00
parent 6906f4957a
commit 6199c61178
5 changed files with 49 additions and 27 deletions

View File

@ -149,7 +149,6 @@ paths:
post:
summary: 'Invoke a function asynchronously in OpenFaaS'
description: >-
### This endpoint requires the asynchronous stack.
See https://github.com/openfaas/faas/blob/master/guide/asynchronous.md.
parameters:
- in: path

View File

@ -1,9 +0,0 @@
#!/bin/sh
if ! [ -x "$(command -v docker)" ]; then
echo 'Unable to find docker command, please install Docker (https://www.docker.com/) and retry' >&2
exit 1
fi
echo "Deploying extended stack"
docker stack deploy func --compose-file docker-compose.extended.yml

View File

@ -12,6 +12,8 @@ services:
read_timeout: 10 # set both here, and on your functions
write_timeout: 10 # set both here, and on your functions
dnsrr: "true" # Temporarily use dnsrr in place of VIP while issue persists on PWD
faas_nats_address: "nats"
faas_nats_port: 4222
deploy:
resources:
limits:
@ -27,6 +29,49 @@ services:
constraints:
- 'node.role == manager'
- 'node.platform.os == linux'
nats:
image: nats-streaming:0.6.0
# Uncomment the following port mappings if you wish to expose the
# NATS client and/or management ports
# ports:
# - 4222:4222
# - 8222:8222
command: "--store memory --cluster_id faas-cluster"
networks:
- functions
deploy:
resources:
limits:
memory: 125M
reservations:
memory: 50M
placement:
constraints:
- 'node.platform.os == linux'
queue-worker:
image: functions/queue-worker:0.4
networks:
- functions
environment:
max_inflight: "1"
ack_timeout: "30s" # Max duration of any async task / request
deploy:
resources:
limits:
memory: 50M
reservations:
memory: 20M
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 20
window: 380s
placement:
constraints:
- 'node.platform.os == linux'
# End
# Start monitoring
@ -209,4 +254,4 @@ services:
networks:
functions:
driver: overlay
#attachable: true
attachable: true

View File

@ -39,22 +39,9 @@ You can also use asynchronous calls with a callback URL
<img width="1440" alt="screen shot 2017-10-26 at 15 55 06" src="https://user-images.githubusercontent.com/6358735/32060205-04545692-ba66-11e7-9e6d-b800a07b9bf5.png">
## Deploy the async stack
The reference implementation for asychronous processing uses NATS Streaming, but you are free to extend OpenFaaS and write your own [queue-worker](https://github.com/open-faas/nats-queue-worker).
Swarm:
```
$ ./deploy_extended.sh
```
K8s:
```
$ kubectl delete -f ./faas.yml
$ kubectl apply -f./faas.async.yml,nats.yml
```
> The asynchronous stack is now built-in by default. Previously it was an optional configuration.
## Call a function

View File

@ -7,11 +7,11 @@ output: github_document
knitr::opts_chunk$set(echo = TRUE)
```
Use this FaaS function using R.
Use this OpenFaaS function using R.
**Deploy the base R function**
(Make sure you have already deployed FaaS with ./deploy_stack.sh in the root of this Github repository.
(Make sure you have already deployed OpenFaaS with ./deploy_stack.sh in the root of this Github repository.
* Option 1 - click *Create a new function* on the FaaS UI