-
Notifications
You must be signed in to change notification settings - Fork 36
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
Simple macro benchmark #2304
Simple macro benchmark #2304
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2304 +/- ##
==========================================
- Coverage 72.92% 67.87% -5.06%
==========================================
Files 89 101 +12
Lines 7783 8380 +597
==========================================
+ Hits 5676 5688 +12
- Misses 2107 2692 +585
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
To try this out:
|
What I'm getting:
|
just tried from the Mac. ❱ benchmark_simple
pkg: golang.org/x/benchmarks
goos: darwin
goarch: arm64
driver.go:212: Benchmarking 1 iterations
WARN[0021] Encountered error while checking for Image Index: unable to fetch descriptior for container image quay.io/redhat-user-workloads/rhtap-contract-tenant/golden-container/golden-container@sha256:166e38c156fa81d577a7ba7a948b68c79005a06e302779d1bebc7d31e8bea315: Get "https://quay.io/v2/": tls: failed to verify certificate: x509: “benchmark.ec” certificate is not standards compliant
panic: pulling policy: failed to resolve quay.io/enterprise-contract/ec-release-policy@sha256:64617f0c45689ef7152c5cfbd4cd5709a3126e4ab7482eb6acd994387fe2d4ba: Get "https://quay.io/v2/enterprise-contract/ec-release-policy/manifests/sha256:64617f0c45689ef7152c5cfbd4cd5709a3126e4ab7482eb6acd994387fe2d4ba": tls: failed to verify certificate: x509: “benchmark.ec” certificate is not standards compliant
goroutine 33 [running]:
main.ec.func1()
/Users/jstuart/Documents/repos/ec-cli/benchmark/simple/simple.go:114 +0x168
golang.org/x/benchmarks/driver.Parallel.func1()
/Users/jstuart/go/pkg/mod/golang.org/x/benchmarks@v0.0.0-20241115175113-a2b48b605b42/driver/driver.go:287 +0x60
created by golang.org/x/benchmarks/driver.Parallel in goroutine 1
/Users/jstuart/go/pkg/mod/golang.org/x/benchmarks@v0.0.0-20241115175113-a2b48b605b42/driver/driver.go:284 +0x84
exit status 2
make: *** [Makefile:148: benchmark_simple] Error 1 |
Implementation of a simple macro benchmark executing `ec validate image` with the fixed state and no external dependencies. For this the OCI distribution registry is run in a container with the data from the `benchmark/simple/data.tar.gz` that contains the copy of all images/blobs that the command and the policy rules currently access and the git repository. The benchmark outputs in the golang standard benchmark format that can be utilized with tools in the golang benchmarking ecosystem. Due to the global `downloadCache` variable in `internal/policy/source/source.go` the benchmark cannot be run in parallel. So only invoking the benchmark once is currently possible. Reference: https://issues.redhat.com/browse/EC-968
The motivation is to include the change from https://issues.redhat.com/browse/EC-1041 .
After rebasing on the go-gather update, related to EC-1163, the I think at last we can merge this. |
I think the coverage alerts are okay, we don't need to write unit tests for the benchmarking code. |
Implementation of a simple macro benchmark executing
ec validate image
with the fixed state and no external dependencies.For this the OCI distribution registry is run in a container with the data from the
benchmark/simple/data.tar.gz
that contains the copy of all images/blobs that the command and the policy rules currently access and the git repository.The benchmark outputs in the golang standard benchmark format that can be utilized with tools in the golang benchmarking ecosystem.
Due to the global
downloadCache
variable ininternal/policy/source/source.go
the benchmark cannot be run in parallel. So only invoking the benchmark once is currently possible.Reference: https://issues.redhat.com/browse/EC-968
(Original PR at #2192)