Skip to content

Commit

Permalink
adding metrics report (#29010)
Browse files Browse the repository at this point in the history
* adding metrics report

* change concurrency group

Co-authored-by: Andrey Devyatkin <andrey.9evyatkin@gmail.com>

* misc fixes

* Update .github/workflows/beam_Metrics_Report.yml

Co-authored-by: Andrey Devyatkin <andrey.9evyatkin@gmail.com>

---------

Co-authored-by: Andrey Devyatkin <andrey.9evyatkin@gmail.com>
  • Loading branch information
volatilemolotov and andreydevyatkin authored Oct 24, 2023
1 parent bf5ded4 commit 9e21f3d
Showing 1 changed file with 114 additions and 0 deletions.
114 changes: 114 additions & 0 deletions .github/workflows/beam_Metrics_Report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: Beam Metrics Report

on:
# issue_comment:
# types: [created]
# schedule:
# - cron: '0 */23 * * *'
workflow_dispatch:

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
cancel-in-progress: true

env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
actions: write
pull-requests: read
checks: read
contents: read
deployments: read
id-token: none
issues: read
discussions: read
packages: read
pages: read
repository-projects: read
security-events: read
statuses: read

jobs:
beam_Metrics_Report:
name: ${{matrix.job_name}} (${{matrix.job_phrase}})
runs-on: [self-hosted, ubuntu-20.04, main]
timeout-minutes: 100
strategy:
matrix:
job_name: [beam_Metrics_Report]
job_phrase: [Run Metrics Report]
if: |
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
github.event.comment.body == 'Run Metrics Report'
steps:
- uses: actions/checkout@v3
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app_id: ${{ secrets.GH_APP_ID }}
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Setup repository
uses: ./.github/actions/setup-action
with:
comment_phrase: ${{ matrix.job_phrase }}
github_token: ${{ steps.generate_token.outputs.token }}
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
steps_context: ${{ toJson(steps) }}
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
python-version: 3.8
- name: Run Metrics Report
uses: ./.github/actions/gradle-command-self-hosted-action
with:
gradle-command: :beam-test-jenkins:generateMetricsReport
arguments: --info -PinfluxDb=beam_test_metrics -PinfluxHost='10.128.0.96' -PinfluxPort=8086
env:
INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}
- name: Archive Report
uses: actions/upload-artifact@v3
with:
name: Metrics Report
path: "${{ github.workspace }}/.test-infra/jenkins/metrics_report/beam-metrics_report.html"
- name: Generate Date
run: |
date=$(date -u +"%Y-%m-%d")
echo "date=$date" >> $GITHUB_ENV
- name: Send mail
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 465
secure: true
username: ${{ secrets.ISSUE_REPORT_SENDER_EMAIL_ADDRESS }}
password: ${{ secrets.ISSUE_REPORT_SENDER_EMAIL_PASSWORD }}
subject: Beam Metrics Report ${{ env.date }}
to: dannymccormick@google.com #dev@beam.apache.org
cc: vlado.djerek@akvelon.com
from: gactions@beam.apache.org # <user@example.com>
html_body: file://${{ github.workspace }}/.test-infra/jenkins/metrics_report/beam-metrics_report.html

0 comments on commit 9e21f3d

Please sign in to comment.