Skip to content

Resolve "Candidate artifact clutters package registry"

What does this MR do and why?

Internal feedback mentioned that creating a package for each of the candidates clutters the package registry. We address it my having every experiment being a package name, and each candidate package being a version of the experiment. Before, creating 10 candidates would create 10 candidates with names ml_candidate_{candidate.id} and version -, but now all the 10 candidates have package name ml_experiment_{candidate.experiment.iid} and version candidate.iid.

Artifacts for existing candidates will keep their name and version.

How to set up and validate locally

  1. Enable the feature flag

    echo "Feature.enable(:ml_experiment_tracking)" | bundle exec rails c
  2. Create an experiment

    exp = Ml::Experiment.create!(name: "Gitlab Experiment", user_id: user_id, project_id: project_id)
  3. Fetch the candidate using the api. Note that the PATH has now been changed.

    curl -X POST -H "Authorization: Bearer $GITLAB_PAT" -d experiment_id=1 http://gdk.test:3000/api/v4/projects/$PROJECT_ID/ml/mlflow/api/2.0/mlflow/runs/create
  4. Note that the artifact path has changed from '/api/v4/projects/21/packages/generic/ml_candidate_{id}/-/' to '/api/v4/projects/21/packages/generic/ml_candidate_experiment_{candidate.experiment.iid}/{candidate.iid}/

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

Edited by Eduardo Bonet

Merge request reports