-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_gateway.py
83 lines (68 loc) · 2.71 KB
/
run_gateway.py
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
"""
Copyright 2019-2021 Lummetry.AI (4E SOFTWARE SRL). All Rights Reserved.
* NOTICE: All information contained herein is, and remains the property of 4E SOFTWARE SRL.
* The intellectual and technical concepts contained herein are proprietary to 4E SOFTWARE SRL
* and may be covered by Romanian and Foreign Patents, patents in process, and are protected
* by trade secret or copyright law.
* Dissemination of this information or reproduction of this material is strictly forbidden
* unless prior written permission is obtained from 4E SOFTWARE SRL.
*
*
* RO:
* Modul software TempRent, proiect finanțat în cadrul POC, Axa prioritara 2 - Tehnologia Informației și Comunicațiilor (TIC)
* pentru o economie digitală competitivă, Prioritatea de investiții 2b - Dezvoltarea produselor și s
* erviciilor TIC, a comerțului electronic și a cererii de TIC, cod SMIS 142474,
* Contractul de finanțare nr. 2/221_ap3/24.06.2021.
*
RO:
Acest produs a fost livrat si realizat in baza serviciilor de cercetare-inovare industrială
conform contract de servicii nr. 9 din 01.11.2021 folosind modulele AI "ALLAN" aferente "TempRent" -
Proiect finanțat în cadrul POC, Axa prioritara 2 - Tehnologia Informației și Comunicațiilor (TIC)
pentru o economie digitală competitivă, Prioritatea de investiții 2b - Dezvoltarea produselor și s
erviciilor TIC, a comerțului electronic și a cererii de TIC, cod SMIS 142474,
Contractul de finanțare nr. 2/221_ap3/24.06.2021.
"""
import argparse
from libraries import Logger
from libraries.model_server_v2.gateway import FlaskGateway
### Example for running a gateway
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument(
'-b', '--base_folder',
type=str, default='.',
help='Logger base folder'
)
parser.add_argument(
'-a', '--app_folder',
type=str, default='_cache',
help='Logger app folder'
)
parser.add_argument(
'--host', type=str, default='0.0.0.0'
)
parser.add_argument(
'--port', type=int, default=5002
)
args = parser.parse_args()
base_folder = args.base_folder
app_folder = args.app_folder
host = args.host
port = args.port
### Attention! config_file should contain the configuration for each endpoint; 'NR_WORKERS' and upstream configuration
log = Logger(
lib_name='GTW',
config_file='config_gateway.txt',
base_folder=base_folder, app_folder=app_folder,
TF_KERAS=False
)
gtw = FlaskGateway(
log=log,
# server_names=['get_tags', 'get_qa', 'get_sim', 'get_aprox', 'get_conf'],
workers_location='endpoints',
workers_suffix='Worker',
host=host,
port=port,
#first_server_port=5020,
server_execution_path='/run'
)