Permalink
Browse files

Remove non-async deployment option

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
  • Loading branch information...
alexellis committed Dec 21, 2017
1 parent 6906f49 commit 6199c61178bc34a09d99a2c9a23b631c703deacc
Showing with 49 additions and 27 deletions.
  1. +0 −1 api-docs/swagger.yml
  2. +0 −9 deploy_extended.sh
  3. +46 −1 docker-compose.yml
  4. +1 −14 guide/asynchronous.md
  5. +2 −2 sample-functions/BaseFunctions/R/README.Rmd
View
@@ -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

This file was deleted.

Oops, something went wrong.
View
@@ -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
@@ -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
@@ -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

0 comments on commit 6199c61

Please sign in to comment.