From ae76f7339b6f252caf521bce941376cd3d31f325 Mon Sep 17 00:00:00 2001 From: Paul Schwind Date: Wed, 8 Nov 2023 19:27:18 +0100 Subject: [PATCH 1/4] Remove the CoFee MongoDB database --- docker-compose.cofee.yml | 23 ++++------------------- env_example/cofee.env | 17 ----------------- 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/docker-compose.cofee.yml b/docker-compose.cofee.yml index 875d53993..0d6c3a6a6 100644 --- a/docker-compose.cofee.yml +++ b/docker-compose.cofee.yml @@ -28,7 +28,7 @@ services: # http://localhost/getTask # http://localhost/sendTaskResult load-balancer: - image: ghcr.io/ls1intum/athena/load-balancer + image: ghcr.io/ls1intum/athena/load-balancer:remove-tracking-and-feedback-consistency container_name: cofee-load-balancer restart: unless-stopped expose: @@ -47,7 +47,7 @@ services: - traefik.http.routers.balancer.entrypoints=web segmentation: - image: ghcr.io/ls1intum/athena/segmentation + image: ghcr.io/ls1intum/athena/segmentation:remove-tracking-and-feedback-consistency container_name: cofee-segmentation restart: unless-stopped depends_on: @@ -64,12 +64,11 @@ services: # http://localhost/upload # http://localhost/feedback_consistency embedding: - image: ghcr.io/ls1intum/athena/embedding + image: ghcr.io/ls1intum/athena/embedding:remove-tracking-and-feedback-consistency container_name: cofee-embedding restart: unless-stopped depends_on: - load-balancer - - database expose: - 8000 env_file: @@ -82,12 +81,11 @@ 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:remove-tracking-and-feedback-consistency container_name: cofee-clustering restart: unless-stopped depends_on: - load-balancer - - database expose: - 8000 env_file: @@ -96,16 +94,3 @@ services: labels: - traefik.enable=true - traefik.http.services.cofee-clustering.loadbalancer.server.port=8000 # set service name this way - - database: - image: mongo:latest - container_name: cofee-mongodb - restart: unless-stopped - expose: - - 27017 - env_file: - - ${ATHENA_ENV_DIR:-./env_example}/cofee.env - volumes: - - ./module_text_cofee/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro - - ./data/cofee_db:/data/db - command: --quiet > /dev/null \ No newline at end of file diff --git a/env_example/cofee.env b/env_example/cofee.env index fe77abb65..99591a1dc 100644 --- a/env_example/cofee.env +++ b/env_example/cofee.env @@ -10,9 +10,6 @@ LOAD_BALANCER_CONFIG_FILE_PATH=/config/node_config.docker.yml # shared worker variables AUTHORIZATION_SECRET=YWVuaXF1YWRpNWNlaXJpNmFlbTZkb283dXphaVF1b29oM3J1MWNoYWlyNHRoZWUzb2huZ2FpM211bGVlM0VpcAo= -DATABASE_HOST=database -DATABASE_PORT=27017 -DATABASE_NAME=athene_db BALANCER_QUEUE_FREQUENCY=600 BALANCER_GETTASK_URL=http://load-balancer:8000/getTask BALANCER_SENDRESULT_URL=http://load-balancer:8000/sendTaskResult @@ -21,18 +18,4 @@ BALANCER_SENDRESULT_URL=http://load-balancer:8000/sendTaskResult # embedding variables EMBEDDING_CLOUD_CONFIG_PATH=./embedding/src/cloud/config.py -EMBEDDING_DATABASE_USER=embedding -EMBEDDING_DATABASE_PWD=embedding_password EMBEDDING_CHUNK_SIZE=50 - -# clustering variables -CLUSTERING_DATABASE_USER=embedding -CLUSTERING_DATABASE_PWD=embedding_password - -# tracking variables -TRACKING_DATABASE_USER=tracking -TRACKING_DATABASE_PWD=tracking_password - -# database variables -DATABASE_ROOT_USERNAME=root -DATABASE_ROOT_PASSWORD=root_password From 6fe2e5c5c0c6ab55bce1c2aa527e0361fcd4f698 Mon Sep 17 00:00:00 2001 From: Paul Schwind Date: Wed, 8 Nov 2023 20:16:17 +0100 Subject: [PATCH 2/4] use new commit hash --- docker-compose.cofee.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.cofee.yml b/docker-compose.cofee.yml index 0d6c3a6a6..e2af420f3 100644 --- a/docker-compose.cofee.yml +++ b/docker-compose.cofee.yml @@ -28,7 +28,7 @@ services: # http://localhost/getTask # http://localhost/sendTaskResult load-balancer: - image: ghcr.io/ls1intum/athena/load-balancer:remove-tracking-and-feedback-consistency + image: ghcr.io/ls1intum/athena/load-balancer:ff6c4d0 container_name: cofee-load-balancer restart: unless-stopped expose: @@ -47,7 +47,7 @@ services: - traefik.http.routers.balancer.entrypoints=web segmentation: - image: ghcr.io/ls1intum/athena/segmentation:remove-tracking-and-feedback-consistency + image: ghcr.io/ls1intum/athena/segmentation:ff6c4d0 container_name: cofee-segmentation restart: unless-stopped depends_on: @@ -64,7 +64,7 @@ services: # http://localhost/upload # http://localhost/feedback_consistency embedding: - image: ghcr.io/ls1intum/athena/embedding:remove-tracking-and-feedback-consistency + image: ghcr.io/ls1intum/athena/embedding:ff6c4d0 container_name: cofee-embedding restart: unless-stopped depends_on: @@ -81,7 +81,7 @@ services: - traefik.http.services.cofee-embedding.loadbalancer.server.port=8000 # set service name this way clustering: - image: ghcr.io/ls1intum/athena/clustering:remove-tracking-and-feedback-consistency + image: ghcr.io/ls1intum/athena/clustering:ff6c4d0 container_name: cofee-clustering restart: unless-stopped depends_on: From cf7c53ee04694c8714d65723930da6d1807a9a2f Mon Sep 17 00:00:00 2001 From: Paul Schwind Date: Wed, 8 Nov 2023 21:01:06 +0100 Subject: [PATCH 3/4] log sending error --- module_text_cofee/module_text_cofee/adapter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module_text_cofee/module_text_cofee/adapter.py b/module_text_cofee/module_text_cofee/adapter.py index 19230bddd..c10892c00 100644 --- a/module_text_cofee/module_text_cofee/adapter.py +++ b/module_text_cofee/module_text_cofee/adapter.py @@ -59,7 +59,11 @@ def send_submissions(exercise: Exercise, submissions: List[Submission]): # TODO: remove this again: verify=False, # Ignore SSL errors for now, because athenetest1-01 has an invalid certificate ) - resp.raise_for_status() + try: + resp.raise_for_status() + except requests.exceptions.HTTPError as e: + logger.error("Failed to send submissions to CoFee: %s", e) + raise e logger.info("Submissions sent to CoFee") From 7a3c4dd86bd891c1fd8f122b28b2561b11eac062 Mon Sep 17 00:00:00 2001 From: Paul Schwind Date: Wed, 8 Nov 2023 21:47:36 +0100 Subject: [PATCH 4/4] additional log message --- module_text_cofee/module_text_cofee/adapter.py | 1 + 1 file changed, 1 insertion(+) diff --git a/module_text_cofee/module_text_cofee/adapter.py b/module_text_cofee/module_text_cofee/adapter.py index c10892c00..ff1ab561e 100644 --- a/module_text_cofee/module_text_cofee/adapter.py +++ b/module_text_cofee/module_text_cofee/adapter.py @@ -36,6 +36,7 @@ def get_cofee_url() -> str: def send_submissions(exercise: Exercise, submissions: List[Submission]): """Send submissions to old Athena-CoFee server.""" logger.info("Sending %d submissions to CoFee", len(submissions)) + logger.debug("Sending to %s with submissions: %s", get_cofee_url(), submissions) module_url = os.environ.get("MODULE_URL", f"http://localhost:{get_module_config().port}") resp = requests.post( f"{get_cofee_url()}/submit",