mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 12:16:30 +00:00
move zmq port to config file for C# and python
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from user cimport User
|
||||
from credentials cimport Credentials
|
||||
from file_data cimport FileData
|
||||
|
||||
|
||||
cdef class ApiClient:
|
||||
cdef public Credentials credentials
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
pyinstaller --onefile ^
|
||||
--collect-all pyyaml ^
|
||||
--collect-all jwt ^
|
||||
--collect-all requests ^
|
||||
--collect-all psutil ^
|
||||
--collect-all msgpack ^
|
||||
--collect-all zmq ^
|
||||
--collect-all cryptography ^
|
||||
--collect-all cv2 ^
|
||||
--collect-all onnxruntime ^
|
||||
--hidden-import constants ^
|
||||
--hidden-import annotation ^
|
||||
--hidden-import credentials ^
|
||||
--hidden-import file_data ^
|
||||
--hidden-import user ^
|
||||
--hidden-import security ^
|
||||
--hidden-import secure_model ^
|
||||
--hidden-import api_client ^
|
||||
--hidden-import hardware_service ^
|
||||
--hidden-import remote_command ^
|
||||
--hidden-import ai_config ^
|
||||
--hidden-import inference ^
|
||||
--hidden-import remote_command_handler ^
|
||||
start.py
|
||||
@@ -0,0 +1 @@
|
||||
zmq_port: 5128
|
||||
@@ -1,4 +1,4 @@
|
||||
cdef int ZMQ_PORT = 5127 # Port for the zmq
|
||||
cdef str CONFIG_FILE # Port for the zmq
|
||||
|
||||
cdef int QUEUE_MAXSIZE # Maximum size of the command queue
|
||||
cdef str COMMANDS_QUEUE # Name of the commands queue in rabbit
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
cdef int ZMQ_PORT = 5127 # Port for the zmq
|
||||
cdef str CONFIG_FILE = "config.yaml" # Port for the zmq
|
||||
|
||||
cdef int QUEUE_MAXSIZE = 1000 # Maximum size of the command queue
|
||||
cdef int QUEUE_MAXSIZE = 1000 # Maximum size of the command queue
|
||||
cdef str COMMANDS_QUEUE = "azaion-commands"
|
||||
cdef str ANNOTATIONS_QUEUE = "azaion-annotations"
|
||||
|
||||
@@ -9,4 +9,4 @@ cdef str QUEUE_CONFIG_FILENAME = "secured-config.json"
|
||||
cdef str AI_MODEL_FILE = "azaion.onnx"
|
||||
|
||||
cdef bytes DONE_SIGNAL = b"DONE"
|
||||
cdef int MODEL_BATCH_SIZE = 4
|
||||
cdef int MODEL_BATCH_SIZE = 4
|
||||
|
||||
@@ -3,7 +3,7 @@ import zmq
|
||||
from threading import Thread, Event
|
||||
from remote_command cimport RemoteCommand
|
||||
cimport constants
|
||||
|
||||
import yaml
|
||||
|
||||
cdef class RemoteCommandHandler:
|
||||
def __init__(self, object on_command):
|
||||
@@ -12,7 +12,9 @@ cdef class RemoteCommandHandler:
|
||||
|
||||
self._router = self._context.socket(zmq.ROUTER)
|
||||
self._router.setsockopt(zmq.LINGER, 0)
|
||||
self._router.bind(f'tcp://*:{constants.ZMQ_PORT}')
|
||||
with open(<str>constants.CONFIG_FILE, "r") as f:
|
||||
config = yaml.safe_load(f)
|
||||
self._router.bind(f'tcp://*:{config["zmq_port"]}')
|
||||
|
||||
self._dealer = self._context.socket(zmq.DEALER)
|
||||
self._dealer.setsockopt(zmq.LINGER, 0)
|
||||
|
||||
Reference in New Issue
Block a user