Skip to content
Snippets Groups Projects

Adds backend project setting for model registry

Merged Darby Frey requested to merge model-registry-feature-setting into master
All threads resolved!

What does this MR do and why?

This MR addresses the first part of Add feature toggle for Model registry (#412734 - closed) by adding the attribute to the database and the configuration for the Model Registry feature setting.

How to set up and validate locally

  1. Run migrations
  2. on rails console, run the command below. It should return 20
    Project.first.model_experiments_access_level

Database Review

Up
main: == [advisory_lock_connection] object_id: 184060, pg_backend_pid: 11065
main: == 20231130195635 AddModelRegistryAccessLevelToProjectFeature: migrating ======
main: -- add_column(:project_features, :model_registry_access_level, :integer, {:null=>false, :default=>20})
main:    -> 0.0026s
main: == 20231130195635 AddModelRegistryAccessLevelToProjectFeature: migrated (0.0062s) 

main: == [advisory_lock_connection] object_id: 184060, pg_backend_pid: 11065
Down
main: == [advisory_lock_connection] object_id: 184060, pg_backend_pid: 10462
main: == 20231130195635 AddModelRegistryAccessLevelToProjectFeature: reverting ======
main: -- remove_column(:project_features, :model_registry_access_level, :integer, {:null=>false, :default=>20})
main:    -> 0.0026s
main: == 20231130195635 AddModelRegistryAccessLevelToProjectFeature: reverted (0.0087s) 

main: == [advisory_lock_connection] object_id: 184060, pg_backend_pid: 10462

MR acceptance checklist

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

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Eduardo Bonet approved this merge request

    approved this merge request

  • Eduardo Bonet requested review from @acook.gitlab and removed review request for @eduardobonet

    requested review from @acook.gitlab and removed review request for @eduardobonet

  • Setting label(s) Category:MLOps based on groupmlops.

  • Darby Frey requested review from @carlad-gl

    requested review from @carlad-gl

  • additive schema change; no impact to data warehouse

  • Allen Cook approved this merge request

    approved this merge request

  • Allen Cook removed review request for @acook.gitlab

    removed review request for @acook.gitlab

  • Carla Drago approved this merge request

    approved this merge request

  • Carla Drago requested review from @ahegyi and removed review request for @carlad-gl

    requested review from @ahegyi and removed review request for @carlad-gl

  • Adam Hegyi approved this merge request

    approved this merge request

  • added databaseapproved label and removed databasereview pending label

  • Contributor

    Database migrations (on the main database)

    Migrations included in this change have been executed on gitlab.com data for testing purposes. For details, please see the migration testing pipeline (limited access).

    Migration Type Total runtime Result DB size change
    20231130195635 - AddModelRegistryAccessLevelToProjectFeature Regular 2.3 s :white_check_mark: +0.00 B
    Runtime Histogram for all migrations
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 5
    0.1 seconds - 1 second 0
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20231130195635 - AddModelRegistryAccessLevelToProjectFeature

    • Type: Regular
    • Duration: 2.3 s
    • Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    1 45.1 ms 45.1 ms 45.1 ms 0
    ALTER TABLE "project_features" ADD "model_registry_access_level" integer DEFAULT 20 NOT NULL
    1 1.3 ms 1.3 ms 1.3 ms 1
    SELECT "feature_gates"."key", "feature_gates"."value"  FROM "feature_gates"  WHERE "feature_gates"."feature_key" = $1
    1 0.0 ms 0.0 ms 0.0 ms 1
    SELECT $1::regtype::oid
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for AddModelRegistryAccessLevelToProjectFeature
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 5
    0.1 seconds - 1 second 0
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Other information

    No other migrations pending on GitLab.com

    Clone details
    Clone ID Clone Created At Clone Data Timestamp Expected Removal Time
    database-testing-2596691-12097558-main 2023-12-04T11:01:00Z 2023-12-04T08:10:14Z 2023-12-04 23:05:05 +0000
    database-testing-2596691-12097558-ci 2023-12-04T11:01:00Z 2023-12-04T08:44:15Z 2023-12-04 23:05:05 +0000

    Job artifacts

    Database migrations (on the ci database)

    Migrations included in this change have been executed on gitlab.com data for testing purposes. For details, please see the migration testing pipeline (limited access).

    Migration Type Total runtime Result DB size change
    20231130195635 - AddModelRegistryAccessLevelToProjectFeature Regular 3.2 s :white_check_mark: +0.00 B
    Runtime Histogram for all migrations
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 3
    0.1 seconds - 1 second 1
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20231130195635 - AddModelRegistryAccessLevelToProjectFeature

    • Type: Regular
    • Duration: 3.2 s
    • Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    1 81.7 ms 81.7 ms 81.7 ms 0
    ALTER TABLE "project_features" ADD "model_registry_access_level" integer DEFAULT 20 NOT NULL
    1 0.0 ms 0.0 ms 0.0 ms 1
    SELECT $1::regtype::oid
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for AddModelRegistryAccessLevelToProjectFeature
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 3
    0.1 seconds - 1 second 1
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Other information

    No other migrations pending on GitLab.com

    Clone details
    Clone ID Clone Created At Clone Data Timestamp Expected Removal Time
    database-testing-2596691-12097558-main 2023-12-04T11:01:00Z 2023-12-04T08:10:14Z 2023-12-04 23:05:05 +0000
    database-testing-2596691-12097558-ci 2023-12-04T11:01:00Z 2023-12-04T08:44:15Z 2023-12-04 23:05:05 +0000

    Job artifacts


    Brought to you by gitlab-org/database-team/gitlab-com-database-testing. Epic

  • Adam Hegyi resolved all threads

    resolved all threads

  • Adam Hegyi requested review from @sam.figueroa

    requested review from @sam.figueroa

  • SAM FIGUEROA approved this merge request

    approved this merge request

  • SAM FIGUEROA resolved all threads

    resolved all threads

  • Adam Hegyi enabled an automatic merge when the pipeline for 9dd7e9f4 succeeds

    enabled an automatic merge when the pipeline for 9dd7e9f4 succeeds

  • merged

  • Hello @darbyfrey :wave:

    The database team is looking for ways to improve the database review process and we would love your help!

    If you'd be open to someone on the database team reaching out to you for a chat, or if you'd like to leave some feedback asynchronously, just post a reply to this comment mentioning:

    @gitlab-org/database-team

    And someone will be by shortly!

    Thanks for your help! :heart:

    This message was generated automatically. You're welcome to improve it.

  • Adam Hegyi mentioned in commit 060a7794

    mentioned in commit 060a7794

  • Darby Frey mentioned in commit 8f2c2253

    mentioned in commit 8f2c2253

  • added workflowproduction label and removed workflowcanary label

  • Eduardo Bonet mentioned in issue #440955

    mentioned in issue #440955

  • Please register or sign in to reply
    Loading