Snowpark Container Services (SPCS) lets you run OCI container images directly inside Snowflake's managed environment. Workloads that cannot run on a warehouse — ML inference, LLM hosting, web apps, custom ETL — can all operate under Snowflake's security and governance umbrella.
SPCS is built from three components: compute pools, an image registry, and services. A compute pool is a cluster of nodes that runs the containers — completely isolated from warehouse compute resources. The image registry is an OCI-compatible private registry embedded in your Snowflake account, accessible from the docker CLI via push/pull. A service is the execution unit deployed on top of a compute pool.
A compute pool is the cluster of nodes that runs your service containers. INSTANCE_FAMILY selects the CPU/GPU type, and MIN_NODES / MAX_NODES define the autoscaling range.
-- CPU compute pool (for lightweight API servers)
CREATE COMPUTE POOL ml_cpu_pool
MIN_NODES = 1
MAX_NODES = 3
INSTANCE_FAMILY = CPU_X64_S
AUTO_RESUME = TRUE
AUTO_SUSPEND_SECS = 600;
-- GPU compute pool (for ML inference)
CREATE COMPUTE POOL gpu_inference_pool
MIN_NODES = 1
MAX_NODES = 2
INSTANCE_FAMILY = GPU_NV_S
AUTO_RESUME = TRUE
AUTO_SUSPEND_SECS = 300;
-- Inspect compute pool state
SHOW COMPUTE POOLS IN ACCOUNT;
DESCRIBE COMPUTE POOL gpu_inference_pool;The main INSTANCE_FAMILY options are listed below.
| INSTANCE_FAMILY | CPU/GPU | Memory | Typical Use Case |
|---|---|---|---|
| CPU_X64_XS | 2 vCPU | 8 GB | Lightweight batch, testing |
| CPU_X64_S | 4 vCPU | 16 GB | API servers, ETL |
| CPU_X64_M | 8 vCPU | 32 GB | Mid-scale processing |
| GPU_NV_S | 1 GPU (T4 class) | 16 GB GPU | Small to mid-scale inference |
| GPU_NV_M | 1 GPU (A10G class) | 24 GB GPU | Mid-scale inference and training |
| GPU_NV_L | 1 GPU (A100 class) | 40/80 GB GPU | LLMs, large-scale training |
SPCS provides an OCI-compliant private image registry built into your Snowflake account. Authenticate with the docker CLI and push prebuilt images.
-- Create an image repository
CREATE IMAGE REPOSITORY ml_images;
-- Check the repository URL
SHOW IMAGE REPOSITORIES;
-- e.g. myorg-myacct.registry.snowflakecomputing.com/ml_db/ml_schema/ml_images
-- Log in and push from the CLI
-- docker login myorg-myacct.registry.snowflakecomputing.com
-- docker tag my-model:v1 myorg-myacct.registry.snowflakecomputing.com/ml_db/ml_schema/ml_images/my-model:v1
-- docker push myorg-myacct.registry.snowflakecomputing.com/ml_db/ml_schema/ml_images/my-model:v1Access to image repositories is governed by Snowflake's RBAC: you grant READ/WRITE privileges to roles. SPCS cannot pull directly from external registries like Docker Hub, so you need a workflow that builds images locally or in CI/CD and then re-pushes them into the Snowflake registry.
A service is the container execution unit, defined by a YAML service specification (spec). Upload the spec file to a Snowflake stage and start the service with CREATE SERVICE.
-- Upload the service spec (spec.yaml) to a stage
PUT file:///tmp/spec.yaml @ml_db.ml_schema.service_stage
AUTO_COMPRESS = FALSE
OVERWRITE = TRUE;
-- Create the service
CREATE SERVICE ml_inference_service
IN COMPUTE POOL gpu_inference_pool
FROM @ml_db.ml_schema.service_stage
SPEC = 'spec.yaml'
MIN_INSTANCES = 1
MAX_INSTANCES = 3
EXTERNAL_ACCESS_INTEGRATIONS = (egress_integration);
-- Check service status
SHOW SERVICES IN ACCOUNT;
SELECT SYSTEM$GET_SERVICE_STATUS('ml_inference_service');
SELECT SYSTEM$GET_SERVICE_LOGS(
'ml_inference_service', 0, 'inference-container', 100
);spec.yaml defines container images, ports, environment variables, volume mounts, and similar properties.
# Example spec.yaml
spec:
containers:
- name: inference-container
image: /ml_db/ml_schema/ml_images/my-model:v1
resources:
requests:
nvidia.com/gpu: 1
limits:
nvidia.com/gpu: 1
memory: 8Gi
env:
MODEL_PATH: /models/v1
readinessProbe:
port: 8080
path: /health
endpoints:
- name: predict
port: 8080
public: true
volumes:
- name: model-volume
source: "@ml_db.ml_schema.model_stage"
uid: 1000
gid: 1000To call a service from SQL, create a service function. This lets you fetch the container's inference results from inside a SELECT statement.
-- Create a service function
CREATE FUNCTION predict_sentiment(text VARCHAR)
RETURNS VARIANT
SERVICE = ml_inference_service
ENDPOINT = predict
AS '/predict';
-- Invoke inference from SQL
SELECT
review_id,
review_text,
predict_sentiment(review_text) AS sentiment
FROM product_reviews
WHERE review_date >= '2026-01-01';There are three typical use cases for GPUs on SPCS.
SPCS services have outbound network access blocked by default. When containers need to call external APIs or download models, create an External Access Integration to authorize egress traffic.
-- Create a network rule
CREATE NETWORK RULE hf_egress_rule
TYPE = HOST_PORT
MODE = EGRESS
VALUE_LIST = ('huggingface.co:443', 'cdn-lfs.huggingface.co:443');
-- Create the External Access Integration
CREATE EXTERNAL ACCESS INTEGRATION egress_integration
ALLOWED_NETWORK_RULES = (hf_egress_rule)
ENABLED = TRUE;For ingress, you can expose an endpoint by setting public: true, with access controlled by Snowflake authentication tokens.
Compute pool cost is determined by node count times uptime times the INSTANCE_FAMILY unit price. AUTO_SUSPEND_SECS automatically suspends the pool when idle, and AUTO_RESUME brings it back up on the next request. Setting MIN_INSTANCES=0 lets a service scale all the way down to zero instances when there is no traffic.
SnowPro
問題 1
When deploying a GPU-based ML inference service on Snowpark Container Services (SPCS), which sequence of steps is correct?
正解: A
The correct flow for SPCS is: (1) create a compute pool with a GPU instance family, (2) push the image to the built-in Snowflake registry, and (3) deploy with CREATE SERVICE. The exam frequently tests that compute pools (not warehouses) are used, and that direct pulls from external registries are not supported.
What GPU instance types are available in Snowpark Container Services?
The compute pool INSTANCE_FAMILY can be set to GPU_NV_S (NVIDIA T4 class), GPU_NV_M (A10G class), or GPU_NV_L (A100 class). GPU_NV_S is well suited for inference, while GPU_NV_L is the right choice for fine-tuning and large-scale training — pick the size based on compute intensity. Available families vary by cloud region, so always confirm with the output of SHOW COMPUTE POOLS IN ACCOUNT.
How is the SPCS image registry different from Docker Hub?
SPCS uses an OCI-compliant image registry built into Snowflake, and you upload images with the docker push command. The registry URL takes the form <org>-<account>.registry.snowflakecomputing.com/<db>/<schema>/<image_repo>, and Snowflake's authentication, RBAC, and network policies all apply directly. Direct pulls from public registries like Docker Hub are not supported, so prebuilt images must be re-pushed into the Snowflake registry.
Do SPCS services consume virtual warehouse credits?
No. SPCS services run as containers on a compute pool, using compute resources that are completely separate from virtual warehouses. Billing is based on compute pool node count multiplied by uptime, calculated under the Serverless Credit model. SQL issued from a service to access Snowflake tables via a service function may consume warehouse credits, but the container execution itself is independent of warehouses.
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Snowflake Certifications: All 11 Exams Explained (2026)
Every SnowPro certification — Associate, Core, Specialty, Ad...
Snowflake Exam Difficulty Ranking: All 11 Certs Compared (2026)
All 11 SnowPro exams ranked by difficulty with study-time es...
Snowflake Study Guide: Fastest Pass Route by Exam (2026)
How to pass SnowPro certifications efficiently — official ma...
SnowPro Core (COF-C03): Complete Exam Guide (2026)
Pass the SnowPro Core exam — six domains, scope, sample ques...
SnowPro Associate Platform (SOL-C01): Complete Guide (2026)
The entry-level SnowPro Associate exam — scope, weighting, s...