diff --git a/.github/workflows/actions/send-slack-msg/action.yaml b/.github/workflows/actions/send-slack-msg/action.yaml new file mode 100644 index 00000000..c8af884e --- /dev/null +++ b/.github/workflows/actions/send-slack-msg/action.yaml @@ -0,0 +1,72 @@ +name: Send Notification +description: "Send a notification to Slack" +inputs: + bench_name: + description: "name of the failed job (i.e runBenchmark)" + required: true + job_status: + description: "status of the job (i.e failed)" + required: true + failed_outputs: + description: "details of the failed job" + required: false + default: "{}" + qdrant_version: + description: "version of Qdrant used in the benchmark" + required: false + default: "unknown" + engine_name: + description: "name of the engine used in the benchmark" + required: false + default: "unknown" + dataset: + description: "name of the dataset used in the benchmark" + required: false + default: "unknown" + +runs: + using: "composite" + steps: + - uses: slackapi/slack-github-action@v1.26.0 + with: + payload: | + { + "text": "CI benchmarks (${{ inputs.bench_name }}) run status: ${{ inputs.status }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "CI benchmarks (${{ inputs.bench_name }}) failed because of *${{ inputs.failed_outputs }}*." + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Qdrant version: *${{ inputs.qdrant_version }}*." + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Engine: *${{ inputs.engine_name }}*." + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Dataset: *${{ inputs.dataset }}*." + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "View the results <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>" + } + } + ] + } diff --git a/.github/workflows/continuous-benchmark-2.yaml b/.github/workflows/continuous-benchmark-2.yaml index d7f9dcae..3ec6d6d8 100644 --- a/.github/workflows/continuous-benchmark-2.yaml +++ b/.github/workflows/continuous-benchmark-2.yaml @@ -71,51 +71,16 @@ jobs: - name: Fail job if any of the benches failed if: steps.benches.outputs.failed == 'error' || steps.benches.outputs.failed == 'timeout' run: exit 1 - - name: Send Notification + - name: Send slack message + uses: ./.github/workflows/actions/send-slack-msg if: failure() || cancelled() - uses: slackapi/slack-github-action@v1.26.0 with: - payload: | - { - "text": "CI benchmarks (runLoadTimeBenchmark) run status: ${{ job.status }}", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "CI benchmarks (runLoadTimeBenchmark) failed because of *${{ steps.benches.outputs.failed }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Qdrant version: *${{ steps.benches.outputs.qdrant_version }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Engine: *${{ steps.benches.outputs.engine_name }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Dataset: *${{ steps.benches.outputs.dataset }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "View the results <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>" - } - } - ] - } + bench_name: "runLoadTimeBenchmark" + job_status: ${{ job.status }} + failed_outputs: ${{ steps.benches.outputs.failed }} + qdrant_version: ${{ steps.benches.outputs.qdrant_version }} + engine_name: ${{ steps.benches.outputs.engine_name }} + dataset: ${{ steps.benches.outputs.dataset }} env: SLACK_WEBHOOK_URL: ${{ secrets.CI_ALERTS_CHANNEL_WEBHOOK_URL }} SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK diff --git a/.github/workflows/continuous-benchmark.yaml b/.github/workflows/continuous-benchmark.yaml index 0056b6ab..f36b7745 100644 --- a/.github/workflows/continuous-benchmark.yaml +++ b/.github/workflows/continuous-benchmark.yaml @@ -63,51 +63,16 @@ jobs: - name: Fail job if any of the benches failed if: steps.benches.outputs.failed == 'error' || steps.benches.outputs.failed == 'timeout' run: exit 1 - - name: Send Notification + - name: Send slack message + uses: ./.github/workflows/actions/send-slack-msg if: failure() || cancelled() - uses: slackapi/slack-github-action@v1.26.0 with: - payload: | - { - "text": "CI benchmarks (runBenchmark) run status: ${{ job.status }}", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "CI benchmarks (runBenchmark) failed because of *${{ steps.benches.outputs.failed }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Qdrant version: *${{ steps.benches.outputs.qdrant_version }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Engine: *${{ steps.benches.outputs.engine_name }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Dataset: *${{ steps.benches.outputs.dataset }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "View the results <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>" - } - } - ] - } + bench_name: "runBenchmark" + job_status: ${{ job.status }} + failed_outputs: ${{ steps.benches.outputs.failed }} + qdrant_version: ${{ steps.benches.outputs.qdrant_version }} + engine_name: ${{ steps.benches.outputs.engine_name }} + dataset: ${{ steps.benches.outputs.dataset }} env: SLACK_WEBHOOK_URL: ${{ secrets.CI_ALERTS_CHANNEL_WEBHOOK_URL }} SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK @@ -154,51 +119,16 @@ jobs: - name: Fail job if any of the benches failed if: steps.benches.outputs.failed == 'error' || steps.benches.outputs.failed == 'timeout' run: exit 1 - - name: Send Notification + - name: Send slack message + uses: ./.github/workflows/actions/send-slack-msg if: failure() || cancelled() - uses: slackapi/slack-github-action@v1.26.0 with: - payload: | - { - "text": "CI benchmarks (runTenantsBenchmark) run status: ${{ job.status }}", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "CI benchmarks (runTenantsBenchmark) failed because of *${{ steps.benches.outputs.failed }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Qdrant version: *${{ steps.benches.outputs.qdrant_version }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Engine: *${{ steps.benches.outputs.engine_name }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Dataset: *${{ steps.benches.outputs.dataset }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "View the results <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>" - } - } - ] - } + source_name: "runTenantsBenchmark" + job_status: ${{ job.status }} + failed_outputs: ${{ steps.benches.outputs.failed }} + qdrant_version: ${{ steps.benches.outputs.qdrant_version }} + engine_name: ${{ steps.benches.outputs.engine_name }} + dataset: ${{ steps.benches.outputs.dataset }} env: SLACK_WEBHOOK_URL: ${{ secrets.CI_ALERTS_CHANNEL_WEBHOOK_URL }} SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK @@ -245,51 +175,16 @@ jobs: - name: Fail job if any of the benches failed if: steps.benches.outputs.failed == 'error' || steps.benches.outputs.failed == 'timeout' run: exit 1 - - name: Send Notification + - name: Send slack message + uses: ./.github/workflows/actions/send-slack-msg if: failure() || cancelled() - uses: slackapi/slack-github-action@v1.26.0 with: - payload: | - { - "text": "CI benchmarks (runParallelBenchmark) run status: ${{ job.status }}", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "CI benchmarks (runParallelBenchmark) failed because of *${{ steps.benches.outputs.failed }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Qdrant version: *${{ steps.benches.outputs.qdrant_version }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Engine: *${{ steps.benches.outputs.engine_name }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Dataset: *${{ steps.benches.outputs.dataset }}*." - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "View the results <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>" - } - } - ] - } + source_name: "runParallelBenchmark" + job_status: ${{ job.status }} + failed_outputs: ${{ steps.benches.outputs.failed }} + qdrant_version: ${{ steps.benches.outputs.qdrant_version }} + engine_name: ${{ steps.benches.outputs.engine_name }} + dataset: ${{ steps.benches.outputs.dataset }} env: SLACK_WEBHOOK_URL: ${{ secrets.CI_ALERTS_CHANNEL_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK \ No newline at end of file + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK