Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding metrics report #29010

Merged
merged 4 commits into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
volatilemolotov marked this conversation as resolved.
Show resolved Hide resolved
- 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: [email protected] #[email protected]
cc: [email protected]
Comment on lines +111 to +112
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that we need to send a copy.
Can we specify the actual to? If no what is the next step?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are specifying both to: and cc: in this case. This is temporary so that it can be tested once merged and action is approved (notice that only wokflow_dispatch trigger is enabled for now). After that there will be only to: dev@...

from: [email protected] # <[email protected]>
html_body: file://${{ github.workspace }}/.test-infra/jenkins/metrics_report/beam-metrics_report.html