cli
cli copied to clipboard
Add MLflow "download artifacts" command to CLI for CI/CD model deployment
Event though "download artifacts" is not part of MLflow REST API (because much of the logic is client-side), it is an important method that is part of the Python MLflow API and the MLflow CLI. This is needed by CI/CD pipelines that need to download a model in order to deploy it to another environment.
Python API: https://mlflow.org/docs/latest/python_api/mlflow.artifacts.html#mlflow.artifacts.download_artifacts
MLflow CLI: https://mlflow.org/docs/latest/cli.html?highlight=download%20artifacts#mlflow-artifacts-download
mlflow artifacts --help
Download an artifact file or directory to a local directory. The output is
the name of the file or directory on the local filesystem.
Either ``--artifact-uri`` or ``--run-id`` must be provided.
Options:
-r, --run-id TEXT Run ID from which to download
-a, --artifact-path TEXT For use with Run ID: if specified, a path relative
to the run's root directory to download
-u, --artifact-uri TEXT URI pointing to the artifact file or artifacts
directory; use as an alternative to specifying
--run_id and --artifact-path
-d, --dst-path TEXT Path of the local filesystem destination directory
to which to download the specified artifacts. If
the directory does not exist, it is created. If
unspecified the artifacts are downloaded to a new
uniquely-named directory on the local filesystem,
unless the artifacts already exist on the local
filesystem, in which case their local path is
returned directly