Managing compute pools¶
A compute pool is a collection of one or more virtual machine (VM) nodes on which Snowflake runs your Snowpark Container Services jobs and services.
For more information about compute pools, see Snowpark Container Services: Working with compute pools.
This topic shows how to do the following tasks with services:
- Create a compute pool
- Create a compute pool from a project definition
- Suspend and resume a compute pool
- Set and unset a compute pool’s properties or parameters
- Stop all services in a compute pool
For common operations, such as listing or dropping, Snowflake CLI uses snow object commands as described in Managing Snowflake objects.
Create a compute pool¶
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.
Create a compute pool from a project definition¶
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:
The following table describes the properties of a compute pool project definition.
Compute pool project definition properties
| Property | Definition |
|---|---|
type required, string | Must be compute-pool. |
identifier optional, string | Snowflake identifier for the entity. The value can have the following forms:
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 | Minimum number of nodes for the compute pool. This value must be greater than 0. Default: |
max_nodes optional, int | Maximum number of nodes for the compute pool. |
auto_resume optional, boolean | Whether to automatically resume a compute pool when a service or job is submitted to it. Default: |
initially_suspended optional, boolean | Whether the compute pool is created initially in the suspended state. If Default: |
auto_suspend_seconds optional, int | Number of seconds of inactivity after which you want Snowflake to automatically suspend the compute pool. 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 |
To create and deploy the compute pool to a stage, do the following:
-
Change your current directory to the directory containing the project definition file.
-
Run a
snow spcs compute-pool deploycommand similar to the following:
Suspend and resume a compute pool¶
Note
The current role must have OPERATE privilege on the compute pool to suspend or resume it.
To suspend a compute pool, enter a command similar to the following:
To resume a suspended compute pool, enter a command similar to the following:
Set and unset a compute pool’s properties or parameters¶
Note
The current role must have MODIFY privilege on the compute pool to set properties.
To set a property or parameter, enter a command similar to the following:
To reset a property or parameter to its default value, enter a command similar to the following:
Stop all services in a compute pool¶
Stopping a compute pool deletes all of the services running on the compute pool; however, it does not stop the compute pool itself.
To stop a compute pool, enter a spcs compute-pool stop-all command similar to the following: