if not backend_store_uri: backend_store_uri = DEFAULT_LOCAL_FILE_AND_ARTIFACT_PATH if not default_artifact_root: if _is_local_uri(backend_store_uri): default_artifact_root = backend_store_uri else: eprint("Option 'default-artifact-root' is required, when backend store is not " "local file based.") sys.exit(1) try: _run_server(backend_store_uri, default_artifact_root, host, port, workers, static_prefix, gunicorn_opts) except ShellCommandException: eprint("Running the mlflow server failed. Please see the logs above for details.") sys.exit(1) cli.add_command(mlflow.pyfunc.cli.commands) cli.add_command(mlflow.rfunc.cli.commands) cli.add_command(mlflow.sagemaker.cli.commands) cli.add_command(mlflow.experiments.commands) cli.add_command(mlflow.store.cli.commands) cli.add_command(mlflow.azureml.cli.commands) cli.add_command(mlflow.runs.commands) cli.add_command(mlflow.db.commands) if __name__ == '__main__': cli()
def server(file_store, default_artifact_root, host, port, workers, static_prefix, gunicorn_opts): """ Run the MLflow tracking server. The server which listen on http://localhost:5000 by default, and only accept connections from the local machine. To let the server accept connections from other machines, you will need to pass --host 0.0.0.0 to listen on all network interfaces (or a specific interface address). """ try: _run_server(file_store, default_artifact_root, host, port, workers, static_prefix, gunicorn_opts) except ShellCommandException: print( "Running the mlflow server failed. Please see the logs above for details.", file=sys.stderr) sys.exit(1) cli.add_command(mlflow.sklearn.commands) cli.add_command(mlflow.data.download) cli.add_command(mlflow.pyfunc.cli.commands) cli.add_command(mlflow.rfunc.cli.commands) cli.add_command(mlflow.sagemaker.cli.commands) cli.add_command(mlflow.azureml.cli.commands) cli.add_command(mlflow.experiments.commands) cli.add_command(mlflow.store.cli.commands) if __name__ == '__main__': cli()
"local file based.") sys.exit(1) try: initialize_backend_stores(backend_store_uri, default_artifact_root) except Exception as e: # pylint: disable=broad-except _logger.error("Error initializing backend store") _logger.exception(e) sys.exit(1) try: _run_server(backend_store_uri, default_artifact_root, host, port, static_prefix, workers, gunicorn_opts, waitress_opts) except ShellCommandException: eprint( "Running the mlflow server failed. Please see the logs above for details." ) sys.exit(1) cli.add_command(mlflow.models.cli.commands) cli.add_command(mlflow.sagemaker.cli.commands) cli.add_command(mlflow.experiments.commands) cli.add_command(mlflow.store.artifact.cli.commands) cli.add_command(mlflow.azureml.cli.commands) cli.add_command(mlflow.runs.commands) cli.add_command(mlflow.db.commands) if __name__ == '__main__': cli()