-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.sh
More file actions
27 lines (22 loc) · 664 Bytes
/
test.sh
File metadata and controls
27 lines (22 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
echo "--- Building docker image ---"
docker build -t pytorch-docker .
docker images
echo "--- Run the image as a container ---"
docker run -d -p 5000:5000 --name http-server pytorch-docker
docker ps
echo "--- Check whether server is running... ---"
sleep 10
curl localhost:5000
echo " "
echo "--- Query the server using images ---"
curl -F "file=@chicken.jpeg" http://127.0.0.1:5000/upload
echo " "
curl -F "file=@puppy.jpeg" http://127.0.0.1:5000/upload
echo " "
curl -F "file=@pig.jpeg" http://127.0.0.1:5000/upload
echo " "
curl -F "file=@cat.jpeg" http://127.0.0.1:5000/upload
echo " "
echo "--- Inference is done... ---"
docker stop http-server