Skip to content
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

Add --artifacts-destination option to mlflow ui #5032

Merged
merged 1 commit into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 6 additions & 13 deletions mlflow/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,10 @@ def _validate_server_args(gunicorn_opts=None, workers=None, waitress_opts=None):
"Note that this flag does not impact already-created experiments. "
"Default: " + DEFAULT_LOCAL_FILE_AND_ARTIFACT_PATH,
)
@cli_args.ARTIFACTS_DESTINATION
@cli_args.PORT
@cli_args.HOST
def ui(backend_store_uri, default_artifact_root, port, host):
def ui(backend_store_uri, default_artifact_root, artifacts_destination, port, host):
"""
Launch the MLflow tracking UI for local viewing of run results. To launch a production
server, use the "mlflow server" command instead.
Expand Down Expand Up @@ -277,7 +278,9 @@ def ui(backend_store_uri, default_artifact_root, port, host):

# TODO: We eventually want to disable the write path in this version of the server.
try:
_run_server(backend_store_uri, default_artifact_root, host, port, None, 1)
_run_server(
backend_store_uri, default_artifact_root, artifacts_destination, host, port, None, 1
)
except ShellCommandException:
eprint("Running the mlflow server failed. Please see the logs above for details.")
sys.exit(1)
Expand Down Expand Up @@ -317,17 +320,7 @@ def _validate_static_prefix(ctx, param, value): # pylint: disable=unused-argume
"Default: Within file store, if a file:/ URI is provided. If a sql backend is"
" used, then this option is required.",
)
@click.option(
"--artifacts-destination",
metavar="URI",
default="./mlartifacts",
help=(
"The base artifact location from which to resolve artifact upload/download/list requests "
"(e.g. 's3://my-bucket'). Defaults to a local './mlartifacts' directory. This option only "
"applies when the tracking server is configured to stream artifacts and the experiment's "
"artifact root location is http or mlflow-artifacts URI."
),
)
@cli_args.ARTIFACTS_DESTINATION
@cli_args.HOST
@cli_args.PORT
@cli_args.WORKERS
Expand Down
12 changes: 12 additions & 0 deletions mlflow/utils/cli_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,15 @@
default=False,
help="Enable serving with MLServer through the v2 inference protocol.",
)

ARTIFACTS_DESTINATION = click.option(
"--artifacts-destination",
metavar="URI",
default="./mlartifacts",
help=(
"The base artifact location from which to resolve artifact upload/download/list requests "
"(e.g. 's3://my-bucket'). Defaults to a local './mlartifacts' directory. This option only "
"applies when the tracking server is configured to stream artifacts and the experiment's "
"artifact root location is http or mlflow-artifacts URI."
),
)