Skip to 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>)
compute_pools:
  <compute-pool-name>:
    <configuration-key>: <value>
    grants:
      <privilege>:
        - <role-name>
        - <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 Key Required/Optional Data Types and Values Description
auto_resume Optional Boolean Specifies whether to automatically resume the compute pool when a service or job is submitted to it.
auto_suspend_secs Optional Integer: 0 or >= 60 The 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.
comment Optional String Specifies a comment for the compute pool.
deleted Optional Boolean: True enables deletion prevention, False does nothing Specifies what objects are allowed to be deleted.
depends_on Optional List of String: See Object Dependencies for a definition of depends_on List 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.
environment Optional String Specifies the environment in which the compute pool is managed. Regex can be provided as well.
grants Optional Map: See Supported Compute Pool Grants to Roles Lists Privileges and Roles to which privileges are granted on the current compute pool.
initially_suspended Optional Boolean Specifies whether the compute pool is created in a suspended state.
instance_family Required if manage_mode is all String: See Supported instance families The instance family that defines the node type for the compute pool.
manage_mode Optional Enumeration: all (default), none, grants Configures what properties to manage for the compute pool.
See Changing Manage Mode before changing the value.
max_nodes Required if manage_mode is all Integer: minimum 1 The maximum number of nodes for the compute pool. Must be >= min_nodes.
min_nodes Required if manage_mode is all Integer: minimum 1 The minimum number of nodes for the compute pool. Must be >= 1.
namespacing Optional String: both (default), prefix, suffix, none Specifies whether Prefix or Suffix or both are to be added to compute pool name.
with_tags Optional Object: See here for a definition of with_tags List 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:

Privilege Description
MODIFY Enables altering any settings of the compute pool.
MONITOR Enables viewing the compute pool status and metrics.
OPERATE Enables starting, stopping, and suspending the compute pool.
OWNERSHIP Grants full control over the compute pool. Only one role can hold this privilege at a time.
USAGE Enables 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:

Parameter Required/Optional Data Types and Values Description
<tag-name> Required String The name of the tag to apply.
tag_value Required String The value to assign to the tag.
database Optional String The database where the tag is defined.
schema Optional String The 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_pools:
  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:
        - SYSADMIN
      OPERATE:
        - 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)
compute_pools:
  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:
        - SYSADMIN
      OPERATE:
        - SYSADMIN