From 6e0ca3645b7a59e837688bd9356f8d4644eba00b Mon Sep 17 00:00:00 2001 From: "Zhou (Joe) Yuan" Date: Thu, 27 Jan 2022 15:44:12 -0500 Subject: [PATCH 1/5] Use cells-gateway as upstream --- nginx/conf.d-prod/cells-api.conf | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nginx/conf.d-prod/cells-api.conf b/nginx/conf.d-prod/cells-api.conf index a16c2f2..f36237a 100644 --- a/nginx/conf.d-prod/cells-api.conf +++ b/nginx/conf.d-prod/cells-api.conf @@ -31,14 +31,14 @@ server { # Only the PROD version of cells api is routed by gateway # The cells api on DEV and TEST are running on their own nginx instances, no STAGE version # Calls to the PROD version of cells api (cells.api.hubmapconsortium.org) come to - # gateway directly and get forwarded to private IP 172.31.7.108 (cells-internal.api.hubmapconsortium.org) - # The cells api PROD is exposed on port 5000 via uwsgi - uwsgi_pass uwsgi://172.31.7.108:5000; - include uwsgi_params; - uwsgi_param HTTP_X_FORWARDED_PROTO $scheme; - uwsgi_param UWSGI_SCHEME $scheme; - uwsgi_read_timeout 600s; - uwsgi_send_timeout 600s; + # gateway directly and get forwarded to their nginx gateway/load balancer http://cells-gateway.cmu.hubmapconsortium.org (no https) + proxy_pass http://cells-gateway.cmu.hubmapconsortium.org; + + # Increase timeout to 10 minutes until a real solution is ready + proxy_connect_timeout 600; + keepalive_timeout 600 600; + proxy_read_timeout 600; + proxy_send_timeout 600; } } From 8735b609127a0206d29fecdd2f1e51a7cb68e0ea Mon Sep 17 00:00:00 2001 From: "Zhou (Joe) Yuan" Date: Thu, 27 Jan 2022 15:45:36 -0500 Subject: [PATCH 2/5] Add timeout --- nginx/conf.d-prod/portal-ui.conf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nginx/conf.d-prod/portal-ui.conf b/nginx/conf.d-prod/portal-ui.conf index 05f59b7..22b2bec 100644 --- a/nginx/conf.d-prod/portal-ui.conf +++ b/nginx/conf.d-prod/portal-ui.conf @@ -45,6 +45,13 @@ server { # gzip_http_version sets the minimum HTTP version of a request required to compress a response to 1.1 by default. # proxy_http_version needs to be >= that, but is 1.0 by default. proxy_http_version 1.1; + + # Due to cells-api slowness + # Increase timeout to 10 minutes until a real solution is ready + proxy_connect_timeout 600; + keepalive_timeout 600 600; + proxy_read_timeout 600; + proxy_send_timeout 600; } } From 7598c43a06493b4e69a3fc2585df7deb5dbfd3eb Mon Sep 17 00:00:00 2001 From: "Zhou (Joe) Yuan" Date: Fri, 28 Jan 2022 09:09:10 -0500 Subject: [PATCH 3/5] Bump version to 2.0.22 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7d5624f..1b8629f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.21 +2.0.22 From 446b972f8ac34e183cbf7c1617361053826b28d9 Mon Sep 17 00:00:00 2001 From: yuanzhou Date: Fri, 28 Jan 2022 09:20:14 -0500 Subject: [PATCH 4/5] Use postgres_connection as key --- hubmap-auth/src/app.py | 2 +- hubmap-auth/src/templates/status.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hubmap-auth/src/app.py b/hubmap-auth/src/app.py index d0507ea..c8c2017 100644 --- a/hubmap-auth/src/app.py +++ b/hubmap-auth/src/app.py @@ -338,7 +338,7 @@ def get_status_data(): FILE_ASSETS_STATUS = 'file_assets_status' BRANCH = 'branch' COMMIT = 'commit' - POSTGRES_CONNECTION = 'Postgres connection' + POSTGRES_CONNECTION = 'postgres_connection' # All API services have api_auth status (meaning the gateway's API auth is working) # We won't get other status if api_auth fails diff --git a/hubmap-auth/src/templates/status.html b/hubmap-auth/src/templates/status.html index ed25a49..86f11c5 100644 --- a/hubmap-auth/src/templates/status.html +++ b/hubmap-auth/src/templates/status.html @@ -158,7 +158,7 @@

CELLS API

{% if data.cells_api["Postgres connection"] %} -

Postgres Connection: {{ data.cells_api["Postgres connection"] }}

+

Postgres Connection: {{ data.cells_api.postgres_connection }}

{% endif %} {% endif %} From c22bf1bcca276cde16ca15e8579cbaaa2ead00bc Mon Sep 17 00:00:00 2001 From: yuanzhou Date: Fri, 28 Jan 2022 09:22:34 -0500 Subject: [PATCH 5/5] Use 10 minutes timeout for portal-ui proxy --- nginx/conf.d-dev/portal-ui.conf | 7 +++++++ nginx/conf.d-stage/portal-ui.conf | 7 +++++++ nginx/conf.d-stage/prod-portal-ui.conf | 11 +++++++++++ nginx/conf.d-test/portal-ui.conf | 7 +++++++ 4 files changed, 32 insertions(+) diff --git a/nginx/conf.d-dev/portal-ui.conf b/nginx/conf.d-dev/portal-ui.conf index 2514518..5c229cd 100644 --- a/nginx/conf.d-dev/portal-ui.conf +++ b/nginx/conf.d-dev/portal-ui.conf @@ -45,6 +45,13 @@ server { # gzip_http_version sets the minimum HTTP version of a request required to compress a response to 1.1 by default. # proxy_http_version needs to be >= that, but is 1.0 by default. proxy_http_version 1.1; + + # Due to cells-api slowness + # Increase timeout to 10 minutes until a real solution is ready + proxy_connect_timeout 600; + keepalive_timeout 600 600; + proxy_read_timeout 600; + proxy_send_timeout 600; } } diff --git a/nginx/conf.d-stage/portal-ui.conf b/nginx/conf.d-stage/portal-ui.conf index f7fdd83..5a78f29 100644 --- a/nginx/conf.d-stage/portal-ui.conf +++ b/nginx/conf.d-stage/portal-ui.conf @@ -45,6 +45,13 @@ server { # gzip_http_version sets the minimum HTTP version of a request required to compress a response to 1.1 by default. # proxy_http_version needs to be >= that, but is 1.0 by default. proxy_http_version 1.1; + + # Due to cells-api slowness + # Increase timeout to 10 minutes until a real solution is ready + proxy_connect_timeout 600; + keepalive_timeout 600 600; + proxy_read_timeout 600; + proxy_send_timeout 600; } } diff --git a/nginx/conf.d-stage/prod-portal-ui.conf b/nginx/conf.d-stage/prod-portal-ui.conf index f0ac8dd..0323395 100644 --- a/nginx/conf.d-stage/prod-portal-ui.conf +++ b/nginx/conf.d-stage/prod-portal-ui.conf @@ -34,6 +34,17 @@ server { # (Plain "$host" does not include port.) proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; + + # gzip_http_version sets the minimum HTTP version of a request required to compress a response to 1.1 by default. + # proxy_http_version needs to be >= that, but is 1.0 by default. + proxy_http_version 1.1; + + # Due to cells-api slowness + # Increase timeout to 10 minutes until a real solution is ready + proxy_connect_timeout 600; + keepalive_timeout 600 600; + proxy_read_timeout 600; + proxy_send_timeout 600; } } diff --git a/nginx/conf.d-test/portal-ui.conf b/nginx/conf.d-test/portal-ui.conf index 3876ca9..824a686 100644 --- a/nginx/conf.d-test/portal-ui.conf +++ b/nginx/conf.d-test/portal-ui.conf @@ -45,6 +45,13 @@ server { # gzip_http_version sets the minimum HTTP version of a request required to compress a response to 1.1 by default. # proxy_http_version needs to be >= that, but is 1.0 by default. proxy_http_version 1.1; + + # Due to cells-api slowness + # Increase timeout to 10 minutes until a real solution is ready + proxy_connect_timeout 600; + keepalive_timeout 600 600; + proxy_read_timeout 600; + proxy_send_timeout 600; } }