From 6a068691f8b95ccc053f0987aa264e2ce38e92d8 Mon Sep 17 00:00:00 2001 From: Alex Merose Date: Sat, 23 Mar 2024 21:17:09 +0530 Subject: [PATCH] Added coiled cluster config. --- demo/sst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/demo/sst b/demo/sst index 6e38b6e..178bfa4 100644 --- a/demo/sst +++ b/demo/sst @@ -9,7 +9,16 @@ gcloud auth application-default login import xarray as xr import xarray_sql as qr -# TODO(alxmrs): Add coiled or dask cluster code. +from coiled import Cluster + +cluster = Cluster( + region='us-central1', + worker_memory='16 GiB', + spot_policy='spot_with_fallback', + arm=True, +) +client = cluster.get_client() +cluster.adapt(minimum=1, maximum=100) era5_ds = xr.open_zarr( 'gs://gcp-public-data-arco-era5/ar/' @@ -22,7 +31,7 @@ era5_sst_ds = era5_ds[['sea_surface_temperature']].sel( level=1000, # surface level only. ) -# chunk sizes determined from VM memory limit of 16 GB. +# chunk sizes determined from VM memory limit of 16 GiB. c = qr.Context() c.create_table('era5', era5_sst_ds, chunks=dict(time=24))