Skip to content

Commit

Permalink
Add deleteTag endpoints in client APIs (mlflow#1559)
Browse files Browse the repository at this point in the history
* add delete tag endpoint and tests to OSS storage interfaces

* lints and order fix to deploy paths for API

* add client API endpoints for deleteTag

* update protos with comments

* add client API endpoints for deleteTag

* update Java client with protobuf mapper, add generated R docs

* lints, docs

* nits, docs

* add client API endpoints for deleteTag

* update Java client with protobuf mapper, add generated R docs

* lints, docs

* fix R test, add rest tracking tests, fix fluent

* file store removes hard instead of move to trash

* fix sqlalchemy store, R test

* lints, java client test, fix R test

* final proto update, final test coverage updates

* add client API endpoints for deleteTag

* update Java client with protobuf mapper, add generated R docs

* lints, docs

* add client API endpoints for deleteTag

* lints, docs

* fix R test, add rest tracking tests, fix fluent

* fix sqlalchemy store, R test

* lints, java client test, fix R test

* deletes have consequences

* update docs

* add client API endpoints for deleteTag

* update Java client with protobuf mapper, add generated R docs

* lints, docs

* add client API endpoints for deleteTag

* lints, docs

* fix R test, add rest tracking tests, fix fluent

* fix sqlalchemy store, R test

* lints, java client test, fix R test

* add client API endpoints for deleteTag

* add client API endpoints for deleteTag

* fix R test, add rest tracking tests, fix fluent

* fix sqlalchemy store, R test

* deletes have consequences

* update docs, test coverage

* resolve weirdness from merge conflicts

* export delete_tag with fluent, add fluent delete_tag test

* test_tracking relies on there being no active run from previous experiments
  • Loading branch information
ankit-db authored Jul 12, 2019
1 parent 849161e commit 37cb677
Show file tree
Hide file tree
Showing 16 changed files with 241 additions and 35 deletions.
100 changes: 68 additions & 32 deletions docs/source/R-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,42 @@ Arguments
| | the current tracking URI. |
+-------------------------------+--------------------------------------+

``mlflow_delete_tag``
=====================

Delete Tag

Deletes a tag on a run. This is irreversible. Tags are run metadata that
can be updated during a run and after a run completes.

.. code:: r
mlflow_delete_tag(key, run_id = NULL, client = NULL)
.. _arguments-4:

Arguments
---------

+-------------------------------+--------------------------------------+
| Argument | Description |
+===============================+======================================+
| ``key`` | Name of the tag. Maximum size is 255 |
| | bytes. This field is required. |
+-------------------------------+--------------------------------------+
| ``run_id`` | Run ID. |
+-------------------------------+--------------------------------------+
| ``client`` | (Optional) An MLflow client object |
| | returned from |
| | `mlflow_client <#mlflow-client>`__ . |
| | If specified, MLflow will use the |
| | tracking server associated with the |
| | passed-in client. If unspecified |
| | (the common case), MLflow will use |
| | the tracking server associated with |
| | the current tracking URI. |
+-------------------------------+--------------------------------------+

``mlflow_download_artifacts``
=============================

Expand All @@ -180,7 +216,7 @@ if applicable, and return a local path for it.
mlflow_download_artifacts(path, run_id = NULL, client = NULL)
.. _arguments-4:
.. _arguments-5:

Arguments
---------
Expand Down Expand Up @@ -217,7 +253,7 @@ is not specified.
mlflow_end_run(status = c("FINISHED", "FAILED", "KILLED"),
end_time = NULL, run_id = NULL, client = NULL)
.. _arguments-5:
.. _arguments-6:

Arguments
---------
Expand Down Expand Up @@ -259,7 +295,7 @@ Attempts to obtain the active experiment if both ``experiment_id`` and
mlflow_get_experiment(experiment_id = NULL, name = NULL,
client = NULL)
.. _arguments-6:
.. _arguments-7:

Arguments
---------
Expand Down Expand Up @@ -295,7 +331,7 @@ Get a list of all values for the specified metric for a given run.
mlflow_get_metric_history(metric_key, run_id = NULL, client = NULL)
.. _arguments-7:
.. _arguments-8:

Arguments
---------
Expand Down Expand Up @@ -331,7 +367,7 @@ largest step.
mlflow_get_run(run_id = NULL, client = NULL)
.. _arguments-8:
.. _arguments-9:

Arguments
---------
Expand Down Expand Up @@ -376,7 +412,7 @@ Extracts the ID of the run or experiment.
list(list("mlflow_id"), list("mlflow_run"))(object)
list(list("mlflow_id"), list("mlflow_experiment"))(object)
.. _arguments-9:
.. _arguments-10:

Arguments
---------
Expand All @@ -398,7 +434,7 @@ Gets a list of artifacts.
mlflow_list_artifacts(path = NULL, run_id = NULL, client = NULL)
.. _arguments-10:
.. _arguments-11:

Arguments
---------
Expand Down Expand Up @@ -435,7 +471,7 @@ Gets a list of all experiments.
mlflow_list_experiments(view_type = c("ACTIVE_ONLY", "DELETED_ONLY",
"ALL"), client = NULL)
.. _arguments-11:
.. _arguments-12:

Arguments
---------
Expand Down Expand Up @@ -471,7 +507,7 @@ all runs under the specified experiment.
mlflow_list_run_infos(run_view_type = c("ACTIVE_ONLY", "DELETED_ONLY",
"ALL"), experiment_id = NULL, client = NULL)
.. _arguments-12:
.. _arguments-13:

Arguments
---------
Expand Down Expand Up @@ -510,7 +546,7 @@ on MLflow model flavors.
mlflow_load_flavor(flavor, model_path)
.. _arguments-13:
.. _arguments-14:

Arguments
---------
Expand Down Expand Up @@ -541,7 +577,7 @@ searches for a flavor supported by R/MLflow.
mlflow_load_model(model_uri, flavor = NULL, client = mlflow_client())
.. _arguments-14:
.. _arguments-15:

Arguments
---------
Expand Down Expand Up @@ -599,7 +635,7 @@ Logs a specific file or directory as an artifact for a run.
mlflow_log_artifact(path, artifact_path = NULL, run_id = NULL,
client = NULL)
.. _arguments-15:
.. _arguments-16:

Arguments
---------
Expand Down Expand Up @@ -654,7 +690,7 @@ request), partial data may be written.
mlflow_log_batch(metrics = NULL, params = NULL, tags = NULL,
run_id = NULL, client = NULL)
.. _arguments-16:
.. _arguments-17:

Arguments
---------
Expand Down Expand Up @@ -708,7 +744,7 @@ historical metric values along two axes: timestamp and step.
mlflow_log_metric(key, value, timestamp = NULL, step = NULL,
run_id = NULL, client = NULL)
.. _arguments-17:
.. _arguments-18:

Arguments
---------
Expand Down Expand Up @@ -757,7 +793,7 @@ model as an artifact within the active run.
mlflow_log_model(model, artifact_path, ...)
.. _arguments-18:
.. _arguments-19:

Arguments
---------
Expand Down Expand Up @@ -795,7 +831,7 @@ allowed to be logged only once.
mlflow_log_param(key, value, run_id = NULL, client = NULL)
.. _arguments-19:
.. _arguments-20:

Arguments
---------
Expand Down Expand Up @@ -834,7 +870,7 @@ multiple invocations of the same script with different parameters.
mlflow_param(name, default = NULL, type = NULL, description = NULL)
.. _arguments-20:
.. _arguments-21:

Arguments
---------
Expand Down Expand Up @@ -888,7 +924,7 @@ to be used by package authors to extend the supported MLflow models.
mlflow_predict(model, data, ...)
.. _arguments-21:
.. _arguments-22:

Arguments
---------
Expand All @@ -912,7 +948,7 @@ Renames an experiment.
mlflow_rename_experiment(new_name, experiment_id = NULL, client = NULL)
.. _arguments-22:
.. _arguments-23:

Arguments
---------
Expand Down Expand Up @@ -952,7 +988,7 @@ restored.
mlflow_restore_experiment(experiment_id, client = NULL)
.. _arguments-23:
.. _arguments-24:

Arguments
---------
Expand Down Expand Up @@ -993,7 +1029,7 @@ Restores the run with the specified ID.
mlflow_restore_run(run_id, client = NULL)
.. _arguments-24:
.. _arguments-25:

Arguments
---------
Expand Down Expand Up @@ -1026,7 +1062,7 @@ Serves an RFunc MLflow model as a local web API.
mlflow_rfunc_serve(model_uri, host = "127.0.0.1", port = 8090,
daemonized = FALSE, browse = !daemonized, ...)
.. _arguments-25:
.. _arguments-26:

Arguments
---------
Expand Down Expand Up @@ -1110,7 +1146,7 @@ https://www.mlflow.org/docs/latest/cli.html#run for more info.
backend = NULL, backend_config = NULL, no_conda = FALSE,
storage_dir = NULL)
.. _arguments-26:
.. _arguments-27:

Arguments
---------
Expand Down Expand Up @@ -1202,7 +1238,7 @@ model types.
conda_env = NULL, ...)
mlflow_save_model(model, path, ...)
.. _arguments-27:
.. _arguments-28:

Arguments
---------
Expand Down Expand Up @@ -1230,7 +1266,7 @@ Metric and Param keys.
"DELETED_ONLY", "ALL"), experiment_ids = NULL, order_by = list(),
client = NULL)
.. _arguments-28:
.. _arguments-29:

Arguments
---------
Expand Down Expand Up @@ -1280,7 +1316,7 @@ Wrapper for ``mlflow server``.
host = "127.0.0.1", port = 5000, workers = 4,
static_prefix = NULL)
.. _arguments-29:
.. _arguments-30:

Arguments
---------
Expand Down Expand Up @@ -1322,7 +1358,7 @@ provided name. Returns the ID of the active experiment.
mlflow_set_experiment(experiment_name = NULL, experiment_id = NULL,
artifact_location = NULL)
.. _arguments-30:
.. _arguments-31:

Arguments
---------
Expand Down Expand Up @@ -1352,7 +1388,7 @@ run and after a run completes.
mlflow_set_tag(key, value, run_id = NULL, client = NULL)
.. _arguments-31:
.. _arguments-32:

Arguments
---------
Expand Down Expand Up @@ -1392,7 +1428,7 @@ experiments.
mlflow_set_tracking_uri(uri)
.. _arguments-32:
.. _arguments-33:

Arguments
---------
Expand All @@ -1415,7 +1451,7 @@ called via ``Rscript`` from the terminal or through the MLflow CLI.
mlflow_source(uri)
.. _arguments-33:
.. _arguments-34:

Arguments
---------
Expand All @@ -1442,7 +1478,7 @@ can be provided.
mlflow_start_run(run_id = NULL, experiment_id = NULL,
start_time = NULL, tags = NULL, client = NULL)
.. _arguments-34:
.. _arguments-35:

Arguments
---------
Expand Down Expand Up @@ -1505,7 +1541,7 @@ Launches the MLflow user interface.
mlflow_ui(client, ...)
.. _arguments-35:
.. _arguments-36:

Arguments
---------
Expand Down
1 change: 1 addition & 0 deletions mlflow/R/mlflow/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export(mlflow_client)
export(mlflow_create_experiment)
export(mlflow_delete_experiment)
export(mlflow_delete_run)
export(mlflow_delete_tag)
export(mlflow_download_artifacts)
export(mlflow_end_run)
export(mlflow_get_experiment)
Expand Down
22 changes: 22 additions & 0 deletions mlflow/R/mlflow/R/tracking-runs.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,28 @@ mlflow_set_tag <- function(key, value, run_id = NULL, client = NULL) {
invisible(NULL)
}

#' Delete Tag
#'
#' Deletes a tag on a run. This is irreversible. Tags are run metadata that can be updated during a run and
#' after a run completes.
#'
#' @param key Name of the tag. Maximum size is 255 bytes. This field is required.
#' @template roxlate-run-id
#' @template roxlate-client
#' @export
mlflow_delete_tag <- function(key, run_id = NULL, client = NULL) {
c(client, run_id) %<-% resolve_client_and_run_id(client, run_id)

key <- cast_string(key)

mlflow_rest("runs", "delete-tag", client = client, verb = "POST", data = list(
run_id = run_id,
key = key
))

invisible(NULL)
}

#' Log Parameter
#'
#' Logs a parameter for a run. Examples are params and hyperparams
Expand Down
22 changes: 22 additions & 0 deletions mlflow/R/mlflow/man/mlflow_delete_tag.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 37cb677

Please sign in to comment.