Skip to content

Draft: Creating ModelVersion also creates Package

What does this MR do and why?

Creating ModelVersion also creates Package

Beforehand the package was only created when a model version was created through the ml_model package endpoint, which would cause model versions created in other places to be inconsistent. While a nil value for package should be allowed (deleted in cleanup job for example), at creation time it should always be available.

How to set up and validate locally

  1. Create a model version with the service

    project = Project.find_by(id: 1)
    user = User.find_by(id: 1)
    params = {user: user, model_name: 'blah', version: '1.2.3'}
    
    mv = Ml::FindOrCreateModelVersionService.new(project, params).execute
  2. Verify that a package was created:

    mv.package

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

Merge request reports