-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add reporting to physmon (#1612)
This attempts to add a workflow that comments details of the physmon result on the relevant PR.
- Loading branch information
1 parent
4ddf9e8
commit e3947c1
Showing
3 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
name: Report on physmon | ||
|
||
on: | ||
workflow_run: | ||
workflows: [Builds] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
post_comment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Download artifact' | ||
uses: actions/github-script@v6 | ||
id: dl-af | ||
with: | ||
script: | | ||
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: context.payload.workflow_run.id, | ||
}); | ||
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { | ||
return artifact.name == "physmon" | ||
})[0]; | ||
let download = await github.rest.actions.downloadArtifact({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
artifact_id: matchArtifact.id, | ||
archive_format: 'zip', | ||
}); | ||
let fs = require('fs'); | ||
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/physmon.zip`, Buffer.from(download.data)); | ||
let = url = `https://herald.dokku.paulgessinger.com/view/${process.env.GITHUB_REPOSITORY}/${matchArtifact.id}`; | ||
core.exportVariable('ARTIFACT_URL', url) | ||
- name: 'Unzip artifact' | ||
run: unzip -d physmon physmon.zip && ls -al && ls -al physmon | ||
|
||
|
||
- name: 'Determine PR number' | ||
uses: actions/github-script@v6 | ||
id: get-pr-number | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
let fs = require('fs'); | ||
let file = 'physmon/pr_number'; | ||
if(!fs.existsSync(file)) { | ||
console.log('No file at ' + file); | ||
return false; | ||
} | ||
let number = Number(fs.readFileSync(file)); | ||
console.log('PR number is '+number); | ||
core.exportVariable('PR_NUMBER', number) | ||
let sha = fs.readFileSync('physmon/sha', {encoding: 'utf8'}); | ||
console.log('SHA is '+sha); | ||
core.exportVariable('PR_SHA', sha) | ||
return number; | ||
- uses: actions/checkout@v3 | ||
if: steps.get-pr-number.outputs.result != 'false' | ||
|
||
# ping the url, triggers caching of the artifact | ||
- name: Prime cache | ||
run: curl -L $ARTIFACT_URL | ||
if: steps.get-pr-number.outputs.result != 'false' | ||
|
||
- name: Render template | ||
id: template | ||
uses: chuhlomin/render-template@v1.4 | ||
if: steps.get-pr-number.outputs.result != 'false' | ||
with: | ||
template: CI/physmon/comment_template.md | ||
vars: | | ||
url: ${{ env.ARTIFACT_URL }} | ||
commit: ${{ env.PR_SHA }} | ||
- name: Find Comment | ||
if: steps.get-pr-number.outputs.result != 'false' | ||
uses: peter-evans/find-comment@v2 | ||
id: fc | ||
with: | ||
issue-number: ${{ steps.get-pr-number.outputs.result }} | ||
comment-author: 'github-actions[bot]' | ||
body-includes: Physics performance monitoring | ||
|
||
- name: Create or update comment | ||
if: steps.get-pr-number.outputs.result != 'false' | ||
uses: peter-evans/create-or-update-comment@v2 | ||
with: | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
issue-number: ${{ steps.get-pr-number.outputs.result }} | ||
body: ${{ steps.template.outputs.result }} | ||
edit-mode: replace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
## :bar_chart: Physics performance monitoring for {{ .commit }} | ||
[Full report]({{ .url }}/) | ||
[CKF seeded]({{ .url }}/ckf_seeded.html) | ||
[CKF truth smeared]({{ .url }}/ckf_truth_smeared.html) | ||
[CKF truth estimated]({{ .url }}/ckf_truth_estimated.html) | ||
|
||
<details> | ||
<summary><b>Vertexing</b></summary> | ||
<img src="{{ .url }}/vertexing_mu_scan.pdf?to_png=1" width="400"/> | ||
</details> | ||
|
||
<details> | ||
<summary><b>CKF seeded</b></summary> | ||
<img src="{{ .url }}/ckf_seeded_plots/trackeff_vs_eta.pdf?to_png=1" width="50%"/><img src="{{ .url }}/ckf_seeded_plots/trackeff_vs_pT.pdf?to_png=1" width="50%"/> | ||
|
||
<img src="{{ .url }}/ckf_seeded_plots/nHoles_vs_eta.pdf?to_png=1" width="50%"/><img src="{{ .url }}/ckf_seeded_plots/nMeasurements_vs_eta.pdf?to_png=1" width="50%"/> | ||
</details> | ||
|
||
<details> | ||
<summary><b>CKF truth smeared</b></summary> | ||
<img src="{{ .url }}/ckf_truth_smeared_plots/trackeff_vs_eta.pdf?to_png=1" width="50%"/><img src="{{ .url }}/ckf_truth_smeared_plots/trackeff_vs_pT.pdf?to_png=1" width="50%"/> | ||
|
||
<img src="{{ .url }}/ckf_truth_smeared_plots/nHoles_vs_eta.pdf?to_png=1" width="50%"/><img src="{{ .url }}/ckf_truth_smeared_plots/nMeasurements_vs_eta.pdf?to_png=1" width="50%"/> | ||
</details> | ||
|
||
<details> | ||
<summary><b>CKF truth estimated</b></summary> | ||
<img src="{{ .url }}/ckf_truth_estimated_plots/trackeff_vs_eta.pdf?to_png=1" width="50%"/><img src="{{ .url }}/ckf_truth_estimated_plots/trackeff_vs_pT.pdf?to_png=1" width="50%"/> | ||
|
||
<img src="{{ .url }}/ckf_truth_estimated_plots/nHoles_vs_eta.pdf?to_png=1" width="50%"/><img src="{{ .url }}/ckf_truth_estimated_plots/nMeasurements_vs_eta.pdf?to_png=1" width="50%"/> | ||
</details> | ||
|
||
<details> | ||
<summary><b>Truth tracking</b></summary> | ||
<img src="{{ .url }}/truth_tracking_plots/nHoles_vs_eta.pdf?to_png=1" width="50%"/><img src="{{ .url }}/truth_tracking_plots/nMeasurements_vs_eta.pdf?to_png=1" width="50%"/> | ||
|
||
<img src="{{ .url }}/truth_tracking_plots/pull_d0.pdf?to_png=1" width="50%"/><img src="{{ .url }}/truth_tracking_plots/pull_z0.pdf?to_png=1" width="50%"/> | ||
|
||
<img src="{{ .url }}/truth_tracking_plots/pull_theta.pdf?to_png=1" width="50%"/><img src="{{ .url }}/truth_tracking_plots/pull_phi.pdf?to_png=1" width="50%"/> | ||
|
||
<img src="{{ .url }}/truth_tracking_plots/pull_qop.pdf?to_png=1" width="50%"/><img src="{{ .url }}/truth_tracking_plots/pull_t.pdf?to_png=1" width="50%"/> | ||
</details> |