管理计算池
计算池是一个或多个虚拟机 (VM) 节点的集合,Snowflake 会在这些节点上运行您的 Snowpark Container Services 作业和服务。
For more information about compute pools, see Snowpark Container Services: Working with compute pools.
本主题介绍如何使用服务执行以下任务:
For common operations, such as listing or dropping, Snowflake CLI uses snow object commands as described in Managing Snowflake objects.
创建计算池
To create a compute pool named “pool_1” composed of two CPUs with 4 GB of memory, enter a spcs pool create command similar to the following:
For more information about instance families, see the SQL CREATE COMPUTE POOL command.
根据项目定义创建计算池
You can create a compute pool from a snowflake.yml project definition file and then executing the snow spcs compute-pool deploy command.
The following shows a sample snowflake.yml project definition file:
下表描述了计算池项目定义的属性。
Compute pool project definition properties
| Property | Definition |
|---|---|
type required、string | Must be compute-pool. |
identifier optional、string | 实体的 Snowflake 标识符。该值可以采用以下形式:
Both unquoted and quoted identifiers are supported. To use quoted identifiers, include the surrounding quotes in the YAML value (for example,
Note An error occurs if you specify a |
instance_family required、string | Name of the instance family. For a list of available instance families, see the CREATE COMPUTE POOL INSTANCE_FAMILY parameter. |
min_nodes optional、string | 计算池的最小节点数。此值必须大于 0。 Default: |
max_nodes optional、int | Maximum number of nodes for the compute pool. |
auto_resume optional、boolean | 在向计算池提交服务或作业时是否会自动恢复计算池。 Default: |
initially_suspended optional、boolean | Whether the compute pool is created initially in the suspended state. If Default: |
auto_suspend_seconds optional、int | 您希望 Snowflake 自动暂停计算池的不活动秒数。 Default: |
comment optional、string | Comments to associate with the compute pool. |
tags optional、Tag sequence | Tag names and values for the compute pool. For more information, see Tag quotas |
要创建计算池并将其部署到暂存区,请执行以下操作:
-
将当前目录更改为包含项目定义文件的目录。
-
Run a
snow spcs compute-pool deploycommand similar to the following:
暂停和恢复计算池
Note
当前角色必须拥有计算池的 OPERATE 权限,才能暂停或恢复计算池。
要暂停计算池,请输入类似下面的命令:
要恢复暂停的计算池,请输入类似下面的命令:
设置和取消设置计算池的属性或参数
Note
当前角色必须具有计算池的 MODIFY 权限才能设置属性。
要设置属性或参数,请输入类似下面的命令:
要将属性或参数重置为默认值,请输入类似下面的命令:
停止计算池中的所有服务
停止计算池会删除计算池上运行的所有服务,但不会停止计算池本身。
To stop a compute pool, enter a spcs compute-pool stop-all command similar to the following: