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

Add benchmarking workflow using ASV #74

Merged
merged 11 commits into from
Aug 1, 2023
Merged

Conversation

light2802
Copy link
Contributor

@light2802 light2802 commented Jun 15, 2023

📝 Description

Type: 🚀 feature | 🚦 testing | 🎢 infrastructure
Add benchmarking workflow for gauging stardis performance using ASV. The workflow can push the benchmarking results to another repo to be viewed later. The workflow compares the performance for the last five commits for now, but this can be changed later.

Only one benchmarking test has been added, which runs the run_stardis function. Next PRs will add code for benchmarking other internal parts, but that requires some change in stardis code.

📌 Resources

ASV resources: https://asv.readthedocs.io/en/stable/using.html

🚦 Testing

How did you test these changes?

  • Testing pipeline
  • The workflow is successfully tested to run on my local repo

☑️ Checklist

  • I requested two reviewers for this pull request
  • I updated the documentation according to my changes
  • I built the documentation by applying the build_docs label

Note: If you are not allowed to perform any of these actions, ping (@) a contributor.

@light2802 light2802 force-pushed the main branch 5 times, most recently from 2f176a8 to 6312074 Compare June 15, 2023 19:45
@atharva-2001 atharva-2001 self-requested a review June 16, 2023 14:21
@light2802 light2802 marked this pull request as ready for review June 16, 2023 15:35
@light2802 light2802 changed the title [WIP] Add benchmarking workflow using ASV Add benchmarking workflow using ASV Jun 16, 2023
@jvshields jvshields self-requested a review June 16, 2023 15:52
@light2802 light2802 force-pushed the main branch 5 times, most recently from acf7941 to af7baa3 Compare June 20, 2023 16:15
@light2802 light2802 force-pushed the main branch 9 times, most recently from e814485 to 7a8ed99 Compare June 20, 2023 18:09
@light2802 light2802 requested a review from atharva-2001 July 12, 2023 05:36
@light2802 light2802 added the benchmarks Trigger benchmarks to run on this pr label Jul 12, 2023
@light2802 light2802 requested a review from wkerzendorf July 12, 2023 15:55
jvshields
jvshields previously approved these changes Jul 13, 2023
Copy link
Member

@atharva-2001 atharva-2001 left a comment

Choose a reason for hiding this comment

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

Hi @light2802 this looks good. I have a few minor comments. Can you address them so we can get this merged?

Comment on lines 95 to 127
- name: Create results html on dest repo
if: github.event_name != 'pull_request_target'
continue-on-error: true
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.BOT_TOKEN }}
with:
source-directory: ".asv/html"
destination-github-username: "tardis-sn"
destination-repository-name: "stardis-benchmarks"
user.email: tardis.sn.bot@gmail.com
target-branch: main

- name: Push misc data to dest repo
if: github.event_name != 'pull_request_target'
continue-on-error: true
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.BOT_TOKEN }}
with:
source-directory: ".asv/results"
destination-github-username: "tardis-sn"
destination-repository-name: "stardis-benchmarks"
user.email: tardis.sn.bot@gmail.com
target-branch: main
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you need to do this separately- once the env files are deleted, all that remains is HTML and the results directory right? You should be able to send it all at once. I don't think having the name "misc" is a good idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am pushing the html to the root directory as it will automatically deploy the webpage using github pages and we can see the results instantaneously

Copy link
Member

Choose a reason for hiding this comment

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

I don't find this organised. I like the approach of not needing a GitHub Actions workflow, however.
But is that the only reason? Can you let me know why you're pushing it to the root directory?
But the workflow I used is pretty simple. I don't think it should be named "misc". I think it should be named something like "asv-results" at least.

Either way, the approaches should be identical for STARDIS and TARDIS benchmarks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GitHub pages builds the site from the root directory so I want the .asv/html in root. As for the .asv/results I don't mind naming it to something else

Copy link
Member

Choose a reason for hiding this comment

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

But if someone wants to find results from the benchmarks repo they won't be able to find it easily right?

Copy link
Member

Choose a reason for hiding this comment

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

You also see the results instantly with the workflow I made- I think it looks cleaner, right? Don't you think so?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh so you made another workflow there. Yeah that's fine too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Thanks

@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Merging #74 (9d17653) into main (fb5f079) will not change coverage.
The diff coverage is n/a.

❗ Current head 9d17653 differs from pull request most recent head 08084d6. Consider uploading reports for the commit 08084d6 to get more accurate results

@@           Coverage Diff           @@
##             main      #74   +/-   ##
=======================================
  Coverage   34.97%   34.97%           
=======================================
  Files          17       17           
  Lines         629      629           
=======================================
  Hits          220      220           
  Misses        409      409           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@light2802 light2802 requested a review from atharva-2001 July 21, 2023 09:47
@jvshields jvshields requested review from isaacgsmith and removed request for isaacgsmith August 1, 2023 15:55
@isaacgsmith isaacgsmith merged commit 1d9daf7 into tardis-sn:main Aug 1, 2023
smokestacklightnin pushed a commit to smokestacklightnin/stardis that referenced this pull request Sep 20, 2023
* Bechmark using ASV

* Delete env files only if generated

* Fix posting comment

* Try addding token as env var

* Put env var at correct place

* fix benchmark comment bug

* Fix typo

* Add compare steps names and fix checkout step

* Push asv results to benchmarks results repo as it is

* Fix workflow name

---------

Co-authored-by: Joshua Shields <54691495+jvshields@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmarks Trigger benchmarks to run on this pr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants