66## docker-stack.yaml
77
88``` yaml
9- version : " 3.7 "
9+ version : " 3.8 "
1010
1111services :
1212
1313 doods :
14- image : snowzach/doods:rpi
14+ image : snowzach/doods:arm32
1515 ports :
1616 - " 8080:8080"
1717 configs :
1818 - source : config.yaml
1919 target : /opt/doods/config.yaml
2020 deploy :
21- replicas : 3
21+ replicas : 2
22+ placement :
23+ max_replicas_per_node : 1
24+ constraints :
25+ - node.role == worker
2226 restart_policy :
2327 condition : on-failure
2428
@@ -32,17 +36,17 @@ configs:
3236` ` `
3337$ docker node ls
3438ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION
35- x1ytchflr5hx8od91d8sospdm * pi1 Ready Active Leader 19.03.5
36- fa4q2xzyiggqrdp899umsb0bi pi2 Ready Active 19.03.5
37- qyfzcl94hxeatjj1qk03ip41n pi3 Ready Active 19.03.5
39+ oy7dhxijdatpj8v6zntsin8l0 * pi1 Ready Active Leader 19.03.12
40+ 7hkc4r7pr0mjpzxbei2y92voe pi2 Ready Active 19.03.12
41+ rcp67rotibho0qxfdnpqwx71l pi3 Ready Active 19.03.12
3842
3943$ docker stack deploy -c docker-stack.yml doods
4044Creating network doods_default
4145Creating config doods_config.yaml
4246Creating service doods_doods
4347
4448$ curl http://127.0.0.1:8080/version
45- {"version":"v0.1.5 -0-g99f5768 "}
49+ {"version":"v0.2.2 -0-gf87b48e-dirty "}
4650
4751$ curl http://127.0.0.1:8080/detectors
4852{
@@ -65,6 +69,8 @@ $ curl http://127.0.0.1:8080/detectors
6569 ]
6670}
6771
72+ $ jq -n --arg data $(base64 -w0 image.jpg) '.detector_name="default" | .detect["*"]=50 | .data=$data' > data.json
73+
6874$ cat data.json
6975{
7076 " detector_name " : " default" ,
@@ -74,6 +80,8 @@ $ cat data.json
7480 }
7581}
7682
83+ $ base64 -w0 image.jpg | http -I http://127.0.0.1:8080/detect detector_name=default detect:='{"*":50}' data=@/dev/stdin
84+
7785$ curl -X POST -H Content-Type:application/json http://127.0.0.1:8080/detect -d @data.json
7886{
7987 " detections " : [
0 commit comments