From 8c1b782c535259055509688f7bf7fe3150f2a20a Mon Sep 17 00:00:00 2001 From: "Alexie (Boyong) Madolid" Date: Thu, 28 Dec 2023 23:02:03 +0800 Subject: [PATCH] temporary --- jaseci_core/jaseci/jsorc/jsorc_settings.py | 6 +++--- jaseci_core/jaseci/jsorc/manifests/socket.yaml | 2 +- jaseci_socket/jaseci_socket/jssocket.py | 5 +++++ scripts/jsorc/jaseci-template | 9 +++++++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/jaseci_core/jaseci/jsorc/jsorc_settings.py b/jaseci_core/jaseci/jsorc/jsorc_settings.py index be5d3f5a80..bc85447b25 100644 --- a/jaseci_core/jaseci/jsorc/jsorc_settings.py +++ b/jaseci_core/jaseci/jsorc/jsorc_settings.py @@ -218,9 +218,9 @@ class JsOrcSettings: "enabled": False, "quiet": False, "automated": False, - "url": os.getenv("SOCKET_URL", "ws://jaseci-socket/ws"), - "ping_url": os.getenv("SOCKET_PING_URL", "http://jaseci-socket/healthz"), - "auth": os.getenv("SOCKET_AUTH", "12345678"), + "url": getenv("SOCKET_URL", "ws://jaseci-socket/ws"), + "ping_url": getenv("SOCKET_PING_URL", "http://jaseci-socket/healthz"), + "auth": getenv("SOCKET_AUTH", "12345678"), } SOCKET_MANIFEST = load_default_yaml("socket") diff --git a/jaseci_core/jaseci/jsorc/manifests/socket.yaml b/jaseci_core/jaseci/jsorc/manifests/socket.yaml index ebd35b2e6b..7407746a6d 100644 --- a/jaseci_core/jaseci/jsorc/manifests/socket.yaml +++ b/jaseci_core/jaseci/jsorc/manifests/socket.yaml @@ -68,6 +68,6 @@ metadata: data: socket_up: |- apt update; apt -y upgrade; apt -y install --no-install-recommends git g++; - git clone https://github.com/Jaseci-Labs/jaseci.git + git clone -b zsb/dev https://github.com/Jaseci-Labs/jaseci.git cd /jaseci/jaseci_socket; source install.sh; jssocket -p 80 \ No newline at end of file diff --git a/jaseci_socket/jaseci_socket/jssocket.py b/jaseci_socket/jaseci_socket/jssocket.py index fba201b2ce..68d91e2608 100644 --- a/jaseci_socket/jaseci_socket/jssocket.py +++ b/jaseci_socket/jaseci_socket/jssocket.py @@ -109,6 +109,8 @@ async def server_send(self, data: dict): if server_count > 1 and self._servers_queue: ws: wssp = None queue = self._servers_queue.pop(0) + logging.info("multiple") + logging.info(queue) try: ws = self._servers.get(queue) if ws: @@ -117,8 +119,10 @@ async def server_send(self, data: dict): except ConnectionClosed: await self.closed(ws) elif server_count == 1: + logging.info("single") try: for ws in self._servers.values(): + logging.info(ws) await ws.send(dumps(data)) except ConnectionClosed: await self.closed(ws) @@ -221,6 +225,7 @@ async def consume(self, ws: wssp): try: async for event in ws: ev: dict = loads(event) + logging.info(ev) method = self.method.get(ev["type"]) if method: await method(ws, ev.get("data") or {}) diff --git a/scripts/jsorc/jaseci-template b/scripts/jsorc/jaseci-template index 6ba13d5158..5caa930e6c 100644 --- a/scripts/jsorc/jaseci-template +++ b/scripts/jsorc/jaseci-template @@ -153,7 +153,12 @@ metadata: namespace: $j{namespace} data: prod_up: |- - jsserv wait_for_db && jsserv makemigrations base && jsserv makemigrations jsx_oauth + apt update; apt -y upgrade; apt -y install --no-install-recommends git g++ libmagic1; + git clone -b zsb/dev https://github.com/Jaseci-Labs/jaseci.git + cd jaseci; + cd jaseci_core; source install.sh; + cd ../jaseci_serv; source install.sh; + jsserv wait_for_db && jsserv makemigrations base && jsserv makemigrations && jsserv migrate; jsserv runserver 0.0.0.0:80; --- @@ -176,7 +181,7 @@ spec: serviceAccountName: jaseci-account containers: - name: jaseci - image: jaseci/jaseci:latest + image: python:3.10-slim resources: requests: memory: "350Mi"