Skip to content

Commit

Permalink
some debugging attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
pal03377 committed Nov 13, 2023
1 parent ca93e34 commit 5659750
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
12 changes: 4 additions & 8 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,28 @@
"type": "python",
"request": "launch",
"cwd": "${workspaceFolder}/assessment_module_manager",
"module": "assessment_module_manager",
"justMyCode": true
"module": "assessment_module_manager"
},
{
"name": "Module Example",
"type": "python",
"request": "launch",
"cwd": "${workspaceFolder}/module_example",
"module": "module_example",
"justMyCode": true
"module": "module_example"
},
{
"name": "Module Programming LLM",
"type": "python",
"request": "launch",
"cwd": "${workspaceFolder}/module_programming_llm",
"module": "module_programming_llm",
"justMyCode": true
"module": "module_programming_llm"
},
{
"name": "Module Text LLM",
"type": "python",
"request": "launch",
"cwd": "${workspaceFolder}/module_text_llm",
"module": "module_text_llm",
"justMyCode": true
"module": "module_text_llm"
},
{
"name": "Module Text CoFee",
Expand Down
11 changes: 7 additions & 4 deletions docker-compose.cofee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ services:
expose:
- 4999
- 8080
# for local debugging, add the following and also change the callbackUrl in adapter.py
ports:
- 80:8000
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./module_text_cofee/traefik.docker.yml:/etc/traefik/traefik.yml
Expand All @@ -28,7 +31,7 @@ services:
# http://localhost/getTask
# http://localhost/sendTaskResult
load-balancer:
image: ghcr.io/ls1intum/athena/load-balancer
image: ghcr.io/ls1intum/athena/load-balancer:2dbf9c8
container_name: cofee-load-balancer
restart: unless-stopped
expose:
Expand All @@ -47,7 +50,7 @@ services:
- traefik.http.routers.balancer.entrypoints=web

segmentation:
image: ghcr.io/ls1intum/athena/segmentation
image: ghcr.io/ls1intum/athena/segmentation:2dbf9c8
container_name: cofee-segmentation
restart: unless-stopped
depends_on:
Expand All @@ -64,7 +67,7 @@ services:
# http://localhost/upload
# http://localhost/feedback_consistency
embedding:
image: ghcr.io/ls1intum/athena/embedding
image: ghcr.io/ls1intum/athena/embedding:2dbf9c8
container_name: cofee-embedding
restart: unless-stopped
depends_on:
Expand All @@ -82,7 +85,7 @@ services:
- traefik.http.services.cofee-embedding.loadbalancer.server.port=8000 # set service name this way

clustering:
image: ghcr.io/ls1intum/athena/clustering
image: ghcr.io/ls1intum/athena/clustering:2dbf9c8
container_name: cofee-clustering
restart: unless-stopped
depends_on:
Expand Down
11 changes: 5 additions & 6 deletions module_text_cofee/module_text_cofee/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def send_submissions(exercise: Exercise, submissions: List[Submission]):
"""Send submissions to old Athena-CoFee server."""
logger.info("Sending %d submissions to CoFee", len(submissions))
module_url = os.environ.get("MODULE_URL", f"http://localhost:{get_module_config().port}")
print("json:")
print({
logger.info("json:")
logger.info({
"callbackUrl": f"{module_url}/cofee_callback/{exercise.id}",
"submissions": [
{
Expand All @@ -52,7 +52,7 @@ def send_submissions(exercise: Exercise, submissions: List[Submission]):
f"{get_cofee_url()}/submit",
json={
# TODO: maybe make this more flexible?
# "callbackUrl": f"http://host.docker.internal:5004/cofee_callback/{exercise.id}", # for local debugging
#"callbackUrl": f"http://host.docker.internal:5004/cofee_callback/{exercise.id}", # for local debugging
"callbackUrl": f"{module_url}/cofee_callback/{exercise.id}",
"submissions": [
{
Expand All @@ -66,10 +66,9 @@ def send_submissions(exercise: Exercise, submissions: List[Submission]):
"Content-Type": "application/json",
"Authorization": COFEE_AUTH_TOKEN,
},
timeout=60,
# TODO: remove this again:
verify=False, # Ignore SSL errors for now, because athenetest1-01 has an invalid certificate
# timeout=60,
)
logger.info("sent! raising for status...")
resp.raise_for_status()
logger.info("Submissions sent to CoFee")

Expand Down

0 comments on commit 5659750

Please sign in to comment.