Backend should return results data in a task agnostic format for frontend consumption #678
Open
1 task done
Labels
api
Changes which impact API/presentation layer
backend
enhancement
New feature or request
schemas
Changes to schemas (which may be public facing)
sdk
Motivation
I believe this is also a relevant issue for the task that @HareeshBahuleyan is working on:
As I understand it currently, the metric names and settings are hardcoded into the frontend, e.g. https://github.com/mozilla-ai/lumigator/blob/main/lumigator/frontend/src/components/molecules/LExperimentResults.vue#L69
As we support new metrics and custom user metrics in the future, I'm thinking that the frontend should be able to remain ignorant about what the specific metric is.
In order to support this, I think we need to restructure the file whose path we provide to the frontend, which relates to #670.
Currently, the file that the eval job creates and saves to S3 (which then the backend creates a presigned url so that the frontend can download the file) looks like this:
Can we re-org this to something that looks more like
This would be the first step towards a more structured output. As I understand it, the backend is agnostic about what is in the output result.json from a job, and the frontend relies upon the job to create the result.json in the right format. My thought was that it would help if the backend was responsible for ensuring that the job output conforms to the standards that the frontend requires.
I think(?) this should help to make our code more flexible to handle new tasks.
In order to make this backwards compatible at first, we can overhaul each job to save both the existing result.json file in addition to a new file that conforms to our new agreed upon format. This way we don't need to as tightly coordinate the backend with frontend changes.
Alternatives
This is more of an incremental step. We could try to take a more massive bite and try to completely overhaul how files are saved and provided to the frontend, for example, saving and providing 3+ files to the frontend instead of the single results.json.
Contribution
Happy to help work on this if this direction sounds good.
Have you searched for similar issues before submitting this one?
The text was updated successfully, but these errors were encountered: