From f9b73589de6119fda55aa6ab5eb4d59f13192574 Mon Sep 17 00:00:00 2001 From: Tomer Shvadron Date: Wed, 9 Oct 2024 11:35:56 +0300 Subject: [PATCH] feat: removed websocket-service uses (#2760) --- .github/workflows/publish-websocket.yml | 118 ------------------------ deploy/docker-compose-dev.yml | 18 +--- deploy/helm/example.values.yaml | 39 -------- package.json | 2 +- scripts/init.js | 1 - 5 files changed, 3 insertions(+), 175 deletions(-) delete mode 100644 .github/workflows/publish-websocket.yml diff --git a/.github/workflows/publish-websocket.yml b/.github/workflows/publish-websocket.yml deleted file mode 100644 index fd000de28e..0000000000 --- a/.github/workflows/publish-websocket.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: Publish websocket image - -on: - workflow_dispatch: - push: - paths: - # Run this pipeline only if there are changes in specified path - - "services/websocket-service/**" - branches: - - dev - - test - - prod - - staging - - sb - - demo - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository_owner }}/websocket-service - -jobs: - build-and-push-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Install jq - run: sudo apt-get install jq - - - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Get package version from package.json - id: get_version - run: | - PACKAGE_VERSION=$(jq -r '.version' services/websocket-service/package.json) - echo "::set-output name=version::$PACKAGE_VERSION" - - - name: Print the version - run: echo "The version was ${{ steps.get_version.outputs.version }}" - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - with: - platforms: 'arm64,arm' - - - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata for non Prod Docker images - if: github.ref != 'refs/heads/prod' - id: branchmeta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=raw,value=${{ github.head_ref || github.ref_name }} - type=raw,value=commit-${{ github.sha }}-${{ github.head_ref || github.ref_name }} - type=raw,value=${{ steps.get_version.outputs.version }}-${{ github.head_ref || github.ref_name }} - - - name: Build and push Docker image for non Prod - if: github.ref != 'refs/heads/prod' - uses: docker/build-push-action@v4 - with: - context: services/websocket-service - platforms: linux/amd64 - push: true - cache-from: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.head_ref || github.ref_name }}' - tags: ${{ steps.branchmeta.outputs.tags }} - - - name: Extract metadata (tags, labels) for prod Docker images - if: github.ref == 'refs/heads/prod' - # This branch will have the tag latest - id: prodmeta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=raw,value=prod - type=raw,value=commit-${{ github.sha }}-prod - type=raw,value=${{ steps.get_version.outputs.version }}-prod - type=raw,value=latest - - - name: Build and push Docker image for Prod - if: github.ref == 'refs/heads/prod' - uses: docker/build-push-action@v4 - with: - context: services/websocket-service - platforms: linux/amd64 - push: true - cache-from: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.head_ref || github.ref_name }}' - tags: ${{ steps.prodmeta.outputs.tags }} - - - name: Scan Docker Image - uses: aquasecurity/trivy-action@master - with: - image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.head_ref || github.ref_name }}' - format: 'table' - ignore-unfixed: true - exit-code: 1 - vuln-type: 'os,library' - severity: 'CRITICAL' diff --git a/deploy/docker-compose-dev.yml b/deploy/docker-compose-dev.yml index b1dd8e75d6..31fc501eaf 100644 --- a/deploy/docker-compose-dev.yml +++ b/deploy/docker-compose-dev.yml @@ -12,7 +12,7 @@ services: ports: - ${BACKOFFICE_PORT}:${BACKOFFICE_PORT} depends_on: - - service + - service restart: on-failure headlessservice: volumes: @@ -27,7 +27,7 @@ services: - ${HEADLESS_SVC_PORT}:${HEADLESS_SVC_PORT} depends_on: - service - restart: on-failure + restart: on-failure workflows-dashboard: volumes: - ../apps/workflows-dashboard/:/app @@ -42,20 +42,6 @@ services: depends_on: - service restart: on-failure - websocket-service: - volumes: - - ../services/websocket-service/:/app - - /app/node_modules - build: - context: ../services/websocket-service - target: "dev" - args: - NPM_LOG_LEVEL: notice - ports: - - ${WEBSOCKET_SVC_PORT}:${WEBSOCKET_SVC_PORT} - depends_on: - - service - restart: on-failure service: volumes: - ../services/workflows-service/:/app diff --git a/deploy/helm/example.values.yaml b/deploy/helm/example.values.yaml index 9376416308..863e3fe624 100644 --- a/deploy/helm/example.values.yaml +++ b/deploy/helm/example.values.yaml @@ -171,45 +171,6 @@ workflowsdashboard: # hosts: # - workflowdashboard.ballerine.io -websocketService: - enabled: true - replicas: 1 - strategyType: RollingUpdate - updateStrategy: - maxSurge: 1 - maxUnavailable: '0' - nameOverride: websocketservice - service: - port: 3500 - type: ClusterIP - protocol: TCP - image: - registry: ghcr.io - repository: 'ballerine-io/websocket-service' - pullPolicy: Always - tag: "dev" - ingress: - enabled: true - className: "nginx" - pathtype: Prefix - annotations: - kubernetes.io/ingress.class: nginx - ingress.annotations.service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "" - # acme.cert-manager.io/http01-edit-in-place: "true" - # cert-manager.io/cluster-issuer: letsencrypt-staging - # cert-manager.io/common-name: websocket.ballerine.io - # nginx.ingress.kubernetes.io/force-ssl-redirect: "true" - nginx.ingress.kubernetes.io/limit-rps: "15" - tls : {} - hosts: - - host: websocket.dev.eu.ballerine.app - paths: - - path: / - applicationConfig: - PORT: 3500 - NODE_ENV: development - COMPOSE_PROJECT_NAME: ballerine-x - workflowService: enabled: true replicas: 1 diff --git a/package.json b/package.json index cf13d4d3c0..101df7d69d 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "playwright:install": "nx run-many --target=playwright:install", "dev": "nx run-many --target=dev --projects=@ballerine/workflows-service,@ballerine/backoffice-v2", "start": "nx run-many --target=start --projects=@ballerine/web-ui-sdk", - "build": "nx run-many --target=build --projects=@ballerine/workflow-browser-sdk,@ballerine/workflow-core,@ballerine/workflow-node-sdk,@ballerine/rules-engine-lib,@ballerine/common,@ballerine/workflows-service,@ballerine/websocket-service,@ballerine/ui,@ballerine/blocks,@ballerine/react-pdf-toolkit", + "build": "nx run-many --target=build --projects=@ballerine/workflow-browser-sdk,@ballerine/workflow-core,@ballerine/workflow-node-sdk,@ballerine/rules-engine-lib,@ballerine/common,@ballerine/workflows-service,@ballerine/ui,@ballerine/blocks,@ballerine/react-pdf-toolkit", "web-ui-sdk:dev": "nx run @ballerine/web-ui-sdk:dev", "web-ui-sdk:start": "nx run @ballerine/web-ui-sdk:start", "workflows-service:start": "nx run @ballerine/workflows-service:start", diff --git a/scripts/init.js b/scripts/init.js index 402d059e15..512c22a262 100755 --- a/scripts/init.js +++ b/scripts/init.js @@ -27,7 +27,6 @@ console.log('🍎 preparing environment'); const directories = [ 'services/workflows-service', - 'services/websocket-service', 'apps/backoffice-v2', 'apps/kyb-app', 'apps/workflows-dashboard',