Skip to content

Adds boilerplate for /-/ml/models/{model_id}

Eduardo Bonet requested to merge model_registry/show_model_scaffold into master

What does this MR do and why?

Boilerplate for /-/ml/models/{model_id}

Adds backend and frontend boilerplate code for GET /-/ml/models/{id}. The goal of this MR is not to implement UX or features, just setup the page rendering itself. The page currently only displays the name of the model.

image

How to set up and validate locally

  1. On rails console, enable the feature flag and create some data

    Feature.enable("model_registry")
    p = Project.find_by(id: 20) # or whatever project you want to use for testing
    Ml::FindOrCreateModelService.new(p, "model_0").execute
  2. Navigate to {project}/-/ml/models/{model.id}

Database

SELECT
    "ml_models".*
FROM
    "ml_models"
WHERE
    "ml_models"."project_id" = 20
    AND "ml_models"."id" = 22
LIMIT 1

Local explain (5k+ entries):

Limit  (cost=0.28..2.30 rows=1 width=40) (actual time=0.013..0.014 rows=1 loops=1)
  ->  Index Scan using ml_models_pkey on ml_models  (cost=0.28..2.30 rows=1 width=40) (actual time=0.013..0.013 rows=1 loops=1)
        Index Cond: (id = 22)
        Filter: (project_id = 20)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eduardo Bonet

Merge request reports

Loading