`mlflow server` - `--default-artifact-root` 和 `--artifacts-destination` 之间的区别

wav*_*ide 3 mlflow mlops

我正在用来mlflow server设置 mlflow 跟踪服务器。mlflow server有 2 个接受工件 URI 的命令选项,--default-artifact-root <URI>以及--artifacts-destination <URI>.

\n

根据我的理解,--artifacts-destination当跟踪服务器为工件提供服务时使用。

\n

基于MLflow Tracking文档提供的场景4和5

\n
mlflow server --backend-store-uri postgresql://user:password@postgres:5432/mlflowdb --default-artifact-root s3://bucket_name --host remote_host --no-serve-artifacts\n
Run Code Online (Sandbox Code Playgroud)\n
mlflow server \\\n  --backend-store-uri postgresql://user:password@postgres:5432/mlflowdb \\\n  # Artifact access is enabled through the proxy URI \'mlflow-artifacts:/\',\n  # giving users access to this location without having to manage credentials\n  # or permissions.\n  --artifacts-destination s3://bucket_name \\\n  --host remote_host\n
Run Code Online (Sandbox Code Playgroud)\n

在这 2 个场景中, 和--default-artifact-root--artifacts-destination接受 s3 存储桶 URIs3://bucket_name作为参数。我不明白为什么我们需要 2 个单独的命令选项来设置工件 URI。

\n

他们的描述是

\n
\n

--default-artifact-root <URI>
\n用于存储创建的任何新实验的工件的目录。对于依赖 SQL 的跟踪服务器后端,需要此选项才能存储工件。请注意,此标志不会影响使用 MLflow 服务器实例的任何先前配置创建的实验。默认情况下,如果启用了 \xe2\x80\x93serve-artifacts 选项,数据将记录到 mlflow-artifacts:/ uri 代理。否则,默认位置将为 ./mlruns。

\n
\n
\n

--artifacts-destination <URI>
\n用于解析工件上传/下载/列表请求的基本工件位置(例如 \xe2\x80\x98s3://my-bucket\xe2\x80\x99)。默认为本地 \xe2\x80\x98./mlartifacts\xe2\x80\x99 目录。仅当跟踪服务器配置为流式传输工件且实验\xe2\x80\x99s 工件根位置为 http 或 mlflow-artifacts URI 时,此选项才适用。

\n
\n

有2个命令选项的原因是什么?如果两者都指定了会发生什么情况,一个 URI 会在另一个 URI 之前吗?

\n

gge*_*eop 5

起初,这看起来很混乱,因为你有很高的灵活性。
\n您可以同时使用它们或仅使用其中之一。让我们再解释一下:-)

\n
    \n
  • --default-artifact-root目录用于存储每个新实验的工件。\n
      \n
    • 注意:默认值取决于是否-serve-artifacts启用\n( mlflow-artifacts:/,./mlruns )
    • \n
    \n
  • \n
  • --artifacts-destination用于指定 HTTP 请求中项目的位置。\n
      \n
    • 注意:仅当跟踪服务器配置为流式传输工件(--serve-artifacts已启用)且实验\xe2\x80\x99s 工件根位置为http或时,此选项才适用mlflow-artifacts URI
    • \n
    \n
  • \n
\n

情况 1:同时使用--default-artifact-root&--artifacts-destination

\n
mlflow server\n  --default-artifact-root mlflow-artifacts:/\n  --artifacts-destination s3://my-root-bucket\n  --host remote_host\n  --serve-artifacts\n
Run Code Online (Sandbox Code Playgroud)\n

情况 2:仅使用--artifacts-destination

\n
mlflow server\n  --artifacts-destination s3://my-root-bucket\n  --host remote_host\n  --serve-artifacts\n
Run Code Online (Sandbox Code Playgroud)\n

情况 3:仅使用--default-artifact-root

\n
mlflow server\n    --default-artifact-root is s3://my-root-bucket/mlartifacts\n    --serve-artifacts\n
Run Code Online (Sandbox Code Playgroud)\n

在这种情况下,服务器可以将以下所有模式解析为配置的代理对象存储位置s3://my-root-bucket/mlartifacts

\n
https://<host>:<port>/mlartifacts\nhttp://<host>/mlartifacts\nmlflow-artifacts://<host>/mlartifacts\nmlflow-artifacts://<host>:<port>/mlartifacts\nmlflow-artifacts:/mlartifacts\n
Run Code Online (Sandbox Code Playgroud)\n