Skip to content

Commit

Permalink
Add --artifacts-destination to mlflow ui (#5032)
Browse files Browse the repository at this point in the history
Signed-off-by: harupy <hkawamura0130@gmail.com>
  • Loading branch information
harupy committed Nov 9, 2021
1 parent e9098ef commit f83aea1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
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."
),
)

0 comments on commit f83aea1

Please sign in to comment.