Added gitlab_tags helper to MLflow API
What does this MR do and why?
Related to [MLflow Compatibility]: allow users to pass ver... (#434408 - closed), this MR adds:
- The
gitlab_tagsAPI helper method to extractgitlab.tags to a special input hash - The
custom_versionAPI helper method to return the version string when supplied as a gitlab tag (gitlab.version) - The ability to persist the
gitlab.versiontag value as the version for a model version
How to set up and validate locally
-
In the Rails console, ensure the feature flags are enabled
Feature.enable(:ml_experiment_tracking) Feature.enable(:model_registry) -
In the Rails console, create an ML model in the project
Ml::CreateModelService.new(Project.find(PROJECT_ID), 'my-model-name').execute -
Enable the Model Registry feature toggle in the project by going to Settings > General > Visibility, project features, permissions and flipping the toggle for Model Registry
-
Use the following cURL command to create a new model version with a custom version string in a local GDK project
curl -X "POST" "http://GDKHOST/api/v4/projects/PROJECT_ID/ml/mlflow/api/2.0/mlflow/model-versions/create" \ -H 'Authorization: Bearer PERSONAL_ACCESS_TOKEN' \ -H 'Content-Type: application/json; charset=utf-8' \ -d $'{ "name": "my-model-name", "tags": [ { "key": "gitlab-version", "value": "4.5.6" } ], "description": "My Model Description" }' -
Use the get API to look up the newly created model version.
curl -X "GET" "http://GDKHOST/api/v4/projects/PROJECT_ID/ml/mlflow/api/2.0/mlflow/model-versions/get?name=my-model-name&version=4.5.6" \ -H 'Authorization: Bearer PERSONAL_ACCESS_TOKEN'
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Darby Frey