mirror of
https://github.com/openfaas/faas.git
synced 2025-06-18 20:16:37 +00:00
Remove non-async deployment option
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
@ -149,7 +149,6 @@ paths:
|
|||||||
post:
|
post:
|
||||||
summary: 'Invoke a function asynchronously in OpenFaaS'
|
summary: 'Invoke a function asynchronously in OpenFaaS'
|
||||||
description: >-
|
description: >-
|
||||||
### This endpoint requires the asynchronous stack.
|
|
||||||
See https://github.com/openfaas/faas/blob/master/guide/asynchronous.md.
|
See https://github.com/openfaas/faas/blob/master/guide/asynchronous.md.
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
|
@ -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
|
|
@ -12,6 +12,8 @@ services:
|
|||||||
read_timeout: 10 # set both here, and on your functions
|
read_timeout: 10 # set both here, and on your functions
|
||||||
write_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
|
dnsrr: "true" # Temporarily use dnsrr in place of VIP while issue persists on PWD
|
||||||
|
faas_nats_address: "nats"
|
||||||
|
faas_nats_port: 4222
|
||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
@ -27,6 +29,49 @@ services:
|
|||||||
constraints:
|
constraints:
|
||||||
- 'node.role == manager'
|
- 'node.role == manager'
|
||||||
- 'node.platform.os == linux'
|
- '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
|
# End
|
||||||
|
|
||||||
# Start monitoring
|
# Start monitoring
|
||||||
@ -209,4 +254,4 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
functions:
|
functions:
|
||||||
driver: overlay
|
driver: overlay
|
||||||
#attachable: true
|
attachable: true
|
||||||
|
@ -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">
|
<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).
|
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:
|
> The asynchronous stack is now built-in by default. Previously it was an optional configuration.
|
||||||
|
|
||||||
```
|
|
||||||
$ ./deploy_extended.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
K8s:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ kubectl delete -f ./faas.yml
|
|
||||||
$ kubectl apply -f./faas.async.yml,nats.yml
|
|
||||||
```
|
|
||||||
|
|
||||||
## Call a function
|
## Call a function
|
||||||
|
|
||||||
|
@ -7,11 +7,11 @@ output: github_document
|
|||||||
knitr::opts_chunk$set(echo = TRUE)
|
knitr::opts_chunk$set(echo = TRUE)
|
||||||
```
|
```
|
||||||
|
|
||||||
Use this FaaS function using R.
|
Use this OpenFaaS function using R.
|
||||||
|
|
||||||
**Deploy the base R function**
|
**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
|
* Option 1 - click *Create a new function* on the FaaS UI
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user