Excludes Ml::Models from showing up on Experiments
What does this MR do and why?
Excludes Ml::Models from showing up on Experiments
A model on Model registry will always be created with an associated experiment, but these shouldn't be showing on Model Experiment tracking related routes.
Changelog: changed
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
-
In rails console, create an ml model and an ml experiment:
p = Project.find_by(id: 1) Ml::FindOrCreateModelService.new(p, "model_1").execute Ml::Experiment.create(project: p, name: "Awesome experiment")
-
Navigate to Project > Analyze > Model experiments. Verify that only one item (
Awesome experiment
) is showing.
Database
Queries
exclude_experiments_for_models
SELECT
"ml_experiments".*
FROM
"ml_experiments"
WHERE
"ml_experiments"."model_id" IS NULL
Index Scan using index_ml_experiments_on_model_id on public.ml_experiments (cost=0.15..21.14 rows=335 width=97) (actual time=16.756..36.888 rows=335 loops=1)
Index Cond: (ml_experiments.model_id IS NULL)
Buffers: shared hit=1 read=7 dirtied=2
I/O Timings: read=31.612 write=0.000
https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/25700/commands/81115