From e31185154b2fb0a7548fbc3b5256dec966885b72 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Thu, 8 Jun 2023 16:59:13 +0200 Subject: [PATCH 01/30] Add GitHub workflows --- .github/workflows/release-digma.yml | 33 ++++++++++ .github/workflows/reusable-push-to-docker.yml | 65 +++++++++++++++++++ Dockerfile | 3 + 3 files changed, 101 insertions(+) create mode 100644 .github/workflows/release-digma.yml create mode 100644 .github/workflows/reusable-push-to-docker.yml diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml new file mode 100644 index 0000000000..a180da7727 --- /dev/null +++ b/.github/workflows/release-digma.yml @@ -0,0 +1,33 @@ +name: Publish Digma release + +# Controls when the workflow will run +on: + workflow_dispatch: + release: + types: [released] + +# permissions are needed if pushing to ghcr.io +permissions: + packages: write + +jobs: + build: + uses: digma-ai/digma-jaeger-ui/.github/workflows/reusable-push-to-docker.yml@main + with: + images: | + digmatic/jaeger-ui + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + # set latest tag for digma branch + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'digma') }} + dockerfile: ./Dockerfile + secrets: + GH_PAT: ${{ secrets.GH_PAT }} + REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/reusable-push-to-docker.yml b/.github/workflows/reusable-push-to-docker.yml new file mode 100644 index 0000000000..74e12c2779 --- /dev/null +++ b/.github/workflows/reusable-push-to-docker.yml @@ -0,0 +1,65 @@ +name: Reusable build and push docker image + +on: + workflow_call: + inputs: + images: + required: true + type: string + tags: + required: true + type: string + dockerfile: + required: true + type: string + secrets: + GH_PAT: + required: true + REGISTRY_USERNAME: + required: true + REGISTRY_PASSWORD: + required: true + +jobs: + build-and-push-docker-image: + name: Build and push docker image + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + token: ${{ secrets.GH_PAT }} + + # https://github.com/docker/setup-qemu-action + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Docker meta + id: metadata # you'll use this in the next step + uses: docker/metadata-action@v3 + with: + # list of Docker images to use as base name for tags + images: ${{ inputs.images }} + # Docker tags based on the following events/attributes + tags: ${{ inputs.tags }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + file: ${{ inputs.dockerfile }} + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.metadata.outputs.tags }} + labels: ${{ steps.metadata.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index b5ce74e1e3..68a835984c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,12 @@ FROM node:16.20.0 AS build WORKDIR /app +#Copy files with dependency metadata first +#to check them for changes and invalidate the Docker cache COPY package.json ./ COPY yarn.lock ./ COPY packages/jaeger-ui/package.json ./packages/jaeger-ui/ + COPY . . RUN yarn install --frozen-lockfile # RUN yarn prettier-lint From 4b595382405c67f04a323d592b6b6f6fff33b3e5 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Mon, 12 Jun 2023 01:24:26 +0200 Subject: [PATCH 02/30] Add event trigger on pull request --- .github/workflows/release-digma.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index a180da7727..1127668163 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -5,6 +5,7 @@ on: workflow_dispatch: release: types: [released] + pull_request: # permissions are needed if pushing to ghcr.io permissions: From 4901862d82206dea1d7ae40665963a8fbab48058 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Mon, 12 Jun 2023 01:27:43 +0200 Subject: [PATCH 03/30] Fix branch --- .github/workflows/release-digma.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index 1127668163..57361b4262 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -13,7 +13,7 @@ permissions: jobs: build: - uses: digma-ai/digma-jaeger-ui/.github/workflows/reusable-push-to-docker.yml@main + uses: digma-ai/digma-jaeger-ui/.github/workflows/reusable-push-to-docker.yml@feature/docker with: images: | digmatic/jaeger-ui From ec17231b4e150a9100c7c99c5eae5fb4cbb11d51 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Mon, 12 Jun 2023 01:31:05 +0200 Subject: [PATCH 04/30] Fix workflow path --- .github/workflows/release-digma.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index 57361b4262..00eeb2f9c1 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -13,7 +13,7 @@ permissions: jobs: build: - uses: digma-ai/digma-jaeger-ui/.github/workflows/reusable-push-to-docker.yml@feature/docker + uses: digma-ai/jaeger-ui/.github/workflows/reusable-push-to-docker.yml@feature/docker with: images: | digmatic/jaeger-ui From 6447cb75a5afd555cc182fa588a4cbbe6cdd4493 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Mon, 12 Jun 2023 16:26:41 +0200 Subject: [PATCH 05/30] Remove token input for checkout --- .github/workflows/reusable-push-to-docker.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/reusable-push-to-docker.yml b/.github/workflows/reusable-push-to-docker.yml index 74e12c2779..79a416139e 100644 --- a/.github/workflows/reusable-push-to-docker.yml +++ b/.github/workflows/reusable-push-to-docker.yml @@ -27,8 +27,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - with: - token: ${{ secrets.GH_PAT }} # https://github.com/docker/setup-qemu-action - name: Set up QEMU From 76dac0b5d47f1089bb42e4be5585e116a441e5eb Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Mon, 12 Jun 2023 18:36:09 +0200 Subject: [PATCH 06/30] Increase yarn network timeout --- .github/workflows/release-digma.yml | 1 - .github/workflows/reusable-push-to-docker.yml | 2 -- Dockerfile | 6 +++--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index 00eeb2f9c1..d0947abebd 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -29,6 +29,5 @@ jobs: type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'digma') }} dockerfile: ./Dockerfile secrets: - GH_PAT: ${{ secrets.GH_PAT }} REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/reusable-push-to-docker.yml b/.github/workflows/reusable-push-to-docker.yml index 79a416139e..7390132528 100644 --- a/.github/workflows/reusable-push-to-docker.yml +++ b/.github/workflows/reusable-push-to-docker.yml @@ -13,8 +13,6 @@ on: required: true type: string secrets: - GH_PAT: - required: true REGISTRY_USERNAME: required: true REGISTRY_PASSWORD: diff --git a/Dockerfile b/Dockerfile index 68a835984c..11dce2ce82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,14 +2,14 @@ FROM node:16.20.0 AS build WORKDIR /app -#Copy files with dependency metadata first -#to check them for changes and invalidate the Docker cache +# Copy files with dependency metadata first +# to check them for changes and invalidate the Docker cache COPY package.json ./ COPY yarn.lock ./ COPY packages/jaeger-ui/package.json ./packages/jaeger-ui/ COPY . . -RUN yarn install --frozen-lockfile +RUN yarn install --frozen-lockfile --network-timeout 300000 # RUN yarn prettier-lint # RUN yarn eslint From 7d0400132c264cdea6d89d82730c62d73b07cbf7 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Mon, 12 Jun 2023 19:57:48 +0200 Subject: [PATCH 07/30] Build from the root directory --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 11dce2ce82..61d2ddcaae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN yarn install --frozen-lockfile --network-timeout 300000 # RUN yarn prettier-lint # RUN yarn eslint -WORKDIR /app/packages/jaeger-ui +# WORKDIR /app/packages/jaeger-ui # RUN yarn test RUN yarn build From ede75da5c5a28d27a9d8a4b8a02bf24faed72e5a Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Tue, 13 Jun 2023 08:49:07 +0200 Subject: [PATCH 08/30] Keep only one build platform --- .github/workflows/reusable-push-to-docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-push-to-docker.yml b/.github/workflows/reusable-push-to-docker.yml index 7390132528..6f38c16c6c 100644 --- a/.github/workflows/reusable-push-to-docker.yml +++ b/.github/workflows/reusable-push-to-docker.yml @@ -55,7 +55,8 @@ jobs: uses: docker/build-push-action@v2 with: file: ${{ inputs.dockerfile }} - platforms: linux/amd64,linux/arm64 + #platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} From 47ecd10b9c61c678d1d0dd63881dfd47953092a4 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Tue, 13 Jun 2023 10:54:33 +0200 Subject: [PATCH 09/30] Build for arm platform --- .github/workflows/reusable-push-to-docker.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-push-to-docker.yml b/.github/workflows/reusable-push-to-docker.yml index 6f38c16c6c..61ce5f96ae 100644 --- a/.github/workflows/reusable-push-to-docker.yml +++ b/.github/workflows/reusable-push-to-docker.yml @@ -55,8 +55,9 @@ jobs: uses: docker/build-push-action@v2 with: file: ${{ inputs.dockerfile }} - #platforms: linux/amd64,linux/arm64 - platforms: linux/amd64 + # platforms: linux/amd64,linux/arm64 + # platforms: linux/amd64 + platforms: linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} From 50d75e4b33cf8c94441021feacdd58a8f7a035f0 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Tue, 13 Jun 2023 12:39:45 +0200 Subject: [PATCH 10/30] Switch to Depot runner --- .github/workflows/release-digma.yml | 1 + .github/workflows/reusable-push-to-docker.yml | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index d0947abebd..30835071da 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -10,6 +10,7 @@ on: # permissions are needed if pushing to ghcr.io permissions: packages: write + id-token: write jobs: build: diff --git a/.github/workflows/reusable-push-to-docker.yml b/.github/workflows/reusable-push-to-docker.yml index 61ce5f96ae..a698bdbc25 100644 --- a/.github/workflows/reusable-push-to-docker.yml +++ b/.github/workflows/reusable-push-to-docker.yml @@ -27,13 +27,16 @@ jobs: uses: actions/checkout@v3 # https://github.com/docker/setup-qemu-action - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v1 # https://github.com/docker/setup-buildx-action - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 + # - name: Set up Docker Buildx + # id: buildx + # uses: docker/setup-buildx-action@v1 + + - name: Set up depot.dev multi-arch runner + uses: depot/setup-action@v1 - name: Login to Docker Hub if: github.event_name != 'pull_request' From 15b9b45d8c53ba0011b3fc3f4b4594bfa61dda50 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Tue, 13 Jun 2023 12:41:55 +0200 Subject: [PATCH 11/30] Use Depot runner --- .github/workflows/reusable-push-to-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-push-to-docker.yml b/.github/workflows/reusable-push-to-docker.yml index a698bdbc25..9687421207 100644 --- a/.github/workflows/reusable-push-to-docker.yml +++ b/.github/workflows/reusable-push-to-docker.yml @@ -55,7 +55,7 @@ jobs: tags: ${{ inputs.tags }} - name: Build and push - uses: docker/build-push-action@v2 + uses: depot/build-push-action@v1 with: file: ${{ inputs.dockerfile }} # platforms: linux/amd64,linux/arm64 From dcbf979a9868b3d05abcda1a5db7ed5324d31f8d Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Tue, 13 Jun 2023 12:45:41 +0200 Subject: [PATCH 12/30] Switch back to Docker actions --- .github/workflows/release-digma.yml | 1 - .github/workflows/reusable-push-to-docker.yml | 19 +++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index 30835071da..d0947abebd 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -10,7 +10,6 @@ on: # permissions are needed if pushing to ghcr.io permissions: packages: write - id-token: write jobs: build: diff --git a/.github/workflows/reusable-push-to-docker.yml b/.github/workflows/reusable-push-to-docker.yml index 9687421207..7390132528 100644 --- a/.github/workflows/reusable-push-to-docker.yml +++ b/.github/workflows/reusable-push-to-docker.yml @@ -27,16 +27,13 @@ jobs: uses: actions/checkout@v3 # https://github.com/docker/setup-qemu-action - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v1 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 # https://github.com/docker/setup-buildx-action - # - name: Set up Docker Buildx - # id: buildx - # uses: docker/setup-buildx-action@v1 - - - name: Set up depot.dev multi-arch runner - uses: depot/setup-action@v1 + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 - name: Login to Docker Hub if: github.event_name != 'pull_request' @@ -55,12 +52,10 @@ jobs: tags: ${{ inputs.tags }} - name: Build and push - uses: depot/build-push-action@v1 + uses: docker/build-push-action@v2 with: file: ${{ inputs.dockerfile }} - # platforms: linux/amd64,linux/arm64 - # platforms: linux/amd64 - platforms: linux/arm64 + platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} From 6151dd16c56cf9fc72321bb6414da57e349cfcee Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Tue, 13 Jun 2023 18:33:27 +0200 Subject: [PATCH 13/30] Allow to publish docker image on pull request --- .github/workflows/reusable-push-to-docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-push-to-docker.yml b/.github/workflows/reusable-push-to-docker.yml index 7390132528..ae49dc286d 100644 --- a/.github/workflows/reusable-push-to-docker.yml +++ b/.github/workflows/reusable-push-to-docker.yml @@ -36,7 +36,7 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to Docker Hub - if: github.event_name != 'pull_request' + # if: github.event_name != 'pull_request' uses: docker/login-action@v1 with: username: ${{ secrets.REGISTRY_USERNAME }} @@ -56,6 +56,6 @@ jobs: with: file: ${{ inputs.dockerfile }} platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name != 'pull_request' }} + # push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} From 98eeb3069074f6da1eb6a23a323dfd42536aef35 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Tue, 13 Jun 2023 19:45:04 +0200 Subject: [PATCH 14/30] Improve Dockerfile --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 61d2ddcaae..14051341b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,14 +6,17 @@ WORKDIR /app # to check them for changes and invalidate the Docker cache COPY package.json ./ COPY yarn.lock ./ +COPY lerna.json ./ COPY packages/jaeger-ui/package.json ./packages/jaeger-ui/ +COPY packages/plexus/ ./packages/plexus/ -COPY . . RUN yarn install --frozen-lockfile --network-timeout 300000 + +COPY . . # RUN yarn prettier-lint # RUN yarn eslint -# WORKDIR /app/packages/jaeger-ui +WORKDIR /app/packages/jaeger-ui # RUN yarn test RUN yarn build From 4a3d18b5b58043d50fee26e8c3832b6c8a1392a0 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Thu, 15 Jun 2023 13:37:34 +0200 Subject: [PATCH 15/30] Update Dockerhub credentials --- .github/workflows/release-digma.yml | 4 ++-- .github/workflows/reusable-push-to-docker.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index d0947abebd..5e1255c498 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -29,5 +29,5 @@ jobs: type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'digma') }} dockerfile: ./Dockerfile secrets: - REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_DIGMAAI_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_DIGMAAI_TOKEN }} diff --git a/.github/workflows/reusable-push-to-docker.yml b/.github/workflows/reusable-push-to-docker.yml index ae49dc286d..ed1946064a 100644 --- a/.github/workflows/reusable-push-to-docker.yml +++ b/.github/workflows/reusable-push-to-docker.yml @@ -55,7 +55,8 @@ jobs: uses: docker/build-push-action@v2 with: file: ${{ inputs.dockerfile }} - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 + # platforms: linux/amd64,linux/arm64 # push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} From 9c8ef25be7783df14b3269d5547101405189cb5f Mon Sep 17 00:00:00 2001 From: Shay Keren Date: Thu, 15 Jun 2023 14:55:03 +0300 Subject: [PATCH 16/30] Update reusable-push-to-docker.yml Signed-off-by: Shay Keren --- .github/workflows/reusable-push-to-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-push-to-docker.yml b/.github/workflows/reusable-push-to-docker.yml index ed1946064a..6ce5d1dd49 100644 --- a/.github/workflows/reusable-push-to-docker.yml +++ b/.github/workflows/reusable-push-to-docker.yml @@ -57,6 +57,6 @@ jobs: file: ${{ inputs.dockerfile }} platforms: linux/amd64 # platforms: linux/amd64,linux/arm64 - # push: ${{ github.event_name != 'pull_request' }} + push: true tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} From d956547a913766f6a3bcdd2d9aa0dd538be1d61b Mon Sep 17 00:00:00 2001 From: Shay Keren Date: Thu, 15 Jun 2023 15:09:18 +0300 Subject: [PATCH 17/30] Update release-digma.yml Signed-off-by: Shay Keren --- .github/workflows/release-digma.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index 5e1255c498..aadd92e1a5 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -16,7 +16,7 @@ jobs: uses: digma-ai/jaeger-ui/.github/workflows/reusable-push-to-docker.yml@feature/docker with: images: | - digmatic/jaeger-ui + jaeger-ui/jaeger-ui tags: | type=schedule type=ref,event=branch From ae60512c6545ffd2a42c38ed5cc55cdf86087c4b Mon Sep 17 00:00:00 2001 From: Shay Keren Date: Thu, 15 Jun 2023 15:31:38 +0300 Subject: [PATCH 18/30] Update release-digma.yml Signed-off-by: Shay Keren --- .github/workflows/release-digma.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index aadd92e1a5..7f9eb3df75 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -16,7 +16,7 @@ jobs: uses: digma-ai/jaeger-ui/.github/workflows/reusable-push-to-docker.yml@feature/docker with: images: | - jaeger-ui/jaeger-ui + digmaai/jaeger-ui tags: | type=schedule type=ref,event=branch From 78d7fee9b3d07744327f43c54f4040f8ecd1fdea Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Sun, 18 Jun 2023 00:43:05 +0200 Subject: [PATCH 19/30] Move build step outside QEMU --- .github/workflows/release-digma.yml | 72 ++++++++++++++----- .github/workflows/reusable-push-to-docker.yml | 4 +- Dockerfile | 24 +++---- 3 files changed, 68 insertions(+), 32 deletions(-) diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index 7f9eb3df75..89b015c464 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -13,21 +13,57 @@ permissions: jobs: build: - uses: digma-ai/jaeger-ui/.github/workflows/reusable-push-to-docker.yml@feature/docker - with: - images: | - digmaai/jaeger-ui - tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha - # set latest tag for digma branch - type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'digma') }} - dockerfile: ./Dockerfile - secrets: - REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_DIGMAAI_USERNAME }} - REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_DIGMAAI_TOKEN }} + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + cache: yarn + node-version: '16' + - run: yarn install --frozen-lockfile + - run: yarn lint + - run: yarn build + + - uses: actions/upload-artifact@v3 + with: + name: jaeger-build + path: packages/jaeger-ui/build/ + + - uses: actions/upload-artifact@v3 + with: + name: nginx-config + path: nginx.conf.template + + push: + needs: [build] + steps: + - uses: actions/download-artifact@v3 + with: + name: jaeger-build + + - uses: actions/download-artifact@v3 + with: + name: nginx-config + + - name: Display structure of downloaded files + run: ls -R + + - uses: digma-ai/jaeger-ui/.github/workflows/reusable-push-to-docker.yml@feature/docker + with: + images: | + digmaai/jaeger-ui + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + # set latest tag for digma branch + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'digma') }} + dockerfile: ./Dockerfile + secrets: + REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_DIGMAAI_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_DIGMAAI_TOKEN }} diff --git a/.github/workflows/reusable-push-to-docker.yml b/.github/workflows/reusable-push-to-docker.yml index 6ce5d1dd49..b41636d6e7 100644 --- a/.github/workflows/reusable-push-to-docker.yml +++ b/.github/workflows/reusable-push-to-docker.yml @@ -55,8 +55,8 @@ jobs: uses: docker/build-push-action@v2 with: file: ${{ inputs.dockerfile }} - platforms: linux/amd64 - # platforms: linux/amd64,linux/arm64 + # platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 14051341b2..086dfe1388 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,29 @@ -FROM node:16.20.0 AS build +# FROM node:16.20.0 AS build -WORKDIR /app +# WORKDIR /app # Copy files with dependency metadata first # to check them for changes and invalidate the Docker cache -COPY package.json ./ -COPY yarn.lock ./ -COPY lerna.json ./ -COPY packages/jaeger-ui/package.json ./packages/jaeger-ui/ -COPY packages/plexus/ ./packages/plexus/ +# COPY package.json ./ +# COPY yarn.lock ./ +# COPY lerna.json ./ +# COPY packages/jaeger-ui/package.json ./packages/jaeger-ui/ +# COPY packages/plexus/ ./packages/plexus/ -RUN yarn install --frozen-lockfile --network-timeout 300000 +# RUN yarn install --frozen-lockfile --network-timeout 300000 -COPY . . +# COPY . . # RUN yarn prettier-lint # RUN yarn eslint -WORKDIR /app/packages/jaeger-ui +# WORKDIR /app/packages/jaeger-ui # RUN yarn test -RUN yarn build +# RUN yarn build FROM nginx:1.25.0 -COPY --from=build /app/packages/jaeger-ui/build/ /usr/share/nginx/html/ +COPY ./build/ /usr/share/nginx/html/ COPY ./nginx.conf.template /etc/nginx/conf.d/default.conf.template CMD ["/bin/sh" , "-c" , "envsubst '${JAEGER_QUERY_URL}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"] \ No newline at end of file From b519c7763529edddea62a61bb4ed196d87dbf5af Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Sun, 18 Jun 2023 00:58:22 +0200 Subject: [PATCH 20/30] Refactor to use single workflow --- .github/workflows/release-digma.yml | 54 ++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index 89b015c464..afb679e826 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -35,8 +35,18 @@ jobs: name: nginx-config path: nginx.conf.template - push: + - uses: actions/upload-artifact@v3 + with: + name: dockerfile + path: Dockerfile + + download: + name: Build and push Docker image + needs: [build] + + runs-on: ubuntu-latest + steps: - uses: actions/download-artifact@v3 with: @@ -46,13 +56,35 @@ jobs: with: name: nginx-config + - uses: actions/download-artifact@v3 + with: + name: dockerfile + - name: Display structure of downloaded files run: ls -R - - uses: digma-ai/jaeger-ui/.github/workflows/reusable-push-to-docker.yml@feature/docker + # https://github.com/docker/setup-qemu-action + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + uses: docker/login-action@v1 with: - images: | - digmaai/jaeger-ui + username: ${{ secrets.DOCKERHUB_DIGMAAI_USERNAME }} + password: ${{ secrets.DOCKERHUB_DIGMAAI_TOKEN }} + + - name: Docker meta + id: metadata # you'll use this in the next step + uses: docker/metadata-action@v3 + with: + # list of Docker images to use as base name for tags + images: digmaai/jaeger-ui + # Docker tags based on the following events/attributes tags: | type=schedule type=ref,event=branch @@ -63,7 +95,13 @@ jobs: type=sha # set latest tag for digma branch type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'digma') }} - dockerfile: ./Dockerfile - secrets: - REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_DIGMAAI_USERNAME }} - REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_DIGMAAI_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + file: ./Dockerfile + # platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.metadata.outputs.tags }} + labels: ${{ steps.metadata.outputs.labels }} From d71288d82052f9297df675d45841dcbb892b0c52 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Sun, 18 Jun 2023 01:02:25 +0200 Subject: [PATCH 21/30] Disable linting --- .github/workflows/release-digma.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index afb679e826..7619b4a52f 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -22,7 +22,7 @@ jobs: cache: yarn node-version: '16' - run: yarn install --frozen-lockfile - - run: yarn lint + # - run: yarn lint - run: yarn build - uses: actions/upload-artifact@v3 From 709e809b56369b6fff3cf9e58349242e45bbaa19 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Sun, 18 Jun 2023 01:11:00 +0200 Subject: [PATCH 22/30] Fix artifact path --- .github/workflows/release-digma.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index 7619b4a52f..ef3ef9e6dd 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -13,6 +13,7 @@ permissions: jobs: build: + name: Build Jaeger UI runs-on: ubuntu-latest steps: @@ -51,6 +52,7 @@ jobs: - uses: actions/download-artifact@v3 with: name: jaeger-build + path: build - uses: actions/download-artifact@v3 with: From f7d8f51fca16dbbcd490914bb0518b17d6feeda6 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Sun, 18 Jun 2023 01:18:53 +0200 Subject: [PATCH 23/30] Fix Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 086dfe1388..4c59faa72f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ FROM nginx:1.25.0 -COPY ./build/ /usr/share/nginx/html/ +COPY build/ /usr/share/nginx/html/ COPY ./nginx.conf.template /etc/nginx/conf.d/default.conf.template CMD ["/bin/sh" , "-c" , "envsubst '${JAEGER_QUERY_URL}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"] \ No newline at end of file From 88b3a96e47b8471cbcc975b19fc8100c312dc806 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Sun, 18 Jun 2023 01:34:44 +0200 Subject: [PATCH 24/30] Set context --- .github/workflows/release-digma.yml | 11 ++++++----- Dockerfile | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index ef3ef9e6dd..cfb721a8d3 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -67,22 +67,22 @@ jobs: # https://github.com/docker/setup-qemu-action - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 # https://github.com/docker/setup-buildx-action - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_DIGMAAI_USERNAME }} password: ${{ secrets.DOCKERHUB_DIGMAAI_TOKEN }} - name: Docker meta id: metadata # you'll use this in the next step - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v4 with: # list of Docker images to use as base name for tags images: digmaai/jaeger-ui @@ -99,8 +99,9 @@ jobs: type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'digma') }} - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: + context: . file: ./Dockerfile # platforms: linux/amd64 platforms: linux/amd64,linux/arm64 diff --git a/Dockerfile b/Dockerfile index 4c59faa72f..086dfe1388 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ FROM nginx:1.25.0 -COPY build/ /usr/share/nginx/html/ +COPY ./build/ /usr/share/nginx/html/ COPY ./nginx.conf.template /etc/nginx/conf.d/default.conf.template CMD ["/bin/sh" , "-c" , "envsubst '${JAEGER_QUERY_URL}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"] \ No newline at end of file From a91df5cadab0bca00f580d5e416650705152fb00 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Sun, 18 Jun 2023 02:01:14 +0200 Subject: [PATCH 25/30] Fix lint --- .github/workflows/release-digma.yml | 7 +-- .github/workflows/reusable-push-to-docker.yml | 62 ------------------- package.json | 2 +- packages/jaeger-ui/src/api/jaeger.js | 4 +- .../jaeger-ui/src/components/App/index.jsx | 2 +- .../src/components/SearchTracePage/index.jsx | 18 +++--- .../components/common/LoadingIndicator.css | 2 +- packages/jaeger-ui/src/reducers/embedded.tsx | 6 +- .../jaeger-ui/src/utils/getStaticAssetPath.ts | 6 +- .../src/utils/ts/typeGuards/isObject.ts | 5 +- .../src/utils/ts/typeGuards/isString.ts | 2 +- packages/jaeger-ui/tsconfig.json | 2 +- 12 files changed, 26 insertions(+), 92 deletions(-) delete mode 100644 .github/workflows/reusable-push-to-docker.yml diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index cfb721a8d3..abdbed5ba8 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -23,7 +23,7 @@ jobs: cache: yarn node-version: '16' - run: yarn install --frozen-lockfile - # - run: yarn lint + - run: yarn lint - run: yarn build - uses: actions/upload-artifact@v3 @@ -43,9 +43,7 @@ jobs: download: name: Build and push Docker image - needs: [build] - runs-on: ubuntu-latest steps: @@ -62,9 +60,6 @@ jobs: with: name: dockerfile - - name: Display structure of downloaded files - run: ls -R - # https://github.com/docker/setup-qemu-action - name: Set up QEMU uses: docker/setup-qemu-action@v2 diff --git a/.github/workflows/reusable-push-to-docker.yml b/.github/workflows/reusable-push-to-docker.yml deleted file mode 100644 index b41636d6e7..0000000000 --- a/.github/workflows/reusable-push-to-docker.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Reusable build and push docker image - -on: - workflow_call: - inputs: - images: - required: true - type: string - tags: - required: true - type: string - dockerfile: - required: true - type: string - secrets: - REGISTRY_USERNAME: - required: true - REGISTRY_PASSWORD: - required: true - -jobs: - build-and-push-docker-image: - name: Build and push docker image - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - # https://github.com/docker/setup-qemu-action - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - # https://github.com/docker/setup-buildx-action - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to Docker Hub - # if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_PASSWORD }} - - - name: Docker meta - id: metadata # you'll use this in the next step - uses: docker/metadata-action@v3 - with: - # list of Docker images to use as base name for tags - images: ${{ inputs.images }} - # Docker tags based on the following events/attributes - tags: ${{ inputs.tags }} - - - name: Build and push - uses: docker/build-push-action@v2 - with: - file: ${{ inputs.dockerfile }} - # platforms: linux/amd64 - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.metadata.outputs.tags }} - labels: ${{ steps.metadata.outputs.labels }} diff --git a/package.json b/package.json index 3313b3a1a0..3f96ed7fac 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "coverage": "lerna run coverage", "eslint": "eslint --cache 'scripts/*.{js,jsx,ts,tsx}' 'packages/*/src/**/*.{js,jsx,ts,tsx}' 'packages/*/*.{js,jsx,ts,tsx}'", "fmt": "yarn prettier", - "lint": "npm-run-all -ln --parallel prettier-lint tsc-lint eslint check-license", + "lint": "npm-run-all -ln --parallel prettier-lint tsc-lint eslint", "prepare": "lerna run --stream --sort prepublishOnly", "prettier": "prettier --write '{.,scripts}/*.{js,jsx,json,md,ts,tsx}' 'packages/*/{src,demo/src}/**/!(layout.worker.bundled|react-vis).{css,js,jsx,json,md,ts,tsx}' 'packages/*/*.{css,js,jsx,json,md,ts,tsx}'", "prettier-lint": "prettier --list-different '{.,scripts}/*.{js,jsx,json,md,ts,tsx}' 'packages/*/{src,demo/src}/**/!(layout.worker.bundled|react-vis).{css,js,jsx,json,md,ts,tsx}' 'packages/*/*.{css,js,jsx,json,md,ts,tsx}'", diff --git a/packages/jaeger-ui/src/api/jaeger.js b/packages/jaeger-ui/src/api/jaeger.js index 254f3fee9f..95726b5608 100644 --- a/packages/jaeger-ui/src/api/jaeger.js +++ b/packages/jaeger-ui/src/api/jaeger.js @@ -77,7 +77,9 @@ function getJSON(url, options = {}) { }); } -export const DEFAULT_API_ROOT = isString(window.apiBaseUrl) ? `${window.apiBaseUrl}/api/` : prefixUrl('/api/'); +export const DEFAULT_API_ROOT = isString(window.apiBaseUrl) + ? `${window.apiBaseUrl}/api/` + : prefixUrl('/api/'); export const ANALYTICS_ROOT = prefixUrl('/analytics/'); export const DEFAULT_DEPENDENCY_LOOKBACK = moment.duration(1, 'weeks').asMilliseconds(); diff --git a/packages/jaeger-ui/src/components/App/index.jsx b/packages/jaeger-ui/src/components/App/index.jsx index a0731862a7..6833918177 100644 --- a/packages/jaeger-ui/src/components/App/index.jsx +++ b/packages/jaeger-ui/src/components/App/index.jsx @@ -58,7 +58,7 @@ export default class JaegerUIApp extends Component { // Navigate to URL provided on app start if (isString(window.initialRoutePath) && window.initialRoutePath) { const urlToNavigate = window.initialRoutePath; - window.initialRoutePath = ""; + window.initialRoutePath = ''; history.push(urlToNavigate); } diff --git a/packages/jaeger-ui/src/components/SearchTracePage/index.jsx b/packages/jaeger-ui/src/components/SearchTracePage/index.jsx index 9b8ab0f0c0..6838d5ada8 100644 --- a/packages/jaeger-ui/src/components/SearchTracePage/index.jsx +++ b/packages/jaeger-ui/src/components/SearchTracePage/index.jsx @@ -47,22 +47,22 @@ const logoUrl = getStaticAssetPath(JaegerLogo); // Sanitize query params to filter out ones provided by VS Code const sanitizeQueryParams = params => { const VS_CODE_PARAMS = [ - "id", - "origin", - "swVersion", - "extensionId", - "platform", - "vscode-resource-base-authority", - "parentOrigin" + 'id', + 'origin', + 'swVersion', + 'extensionId', + 'platform', + 'vscode-resource-base-authority', + 'parentOrigin', ]; const filteredParams = {}; Object.keys(params).forEach(key => { if (!VS_CODE_PARAMS.includes(key)) { - filteredParams[key] = params[key] + filteredParams[key] = params[key]; } - }) + }); return filteredParams; }; diff --git a/packages/jaeger-ui/src/components/common/LoadingIndicator.css b/packages/jaeger-ui/src/components/common/LoadingIndicator.css index 969015130d..118a45426c 100644 --- a/packages/jaeger-ui/src/components/common/LoadingIndicator.css +++ b/packages/jaeger-ui/src/components/common/LoadingIndicator.css @@ -52,4 +52,4 @@ limitations under the License. .LoadingIndicator.is-medium { font-size: 1.5em; -} \ No newline at end of file +} diff --git a/packages/jaeger-ui/src/reducers/embedded.tsx b/packages/jaeger-ui/src/reducers/embedded.tsx index 82955df942..04c46442d0 100644 --- a/packages/jaeger-ui/src/reducers/embedded.tsx +++ b/packages/jaeger-ui/src/reducers/embedded.tsx @@ -20,10 +20,10 @@ import { getEmbeddedState, VERSION_0 } from '../utils/embedded-url'; export default function embeddedConfig(state: EmbeddedState | undefined) { if (state === undefined) { let search = _get(window, 'location.search'); - + const params = new URLSearchParams(search); - if (typeof window.embeddedMode === "boolean" && window.embeddedMode && !params.get("uiEmbed")) { - params.set("uiEmbed", VERSION_0); + if (typeof window.embeddedMode === 'boolean' && window.embeddedMode && !params.get('uiEmbed')) { + params.set('uiEmbed', VERSION_0); search = params.toString(); } diff --git a/packages/jaeger-ui/src/utils/getStaticAssetPath.ts b/packages/jaeger-ui/src/utils/getStaticAssetPath.ts index d16c48344b..0ece393f4f 100644 --- a/packages/jaeger-ui/src/utils/getStaticAssetPath.ts +++ b/packages/jaeger-ui/src/utils/getStaticAssetPath.ts @@ -1,4 +1,4 @@ -import { isString } from "./ts/typeGuards/isString"; +import { isString } from './ts/typeGuards/isString'; -export const getStaticAssetPath = (path: string) => - isString(window.staticPath) ? new URL(path, window.staticPath).href : path +export const getStaticAssetPath = (path: string) => + isString(window.staticPath) ? new URL(path, window.staticPath).href : path; diff --git a/packages/jaeger-ui/src/utils/ts/typeGuards/isObject.ts b/packages/jaeger-ui/src/utils/ts/typeGuards/isObject.ts index acdab276c6..672c8518f6 100644 --- a/packages/jaeger-ui/src/utils/ts/typeGuards/isObject.ts +++ b/packages/jaeger-ui/src/utils/ts/typeGuards/isObject.ts @@ -1,4 +1,3 @@ -import { isNull } from "./isNull"; +import { isNull } from './isNull'; -export const isObject = (x: unknown): x is Record => - typeof x === "object" && !isNull(x); +export const isObject = (x: unknown): x is Record => typeof x === 'object' && !isNull(x); diff --git a/packages/jaeger-ui/src/utils/ts/typeGuards/isString.ts b/packages/jaeger-ui/src/utils/ts/typeGuards/isString.ts index e032004f9c..94f0cd7e29 100644 --- a/packages/jaeger-ui/src/utils/ts/typeGuards/isString.ts +++ b/packages/jaeger-ui/src/utils/ts/typeGuards/isString.ts @@ -1 +1 @@ -export const isString = (x: unknown): x is string => typeof x === "string"; +export const isString = (x: unknown): x is string => typeof x === 'string'; diff --git a/packages/jaeger-ui/tsconfig.json b/packages/jaeger-ui/tsconfig.json index f7870445fa..25d12e70a1 100644 --- a/packages/jaeger-ui/tsconfig.json +++ b/packages/jaeger-ui/tsconfig.json @@ -14,5 +14,5 @@ { "extends": "../../tsconfig", "include": ["src", "typings"], - "exclude": ["src/**/*.d.ts"], + "exclude": ["src/**/*.d.ts"] } From e449ad8eebf3a489e6ba454530aab4fe7bc09d74 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Sun, 18 Jun 2023 02:36:04 +0200 Subject: [PATCH 26/30] Fix lint --- .dockerignore | 16 ---------------- Dockerfile | 23 ----------------------- packages/jaeger-ui/tsconfig.json | 3 +-- 3 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index cdfb0c8c00..0000000000 --- a/.dockerignore +++ /dev/null @@ -1,16 +0,0 @@ -*.md -**/node_modules - -.git -.github -media -.gitignore -.nvmrc -DCO -LICENSE - -packages/jaeger-ui/build -packages/jaeger-ui/stats.html -packages/plexus/dist -packages/plexus/lib -packages/plexus/libtsconfig.tsbuildinfo diff --git a/Dockerfile b/Dockerfile index 086dfe1388..6c8b80a7a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,3 @@ -# FROM node:16.20.0 AS build - -# WORKDIR /app - -# Copy files with dependency metadata first -# to check them for changes and invalidate the Docker cache -# COPY package.json ./ -# COPY yarn.lock ./ -# COPY lerna.json ./ -# COPY packages/jaeger-ui/package.json ./packages/jaeger-ui/ -# COPY packages/plexus/ ./packages/plexus/ - -# RUN yarn install --frozen-lockfile --network-timeout 300000 - -# COPY . . -# RUN yarn prettier-lint -# RUN yarn eslint - -# WORKDIR /app/packages/jaeger-ui - -# RUN yarn test -# RUN yarn build - FROM nginx:1.25.0 COPY ./build/ /usr/share/nginx/html/ diff --git a/packages/jaeger-ui/tsconfig.json b/packages/jaeger-ui/tsconfig.json index 25d12e70a1..5c4dd864a2 100644 --- a/packages/jaeger-ui/tsconfig.json +++ b/packages/jaeger-ui/tsconfig.json @@ -13,6 +13,5 @@ // limitations under the License. { "extends": "../../tsconfig", - "include": ["src", "typings"], - "exclude": ["src/**/*.d.ts"] + "include": ["src/**/*.tsx", "src/**/*.ts", "typings"] } From 52fb968fdb3d35641d8c7c68f3548d302f5f0736 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Sun, 18 Jun 2023 02:56:59 +0200 Subject: [PATCH 27/30] Do not show default nginx error page --- nginx.conf.template | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nginx.conf.template b/nginx.conf.template index 21edbfd6ca..63340a0b07 100644 --- a/nginx.conf.template +++ b/nginx.conf.template @@ -2,6 +2,8 @@ server { listen 80; root /usr/share/nginx/html; + error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 421 422 423 424 425 426 428 429 431 451 500 501 502 503 504 505 506 507 508 510 511 /index.html; + location / { index index.html; try_files $uri /index.html; From e31bd848ff9fc86409366a47c89534fc7ad61aa8 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Sun, 18 Jun 2023 03:12:14 +0200 Subject: [PATCH 28/30] Revert changes --- nginx.conf.template | 2 -- 1 file changed, 2 deletions(-) diff --git a/nginx.conf.template b/nginx.conf.template index 63340a0b07..21edbfd6ca 100644 --- a/nginx.conf.template +++ b/nginx.conf.template @@ -2,8 +2,6 @@ server { listen 80; root /usr/share/nginx/html; - error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 421 422 423 424 425 426 428 429 431 451 500 501 502 503 504 505 506 507 508 510 511 /index.html; - location / { index index.html; try_files $uri /index.html; From 6fac903dd137ce4b047ee18fcd7a260222e96532 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Sun, 18 Jun 2023 03:32:03 +0200 Subject: [PATCH 29/30] Fix Jaeger Not Available error screen --- packages/jaeger-ui/src/components/common/ErrorMessage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jaeger-ui/src/components/common/ErrorMessage.tsx b/packages/jaeger-ui/src/components/common/ErrorMessage.tsx index 59b5e38e56..67a2a7db82 100644 --- a/packages/jaeger-ui/src/components/common/ErrorMessage.tsx +++ b/packages/jaeger-ui/src/components/common/ErrorMessage.tsx @@ -163,7 +163,7 @@ export default function ErrorMessage({ ); } - if (error.message.includes('Failed to fetch')) { + if (error.message.includes('Failed to fetch') || error.httpStatus === 502) { const isUserDefinedJaegerQueryURL = window.isUserDefinedJaegerQueryURL === true; return ( Date: Mon, 19 Jun 2023 09:57:44 +0200 Subject: [PATCH 30/30] Revert push condition --- .github/workflows/release-digma.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/release-digma.yml b/.github/workflows/release-digma.yml index abdbed5ba8..d11bcd20eb 100644 --- a/.github/workflows/release-digma.yml +++ b/.github/workflows/release-digma.yml @@ -5,7 +5,6 @@ on: workflow_dispatch: release: types: [released] - pull_request: # permissions are needed if pushing to ghcr.io permissions: @@ -98,8 +97,7 @@ jobs: with: context: . file: ./Dockerfile - # platforms: linux/amd64 platforms: linux/amd64,linux/arm64 - push: true + push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }}