Skip to content

Adds ModelsController#index

Eduardo Bonet requested to merge 385061-model-registry-ui-model-list-1 into master

What does this MR do and why?

Adds the backend boilerplate for ModelsController#index

Frontend changes being added on !124798 (merged)

Database

SELECT DISTINCT ON (name)
    *
FROM
    "packages_packages"
WHERE
    "packages_packages"."project_id" = 19
    AND "packages_packages"."status" IN (0, 1)
    AND "packages_packages"."package_type" = 14
ORDER BY
    "packages_packages"."name" DESC,
    "packages_packages"."created_at" DESC

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/19937/commands/65093

How to set up and validate locally

Example below:

  1. Enable the feature flag

    echo "Feature.enable(:model_registry)" | bundle exec rails c
  2. Create a few packages of model type. In rails console:

    project = Project.find_by(id: 1) # or any other project you are testing
    project.packages.create!(name: 'model1', version: 'a', package_type: :ml_model)
    project.packages.create!(name: 'model1', version: 'b', package_type: :ml_model)
    project.packages.create!(name: 'model2', version: 'a', package_type: :ml_model)
  3. Navigate to /-/ml/models, should display a json version of the models with the name, version and path of each of them. Note that only one model1 should be displayed.

MR acceptance checklist

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

Related to #385061 (closed)

Edited by Eduardo Bonet

Merge request reports

Loading