From 224824f1f173329a1ece24fd6e087167384af2e3 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Mon, 25 Dec 2023 13:09:41 +0000 Subject: [PATCH] Remove notification service and related configurations --- .github/workflows/compile.yml | 14 ----- .github/workflows/docker-build.yml | 17 ------ .github/workflows/release.yml | 60 ------------------ .github/workflows/test-release.yaml | 61 ------------------- .vscode/launch.json | 28 --------- .../oneuptime/templates/notification.yaml | 15 ----- Nginx/default.conf.template | 7 +-- config.example.env | 2 - docker-compose.base.yml | 36 +++-------- docker-compose.dev.yml | 24 -------- docker-compose.yml | 7 +-- 11 files changed, 12 insertions(+), 259 deletions(-) delete mode 100644 HelmChart/Public/oneuptime/templates/notification.yaml diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 33c157bf89..7e671f5508 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -138,20 +138,6 @@ jobs: - run: cd Home && npm install && npm run compile && npm run dep-check - compile-notification: - runs-on: ubuntu-latest - env: - CI_PIPELINE_ID: ${{github.run_number}} - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 18.3.0 - - run: cd Common && npm install - - run: cd Model && npm install - - run: cd CommonServer && npm install - - run: cd Notification && npm install && npm run compile && npm run dep-check - compile-model: runs-on: ubuntu-latest env: diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 03d2299c48..b6ba471da6 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -133,23 +133,6 @@ jobs: - name: build docker image run: sudo docker build -f ./Home/Dockerfile . - - docker-build-notification: - runs-on: ubuntu-latest - env: - CI_PIPELINE_ID: ${{github.run_number}} - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Preinstall - run: npm run prerun - - # build image for mail service - - name: build docker image - run: sudo docker build -f ./Notification/Dockerfile . - - docker-build-probe: runs-on: ubuntu-latest env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc1d12d62b..3bd47b669d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -570,66 +570,6 @@ jobs: GIT_SHA=${{ github.sha }} APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}} - notification-docker-image-deploy: - needs: generate-build-number - runs-on: ubuntu-latest - steps: - - name: Docker Meta - id: meta - uses: docker/metadata-action@v4 - with: - images: | - oneuptime/notification - ghcr.io/oneuptime/notification - tags: | - type=raw,value=release,enable=true - type=semver,value=7.0.${{needs.generate-build-number.outputs.build_number}},pattern={{version}},enable=true - - - uses: actions/checkout@v4 - with: - ref: ${{ github.ref }} - - - uses: actions/setup-node@v2 - with: - node-version: 18.3.0 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Generate Dockerfile from Dockerfile.tpl - run: npm run prerun - - # Build and deploy notification. - - - name: Login to Docker Hub - uses: docker/login-action@v2.2.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2.2.0 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v4 - with: - file: ./Notification/Dockerfile - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - build-args: | - GIT_SHA=${{ github.sha }} - APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}} - probe-docker-image-deploy: needs: generate-build-number runs-on: ubuntu-latest diff --git a/.github/workflows/test-release.yaml b/.github/workflows/test-release.yaml index 73534a7eb3..3a671494d0 100644 --- a/.github/workflows/test-release.yaml +++ b/.github/workflows/test-release.yaml @@ -511,67 +511,6 @@ jobs: GIT_SHA=${{ github.sha }} APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}} - notification-docker-image-deploy: - needs: generate-build-number - runs-on: ubuntu-latest - steps: - - name: Docker Meta - id: meta - uses: docker/metadata-action@v4 - with: - images: | - oneuptime/notification - ghcr.io/oneuptime/notification - tags: | - type=raw,value=test,enable=true - type=semver,value=7.0.${{needs.generate-build-number.outputs.build_number}}-test,pattern={{version}},enable=true - - - - uses: actions/checkout@v4 - with: - ref: ${{ github.ref }} - - - uses: actions/setup-node@v2 - with: - node-version: 18.3.0 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Generate Dockerfile from Dockerfile.tpl - run: npm run prerun - - # Build and deploy notification. - - - name: Login to Docker Hub - uses: docker/login-action@v2.2.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2.2.0 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v4 - with: - file: ./Notification/Dockerfile - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - build-args: | - GIT_SHA=${{ github.sha }} - APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}} - probe-docker-image-deploy: needs: generate-build-number runs-on: ubuntu-latest diff --git a/.vscode/launch.json b/.vscode/launch.json index 98ad45e6f9..d63bacf556 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -111,20 +111,6 @@ "restart": true, "autoAttachChildProcesses": true }, - { - "address": "127.0.0.1", - "localRoot": "${workspaceFolder}/Notification", - "name": "Notification: Debug with Docker", - "port": 9111, - "remoteRoot": "/usr/src/app", - "request": "attach", - "skipFiles": [ - "/**" - ], - "type": "node", - "restart": true, - "autoAttachChildProcesses": true - }, { "address": "127.0.0.1", "localRoot": "${workspaceFolder}/Realtime", @@ -181,20 +167,6 @@ "restart": true, "autoAttachChildProcesses": true }, - { - "address": "127.0.0.1", - "localRoot": "${workspaceFolder}/Identity", - "name": "Identity: Debug with Docker", - "port": 9132, - "remoteRoot": "/usr/src/app", - "request": "attach", - "skipFiles": [ - "/**" - ], - "type": "node", - "restart": true, - "autoAttachChildProcesses": true - }, { "address": "127.0.0.1", "localRoot": "${workspaceFolder}/Identity", diff --git a/HelmChart/Public/oneuptime/templates/notification.yaml b/HelmChart/Public/oneuptime/templates/notification.yaml deleted file mode 100644 index 943a25074c..0000000000 --- a/HelmChart/Public/oneuptime/templates/notification.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# OneUptime notification Deployment -{{- $notificationEnv := dict "PORT" $.Values.port.notification "SMS_HIGH_RISK_COST_IN_CENTS" $.Values.billing.smsHighRiskValueInCents "CALL_HIGH_RISK_COST_IN_CENTS_PER_MINUTE" $.Values.billing.callHighRiskValueInCentsPerMinute "SMS_DEFAULT_COST_IN_CENTS" $.Values.billing.smsDefaultValueInCents "CALL_DEFAULT_COST_IN_CENTS_PER_MINUTE" $.Values.billing.callDefaultValueInCentsPerMinute "INTERNAL_SMTP_EMAIL" $.Values.internalSmtp.email "INTERNAL_SMTP_PASSWORD" "internal_smtp_password" -}} -{{- $notificationDeploymentArgs :=dict "IsServer" true "ServiceName" "notification" "Port" $.Values.port.notification "Release" $.Release "Values" $.Values "Env" $notificationEnv -}} -{{- include "oneuptime.deployment" $notificationDeploymentArgs }} ---- - -# OneUptime notification Service -{{- $notificationServiceArgs := dict "ServiceName" "notification" "Port" $.Values.port.notification "Release" $.Release "Values" $.Values -}} -{{- include "oneuptime.service" $notificationServiceArgs }} ---- - -# OneUptime notification autoscaler -{{- $notificationAutoScalerArgs := dict "ServiceName" "notification" "Release" $.Release "Values" $.Values -}} -{{- include "oneuptime.autoscaler" $notificationAutoScalerArgs }} ---- \ No newline at end of file diff --git a/Nginx/default.conf.template b/Nginx/default.conf.template index 9ec510537b..cad48596c9 100644 --- a/Nginx/default.conf.template +++ b/Nginx/default.conf.template @@ -39,9 +39,6 @@ upstream workers { server ${SERVER_WORKERS_HOSTNAME}:${WORKERS_PORT} weight=10 max_fails=3 fail_timeout=30s; } -upstream notification { - server ${SERVER_NOTIFICATION_HOSTNAME}:${NOTIFICATION_PORT} weight=10 max_fails=3 fail_timeout=30s; -} upstream otel-collector { server ${OTEL_COLLECTOR_HOSTNAME}:${OTEL_COLLECTOR_PORT} weight=10 max_fails=3 fail_timeout=30s; @@ -341,7 +338,7 @@ server { proxy_pass http://otel-collector; } - location /notification { + location /notification/ { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -351,7 +348,7 @@ server { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; - proxy_pass http://notification; + proxy_pass http://dashboard-api/api/notification/; } location /ingestor { diff --git a/config.example.env b/config.example.env index 1f386b18f2..9bdcb72ba2 100644 --- a/config.example.env +++ b/config.example.env @@ -82,7 +82,6 @@ SERVER_ALERT_HOSTNAME=alert SERVER_INGESTOR_HOSTNAME=ingestor SERVER_TEST_SERVER_HOSTNAME=test-server SERVER_HOME_HOSTNAME=home -SERVER_NOTIFICATION_HOSTNAME=hostname SERVER_WORKERS_HOSTNAME=workers SERVER_STATUS_PAGE_HOSTNAME=status-page SERVER_DASHBOARD_HOSTNAME=dashboard @@ -100,7 +99,6 @@ INGESTOR_PORT=3400 PROBE_PORT=3500 TEST_SERVER_PORT=3800 HOME_PORT=1444 -NOTIFICATION_PORT=3191 REALTIME_PORT=3300 WORKERS_PORT=3452 ACCOUNTS_PORT=3003 diff --git a/docker-compose.base.yml b/docker-compose.base.yml index d005d80f89..a7f2c8fe41 100644 --- a/docker-compose.base.yml +++ b/docker-compose.base.yml @@ -23,7 +23,6 @@ x-common-variables: &common-variables SERVER_INGESTOR_HOSTNAME: ingestor SERVER_TEST_SERVER_HOSTNAME: test-server SERVER_HOME_HOSTNAME: home - SERVER_NOTIFICATION_HOSTNAME: notification SERVER_WORKERS_HOSTNAME: workers SERVER_STATUS_PAGE_HOSTNAME: status-page SERVER_DASHBOARD_HOSTNAME: dashboard @@ -41,7 +40,6 @@ x-common-variables: &common-variables PROBE_PORT: ${PROBE_PORT} TEST_SERVER_PORT: ${TEST_SERVER_PORT} HOME_PORT: ${HOME_PORT} - NOTIFICATION_PORT: ${NOTIFICATION_PORT} REALTIME_PORT: ${REALTIME_PORT} WORKERS_PORT: ${WORKERS_PORT} ACCOUNTS_PORT: ${ACCOUNTS_PORT} @@ -144,22 +142,6 @@ services: - oneuptime volumes: - postgres:/var/lib/postgresql/data - - notification: - networks: - - oneuptime - restart: always - environment: - <<: *common-server-variables - PORT: ${NOTIFICATION_PORT} - SMS_DEFAULT_COST_IN_CENTS: ${SMS_DEFAULT_COST_IN_CENTS} - CALL_DEFAULT_COST_IN_CENTS_PER_MINUTE: ${CALL_DEFAULT_COST_IN_CENTS_PER_MINUTE} - SMS_HIGH_RISK_COST_IN_CENTS: ${SMS_HIGH_RISK_COST_IN_CENTS} - CALL_HIGH_RISK_COST_IN_CENTS_PER_MINUTE: ${CALL_HIGH_RISK_COST_IN_CENTS_PER_MINUTE} - INTERNAL_SMTP_EMAIL: ${INTERNAL_SMTP_EMAIL} - INTERNAL_SMTP_PASSWORD: ${INTERNAL_SMTP_PASSWORD} - depends_on: - - haraka accounts: networks: @@ -220,11 +202,11 @@ services: depends_on: - redis - postgres - - notification + links: - redis - postgres - - notification + @@ -238,11 +220,11 @@ services: depends_on: - redis - postgres - - notification + links: - redis - postgres - - notification + workers: @@ -255,10 +237,10 @@ services: ENVIRONMENT: ${ENVIRONMENT} depends_on: - postgres - - notification + links: - postgres - - notification + volumes: - ./Certs:/usr/src/Certs @@ -320,11 +302,11 @@ services: depends_on: - redis - postgres - - notification + links: - redis - postgres - - notification + @@ -352,7 +334,7 @@ services: - dashboard-api - dashboard - home - - notification + - otel-collector restart: always networks: diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index fdf0568795..46c81f8b14 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -32,30 +32,6 @@ services: extends: file: ./docker-compose.base.yml service: postgres - - notification: - extends: - file: ./docker-compose.base.yml - service: notification - ports: - - 9111:9229 # Debugging port. - volumes: - - ./Notification:/usr/src/app - # Use node modules of the container and not host system. - # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder - - /usr/src/app/node_modules/ - - ./Common:/usr/src/Common - - ./Model:/usr/src/Model - - ./CommonServer:/usr/src/CommonServer - - ./CommonUI:/usr/src/CommonUI - - /usr/src/Common/node_modules/ - - /usr/src/CommonUI/node_modules/ - - /usr/src/CommonServer/node_modules/ - - /usr/src/Model/node_modules/ - build: - network: host - context: . - dockerfile: ./Notification/Dockerfile otel-collector: diff --git a/docker-compose.yml b/docker-compose.yml index 080e8436f1..40f5d49f3b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,12 +26,7 @@ services: extends: file: ./docker-compose.base.yml service: postgres - - notification: - image: oneuptime/notification:${APP_TAG} - extends: - file: ./docker-compose.base.yml - service: notification + otel-collector: image: oneuptime/otel-collector:${APP_TAG}