Model Experiments: Add Experiments to GraphQL
What does this MR do and why?
This merge request introduces GraphQL support for machine learning experiments in GitLab. It adds new types, resolvers, and fields to handle ML experiments, including the ability to query individual experiments and lists of experiments. The changes include new GraphQL types for ML experiments, resolvers to fetch experiment details and lists, and updates to existing types to incorporate the new ML experiment fields.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
How to set up and validate locally
- In Rails console create a model with experiment and candidates:
p = Project.find_by_id(7)
m = Ml::CreateModelService.new(p, "model_1").execute
20.times { |i| Ml::CreateCandidateService.new(m.default_experiment, {}).execute }
- Open GraphQL explorer: http://127.0.0.1:3000/-/graphql-explorer
- Fetch all experiments for a project
query getExperiments($fullPath: ID! = "flightjs/Flight") {
project(fullPath: $fullPath) {
id
mlExperiments {
nodes {
id
name
createdAt
path
candidateCount
creator {
id
name
webUrl
}
modelId
candidates {
nodes {
id
name
createdAt
}
}
}
}
}
}
- Fetch a specific experiment
query getExperiment {
mlExperiment(id: "gid://gitlab/Ml::Experiment/3") {
id
name
createdAt
path
modelId
candidateCount
creator {
id
name
webUrl
}
modelId
}
}
Numbered steps to set up and validate the change are strongly suggested.
Related to #509320 (closed)