Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
laadvo committed Jul 22, 2024
1 parent 25fdf03 commit cb1f7ad
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 8 deletions.
6 changes: 5 additions & 1 deletion docker-compose-traefik-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ version: '3'
services:
traefik:
image: traefik:v2.9.6
command:
- --api.insecure=true # Enable the insecure API and dashboard
- --providers.docker=true
- --entrypoints.web.address=:80
container_name: athene-traefik-local
restart: unless-stopped
ports:
- ${TRAEFIK_DASHBOARD_PORT}:8080
- ${TRAEFIK_DASHBOARD_PORT}:8080 #9081
- ${TRAEFIK_HTTP_PORT}:80
volumes:
- ./traefik/traefik.local.yml:/etc/traefik/traefik.yml:ro
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
environment:
# This is needed to rewrite the callback URL in the load-balancer
# when running in Docker, if Artemis is running on the host machine
- REWRITE_LOCALHOST_CALLBACK_URL_TO=http://host.docker.internal
- REWRITE_LOCALHOST_CALLBACK_URL_TO=http://172.17.0.1
volumes:
- ./load-balancer/src:/usr/src/app/src

Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ services:
# http://localhost:9081/dashboard
traefik:
image: traefik:v2.9.6
command:
- --api.insecure=true # Enable the insecure API and dashboard
- --providers.docker=true
- --entrypoints.web.address=:80
container_name: athene-traefik
restart: unless-stopped
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions embedding/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Pillow==10.3.0
pluggy==1.0.0
preshed==3.0.8
protobuf==3.20.3
pydantic==1.10.4
pydantic==1.10.8
Pygments==2.15.0
pyocclient==0.6
pyparsing==3.0.9
Expand Down Expand Up @@ -104,7 +104,7 @@ tomli==2.0.1
tqdm==4.64.1
typer==0.7.0
types-toml==0.10.8.3
typing_extensions==4.4.0
typing_extensions==4.8.0
Unidecode==1.3.6
urllib3==1.26.18
wasabi==1.1.1
Expand Down
6 changes: 6 additions & 0 deletions load-balancer/src/ConfigParser.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import logging

from .entities import NodeType, ComputeNode
from logging import getLogger
import os.path
Expand Down Expand Up @@ -51,9 +53,13 @@ def parseConfig(self, node_type):
try:
# Query traefik API
traefik_services = requests.get(node['traefik_service_api'] + node[node_type + '_service_name'], timeout=5).json()
self.__logger.error(f"Traefik: {traefik_services}")
self.__logger.error(f"Node: {node}")
for i, server in enumerate(traefik_services['loadBalancer']['servers']):
self.__logger.error(f"{i} !!")
new_node = ComputeNode(name='traefik_' + node_type + '_' + str(i), type=node_type, url=str(server['url'])+str(node['trigger_route']))
self.addComputeNode(new_node)

except Exception as e:
self.__logger.error("Error during config parsing (docker nodes): " + str(e))

Expand Down
5 changes: 4 additions & 1 deletion load-balancer/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ def sendBackResults(job: AtheneJob):
"Authorization": auth_secret,
"Content-type": "application/x-protobuf"
}
logger.error(f"DEBUGGING: BEFORE REQUEST CALLBACK TO {job.callback_url}")
response = requests.post(job.callback_url, data=final_result, headers=headers, timeout=600)
logger.error(f"DEBUGGING: AFTER REQUEST CALLBACK TO {job.callback_url}")
if response.status_code == status.HTTP_200_OK:
logger.info("Callback successful")
logger.info("Athene Job finished: " + str(job))
Expand All @@ -176,8 +178,9 @@ def sendBackResults(job: AtheneJob):
# Endpoint for Artemis to submit a job
# This will create a new job and queue up the first task (segmentation)
@app.post("/submit")
async def submit_job(request: Request, response: Response):
async def submit_job(request: Request, response: Response): #TODO ldv
checkAuthorization(request)
logger.error("IN SUBMITTT")

job_request = await parseJson(request)

Expand Down
6 changes: 3 additions & 3 deletions load-balancer/src/node_config.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
docker_nodes:
# This url resolves to the API of the traefik-container inside the docker-network started via docker-compose
- traefik_service_api: http://athene-traefik:8080/api/http/services/
segmentation_service_name: segmentation-athena@docker
embedding_service_name: embedding-athena@docker
clustering_service_name: clustering-athena@docker
segmentation_service_name: segmentation-athena-cofee@docker
embedding_service_name: embedding-athena-cofee@docker
clustering_service_name: clustering-athena-cofee@docker
trigger_route: /trigger

# To use a GPU server, uncomment the following lines and change the values to match your setup.
Expand Down
1 change: 1 addition & 0 deletions segmentation/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
numpy==1.24.2
fastapi==0.109.1
nltk==3.8.1
requests==2.31.0
Expand Down
1 change: 1 addition & 0 deletions traefik/traefik.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ entryPoints:

# API and dashboard configuration
api:
dashboard: true
insecure: true

0 comments on commit cb1f7ad

Please sign in to comment.