Skip to content

Commit

Permalink
Wrap cache_target explicitly in CacheFSpecTarget
Browse files Browse the repository at this point in the history
  • Loading branch information
jbusecke committed Jun 4, 2024
1 parent 1f9755a commit 3700585
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion feedstock/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
ConsolidateDimensionCoordinates,
CheckpointFileTransfer,
)
from pangeo_forge_recipes.storage import CacheFSSpecTarget

#######################################
import datetime as dt
import functools
import gcsfs

import cftime
from pangeo_forge_recipes.patterns import ConcatDim, FilePattern
Expand Down Expand Up @@ -198,13 +200,17 @@ def expand(self, pcoll: beam.PCollection) -> beam.PCollection:
# times = times[0:90000]
times = times[0:20000]
concat_dim = ConcatDim("time", keys=times)
cache_target = CacheFSSpecTarget(
fs = gcsfs.GCSFileSystem,
root_path="gs://leap-scratch/data-library/feedstocks/cache_concurrent"
)

lowres_mli_make_url = functools.partial(make_url, ds_type="mli")
lowres_mli_pattern = FilePattern(lowres_mli_make_url, concat_dim)
climsim_lowres_mli = (
beam.Create(lowres_mli_pattern.items())
| CheckpointFileTransfer(
transfer_target="gs://leap-scratch/data-library/feedstocks/cache_concurrent",
transfer_target=cache_target,
max_executors=10,
concurrency_per_executor=4
)
Expand Down

0 comments on commit 3700585

Please sign in to comment.