Skip to main content

Compute Pool

You can provide configuration to Snowflake Object Lifecycle Engine for the following operations with compute pools:

  • Manage the lifecycle of new and existing compute pools
  • Manage grants of a compute pool
info

Compute pools are account-level objects in Snowflake. They provide the compute resources required to run Snowpark Container Services workloads.

Usage

- compute_pool:
name: <compute-pool-name>
<configuration-key>: <value>
grants:
<privilege>:
- rel(role.<role-name>)
- rel(role.<role-name>)

Supported parameters

The engine supports the parameters listed below.

When manage_mode is set to all (the default), the parameters min_nodes, max_nodes, and instance_family are required.

Configuration KeyRequired/OptionalData Types and ValuesDescription
auto_resumeOptionalBooleanSpecifies whether to automatically resume the compute pool when a service or job is submitted to it.
auto_suspend_secsOptionalInteger: 0 or >= 60The number of seconds of inactivity after which the compute pool automatically suspends. Set to 0 to disable auto-suspend. When non-zero, must be >= 60.
commentOptionalStringSpecifies a comment for the compute pool.
deletedOptionalBoolean: True enables deletion prevention, False does nothingSpecifies what objects are allowed to be deleted.
depends_onOptionalList of String: See Object Dependencies for a definition of depends_onList of SOLE-managed objects that this compute pool depends on. Objects defined in the list will be added to the generated HCL dependencies list to ensure proper creation order.
environmentOptionalStringSpecifies the environment in which the compute pool is managed. Regex can be provided as well.
grantsOptionalMap: See Supported Compute Pool Grants to RolesLists Privileges and Roles to which privileges are granted on the current compute pool.
initially_suspendedOptionalBooleanSpecifies whether the compute pool is created in a suspended state.
instance_familyRequired if manage_mode is allString: See Supported instance familiesThe instance family that defines the node type for the compute pool.
manage_modeOptionalEnumeration: all (default), none, grantsConfigures what properties to manage for the compute pool.
See Changing Manage Mode before changing the value.
max_nodesRequired if manage_mode is allInteger: minimum 1The maximum number of nodes for the compute pool. Must be >= min_nodes.
min_nodesRequired if manage_mode is allInteger: minimum 1The minimum number of nodes for the compute pool. Must be >= 1.
namespacingOptionalString: both (default), prefix, suffix, noneSpecifies whether Prefix or Suffix or both are to be added to compute pool name.
with_tagsOptionalObject: See here for a definition of with_tagsList of tag references to apply to the current compute pool.

Supported instance families

The following instance families are supported:

CPU:

  • CPU_X64_XS
  • CPU_X64_S
  • CPU_X64_M
  • CPU_X64_L
  • CPU_X64_XL

High Memory:

  • HIGHMEM_X64_S
  • HIGHMEM_X64_M
  • HIGHMEM_X64_L
  • HIGHMEM_X64_XL

GPU:

  • GPU_NV_S
  • GPU_NV_M
  • GPU_NV_L

Supported compute pool grants to roles

Following are the privileges you can grant to roles in the compute pool definition:

PrivilegeDescription
MODIFYEnables altering any settings of the compute pool.
MONITOREnables viewing the compute pool status and metrics.
OPERATEEnables starting, stopping, and suspending the compute pool.
OWNERSHIPGrants full control over the compute pool. Only one role can hold this privilege at a time.
USAGEEnables using the compute pool to run services and jobs.
ALL PRIVILEGES handling

When you define ALL PRIVILEGES in the SOLE configuration file, you grant all the privileges listed above to roles on this object except OWNERSHIP. However, the management of ALL PRIVILEGES in SOLE differs from its handling in Snowflake. See Handling ALL PRIVILEGES in SOLE for more information.

with_tags parameter

List multiple tags in the with_tags parameter in an object format, with the following parameters:

ParameterRequired/OptionalData Types and ValuesDescription
<tag-name>RequiredStringThe name of the tag to apply.
tag_valueRequiredStringThe value to assign to the tag.
databaseOptionalStringThe database where the tag is defined.
schemaOptionalStringThe schema where the tag is defined.

Examples

  • Compute pool with CPU instance family and auto-suspend enabled
- compute_pool:
name: MY_CPU_COMPUTE_POOL
min_nodes: 1
max_nodes: 3
instance_family: CPU_X64_XS
auto_resume: true
initially_suspended: true
auto_suspend_secs: 60
comment: "CPU compute pool for container services"
grants:
USAGE:
- rel(role.SYSADMIN)
OPERATE:
- rel(role.SYSADMIN)
  • Compute pool with GPU instance family
- compute_pool:
name: MY_GPU_COMPUTE_POOL
min_nodes: 1
max_nodes: 3
instance_family: GPU_NV_S
auto_resume: false
auto_suspend_secs: 120
comment: "GPU compute pool"
grants:
USAGE:
- rel(role.SYSADMIN)
OPERATE:
- rel(role.SYSADMIN)