-
Notifications
You must be signed in to change notification settings - Fork 17
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
Define node types #371
Comments
Why is this a problem? One thing that I believe needs to be better defined is how to set the result for parent nodes. Some CI systems set the parent result to "fail" if any of their underlying test cases failed. Arguably we could instead not set a result at all if it's not testing anything, or "pass" to show that it ran successfully. Then an API query can be used to find all the individual test cases that failed. The |
Because it limits the type of queries a client can perform programmatically. Examples:
Maybe there's a well defined way to search for this kind of nodes already, based on their structure or on other attributes, but it's not clear how. I understand that, since different node types may have different schemas (maybe I'm wrong about this), not all operations might make sense on all types of nodes. Without a node "type", how can a client know how to operate on a certain node? |
Based on the node name and kind.
At the moment, all nodes follow the same schema. Only the
We discussed this in the meeting today actually, eventually we probably should have some Pydantic model (or jsonschema...) for the payload in the |
But the node name isn't
But test nodes don't hang from build nodes (see #373 (comment)), so we'd have to ascend to the root (
But how is |
Yes the node name needs to be changed to kbuild, or something needs to be done to make this actually work. It's not finished basically, and it's part of the job configuration roadmap issue which is now late on the roadmap and that's what I'm going to be focusing on next week. A lot of things relate to this. Let's sync up at some point in the coming days to make sure we all work towards achieving the same goals and share the work where we can. Probably next Thursday's open hours would be good to catch up on anything we haven't been able to cover by other means. |
Atm
Until we have that in place, you can look at |
Continuing this discussion, I've been thinking on how to proceed and I'd like to start defining certain types of node "patterns" that can cover the most immediate use cases and then grow from there. As I understand it, there are two approaches to this: 1. Differentiate node types in the API (
|
Right, I think the actual ideal solution is pretty well known. It hasn't been implemented due to various other distractions and priorities. So here's what I would propose: First let's take a look at the node fields (should also answer some of @yurinnick's questions):
Some thoughts about how to get this in place: Node kinds aren't well defined yet, that's why it's too early to enable validation at the API level since the pipeline can work without it. The It would seem the first one to add would be Then it would be very useful to have these models shared between client and server implementations. Right now, there's nothing to convert node data to objects or anything like that outside of In order to implement this, I would propose to move the API data models to So to get there, we need to:
Note: I now remember there were issues when I first tried to do this as having a dynamic model for a subpart of the schema doesn't work that well with FastAPI and Pydantic. It's definitely possible to do it in a clean way, at least based on the early experiments I did. One thing we just can't do is inherit Node as a subclass like KbuildNode with something defining the model in Now I'll compare what I'm proposing here with what you wrote and see where things stand. Does this make sense? |
Yes, the general idea sounds good, although some bits and implementation details are out of my reach. Particularly the part about moving the API models to In any case, the ability to share the schema and validation of |
Right, well about sharing the models I can only see 3 solutions:
I believe In terms of having a proof-of-concept for this, we could take the current data stored in |
I was thinking about model/api separation another day, and I believe that that the way we should approach it is something along these lines:
In principal I think we should separate internal structures from public-facing API interface, even if it will add some code de-duplication. |
Yes, but I think It's true we'll probably have to use 2 sets of models, but I believe the line should be drawn at the API level: public ones used by the API endpoints and client code, and internal ones used by the API implementation with the database. In many cases they'll probably align a lot so we may not have to duplicate any code or models while still decoupling these two aspects. |
@gctucker I'm doing some tests about different
But I don't know if that's what you had in mind. I have some questions about the possible approaches:
Also, I noticed that we'll probably have to rework some parts of I could be missing some information or context, so what's your opinion on this? |
Related to #370 and maybe to #204 as well
It's not clear how to distinguish different node types. For instance, how to tell if a node is a test result?
Example:
from this node:
Let's see how a test result looks like (
sysctl_test_api_dointvec_null_tbl_data
):And then let's see its parent (sysctl_test), which is a node that groups many tests cases together:
There's nothing in the node structure or in the values that lets me tell which one of this is a test result and which one is a parent of a test result. The "result" is different, but I found other final test nodes with a null result as well. For instance,
test_task_on_all_and_one_cpu
(651164268326c545a781064c):The text was updated successfully, but these errors were encountered: