指定应用程序所需的资源

本主题介绍如何使用 marketplace.yml 文件来声明 Snowflake Native App 的资源要求。

The marketplace.yml is a configuration file similar to the manifest file of an app. Snowflake uses this file in the following contexts:

  • The objects specified in required_compute_pools and connections properties appear in the listing in Snowsight. This allows the consumer to see the resources the app may require.

  • 该文件有助于避免创建或使用不必要的资源,例如将应用程序包复制到使用者无法安装的区域。在使用者请求远程区域的列表之前,Snowflake 会确保使用者满足 marketplace.yml 文件中声明的资源需求。这有助于避免不必要的复制成本。

  • 在安装和升级应用程序之前,Snowsight 确保满足要求,以防止安装损坏/无法使用的应用程序或将正在运行的应用程序升级到无法使用的状态。

This optional file must be at the root directory of an app at the same level as the manifest file. If this file is not present, no action is taken.

指定应用程序所需的计算池

以下示例显示如何指定应用程序特定版本所需的计算池资源:

required_compute_pools:
  - HIGH_MEM_POOL_1:
      label: "High memory pool"
      description: "A compute pool for computational tasks."
      compatible_instance_families:
        - HIGHMEM_X64_M
        - HIGHMEM_X64_L
Copy

在此示例中,required_compute_pools 是名为 HIGH_MEM_POOL_1 的计算池。

compatible_instance_families 属性指定为计算池预置的机器类型。您必须为每个计算池指定至少一个声明的值。有关更多信息,请参阅 CREATE COMPUTE POOL

备注

如果 compatible_instance_families 属性缺失或值无效,版本创建会失败。

指定应用程序所需的外部端点

以下示例显示如何声明应用程序所需的外部端点:

connections:
  - LAUNCH_DARKLY:
     label: "Launch Darkly"
     description: "Feature flag and configuration"
     required: true
     endpoints:
       - "mobile.launchdarkly.com"
       - "stream.launchdarkly.com"
  - OPEN_AI:
     label: "OpenAPI"
     description: "LLM Connection"
     required: false
     endpoints:
       - "openai.com"
Copy

在此示例中,connection 属性指定两个外部端点:LAUNCH_DARKLYOPEN_AIrequired 属性向 Snowsight 中的使用者表明需要连接。

如果您在此文件中指定 connection,则 endpointsrequired 属性是必需的。如果这些属性不存在,版本创建会失败。endpoints 属性至少需要一个 URL。

语言: 中文