[ideas] Help make deployment
be "main"
for filesystem-dependent tasks
#149
Replies: 2 comments 1 reply
-
It's not clear to me if this would fit better in |
Beta Was this translation helpful? Give feedback.
-
If everything is stored locally, then
# _targets.R file
library(targets)
tar_option_set(deployment = "worker")
on_worker <- list(
tar_target(worker_1, run())
tar_target(worker_2, run())
}
tar_option_set(deployment = "main")
on_main <- list(
tar_target(main_1, run())
tar_target(main_2, run())
}
list(on_worker, on_main) |
Beta Was this translation helpful? Give feedback.
-
Help
Description
I'm starting to move toward more use of remote systems in my
targets
pipeline. (And, I'm excited aboutcrew
/mirai
to help make it easier.) The remote systems do not always (or even usually, for me) have the files that need to be loaded in the same filesystem location. So, I'd like to have file loading and unloading occur viadeployment = "main"
and the rest occur via a"worker"
deployment.I can definitely set
deployment
manually for all relevant targets, but I was wondering if there may be a reasonable way to simplify that.My first brainstorm of how to simplify that would be to have a new
targets::tar_option_get("deployment_filesystem")
which would default totargets::tar_option_get("deployment")
if it wereNULL
or it could be set (I'd assume typically to"main"
).The targets where this would mostly apply in my use cases are the ones immediately downstream of
tar_file()
ortar_files()
and alsotar_read_file()
andtar_render()
targets. The hard part is for targets immediately downstream oftar_file()
andtar_files()
where inheritance of the deployment seems infeasible.Something that may be much simpler would be to have some form of deployment-modifier function like
tar_set_deployment(x, deployment)
where it would take a list of targets and set all of their deployments. I tend to make target lists likel_load_files
, so I could easily wrap that intar_set_deployment()
to say that all file loading should happen on the main system.A more generalized thought rather than
tar_set_deployment()
could be something liketar_set()
which could set any of the arguments totar_targets()
other thanname
andcommand
for a list of targets.Does something like this seem feasible and useful?
Beta Was this translation helpful? Give feedback.
All reactions