Skip to content

Implement model registry package type (database)

What does this MR do and why?

Adds a new package type (ml_model). This does not add interactions yet with this package type, features will be added in further MRs

Migrations

Up

main: == [advisory_lock_connection] object_id: 275700, pg_backend_pid: 1628
main: == 20230515142300 AddUniqueIndexForModelPackages: migrating ===================
main: -- transaction_open?()
main:    -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main:    -> 0.0841s
main: -- index_exists?(:packages_packages, [:project_id, :name, :version], {:unique=>true, :where=>"package_type = 14", :name=>"index_packages_on_project_id_name_version_unique_when_model", :algorithm=>:concurrently})
main:    -> 0.0086s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0005s
main: -- add_index(:packages_packages, [:project_id, :name, :version], {:unique=>true, :where=>"package_type = 14", :name=>"index_packages_on_project_id_name_version_unique_when_model", :algorithm=>:concurrently})
main:    -> 0.0038s
main: -- execute("RESET statement_timeout")
main:    -> 0.0004s
main: == 20230515142300 AddUniqueIndexForModelPackages: migrated (0.1116s) ==========

main: == [advisory_lock_connection] object_id: 275700, pg_backend_pid: 8711
main: == 20230516110414 AddMlModelMaxFileSizeToPlanLimits: migrating ================
main: -- add_column(:plan_limits, :ml_model_max_file_size, :bigint, {:default=>53687091200, :null=>false})
main:    -> 0.0058s
main: == 20230516110414 AddMlModelMaxFileSizeToPlanLimits: migrated (0.0112s) =======

main: == [advisory_lock_connection] object_id: 275700, pg_backend_pid: 1628
ci: == [advisory_lock_connection] object_id: 275980, pg_backend_pid: 1631
ci: == 20230515142300 AddUniqueIndexForModelPackages: migrating ===================
ci: -- transaction_open?()
ci:    -> 0.0000s
ci: -- view_exists?(:postgres_partitions)
ci:    -> 0.0007s
ci: -- index_exists?(:packages_packages, [:project_id, :name, :version], {:unique=>true, :where=>"package_type = 14", :name=>"index_packages_on_project_id_name_version_unique_when_model", :algorithm=>:concurrently})
ci:    -> 0.0114s
ci: -- execute("SET statement_timeout TO 0")
ci:    -> 0.0003s
ci: -- add_index(:packages_packages, [:project_id, :name, :version], {:unique=>true, :where=>"package_type = 14", :name=>"index_packages_on_project_id_name_version_unique_when_model", :algorithm=>:concurrently})
ci:    -> 0.0034s
ci: -- execute("RESET statement_timeout")
ci:    -> 0.0003s
ci: == 20230515142300 AddUniqueIndexForModelPackages: migrated (0.0325s) ==========

ci: == [advisory_lock_connection] object_id: 275940, pg_backend_pid: 8713
ci: == 20230516110414 AddMlModelMaxFileSizeToPlanLimits: migrating ================
ci: -- add_column(:plan_limits, :ml_model_max_file_size, :bigint, {:default=>53687091200, :null=>false})
ci:    -> 0.0035s
ci: == 20230516110414 AddMlModelMaxFileSizeToPlanLimits: migrated (0.0153s) =======

ci: == [advisory_lock_connection] object_id: 275980, pg_backend_pid: 1631

Down

main: == [advisory_lock_connection] object_id: 275500, pg_backend_pid: 2434
main: == 20230516110414 AddMlModelPackageMaxFileSizeToPlanLimits: reverting =========
main: -- remove_column(:plan_limits, :ml_model_packages_max_file_size, :bigint, {:default=>53687091200, :null=>false})
main:    -> 0.0027s
main: == 20230516110414 AddMlModelPackageMaxFileSizeToPlanLimits: reverted (0.0081s)

main: == [advisory_lock_connection] object_id: 275420, pg_backend_pid: 2689
main: == 20230515142300 AddUniqueIndexForModelPackages: reverting ===================
main: -- transaction_open?()
main:    -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main:    -> 0.1473s
main: -- indexes(:packages_packages)
main:    -> 0.0957s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0005s
main: -- remove_index(:packages_packages, {:algorithm=>:concurrently, :name=>"index_packages_on_project_id_name_version_unique_when_model"})
main:    -> 0.0022s
main: -- execute("RESET statement_timeout")
main:    -> 0.0003s
main: == 20230515142300 AddUniqueIndexForModelPackages: reverted (0.2697s) ==========

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 #385042 (closed)

Edited by Eduardo Bonet

Merge request reports

Loading