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

Introduce RunnerInfo to ImageStats #23

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

zakkak
Copy link
Collaborator

@zakkak zakkak commented Mar 29, 2024

This new optional entry is meant to be used for additional information
related to the runner used to perform the testing that generated the
gathered image statistics.

Closes #22

@zakkak zakkak requested review from Karm and jerboaa March 29, 2024 12:40
@jerboaa
Copy link
Collaborator

jerboaa commented Mar 29, 2024

@zakkak
Copy link
Collaborator Author

zakkak commented Mar 29, 2024

Uh, right.

If I get this right:

  • GraalImageStatsResource is used to adapt the graal generated json file, so I don't see how/why we should change this as the test_version field won't be available in that file.
  • ImageStatsResource doesn't seem to need anything explicitly to work with the new field, expect for getExperiment maybe that already doesn't include the generator_version. Otherwise, list, listOne and getByTag should work as expected.

But in order to be able to actually put a value to that field we will need something similar to ImageStatsResource.updateBuildTime. I am actually thinking about renaming ImageStatsResource.updateBuildTime and adding test_version in GraalBuildInfo instead of creating a new endpoint and a new schema. WDYT?

@jerboaa
Copy link
Collaborator

jerboaa commented Mar 29, 2024

* `GraalImageStatsResource` is used to adapt the graal generated json file, so I don't see how/why we should change this as the `test_version` field won't be available in that file.

Yes, though we inject a tag already there. It's conceivable to pass another parameter which is the test_version value when importing. Note this is the main entrypoint these days. See:
https://github.com/graalvm/mandrel/blob/82e6ba445d7c6dea8e4cdbdf2c8bf0ce8b527753/.github/import_stats.sh#L35

* `ImageStatsResource` doesn't seem to need anything explicitly to work with the new field, expect for `getExperiment` maybe that already doesn't include the generator_version. Otherwise, `list`, `listOne` and `getByTag` should work as expected.

That's right. It relies on the passed in ImageStat to already have the test_version set, though.

But in order to be able to actually put a value to that field we will need something similar to ImageStatsResource.updateBuildTime. I am actually thinking about renaming ImageStatsResource.updateBuildTime and adding test_version in GraalBuildInfo instead of creating a new endpoint and a new schema. WDYT?

It's used here, fwiw (but should probably go away now):
https://github.com/graalvm/mandrel/blob/82e6ba445d7c6dea8e4cdbdf2c8bf0ce8b527753/.github/import_stats.sh#L38-L39

I don't think we need updateBuildTime any more for GraalVM 23+. The GraalStats will have them and the adapter will set the build time correctly. See:

// Schema 0.9.1 added total time to the graal stats
final double totalTimeSec = graalStat.getResourceUsage().getTotalTimeSecs();
if (totalTimeSec > 0) {
perfStats.setTotalTimeSeconds(totalTimeSec);
} else {
// Schema 0.9.0 (22.3):
// Timing information needs to be updated using the PUT endpoint
// of api/v1/image-stats/<id>
perfStats.setTotalTimeSeconds(-1);
}

So instead of changing the updateBuildTime endpoint, I'd suggest to add a new one, updateAux or something, that - right now - only adds the test_version. Come to think about it more, maybe we should introduce a new object for those "external" infos. Say AuxInfo part of ImageStats. Similar to ImageSizeStats or the like. That would be more future proof should we need more info. But that's up to you.

TLDR;
The following steps should be sufficient:

  • Add a new update endpoint for setting the test_version
  • Update the script used by GHA's to use that new endpoint

@zakkak zakkak force-pushed the 2024-03-29-add-test-version-to-image-stats branch from 6c8cbae to 7b99210 Compare April 1, 2024 08:13
@zakkak zakkak changed the title Introduce test_version json field for image stats Introduce AuxiliaryInfo to ImageStats Apr 1, 2024
@zakkak
Copy link
Collaborator Author

zakkak commented Apr 1, 2024

So instead of changing the updateBuildTime endpoint, I'd suggest to add a new one, updateAux or something, that - right now - only adds the test_version. Come to think about it more, maybe we should introduce a new object for those "external" infos. Say AuxInfo part of ImageStats. Similar to ImageSizeStats or the like. That would be more future proof should we need more info. But that's up to you.

I liked the idea so I went for it. Please have another look.

@Karm
Copy link
Owner

Karm commented Apr 2, 2024

@zakkak Thx for adding to The Collector!

Ad "Aux" metadata in general, while at it, could we create an entity (add to the one you created) that would take also stuff like this:

https://github.com/Karm/collector/blob/main/src/main/java/com/redhat/quarkus/mandrel/collector/report/model/SimpleTimeAndSize.java#L36-L47

I'd then refactor SimpleTimeAndSize to use it too. I have no hard requirements on the attribute names, I can easily rename tags I look for in jsonc lib. I arrived at the place where I am sure we need at least those runner descriptions, separate version fields so as I can sort by those etc.

I wouldn't shun from adding a String attribute with GH PR link to Aux entity either. On the simple CI this could be used for Q PRs, in the Hydra experiments I'd add Graal PRs etc.

Regarding the architecture and OS for ImageStats, I am abusing the ImageName for it now, producing things like:

build-perf-amd64-el8-q-all
build-perf-aarch64-el8-q-all
build-perf-aarch64-el9-q-all

...which I would like to stop doing :-D

@Karm
Copy link
Owner

Karm commented Apr 2, 2024

@zakkak Reading my previous comment, I am not sure I am making sense. TL;DR:

  1. THX.
  2. Pls consider adding more attributes, I will re-use your entity in runtime tests.
  3. Pls fix testing, add a test that doesn't use the new endpoint and one that uses it, whitelist sequence warning.

:-D

@zakkak
Copy link
Collaborator Author

zakkak commented Apr 2, 2024

@Karm It looks like it makes more sense to add a new class RunnerInfo and possibly another named TestInfo (or BenchmarkInfo) instead of just pushing everything in an Aux.

WDYT?

@Karm
Copy link
Owner

Karm commented Apr 2, 2024

@Karm It looks like it makes more sense to add a new class RunnerInfo and possibly another named TestInfo (or BenchmarkInfo) instead of just pushing everything in an Aux.

WDYT?

@zakkak
Would it be more by the book: Yes.

Do we need it: IMHO no.

I'd jam it into a simple aux class, sort of metadata. We are not about to develop a database of well defined runners to which we would associate experiments and runs and a set of test apps. IMHO a test app is as simple as a String like "Karm/fuzz@ca881049" or "https://github.com/quarkusio/quarkus/tree/3.9.0/integration-tests/jpa-derby".
For a runner, it's good to know the RAM, cores, arch, os and our description.

Do you feel we need to impose more structure on the topic?

@zakkak zakkak force-pushed the 2024-03-29-add-test-version-to-image-stats branch from 7b99210 to f055783 Compare April 9, 2024 18:54
@zakkak
Copy link
Collaborator Author

zakkak commented Apr 9, 2024

I think I addressed all your comments PTAL. Note that I decided to go with RunnerInfo instead of AuxiliaryInfo. If you prefer AuxiliaryInfo I can easily do the renaming, just let me know.

@zakkak zakkak requested a review from jerboaa April 9, 2024 18:57
@zakkak zakkak changed the title Introduce AuxiliaryInfo to ImageStats Introduce RunnerInfo to ImageStats Apr 9, 2024
@zakkak zakkak force-pushed the 2024-03-29-add-test-version-to-image-stats branch from f055783 to 2f16d95 Compare April 10, 2024 11:10
This new optional entry is meant to be used for additional information
related to the runner used to perform the testing that generated the
gathered image statistics.

Closes Karm#22
@zakkak zakkak force-pushed the 2024-03-29-add-test-version-to-image-stats branch from 2f16d95 to d0fbb11 Compare April 10, 2024 11:25
Copy link
Collaborator

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

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

LGTM. Have you tried the angular UI with this change? Does it break?

@Karm
Copy link
Owner

Karm commented Apr 11, 2024

Thx @zakkak, lemme take a look 👁️

@zakkak
Copy link
Collaborator Author

zakkak commented Apr 11, 2024

LGTM. Have you tried the angular UI with this change? Does it break?

It happily just ignores the new data

@jerboaa
Copy link
Collaborator

jerboaa commented Apr 11, 2024

It happily just ignores the new data

Thanks. Good to know.

@Karm Karm merged commit d4f6d9b into Karm:main Apr 15, 2024
1 check passed
@Karm
Copy link
Owner

Karm commented Apr 15, 2024

@zakkak GHA will deploy it to https://stage-collector.foci.life/ momentarily...

@zakkak zakkak deleted the 2024-03-29-add-test-version-to-image-stats branch April 16, 2024 19:21
@zakkak
Copy link
Collaborator Author

zakkak commented Apr 16, 2024

@Karm when should we expect it to make it to collector.foci.life, as that's were it would make more sense to have for uploading build stats from Quarkus CI.

Do you suggest first setting up Quarkus to upload stats to stage and once we see everything works as expected then move it to prod?

@Karm
Copy link
Owner

Karm commented Apr 18, 2024

@zakkak I would like to see a JSON returned from stage-collector that contains the data from the full Quarkus run, uplaoded the way you want it, displayed (retrieved) the way you wanted.

Meaning, to see that indeed GHA run 9823793 produces these 23 build.json files that were all uploaded with this one RunnerInfo and thus can be reported as such.

If it's already there, let's see it here...

@Karm
Copy link
Owner

Karm commented Apr 18, 2024

Releasing:
Unless we are touching schema, it's juts tagging a tag here and running the GHA Workflow that deploys to prod with that tag.

This PR is touching schema, our prod conf is set to "validate", we need "update". The way I do that is physically sshing to the system, dumping DB, changing the prop via env temporarily and staring the service and seeing the log. (The whole system is snapshotted nightly, so even without the dump, worst case, we lose 1 day).

This PR is benign in a way that is adds, not removes stuff/relations. So it should be all good and no manual migration steps ought to be required.

@zakkak
Copy link
Collaborator Author

zakkak commented May 14, 2024

@Karm stage seems OK with the changes (including your enhancements).

curl -v -H "Content-Type: application/json" -H "token: ${TOKEN}" https://stage-collector.foci.life/api/v1/image-stats/199003

Is an example. Do you think we can push it to production or would you like to get some more testing done first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support the inclusion of commit/version of test in ImageStats
3 participants