Live Preview - Jedi Kittens: https://twitter.com/alexellisuk/status/911290757314744322
Get OpenFaaS with instructions @ https://github.com/alexellis/faas/blob/master/guide/deployment_swarm.md
Edit docker-compose.yml:
$ git diff docker-compose.yml
diff --git a/docker-compose.yml b/docker-compose.yml
index 9d91cff..cfcde24 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -10,6 +10,8 @@ services:
- functions
environment:
dnsrr: "true" # Temporarily use dnsrr in place of VIP while issue persists on PWD
+ read_timeout: 65 # seconds
+ write_timeout: 65 # seconds
deploy:
placement:
constraints:
Then re-deploy:
./deploy_stack.sh
And deploy the functions:
$ faas-cli -action deploy --env write_debug=false -image alexellis2/faas-youtubedl:0.2 -name youtubedl -fprocess="sh ./entry.sh" --env read_timeout=60 --env write_timeout=60
$ faas-cli deploy --env write_debug=false --env read_timeout=60 --env write_timeout=60 --fprocess="./entry.sh" --image alexellis/gif-maker --name gif-maker
Now try it out:
$ curl localhost:8080/function/youtubedl \
-d "https://www.youtube.com/watch?v=NtgtMQwr3Ko" \
| curl -X POST localhost:8080/function/gif-maker --data-binary @- > yt.gif
Your gif will be in the "yt.gif" file. Enjoy