Skip to content

Commit

Permalink
temporary
Browse files Browse the repository at this point in the history
  • Loading branch information
amadolid committed Jan 10, 2024
1 parent dd1e029 commit 8d4aa60
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
6 changes: 3 additions & 3 deletions jaseci_core/jaseci/jsorc/jsorc_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
2 changes: 1 addition & 1 deletion jaseci_core/jaseci/jsorc/manifests/socket.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions jaseci_socket/jaseci_socket/jssocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down Expand Up @@ -212,6 +216,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 {})
Expand Down
9 changes: 7 additions & 2 deletions scripts/jsorc/jaseci-template
Original file line number Diff line number Diff line change
Expand Up @@ -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;
---
Expand All @@ -176,7 +181,7 @@ spec:
serviceAccountName: jaseci-account
containers:
- name: jaseci
image: jaseci/jaseci:latest
image: python:3.10-slim
resources:
requests:
memory: "350Mi"
Expand Down

0 comments on commit 8d4aa60

Please sign in to comment.