From 87f6a045e4d212fd9a370df64ce1199c1d1dd029 Mon Sep 17 00:00:00 2001 From: dtuantran Date: Thu, 21 Dec 2023 16:19:40 +0100 Subject: [PATCH 1/4] Add HTTP_PROXY and WORKER_CONNECTION_TIMEOUT variables --- .env_sample | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.env_sample b/.env_sample index 8c377ec53..2318db37f 100644 --- a/.env_sample +++ b/.env_sample @@ -3,6 +3,13 @@ # ---------------------------------------------------------------------------- SUBMISSION_TEMP_DIR=/tmp/codalab +# ---------------------------------------------------------------------------- +# HTTP proxy support +# ---------------------------------------------------------------------------- +#HTTP_PROXY=http://proxy-host:port +#HTTPS_PROXY=http://proxy-host:port +#NO_PROXY=127.0.0.0/8,10.0.0.0/8,172.0.0.0/8 + # ---------------------------------------------------------------------------- # Storage @@ -94,6 +101,7 @@ RABBITMQ_DEFAULT_PASS=guest RABBITMQ_HOST=rabbit RABBITMQ_PORT=5672 RABBITMQ_MANAGEMENT_PORT=15672 +#WORKER_CONNECTION_TIMEOUT=100000000 # milisecond FLOWER_BASIC_AUTH=root:password FLOWER_PORT=5555 From 1c2a96813b23cd81547d0a6647df26dd2294883c Mon Sep 17 00:00:00 2001 From: dtuantran Date: Thu, 21 Dec 2023 16:20:48 +0100 Subject: [PATCH 2/4] Add consumer_timeout config for rabbitmq --- docker/rabbitmq/rabbitmq.config | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/rabbitmq/rabbitmq.config b/docker/rabbitmq/rabbitmq.config index 27d91d1fc..2414944ad 100644 --- a/docker/rabbitmq/rabbitmq.config +++ b/docker/rabbitmq/rabbitmq.config @@ -1,5 +1,6 @@ [ {rabbit, [ + {consumer_timeout, ${WORKER_CONNECTION_TIMEOUT}}, {tcp_listeners, [{"::", ${RABBITMQ_PORT}}]}, {loopback_users, []} ]}, From 6c8743f6700738c162102321eeccedd7fcfe9987 Mon Sep 17 00:00:00 2001 From: dtuantran Date: Thu, 21 Dec 2023 16:22:35 +0100 Subject: [PATCH 3/4] Update run_django.sh with HTTP_PROXY variables --- docker/run_django.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/run_django.sh b/docker/run_django.sh index e9c9caf4b..5f3fe8b77 100644 --- a/docker/run_django.sh +++ b/docker/run_django.sh @@ -29,6 +29,11 @@ python scripts/initialize_from_fixture.py python manage.py loaddata initial_data.json initialize_site.json initial_team_data.json +# Django needs to remove http proxy variables for working +unset HTTP_PROXY +unset HTTPS_PROXY +unset NO_PROXY + # start development server on public ip interface, on port 8000 PYTHONUNBUFFERED=TRUE gunicorn codalab.wsgi \ --bind django:$DJANGO_PORT \ From 4689e35817e6390cbc5c7791548bdc79f9410dbc Mon Sep 17 00:00:00 2001 From: dtuantran Date: Thu, 21 Dec 2023 16:25:18 +0100 Subject: [PATCH 4/4] Update docker-compose.yml for rabbitmq with consumer_timeout environment variable --- docker-compose.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index c7b55e8a1..ce0b4235c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3' services: # -------------------------------------------------------------------------- # HTTP Server @@ -58,6 +58,7 @@ services: environment: - RABBITMQ_LOGS=/var/log/rabbitmq/output.log - RABBITMQ_SASL_LOGS=/var/log/rabbitmq/output_sasl.log + - WORKER_CONNECTION_TIMEOUT="${WORKER_CONNECTION_TIMEOUT:-100000000}" env_file: .env volumes: - ./docker:/app/docker