From 2873092565487ca11dd3be7273700497469c3ef4 Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Mon, 17 Jul 2023 14:37:24 -0400 Subject: [PATCH 1/7] feat: new authz'd notification service (wip) --- etc/bento.env | 2 +- .../{services => public_services}/notification.conf.tpl | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) rename lib/gateway/{services => public_services}/notification.conf.tpl (76%) diff --git a/etc/bento.env b/etc/bento.env index 675bd639..5ca38d1a 100644 --- a/etc/bento.env +++ b/etc/bento.env @@ -133,7 +133,7 @@ BENTOV2_SERVICE_REGISTRY_CPUS=1 # Notification BENTOV2_NOTIFICATION_IMAGE=ghcr.io/bento-platform/bento_notification_service -BENTOV2_NOTIFICATION_VERSION=2.4.1 +BENTOV2_NOTIFICATION_VERSION=pr-21 BENTOV2_NOTIFICATION_VERSION_DEV=${BENTOV2_NOTIFICATION_VERSION}-dev BENTOV2_NOTIFICATION_CONTAINER_NAME=${BENTOV2_PREFIX}-notification BENTO_NOTIFICATION_NETWORK=${BENTOV2_PREFIX}-notification-net diff --git a/lib/gateway/services/notification.conf.tpl b/lib/gateway/public_services/notification.conf.tpl similarity index 76% rename from lib/gateway/services/notification.conf.tpl rename to lib/gateway/public_services/notification.conf.tpl index 4ea8d198..60015673 100644 --- a/lib/gateway/services/notification.conf.tpl +++ b/lib/gateway/public_services/notification.conf.tpl @@ -1,9 +1,8 @@ -location /api/notification { return 302 https://${BENTOV2_PORTAL_DOMAIN}/api/notification/; } +location /api/notification { return 302 https://${BENTOV2_DOMAIN}/api/notification/; } location /api/notification/ { # Reverse proxy settings include /gateway/conf/proxy.conf; include /gateway/conf/proxy_extra.conf; - include /gateway/conf/proxy_private.conf; # Forward request to notification service rewrite ^ $request_uri; From 2f42a17fc2b63382d68dca57eb400c26fcee7a92 Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Mon, 17 Jul 2023 16:00:33 -0400 Subject: [PATCH 2/7] fix: provide authz service url to notification service --- docker-compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index 6d9f31fc..1ba771da 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -281,6 +281,7 @@ services: - REDIS_HOST=${BENTOV2_REDIS_CONTAINER_NAME} - REDIS_PORT=${BENTOV2_REDIS_INTERNAL_PORT} - INTERNAL_PORT=${BENTOV2_NOTIFICATION_INTERNAL_PORT} + - BENTO_AUTHZ_SERVICE_URL networks: - notification-net - redis-net # For event pub/sub From 80a6a3241ddc2110be34ac7a1b18726decc122db Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Mon, 17 Jul 2023 16:00:55 -0400 Subject: [PATCH 3/7] chore: configure notification debugger in dev mode --- README.md | 2 +- docker-compose.dev.yaml | 3 +++ etc/bento.env | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 103b11d1..f57a097e 100644 --- a/README.md +++ b/README.md @@ -569,7 +569,7 @@ The following is a list of all host port allocations for Bento services in devel | DRS | 7007 | 5682 | | Event relay | 8750 | Unimplemented | | Katsu | 8000 | 5432 | -| Notification | 8500 | Unimplemented | +| Notification | 8500 | 5681 | | Public | 8090 | Unimplemented | | Redis | 6379 | `N/A` | | Service Registry | 5010 | Unimplemented | diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml index e64a6873..f8c4087e 100644 --- a/docker-compose.dev.yaml +++ b/docker-compose.dev.yaml @@ -227,6 +227,9 @@ services: # Runtime - FLASK_DEBUG=True - BENTO_DEBUG=True + ports: + - "${BENTOV2_NOTIFICATION_EXTERNAL_PORT}:${BENTOV2_NOTIFICATION_INTERNAL_PORT}" + - "${BENTO_NOTIFICATION_DEBUGGER_EXTERNAL_PORT}:${BENTO_NOTIFICATION_DEBUGGER_INTERNAL_PORT}" extends: file: docker-compose.yaml service: notification diff --git a/etc/bento.env b/etc/bento.env index 5ca38d1a..114862d0 100644 --- a/etc/bento.env +++ b/etc/bento.env @@ -140,6 +140,8 @@ BENTO_NOTIFICATION_NETWORK=${BENTOV2_PREFIX}-notification-net BENTOV2_NOTIFICATION_INTERNAL_PORT=${BENTO_STD_SERVICE_INTERNAL_PORT} BENTOV2_NOTIFICATION_EXTERNAL_PORT=8500 BENTOV2_NOTIFICATION_VOL_DIR=${BENTOV2_ROOT_DATA_DIR}/notification/data +BENTO_NOTIFICATION_DEBUGGER_EXTERNAL_PORT=5681 +BENTO_NOTIFICATION_DEBUGGER_INTERNAL_PORT=5681 BENTOV2_NOTIFICATION_MEM_LIM=2G BENTOV2_NOTIFICATION_CPUS=2 From 07bc3d4c4b15be5dd0410944d9247d71c705ff12 Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Mon, 17 Jul 2023 16:07:03 -0400 Subject: [PATCH 4/7] fix: notification url template in bento_services --- etc/bento_services.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/bento_services.json b/etc/bento_services.json index f1c3c1cc..331575b4 100644 --- a/etc/bento_services.json +++ b/etc/bento_services.json @@ -25,7 +25,7 @@ }, "notification": { "service_kind": "notification", - "url_template": "{BENTO_PORTAL_PUBLIC_URL}/api/{service_kind}", + "url_template": "{BENTO_PUBLIC_URL}/api/{service_kind}", "repository": "git@github.com:bento-platform/bento_notification_service", "data_service": false }, From 477b5cdf772b291c55b64347e732b3e3409f6615 Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Mon, 17 Jul 2023 16:12:18 -0400 Subject: [PATCH 5/7] chore: set up cors --- docker-compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index 1ba771da..fa37ffd6 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -282,6 +282,7 @@ services: - REDIS_PORT=${BENTOV2_REDIS_INTERNAL_PORT} - INTERNAL_PORT=${BENTOV2_NOTIFICATION_INTERNAL_PORT} - BENTO_AUTHZ_SERVICE_URL + - CORS_ORIGINS=${BENTOV2_PUBLIC_URL};${BENTOV2_PORTAL_PUBLIC_URL} networks: - notification-net - redis-net # For event pub/sub From d3842257cfa684890a53664c0b1ce670b6b4adae Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Mon, 17 Jul 2023 16:29:40 -0400 Subject: [PATCH 6/7] set notif image version to edge --- etc/bento.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/bento.env b/etc/bento.env index 114862d0..77bf4355 100644 --- a/etc/bento.env +++ b/etc/bento.env @@ -133,7 +133,7 @@ BENTOV2_SERVICE_REGISTRY_CPUS=1 # Notification BENTOV2_NOTIFICATION_IMAGE=ghcr.io/bento-platform/bento_notification_service -BENTOV2_NOTIFICATION_VERSION=pr-21 +BENTOV2_NOTIFICATION_VERSION=edge BENTOV2_NOTIFICATION_VERSION_DEV=${BENTOV2_NOTIFICATION_VERSION}-dev BENTOV2_NOTIFICATION_CONTAINER_NAME=${BENTOV2_PREFIX}-notification BENTO_NOTIFICATION_NETWORK=${BENTOV2_PREFIX}-notification-net From b2a620686b525c5e32349e0f7d92ea63007abdfa Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Tue, 18 Jul 2023 09:53:21 -0400 Subject: [PATCH 7/7] chore: bump notification to 3.0.0 --- etc/bento.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/bento.env b/etc/bento.env index 77bf4355..981b9ba7 100644 --- a/etc/bento.env +++ b/etc/bento.env @@ -133,7 +133,7 @@ BENTOV2_SERVICE_REGISTRY_CPUS=1 # Notification BENTOV2_NOTIFICATION_IMAGE=ghcr.io/bento-platform/bento_notification_service -BENTOV2_NOTIFICATION_VERSION=edge +BENTOV2_NOTIFICATION_VERSION=3.0.0 BENTOV2_NOTIFICATION_VERSION_DEV=${BENTOV2_NOTIFICATION_VERSION}-dev BENTOV2_NOTIFICATION_CONTAINER_NAME=${BENTOV2_PREFIX}-notification BENTO_NOTIFICATION_NETWORK=${BENTOV2_PREFIX}-notification-net