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

Save benchmark + Haddock artifacts during CI #281

Open
xsebek opened this issue Nov 6, 2021 · 9 comments
Open

Save benchmark + Haddock artifacts during CI #281

xsebek opened this issue Nov 6, 2021 · 9 comments
Labels
C-Low Hanging Fruit Ideal issue for new contributors. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. Z-CI This issue is about continuous integration pipelines - GH Actions - tests and releases on server. Z-Documentation This issue is about README or Wikis or Haddock or... Z-Meta This issue is about other Swarm issues or infrastructure. Z-Performance This issue concerns memory or time efficiency of the Swarm game.

Comments

@xsebek
Copy link
Member

xsebek commented Nov 6, 2021

It would be nice to mark the benchmark logs as artifacts.

We could then write a script that would use GitHub CLI tool to download the artifacts of main branch and plot the benchmarks.

@xsebek xsebek added C-Low Hanging Fruit Ideal issue for new contributors. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. Z-Meta This issue is about other Swarm issues or infrastructure. Z-Performance This issue concerns memory or time efficiency of the Swarm game. labels Nov 6, 2021
@byorgey
Copy link
Member

byorgey commented Nov 6, 2021

Since I didn't know what this meant, here's a link for the benefit of others who don't know either: https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts

@byorgey
Copy link
Member

byorgey commented Nov 6, 2021

Marking the benchmark logs as artifacts sounds fine to me. But as for plotting them, couldn't we just add some commands to the github action to plot the benchmarks right after generating them, and save the plot(s) as artifacts too?

@xsebek
Copy link
Member Author

xsebek commented Nov 6, 2021

If we install gh (may also need secrets) and some plotter in the container, then probably yes.

If the actions do not measure performance well, then at least we would have a script to do it locally 🙂

The only other useful artefact I can think of is the generated documentation, which could be cool to show off. 🤓

@byorgey byorgey added the Z-CI This issue is about continuous integration pipelines - GH Actions - tests and releases on server. label Apr 12, 2022
@byorgey byorgey changed the title Add benchmark artifacts Add benchmark + Haddock documentation artifacts Jun 17, 2022
@xsebek
Copy link
Member Author

xsebek commented Jun 18, 2022

As a note, we do not run benchmarks in the CI. We could add it if we wanted to.
For local comparison, criterion-compare is quite nice:

cabal run benchmark -- --csv "main.csv" --output "main.html"
git switch feature
cabal run benchmark -- --csv "feature.csv" --output "feature.html"
criterion-compare main.csv feature.csv

For example see #415.

@xsebek
Copy link
Member Author

xsebek commented Jun 18, 2022

We do run haddock in the CI so it is only a matter of getting it from there to GitHub pages.

For example, Cabal seems to have been using GitHub pages and automatically pushing the Haddock documentation there:

But that is outdated now, so we should check if there is an easy way for Github Actions.

Worst case scenario we add a secret to allow pushing to a new swarm-website repository and manually do the clone/push after Haddock is built. This at least we could copy-paste from the linked commit.

@byorgey
Copy link
Member

byorgey commented Aug 22, 2022

@xsebek
Copy link
Member Author

xsebek commented Oct 31, 2022

There is https://github.com/benchmark-action/github-action-benchmark which can be passed results from any benchmark tool in JSON containing a list of benchmarks with names and values. It creates nice HTML graphs on GitHub pages and posts alerts on the commit page if it really degrades performance.

The history is stored using actions/cache which we already use.

I think we should make this a separate GitHub action running only on the main branch. Not sure what needs to be done to create GitHub pages, but it should be relatively easy.

@xsebek
Copy link
Member Author

xsebek commented Oct 31, 2022

The GitHub runners are often under different loads, so we might want to run the benchmark and a comparison benchmark:

I think we could publish a benchmark binary in the release and use it as a baseline - run A, B, A, B take averages and compare.


Another interesting thing to consider is which compiler to use, as the numbers change quite a lot. (See #752)

@xsebek
Copy link
Member Author

xsebek commented Oct 31, 2022

But to keep this issue reasonable, let's just set up GitHub pages and an Action that will publish haddock and benchmark. 😅

By using the benchmarks as is, we might be able to use the same format as Rust criterion benchmarks. 🤔

@byorgey byorgey changed the title Add benchmark + Haddock documentation artifacts Save benchmark + Haddock artifacts during CI May 29, 2023
@kostmo kostmo added the Z-Documentation This issue is about README or Wikis or Haddock or... label Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Low Hanging Fruit Ideal issue for new contributors. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. Z-CI This issue is about continuous integration pipelines - GH Actions - tests and releases on server. Z-Documentation This issue is about README or Wikis or Haddock or... Z-Meta This issue is about other Swarm issues or infrastructure. Z-Performance This issue concerns memory or time efficiency of the Swarm game.
Projects
None yet
Development

No branches or pull requests

3 participants