-
Notifications
You must be signed in to change notification settings - Fork 7
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
Investigate one-of support with Goa #80
Comments
I have yet to understand why would someone use those input parameters. Could you clarify how it's gonna be exposed to the API user? Shouldn't fuseml instead focus on provide a generic input I still will have a look at optional arguments in goa, that might be useful. |
Also: What is the exclusive part: If parameter is given, codesets can't be given? Can multiple codesets be given? Can multiple parameters be given? (Those questions would be clarified by explaining how/why someone would use those input parameters) |
I can explain the background, maybe a wider context is relevant to solve this particular case: when you're running a container, as input you may need to provide either scalar values (named
I don't understand the question. Could you please be more specific, or even give some example of what you're referring to ? Those concepts (codesets, models, datasets) are the particular concepts used in machine learning. How much more generic would you want them to be ?
Good point, that's exactly the approach I'm taking now, precisely because one-of support is missing in goa. Validation is done in the business logic.
I don't understand this comment either, more so as it comes in conflict with the earlier question about not being generic about the input payload. If you have an idea about reducing the number of arguments without losing expressivity, I'd love to hear more about it. The only other variant I explored was having an input
|
I was indeed thinking that there are "types" of input:
another example would be:
The inputs would then be a dict, containing lists of pre-determined objects. If we want the dict to be extensible, we can have known keys with pre-defined structure, and unknown payloads in text, which needs proper serializing, like this:
This could help on maintainability, and doesn't hurt usability too much, thanks to the fact we generate the client. What I meant above with the "generic input payload" is the following:
for which no structure is given, and all validation is done on the business logic. That seems by far the more flexible and readable bit. Reason: When you unmarshal, you will most likely use a client library, that will throw an error on wrong content, and you can return it to the user. This is not possible if the data structure is statically defined in the API. At the end, it will be less expressive and more restricted. However, one might wonder why we have an API that is so abstracted away (accept any inpyt). For that, we might want to "rethink" the API to be more precise. Similarly, we might want to think if we really need a gRPC interface, as this won't make our life easier. |
Yes, I have to say I like this approach, maybe even more than the current one I settled for in my ongoing PR (fuseml/fuseml-core#24), which uses a
I agree with the general idea of "other", but I can't see any use for "unknown input type" in this particular case, given that fuseml needs to explicitly translate all inputs and outputs into Tekton concepts.
Yes, this is a trade-off between convenience and flexibility. From a domain driven design, the business logic isn't (and shouldn't) be concerned with marshalling, serialization, data type validation etc or basically anything that deals with I/O. So either we use a code generation tools to offload some of that effort, or we write our own marshalling/unmarshalling logic in addition to the business logic. Currently, we're harvesting the convenience of goa to get results fast, while focusing on business logic, but I don't see any reason why we couldn't switch to a different approach at a later time. The fact that we're using domain driven design to decouple our business logic from I/O details makes this possible with minimal impact to the existing code.
Yes, we could disable gRPC for now, we don't really use it anyway, and it's a transport detail. |
No longer relevant. We went with the approach described in #80 (comment) |
We need to model mutually exclusive attributes in the fuseml REST API, but goa doesn't seem to offer this out-of-the-box.
Example: runnable and workflow REST API resources can have several types of inputs. Depending on its type, the input's attributes are different, e.g.:
This could be modeled using a one-of type of validation:
, but this isn't implemented in goa, so we use a single type for all inputs, and have all the attributes dumped there:
The text was updated successfully, but these errors were encountered: