New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli support for delete and restore + docs #367
Changes from 2 commits
71047eb
6e61eae
b87b238
1c8b972
6ca63fc
4c51742
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ and list experiments, and download artifacts. | |
Commands: | ||
azureml Serve models on Azure ML. | ||
download Download the artifact at the specified DBFS or S3 URI. | ||
experiments Run and list experiments. | ||
experiments Manage experiments. | ||
pyfunc Serve Python models locally. | ||
run Run an MLflow project from the given URI. | ||
sagemaker Serve models on Amazon SageMaker. | ||
|
@@ -49,7 +49,41 @@ specified. | |
Experiments | ||
----------- | ||
|
||
Subcommands to create and list experiments. | ||
Subcommands to manage experiments. | ||
|
||
|
||
Create | ||
------ | ||
Subcommand to create a new experiment using name. System will generate a unique ID for each | ||
experiment. Additionally, users can provide an artifact location using ``-l`` or | ||
``--artifact-location`` option. If not provided, backend store will pick default location. | ||
|
||
All artifacts related to this experiment will be stored under artifact location under specific | ||
run directories. | ||
|
||
|
||
List | ||
---- | ||
|
||
Listing of all experiments managed by backend store. | ||
|
||
|
||
Delete | ||
------ | ||
|
||
Delete an active experiment. Command takes an mandatory argument experiment ID. If experiment | ||
is already deleted or not found, the command will throw error. This deletes associated metadata, | ||
runs and data as well. If the backend store controls locations of artifacts, they will be deleted | ||
as well. Deleted experiments can be restored using ``restore`` command. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe talk about how they can clear the trash here? Can also recommend setting up a cron job or something. |
||
|
||
|
||
Restore | ||
------- | ||
|
||
Restore a deleted experiment. Command takes an mandatory argument experiment ID. If experiment is | ||
already active, permanently deleted, or cannot be found, the command will throw error. The command | ||
will restore all runs belonging to the experiment and all metadata associated with experiment and | ||
runs. | ||
|
||
|
||
Python Function | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,31 @@ def list_experiments(): | |
List all experiments in the configured tracking server. | ||
""" | ||
store = _get_store() | ||
experiments = store.list_experiments() | ||
experiments = store.list_experiments("deleted_only") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ToDo : fix this. Should default to |
||
table = [[exp.experiment_id, exp.name, exp.artifact_location if is_uri(exp.artifact_location) | ||
else os.path.abspath(exp.artifact_location)] for exp in experiments] | ||
print(tabulate(sorted(table), headers=["Experiment Id", "Name", "Artifact Location"])) | ||
|
||
|
||
@commands.command("delete") | ||
@click.argument("experiment_id") | ||
def delete_experiment(experiment_id): | ||
""" | ||
Delete an experiment from backend store. | ||
Will error out if experiment does not exist or already deleted. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This help should say that you mark it for deletion. Experiments marked this way can be restored with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
""" | ||
store = _get_store() | ||
store.delete_experiment(experiment_id) | ||
print("Experiment with id %s has been deleted." % str(experiment_id)) | ||
|
||
|
||
@commands.command("restore") | ||
@click.argument("experiment_id") | ||
def restore_experiment(experiment_id): | ||
""" | ||
Restore a deleted experiment. | ||
Will error out if experiment is already active or has been permanently deleted. | ||
""" | ||
store = _get_store() | ||
store.restore_experiment(experiment_id) | ||
print("Experiment with id %s has been restored and is now active." % str(experiment_id)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd remove the "is now active". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to be a separate kind of header from
----
to render correctly in the docs, since it's under Experiments. Right now these will look like the same level of heading. You can look at the Sphinx/RST docs to see the hierarchy of headings allowed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might also be possible to just make this a bulleted list instead of sections, since there's a lot of detail about each one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I misread the documentations. Subsections are marked with "~" . Patching coming soon.
I had initially tried the bullet route, but it looked a bit bulky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed: