-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_rest.sh
executable file
·85 lines (77 loc) · 1.98 KB
/
run_rest.sh
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
echo
# setting the authentication variables
source authentication.env
# Script Options
if [ $# -eq 1 ]
then
# setting up configuration variables
# source ./config.sh
source $1
else
while getopts ":q:e:m:h:p:v:" opt; do
case $opt in
q)
query="$OPTARG" >&2
;;
e)
endpoint="$OPTARG" >&2
;;
u)
pharos_user="$OPTARG" >&2
;;
w)
pharos_password="$OPTARG" >&2
;;
v)
vision_endpoint="$OPTARG" >&2
;;
r)
vision_user="$OPTARG" >&2
;;
s)
vision_password="$OPTARG" >&2
;;
m)
method="$OPTARG" >&2
;;
h)
host="$OPTARG" >&2
;;
p)
port="$OPTARG" >&2
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
fi
# Optional arguments default configuration
host=${host:-localhost}
method=${method,,}
now=$(date +"%Y-%m-%dT%H-%M-%S")
# echo $query
# echo $endpoint
# echo $pharos_user
# echo $pharos_password
# echo $vision_endpoint
# echo $vision_user
# echo $vision_password
# echo $method
# echo $host
# echo $port
method=pastec
# PASTEC METHOD
port=4212
# Request existing indexes
python3 sntxnorm.py "./PhotoSimilarity-Workspace/IDs/2022-01-07T08-24-37_pastecIDs.json"
# Update Pharos
java -jar target/PhotoSimilarity-0.1-assembly.jar -m $method -e $endpoint -pharos_user $pharos_user -pharos_password $pharos_password -json_file "./PhotoSimilarity-Workspace/IDs/2022-01-07T08-24-37_pastecIDs.json" -pharosModel "./PhotoSimilarity-Workspace/IDs/2022-01-07T08-24-37_pastecIDs.ttl"
# Create model and update Vision
java -jar target/PhotoSimilarity-0.1-assembly.jar -m $method -p $endpoint -pharos_user $pharos_user -pharos_password $pharos_password -e $vision_endpoint -vision_user $vision_user -vision_password $vision_password -visionModel "./PhotoSimilarity-Workspace/IDs/2022-01-07T08-24-37_pastecIDs.json" -log "./PhotoSimilarity-Workspace/Logs/2022-01-07T08-24-37_pastec_error.log"