Model Registry MLFlow compatibility: Candidate deletion"
What does this MR do and why?
This MR adds the endpoint to delete a Candidate (run) by using MLflow.
Delete Candidate query
DELETE FROM "ml_candidates"
WHERE "ml_candidates"."id" = 20
https://console.postgres.ai/gitlab/gitlab-production-main/sessions/32130/commands/99272
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
How to set up and validate locally
- Open GDK: http://127.0.0.1:3000/flightjs/Flight/-/ml/models
- Perform the following cURL
curl -X POST --header "Authorization: Bearer glpat-<redacted>" "http://127.0.0.1:3000/api/v4/projects/7/ml/mlflow/api/2.0/mlflow/experiments/create?name=experiment1"
Response:
{"experiment_id":"12"}
- This should return experiment id, use that for the following cURL to create a run. Note the run_id from the response.
curl -X POST --header "Authorization: Bearer glpat-<redacted>" "http://127.0.0.1:3000/api/v4/projects/7/ml/mlflow/api/2.0/mlflow/runs/create?experiment_id=<experiment_id>"
Response:
{"run":{"info":{"run_id":"f15c4b48-6786-4a9f-889e-3cb2dc14008a","run_uuid":"f15c4b48-6786-4a9f-889e-3cb2dc14008a","experiment_id":"12","start_time":0,"run_name":"chimpanzee-zebra-weasel-7974","status":"RUNNING","artifact_uri":"http://127.0.0.1:3000/api/v4/projects/7/packages/generic/ml_experiment_12/50/","lifecycle_stage":"active","user_id":"1"},"data":{"metrics":[],"params":[],"tags":[]}}}
- (optional) Verify that the run exists
curl -X GET --header "Authorization: Bearer glpat-<redacted>" "http://127.0.0.1:3000/api/v4/projects/7/ml/mlflow/api/2.0/mlflow/runs/get?run_id=<run_id>"
Response:
{"run":{"info":{"run_id":"f15c4b48-6786-4a9f-889e-3cb2dc14008a","run_uuid":"f15c4b48-6786-4a9f-889e-3cb2dc14008a","experiment_id":"12","start_time":0,"run_name":"chimpanzee-zebra-weasel-7974","status":"RUNNING","artifact_uri":"http://127.0.0.1:3000/api/v4/projects/7/packages/generic/ml_experiment_12/50/","lifecycle_stage":"active","user_id":"1"},"data":{"metrics":[],"params":[],"tags":[]}}}
- Delete the run
curl -X POST --header "Authorization: Bearer glpat-<redacted>" "http://127.0.0.1:3000/api/v4/projects/7/ml/mlflow/api/2.0/mlflow/runs/delete?run_id=<run_id>"
Response:
{}
- Verify that the run no longer exists
curl -X GET --header "Authorization: Bearer glpat-<redacted>" "http://127.0.0.1:3000/api/v4/projects/7/ml/mlflow/api/2.0/mlflow/runs/get?run_id=<run_id>"
Reponse:
{"error_code":"RESOURCE_DOES_NOT_EXIST"}
Numbered steps to set up and validate the change are strongly suggested.
Related to #482876 (closed)
Edited by Fred de Gier