@@ -146,19 +146,19 @@ def deployer(cfg):
146146 topic ,
147147 )
148148
149- # extraction_tasks_path = os.path.join(
150- # ".", cfg.dataset_name + "_extraction_tasks.pkl",
151- # )
152149
153- # logger.info(f"deploying on { cfg.deployer._target_} to {cfg.cloud.storage_root}",)
150+ def plugins ( cfg ):
154151
155- # extraction_tasks = pickle.load(open(extraction_tasks_path, "rb") )
152+ logger . info ( f"using { cfg . plugins . _target_ } as plugin" )
156153
157- # # check tiles meet spec
158- # for t in extraction_tasks:
159- # assert isinstance(t, ExtractionTask), "Task does not match ExtractionTask spec"
154+ extraction_tasks = pickle .load (open (cfg .extraction_tasks , "rb" ))
160155
161- # hydra.utils.instantiate(cfg.deployer, extraction_tasks)
156+ hydra .utils .call (
157+ cfg .plugins ,
158+ cfg .credentials ,
159+ extraction_tasks ,
160+ f"{ cfg .cloud .storage_prefix } /{ cfg .cloud .storage_root } /{ cfg .dataset_name } " ,
161+ )
162162
163163
164164@hydra .main (config_path = "./../../conf" , config_name = "config" )
@@ -181,7 +181,8 @@ def main(cfg: DictConfig):
181181 "schedule" ,
182182 "prepare" ,
183183 "deploy" ,
184- ], "valid tasks are [build, stac, tile, schedule, prepare, deploy]"
184+ "plugins" ,
185+ ], "valid tasks are [build, stac, tile, schedule, prepare, deploy, plugins]"
185186
186187 logger .info (f"Running tasks { cfg .tasks } " )
187188
@@ -203,6 +204,9 @@ def main(cfg: DictConfig):
203204 if "deploy" in cfg .tasks :
204205 deployer (cfg )
205206
207+ if "plugins" in cfg .tasks :
208+ plugins (cfg )
209+
206210 return 0
207211
208212
0 commit comments