Skip to content

Implement model registry authorize endpoint

What does this MR do and why?

Adds first endpoints for Ml Models package endpoints. Workhorse is necessary because files uploaded are up to 10gb. Authentication should behave in the same way as generic packages, ml model specific permissions will be added later (#412734 (closed)). This is part of merging the original POC for Model Registry (!106061 (diffs))

Steps to validate

  1. Enable the feature flag

    echo "Feature.enable(:model_registry)" | bundle exec rails c
  2. Create an access token, and choose a project. Create a simple file:

    echo 'blah' > blah.txt
  3. Upload a file to ml_models. It should return {"message":"201 Created"} with feature flag enabled, 404 if feature flag disabled.

    curl  --header "Authorization:$GLAB_TOKEN" --upload-file blah.txt "http://localhost:3000/api/v4/projects/$PROJECT_ID/packages/ml_models/blah2/1.1.0/blah.txt"
  4. Navigate to Package registry of that project and verify that the model was uploaded

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

Edited by Eduardo Bonet

Merge request reports