Skip to content

Commit

Permalink
[CHORE] adjust warehouses to reduce cost (#181)
Browse files Browse the repository at this point in the history
* adjust warehouses

---------

Co-authored-by: TJ Murphy <[email protected]>
  • Loading branch information
teej and teej authored Dec 19, 2024
1 parent c1e148e commit d37ca73
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 10 deletions.
9 changes: 6 additions & 3 deletions examples/dbt-labs-how-we-configure-snowflake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,21 @@ databases:
warehouses:
- name: loading
warehouse_size: XSMALL
auto_suspend: 60
auto_suspend: 30
auto_resume: true
initially_suspended: true
comment: "Tools like Fivetran and Stitch will use this warehouse to perform their regular loads of new data. We separate this workload from the other workloads because, at scale, loading can put significant strain on your warehouse and we don't want to cause slowness for your BI users."
- name: transforming
warehouse_size: XSMALL
auto_suspend: 60
auto_suspend: 30
auto_resume: true
initially_suspended: true
comment: "This is the warehouse that dbt will use to perform all data transformations. It will only be in use (and charging you credits) when regular jobs are being run."
- name: reporting
warehouse_size: XSMALL
auto_suspend: 60
auto_suspend: 30
auto_resume: true
initially_suspended: true
comment: "Mode and any other BI tools will connect to this warehouse to run analytical queries and report the results to end users. This warehouse will be spun up only when a user is actively running a query against it."

grants:
Expand Down
10 changes: 6 additions & 4 deletions examples/dicom-image-classification-to-detect-pneumonia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ schemas:

warehouses:
- name: snowopt_wh
warehouse_size: LARGE
auto_suspend: 120
warehouse_size: XSMALL
auto_suspend: 30
auto_resume: true
initially_suspended: true
comment: "Warehouse optimized for model training and heavy computations."
- name: standard_wh
warehouse_size: MEDIUM
auto_suspend: 120
warehouse_size: XSMALL
auto_suspend: 30
auto_resume: true
initially_suspended: true
comment: "General purpose warehouse for regular workloads."

stages:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ warehouses:
- name: iceberg_tutorial_wh
owner: iceberg_tutorial_role
warehouse_size: XSMALL
auto_suspend: 60
auto_suspend: 30
auto_resume: true
initially_suspended: true

grants:
- GRANT CREATE DATABASE ON ACCOUNT TO ROLE iceberg_tutorial_role
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/json/warehouse.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"max_cluster_count": 1,
"min_cluster_count": 1,
"scaling_policy": "STANDARD",
"auto_suspend": 60,
"auto_suspend": 30,
"auto_resume": false,
"initially_suspended": true,
"resource_monitor": null,
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/sql/warehouse.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CREATE WAREHOUSE lowercase_wh
warehouse_size = x6large
warehouse_type = snowpark-optimized
scaling_policy = economy
initially_suspended = true
;


2 changes: 1 addition & 1 deletion tests/integration/test_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def test_task_lifecycle(cursor, suffix, marked_for_cleanup):
owner=TEST_ROLE,
comment="This is a test task modified",
allow_overlapping_execution=False,
user_task_managed_initial_warehouse_size="LARGE",
user_task_managed_initial_warehouse_size="XSMALL",
user_task_timeout_ms=2000,
suspend_task_after_num_failures=2,
config='{"output_dir": "/temp/test_directory/", "learning_rate": 0.2}',
Expand Down
1 change: 1 addition & 0 deletions tests/integration/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def test_fetch_warehouse_snowpark_optimized(cursor, suffix, marked_for_cleanup):
name=f"TEST_FETCH_WAREHOUSE_SNOWPARK_OPTIMIZED_{suffix}",
warehouse_type="SNOWPARK-OPTIMIZED",
warehouse_size="MEDIUM",
initially_suspended=True,
)

cursor.execute(warehouse.create_sql())
Expand Down
6 changes: 6 additions & 0 deletions tools/test_account_configs/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,14 @@ views:

warehouses:
- name: static_warehouse
warehouse_size: XSMALL
auto_suspend: 30
auto_resume: true
initially_suspended: true
- name: CI
warehouse_size: XSMALL
auto_suspend: 30
initially_suspended: true



Expand Down

0 comments on commit d37ca73

Please sign in to comment.