Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider / Implement a driver --reset flag #605

Open
christinaholtNOAA opened this issue Sep 9, 2024 · 1 comment
Open

Consider / Implement a driver --reset flag #605

christinaholtNOAA opened this issue Sep 9, 2024 · 1 comment

Comments

@christinaholtNOAA
Copy link
Collaborator

christinaholtNOAA commented Sep 9, 2024

A proposed --reset argument on drivers would direct them to remove run materiel before proceeding.

In the simplest and safest case, this might simply remove the entire run directory. This would probably be easy to implement, but may also not add much value on top of rm --rf rundir, assuming rundir is readily known, though it's possible that it is computed in the config based on Jinja2 expressions, possibly involving cycle and/or leadtime information, in which case the --reset switch would free the user from having to figure this out, or mistakenly removing the wrong directory.

More nuanced behavior might remove only the affected asset(s). For example, uw some_driver namelist_file --config <config> --reset might only remove the namelist file. uw some_driver linked_files --config <config> --reset might remove all the linked files. Every task method would need to define its own logic for removing the asset(s) it is responsible for, and might then provide logic, before any yield statements, like

if self._reset:  # set in the constructor
    # remove this task's assets

Either way, I'm not sure how much value this really adds. For example, if a user modifies their input config, they don't necessarily know which assets in the run directory are affected by that change, so how would they know which uw call to make to reset and re-create those? If they do know that, they can (often) just as easily just manually rm those assets – assuming they know where they are, but they are probably trying to recreate them because they've inspected them and found issues, so they do know where they are. Another edge case would be a desire to remove a bunch of assets (e.g. a bunch of linked files), which might involve a long sequence of rm commands instead of a single uw --reset command.

@christinaholtNOAA christinaholtNOAA converted this from a draft issue Sep 9, 2024
@christinaholtNOAA christinaholtNOAA moved this from Backlog to Todo in Unified Workflow Kanban Sep 24, 2024
@christinaholtNOAA christinaholtNOAA moved this from Todo to Backlog in Unified Workflow Kanban Sep 24, 2024
@maddenp-noaa
Copy link
Collaborator

The work currently being done to add output() methods to drivers would help facilitate this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants