File tree 2 files changed +12
-4
lines changed 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ def reduce_references(results):
40
40
coords = "minimal" ,
41
41
compat = "override" ,
42
42
)
43
-
43
+
44
44
return combined_vds
45
45
46
46
@@ -55,5 +55,9 @@ def reduce_references(results):
55
55
56
56
ds = futures .get_result ()
57
57
58
- # Save the virtual zarr manifest to s3
59
- ds .virtualize .to_kerchunk (f"{ bucket_url } /combined.json" , format = "json" )
58
+ # Save the virtual zarr manifest
59
+ ds .virtualize .to_kerchunk (f"combined.json" , format = "json" )
60
+
61
+ # Upload manifest to s3
62
+ fs_write = fsspec .filesystem ("s3" , anon = False , skip_instance_cache = True )
63
+ fs_write .put ("combined.json" , f"{ bucket_url } /combined.json" )
Original file line number Diff line number Diff line change 7
7
# aren't propogated until the kernel is restarted.
8
8
9
9
import os
10
+ import fsspec
10
11
import xarray as xr
11
12
12
13
bucket_url = os .getenv ("BUCKET_URL" )
13
14
15
+ target = fsspec .get_mapper (f"{ bucket_url } /rechunked.zarr" )
16
+ # client_kwargs={'region_name':'us-west-2'})
17
+
14
18
combined_ds = xr .open_dataset (
15
19
f"{ bucket_url } /combined.json" , # location must be accessible to workers
16
20
engine = "kerchunk" ,
26
30
)
27
31
28
32
rechunked_ds .to_zarr (
29
- f" { bucket_url } /rechunked.zarr" ,
33
+ target ,
30
34
mode = "w" ,
31
35
encoding = {}, # TODO
32
36
consolidated = True ,
You can’t perform that action at this time.
0 commit comments