iavl icon indicating copy to clipboard operation
iavl copied to clipboard

ci: Enable benchmarks in Github Actions

Open faddat opened this issue 1 year ago • 15 comments

Automates one run of the iavl benchmarks, and does so with each commit.

It also removes old benchmark records, that are likely no longer relevant, as well as the setup script for those benchmarks.

faddat avatar Sep 03 '22 13:09 faddat

@robert-zaremba hey, I ended up finding the benchmarking issue that you described.

Indeed, they do not run "stock".

Since this is an important library, I think that these changes should fix benchmarks. Basically just explicitly installed clang and gcc here:

https://github.com/notional-labs/containers/blob/1bbdb5894ac2d293651a2bffeefa831de0eb8448/cosmos/Dockerfile#L9

We're missing some kind of pthread support header.

turns out "reinstall glibc" does it.

faddat avatar Sep 03 '22 14:09 faddat

@odeke-em how do we make gobencher work. This should already be handled no?

tac0turtle avatar Sep 03 '22 18:09 tac0turtle

Not sure, but I can check that out

faddat avatar Sep 04 '22 05:09 faddat

Latest commit - since we run the benchmarks in CI, there's not really a need to have the results kept here, ci will keep those for us.

faddat avatar Sep 04 '22 07:09 faddat

@marbar3778 yup, bencher already runs with every commit on this repository, please see https://dashboard.bencher.orijtech.com/?repo=cosmos%2Fiavl but seems like something inside iavl ain't properly running right image cc @kirbyquerby

odeke-em avatar Sep 04 '22 15:09 odeke-em

@odeke-em hi :D

so, I think that this is .... wierd. Where could I see the gobencher config?

If I had to guess, it's not being built quite right.

faddat avatar Sep 06 '22 21:09 faddat

bench:
	cd benchmarks && \
		go test $(LDFLAGS) -tags cleveldb,rocksdb,pebbledb -run=NOTEST -bench=Small . && \
		go test $(LDFLAGS) -tags cleveldb,rocksdb,pebbledb -run=NOTEST -bench=Medium . && \
		go test $(LDFLAGS) -run=NOTEST -bench=RandomBytes .
.PHONY: bench

in order to run the tests, you'll want to build with the different tags.

faddat avatar Sep 06 '22 21:09 faddat

go bencher is now fixed, we should opt to only use that. no need to duplicate jobs

tac0turtle avatar Sep 09 '22 11:09 tac0turtle

How do I see what gobencher produces?

This is globally visible

Found the link....

faddat avatar Sep 09 '22 16:09 faddat

@odeke-em hi!

Is it possible to run gobencher benchmarks in a container?

One of the things that this PR does is it uses a tightly defined environment where all of the db's work.

RIght now I can see that gobencher is working only for goleveldb and rocksdb-- or I am using it wrong, here's where I'm viewing results:

https://dashboard.bencher.orijtech.com/graphs?repo=https%3A%2F%2Fgithub.com%2Fcosmos%2Fiavl.git

thanks!

faddat avatar Sep 09 '22 16:09 faddat

If the gobencher works then I prefer much more gobencher approach. It gives us diff, and won't consume github cycles.

robert-zaremba avatar Sep 09 '22 16:09 robert-zaremba

question:

We are spending on these ci jobs?

Who is spending-- and then also maybe, why are we spending?

Vast majority of github ci is afaik free.

Thanks

faddat avatar Sep 10 '22 07:09 faddat

no limit CI is not for free. I'm not sure if we are currently in a free tier for IAVL. For Cosmos-SDK, we are in a paid plan. But with benchamarks enabled in CI then it will be more complicated.

robert-zaremba avatar Sep 11 '22 12:09 robert-zaremba

I get unlimited CI for free.

anyhow no worries and I still have no idea who's paying for it

The real issue at this point is that we need to make gobencher test pebble and rocks and cleveldb not just goleveldb.

faddat avatar Sep 11 '22 14:09 faddat

@odeke-em how do we run govencher with other dbs?

tac0turtle avatar Sep 11 '22 14:09 tac0turtle

ah nvm we should actually run this to make sure they pass

tac0turtle avatar Oct 22 '22 15:10 tac0turtle