Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the CoFee MongoDB database #177

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions docker-compose.cofee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:ff6c4d0
container_name: cofee-load-balancer
restart: unless-stopped
expose:
Expand All @@ -47,7 +47,7 @@ services:
- traefik.http.routers.balancer.entrypoints=web

segmentation:
image: ghcr.io/ls1intum/athena/segmentation
image: ghcr.io/ls1intum/athena/segmentation:ff6c4d0
container_name: cofee-segmentation
restart: unless-stopped
depends_on:
Expand All @@ -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:ff6c4d0
container_name: cofee-embedding
restart: unless-stopped
depends_on:
- load-balancer
- database
expose:
- 8000
env_file:
Expand All @@ -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:ff6c4d0
container_name: cofee-clustering
restart: unless-stopped
depends_on:
- load-balancer
- database
expose:
- 8000
env_file:
Expand All @@ -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
17 changes: 0 additions & 17 deletions env_example/cofee.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
7 changes: 6 additions & 1 deletion module_text_cofee/module_text_cofee/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -59,7 +60,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")


Expand Down
Loading