|
| 1 | +# Video Analytics Standalone Benchmark |
| 2 | + |
| 3 | +The video analyics standalone benchmark preprocesses an input video and runs an object detection model (squeezenet) on the video. An input video can be specified, but if nothing is given, a default video is used. This benchmark also utilises and depends on a database to store the videos that can be used, which in turn uses MongoDB. |
| 4 | + |
| 5 | +The `init-database.go` script runs when starting the function and populates the database with the videos from the `videos` folder. |
| 6 | + |
| 7 | +The functionality is implemented in Python. The function is invoked using gRPC. |
| 8 | + |
| 9 | +## Running this benchmark locally (using docker) |
| 10 | + |
| 11 | +The detailed and general description how to run benchmarks local you can find [here](../../docs/running_locally.md). The following steps show it on the video-analytics-standalone-python function. |
| 12 | +1. Build or pull the function images using `make all-image` or `make pull`. |
| 13 | +### Invoke once |
| 14 | +2. Start the function with docker-compose |
| 15 | + ```bash |
| 16 | + docker-compose -f ./yamls/docker-compose/dc-video-analytics-standalone-python.yaml up |
| 17 | + ``` |
| 18 | +3. In a new terminal, invoke the interface function with grpcurl. |
| 19 | + ```bash |
| 20 | + ./tools/bin/grpcurl -plaintext localhost:50000 helloworld.Greeter.SayHello |
| 21 | + ``` |
| 22 | +### Invoke multiple times |
| 23 | +2. Run the invoker |
| 24 | + ```bash |
| 25 | + # build the invoker binary |
| 26 | + cd ../../tools/invoker |
| 27 | + make invoker |
| 28 | + |
| 29 | + # Specify the hostname through "endpoints.json" |
| 30 | + echo '[ { "hostname": "localhost" } ]' > endpoints.json |
| 31 | + |
| 32 | + # Start the invoker with a chosen RPS rate and time |
| 33 | + ./invoker -port 50000 -dbg -time 10 -rps 1 |
| 34 | + ``` |
| 35 | + |
| 36 | +## Running this benchmark (using knative) |
| 37 | + |
| 38 | +The detailed and general description on how to run benchmarks on knative clusters you can find [here](../../docs/running_benchmarks.md). The following steps show it on the video-analytics-standalone-python function. |
| 39 | +1. Build or pull the function images using `make all-image` or `make pull`. |
| 40 | +2. Initialise the database and start the function with knative |
| 41 | + ```bash |
| 42 | + kubectl apply -f ./yamls/knative/video-analytics-standalone-database.yaml |
| 43 | + kubectl apply -f ./yamls/knative/kn-video-analytics-standalone-python.yaml |
| 44 | + ``` |
| 45 | +3. **Note the URL provided in the output. The part without the `http://` we'll call `$URL`. Replace any instance of `$URL` in the code below with it.** |
| 46 | +### Invoke once |
| 47 | +4. In a new terminal, invoke the interface function with test-client. |
| 48 | + ```bash |
| 49 | + ./test-client --addr $URL:80 --name "Example text for video analytics standalone" |
| 50 | + ``` |
| 51 | +### Invoke multiple times |
| 52 | +4. Run the invoker |
| 53 | + ```bash |
| 54 | + # build the invoker binary |
| 55 | + cd ../../tools/invoker |
| 56 | + make invoker |
| 57 | + |
| 58 | + # Specify the hostname through "endpoints.json" |
| 59 | + echo '[ { "hostname": "$URL" } ]' > endpoints.json |
| 60 | + |
| 61 | + # Start the invoker with a chosen RPS rate and time |
| 62 | + ./invoker -port 80 -dbg -time 10 -rps 1 |
| 63 | + ``` |
| 64 | +## Tracing |
| 65 | + |
| 66 | +This Benchmark does not support distributed tracing for now. |
0 commit comments