demo script updates (#934)

Demo script updates.  Record-replay, a bugfix in the canary demo script, etc.
This commit is contained in:
Soam Vasani
2018-10-15 14:48:01 -07:00
committed by GitHub
parent 4cc42fb216
commit 8329ef36b3
21 changed files with 391 additions and 12 deletions
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
fission fn delete --name hi-py
fission route delete --name $(fission route list|grep hi|cut -f1 -d' ')
fission recorder delete --name my-recorder
kubectl -n fission delete pod redis-0
+7
View File
@@ -0,0 +1,7 @@
from flask import request
from flask import current_app
def main():
name=request.args["name"]
return "Hello, %s" % name
+28
View File
@@ -0,0 +1,28 @@
#!/bin/bash
DEMO_RUN_FAST=1
ROOT_DIR=$(dirname $0)/..
. $ROOT_DIR/util.sh
desc "A simple function that takes inputs"
run "cat hi.py"
desc "Set up function"
run "fission function create --name hi-py --env python --code hi.py --entrypoint hi.main"
desc "Set up route"
run "fission route create --function hi-py --url /hi --method GET"
desc "Set up recorder"
run "fission recorder create --name my-recorder --function hi-py"
desc "Run function"
run "curl http://$FISSION_ROUTER/hi?name=world"
desc "View recording"
run "fission records view -v"
requid=$(fission records view -v|tail -1|cut -f1 -d' ')
desc "Replay recording"
run "fission replay --reqUID $requid"