-
Notifications
You must be signed in to change notification settings - Fork 2
Add reporting design #6
base: master
Are you sure you want to change the base?
Conversation
* Configuration type: "tinyconfig", "rh-configs" (works only if Makefile | ||
supports "rh-configs" target), other configuration-generating target | ||
supported by the Makefile in "source". | ||
* Shell glob, relative to the "source" root, matching a configuration file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could build RPMs and use the 'target' option to avoid this globbing. :)
reporting_design.md
Outdated
* "kernel.tar.gz" - the built kernel tarball | ||
* "kernel.config" - the used kernel configuration | ||
* "build.log" - diagnostics output of the building stage | ||
* "build.done" - empty file, created only if build stage succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest having a kernelrelease.txt that contains the kernel release text. That would make it easy to parse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I expect those are not all the files we need, just a sketch. That can be a YAML file as well. What do you want a kernelrelease.txt
for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we need that string from make kernelrelease
when we make tarballs and such? If not, then ignore that request. ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, let's see where this takes us and what the code needs :)
Some thoughts, as I've been thinking about possible reporting implementation in sktm:
Additional ideas? Comments? |
@veruu, thank you for your ideas and comments! OK, I added another commit adding a little boiler-plate run stage description. Simply didn't have time to add it earlier. We can squash all the commits in the end, just thought it might be easier for everyone to see what's changing. Actually, how about we just merge this and continue making our own PRs changing this so it's easier to see what each of us is talking about? Now, onto answering your points.
So far I like the approach of "stage sub-directories" (created by skt), so it's easier to determine which one have run (and also to avoid filename clashes between stages), and skt making stage report texts and the "success" file. Then sktm would glue them together and designate which stage means what. OK, gotta submit this comment before my browser crashes, and continue in another one. |
I think that it should be sktm (or the pipeline) who decide which architectures to build/run. Since they decide that, they should know what the architecture was. I think skt shouldn't serve as a storage for what, whoever invokes it, decided or wanted to remember. Skt doesn't need to know the architecture, at this moment, strictly speaking (it only needs to know which environment variables and arguments to pass to make and what beakerjob.xml to use), so it shouldn't store it. If, OTOH, we decide to introduce that knowledge into skt, then, sure. |
Yeah, I think we can do that, or we can go with stage sub-directories and simply name it "config" (i.e. path relative to the output dir would be "build/config"). |
I added a small section on "run", but we gotta take it much further. I'm not sure what exactly you mean in the last sentence, but I think sktm should know nothing about Beaker, if possible. It would be great if skt provided an abstract interface to sktm, and it could be as simple as a text to include in the report (be it e-mail, or a web page), along with files to attach, with possible links to more data. That report can concern itself only with the stage run in question, and only speak about it, so that sktm could then meaningfully combine such reports. |
I'm aiming the previous comment at the idea of having support for different runners, e.g. libvirt or direct qemu, or such. |
This is again the question of "should skt store data in its output it doesn't care about"? I.e. skt doesn't care which patches were merged, once merge stage is done. It can use that information to e.g. produce a merge stage report, but neither build nor run stage care about them. OTOH, sktm knows which patches it asked to merge, and all the extra circumstances, and it should be able to associate those. The "report results in this directory" would be interesting functionality, however, I think making skt store sktm's data would not hold in the long run anyway. If we go that route, we will end up with more and more data being stored by skt, and it being less and less relevant to it, as we build complex pipelines and combinations of skt runs. Instead, if sktm needs to quit during a pipeline and resume it later, it should create its own persistent storage scheme (in filesystem, or in database, or in both) and encapsulate skt stage outputs into it. |
This is something that indeed only skt can know, because it's its job to actually build the kernel and only it can run |
I would love to hear what you think about all this and am excited to find out what we'll come up with :) So, shall we perhaps merge this as is (or with tweaks to what's already there), and go on to submitting more PRs amending and discussing it, each with our own ideas? Do you think that would work? Otherwise I feel like we'll end up miscommunicating more through hand-waiving in the comments :) |
I really don't want to complicate things too much. If the stage successfully finished, get a If the output files are always going to be named differently, do we really need to deal with subdirectories? It seems like additional complication to deal with on both sides.
Then we need to figure a way for the sktm/pipeline to get that info to the reports (if we want to report it). Should they be creating the files in the correct directories? We need to be able to associate the runs with the arches.
I'd say having skt describe "this is what I did" would be pretty useful. Then if needed, the end user can get to the directory and see exactly what was done, instead of trying to match a command from last week to the right results. As I said before, we can go with I don't want skt to store any data, I want it to output "this is what I did and these are the results", so it's easy to match the command and output without having to dig around too much. We already dealt with it not being easy to match reports to the originating runs, and I really don't want to do it again.
Good point. What would you say if we had all supporter runners create a same output, and use that ( |
Let me try to sell you one idea at a time :) How about skt's interface to sktm for each stage was (however expressed) a success/failure/error status, a human-readable report text, and a list of files to attach to that report? And that's all? I.e. sktm wouldn't really need to know anything about what a kernel config is, or a merge log, or a junit file? It seems to me that sktm doesn't really needs to know that. It just needs to know if merge failed, a build failed, or tests failed and make a report. For example, an "skt merge" can fail and produce a report text like this (e.g. in a file
An
Skt can actually put specially-formatted references in the reports it produces instead of plain filenames, so that sktm can reformat them with any prefixes it sees necessary (and also get a list of attachments from them). E.g. skt can produce this report instead:
And if e.g. that was a build for ppc64le, sktm would take the For the
Then sktm would be able to attach the (renamed) files and rewrite references in the report in a similar way. When all the various stages from all architectures are collected, sktm would be able to put them together and summarize. E.g. something like this:
or
I.e.
or
I.e.
(we can measure the distance between references and add "the attached " only if the previous one further than e.g. 100 characters, so we don't end up repeating it too often). What do you think? |
That can work. I like the idea with the placeholders, especially when eg. multiple builds failed and are supposed to be reported in a single report, we'd need to distinguish between them. I'd still create the |
OK, I added a paragraph and output directory item describing the report files in another commit. Please take a look. Now, regarding the Only the entity which actually gates something can give a verdict whether something (e.g. a patch series) "passed" or "failed" the tests. Skt lacks the context for that. I.e. it can assume that a "pass" is when a patch merges/builds/and passes tests, but when its results are going to be integrate into the sktm framework they will become confusing. E.g. skt's "pass" can become a "fail" in overall sktm result, and vice versa (e.g. when testing for a faulty host). We can take special care to hide that in sktm, but it will eventually show up, either in an occasional confusing reports, in awkward code, or in an actual bug, where results would be interpreted incorrectly. OTOH, "success" is neutral and is not giving any verdict. It just says that the merge/build/test stage succeeded. Anyway, that's my idea behind not using "pass" in the names of those files. I'll probably cringe a little when using "pass", but I'll easily survive that :) |
Another thing about those files, is that just marking "success"/"pass" is not enough. We need to differentiate between "failures" (merge/build/test failures) and "errors" (infrastructure/code failures) too, and just presence/absence of the "success"/"pass" failure doesn't cover that. How about we have either a "success" or "result" file encoding that? Let's say that each stage will create an executable A simple way to implement those would be simply having an executable file containing either |
We can name them |
I agree, and that's what I want to be marked clearly in the filename. If it's going to be
How? It's skt's
sktm should trust skt's reports, and not try to overwrite the results. If the stage reports success, then the stage succeeded and we shouldn't report otherwise. The only thing sktm should be putting together is aggregation of different runs.
I agree that we need to differentiate between them, but I don't think sktm should be the one doing it. I think that no files for that stage should be created and the return code should be checked in the pipeline if needed (and eg. re-run the stage later if we want to). sktm should be okay with creating reports that didn't go through every stage, and it doesn't need to know about failed infrastructure. Or, another idea that just occurred to me, if we don't want to mess around removing the created files when the infrastructure fails, we can save the exit status in general into the Hope I got everything :) thoughts? |
Riiight, I keep getting confused where that host retry logic is. Yes, sktm doesn't interpret skt results as anything but straight pass/fail. I'm suggesting encoding infrastructure failure as a missing Yeah, I don't want to remove files when stage fails, because we won't be able to do that in general (e.g. in case skt crashes with a segfault). Let the absence of the Unless you have strong objections, let's move onto more important stuff. We can change it later. I feel like we're going way too deep into gory details and are slowing down. |
Okay, works for me. Glad that we are finally getting somewhere :D |
OK, let's talk about the structure. Below are two mock-ups of artifacts for a complete run through all stages, flat FlatI chose the scheme of files sharing the same name for the same stage, but
Subdirs
I like the subdirs approach better when several stages are in the same dir, |
Ah, one advantage of the "subdirs" approach, is that it's easier to determine/check if the stage ran or not. |
I prefer the first one, mainly because of multireports -- I was thinking we could have
I feel like the the subdirectories for stages would add too much nesting. I mean, we could deal with it if really needed but it's too much structure for little benefit (you can already see if the stage ran based on the file names). If you have alternative idea how to handle multireports please let me know, but this is the only smart idea I have right now :) Thinking about what we discussed previously, do we need both Other than that, we already talked about the file naming so nothing to add there and I agree |
I added description of So far I agree, extra subdirs can be unwieldy, let's go with just flat directory and have the stage files start with the stage name and a dot. I'll add another commit describing that. Right, how about we simply don't define the .log files, only define the .report file, and say that there can be extra files referenced by the report, for the start? Later we can add requirement of specific files to the documentation, if they're e.g. needed by other tools or for some other reason besides just reporting. I don't think we need a separate |
de01860
to
b08ac34
Compare
👍 |
b08ac34
to
ecc787d
Compare
We do not need to describe test result representation now that we have reports.
ecc787d
to
c882add
Compare
OK, did that. What else do we need to decide/change? |
For skt, nothing else comes to my mind right now. For the reporting part, it would be nice to know which architecture the build/run belongs to (and without that ppc chaos), especially for multiruns. I'm assuming it would be best for the pipeline to pass these information from since sktm has no notion of architectures and skt's one is a bit skewed. Should the pipeline create the For the record, I don't think the architecture should be coded into the directory name - what if we want to have separate runs for AMD/Intel CPUs, the architecture is the same and the directories would just be overwritten. |
Provided we're still going with the Jenkins pipeline deciding which builds to do and which tests to run, we need to give it a way of communicating those to sktm. I don't think skt should be involved in that. I think we need to stop skt making junit outputs and let pipeline present skt output directories to sktm, along with their relations. I'll think about this for a bit. Write if you have any ideas! |
Technically, we have Jenkins build artifacts and JUnit results. The latter can be generated by the pipeline itself. |
Build artifacts too, of course. |
WFM. More independent code if we remove the junit generation \o/
Also agreed. Or whatever pipeline we decide to go with. Neither sktm nor skt should be deciding by themselves what they'll run out of their own will. The question stays how we pass that info. I'm advocating the |
Still thinking about this and your ideas. However, how about a radical approach (similar to what we decided with skt): let the pipeline generate the report text, leaving only sending/publishing the results to sktm? We can let skt provide all the necessary tools for manipulating its reports (e.g. adding prefixes to output files / references in reports), to make that easier. The pipeline report can be a text report with references plus a bunch of files (same as skt), only it will be single report for the whole run. The pipeline is the best one to know what it was testing and how all these stages are related to each other. |
The above would also work if the "pipeline" was e.g. just a shell script. |
I understand where you're coming from, but I feel that would make the pipeline even more complicated than it already is. I don't want to get too dependent on the pipeline, instead it should be just glue between sktm and skt, doing nothing except running skt's stages and getting their results back to sktm. Yes, the pipeline knows what it runs, but then everybody who wants a custom pipeline file would need to implement the report merging there, and I'm really not a fan of it. Or we'd need to support various ones and implement them ourselves, writing X solutions for the same thing, which is pretty error prone (and I really don't want us writing the same thing multiple times, and then having to propagate a single change into each file etc). Especially if we still going with the ability to use different pipelines / run without jenkins. Supporting this with different solutions would be a disaster. |
skt stage command replaces existing files completely. E.g. it will need to | ||
remove all files that might have been created by the previous run of the same | ||
command, before starting adding its own, so the output file set is not | ||
inconsistent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer that we leave this to the administrator/operator/pipeline to clean up rather than make these applications aware that they need to remove or clear something. They should output whatever they need to without needing to know that something needs to be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@major, I think I understand where you're going with this, and I like the idea. However, since skt's output here is a particular set of files, which can be different depending on results, and which represent the results (i.e. which files are there changes meaning), I think it's right to let skt reset that set of files before output. It's kind-of similar to using O_TRUNC with open(2).
reporting_design.md
Outdated
either the `true` or `false` strings, for the overall stage status of success | ||
or failure respectively. If the file is missing, but any of the other output | ||
files are present, the stage can be considered as incomplete, i.e. it must | ||
have exprienced an error, and there was no conclusive result. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/exprienced/experienced/
reporting_design.md
Outdated
|
||
#### Exit status | ||
Execution of each stage should return an exit status of zero, if the stage | ||
completed succesfully, one if it failed, and something else if an error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/succesfully/successfully/
Build | ||
----- | ||
|
||
Produce a kernel tarball. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree here. A tarball is so much easier to move around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, didn't mean to hit approve. ;)
@veruu, let me think about that and see if I can come up with some examples which can convince you it won't be that bad :) I might not be able to, and it might not be good, but I'll try :) |
reporting_design.md
Outdated
#### Output directory | ||
|
||
* "build.kernel.tar.gz" - the built kernel tarball, as required by "run" input. | ||
* "build.kernel.config" - the used kernel configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, we are always compressing the kernel config because it's huge. Given that we want just to attach any referenced files without additional logic, I think it would make sense to create a compressed build.kernel.config.gz
file. Similarly with anything we'd want to compress, although this is the only thing now.
If not, we'd need to pass additional data to the reporter to know which files should be compressed, which I think adds useless complexity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, we can compress them. Another approach can be to let the reporter decide whether to compress them or not, depending on the file type and/or size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That occurred to me too, but we aren't really mentioning any file types as suffixes and determining the size or type would just add complexity we don't need. "Here are the results, merge and send them out". If it's really needed we can of course deal with finding out size and type, but that's something we can change if it turns out a better option in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, we can remove this from the specification as well for now. The report will be referencing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
Thank you, Major, I fixed the typos. I also removed |
then e.g. the resulting e-mail would read: | ||
|
||
x86_64 build failed: | ||
See the attached x86_64_build.log.gz for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on what do you plan skt knowing what to add here as prefixes since it doesn't know much about the arch (unless it's going to be a random string)? This is also super confusing, why do we need to suddenly nest reports when we decided that skt will generate a single text report file? TBH I don't see any value in this change, besides complicating things
7eb2189
to
a97a826
Compare
@veruu, OK I added a couple commits updating the "Report text" section. I propose adding support for including "reports" into other reports, with "namespacing". Please see the text before reading further. So that the pipeline (whether it's a Jenkins pipeline, or a shell script, or whatever) doesn't have to know how to assemble them or use any special tools. It just has to output the report text referring to all the skt reports in question. We can require the Jenkins pipeline to produce a specifically-named artifact archive containing file "report" in this format, which will include all other reports, and files to attach. For example, we can have this structure:
The That would only require the pipeline to be able to output a text file, which pretty much any programming language can do without difficulty. The overall job status can be returned as pass/fail/error. For Jenkins it would be SUCCESS/FAILURE/<ANYTHING_ELSE>, for a shell script it can be 0/1/<ANYTHING_ELSE>. A nice perk would be that the pipeline would be taking care of all the branding and recipient-related niceties and we wouldn't have to supply any sort of e-mail templates and such to sktm. What do you think? |
Another nice thing is that only sktm would have to have the code for rendering these reports as both skt and the pipeline would only write them. |
Oh, and the pipeline would be able to add its own files to the overall report easily. |
Just so I understand it correctly (please correct me if not, since I'm really confused by this proposal):
This is starting to move towards "let's replace sktm's responsibilities by the pipeline" direction, and I'm not a fan of it at all. Let me know your answers to my questions since I don't see them :) |
Okay, let me write up the directory structure that's currently expected by sktm/#108 pull. For a single test run, just create a single directory with a random name, which is then passed to skt[m]. The directory is used as both input and output directory for all skt stages, and passed as a directory to report results from for sktm. For multiple runs (which is what's most interesting), it's a bit more complicated, so I'll illustrate it with this example.
In the end, if all the stages completed, we'd end up with
Does it make sense? |
Regarding your last example, yes, that's how it could look. Personally, I wouldn't put data from build/run stages under the directory from merge stage, but it could work that way too. Regarding your previous comments/questions:
We have agreed that we'll do report merging in sktm completely (I don't like that, but OK). I'll just try to answer what my idea was regarding making pipeline link the reports together, and having to deal with multiple Jenkins pipeline implementations. I think it would work OK, since Jenkins pipeline would need to know what skt stages it runs and how many in parallel, and OTOH doesn't need to know about anything except the
We absolutely plan supporting whatever our idea would be to replace the Jenkins pipeline. We can require that "alternative tester" to produce a similar tarball, or something else, our interface would be just PASS/FAIL/ERROR status and a
Jenkins is supposed to be creating the
I'll try to explain what I mean with a trivial example, which is much simpler than what we have, but I might be able to explain it more easily this way. Let's say we have a "single-arch" pipeline (it doesn't have to be Jenkins, but we can imagine it's Jenkins). Just
Which then could be rendered by sktm into something like this:
Sure. It could have something like Anyway, these are just my musings, I'm not asking to change anything, let's proceed as planned for now. |
Here's a very early, incomplete draft of the attempt to redesign skt reporting, so that e-mail sending can be moved to sktm, and also so it's easier to test skt, and have it running different stages on different hosts.
It's only a sketch of a beginning, but it's something we can already discuss :) Bring it on!