Skip to content

Added MLFLow API to delete a registered model by name

Darby Frey requested to merge delete-registered-model into master

What does this MR do and why?

Continuing on the work to build the MLFlow Registered Models API, this MR adds an endpoint to delete a registered model by name.

The Delete RegisteredModel API accepts a name and it returns an empty hash or an error message if the validation fails.

Database Review

This MR introduces two new database interactions:

  1. Get all packages for a given ML Model
  2. Delete an ML Model

Get all packages for a given ML Model

SELECT
  "packages_packages".*
FROM
  "packages_packages"
WHERE
  "packages_packages"."package_type" = 14
  AND "packages_packages"."project_id" = 20
  AND "packages_packages"."id" IN (
    SELECT
      "ml_model_versions"."package_id"
    FROM
      "ml_model_versions"
    WHERE
      "ml_model_versions"."model_id" = 26
  )

https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/24156/commands/77122

Delete an ML Model

DELETE FROM
  "ml_models"
WHERE
  "ml_models"."id" = 16

https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/24022/commands/76895

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

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 Darby Frey

Merge request reports

Loading