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

Support component customization of case.setup clean #4167

Open
jgfouca opened this issue Jan 26, 2022 · 8 comments
Open

Support component customization of case.setup clean #4167

jgfouca opened this issue Jan 26, 2022 · 8 comments
Assignees

Comments

@jgfouca
Copy link
Contributor

jgfouca commented Jan 26, 2022

I have a usecase for one of our atm components (SCREAM) that I'm not sure how to handle. The buildnml for this component makes some YAML files that are processed when the component is run. buildnml is coded to not overwrite these files if they already exist in the case in order to preserve local modifications. What I want is for these files to be removed when the user does a ./case.setup --clean and regenerated when the user does a ./case.setup --reset . What I am seeing is that CIME has no way to notify a component that a clean/reset has been requested.

Some slack discussion has us in tentative agreement that we could add support for a cleaner script in components that ./case.setup --clean would look for and invoke if found.

@jgfouca jgfouca self-assigned this Jan 26, 2022
@billsacks
Copy link
Member

I supported this design on Slack, and still feel like it would be reasonable, but I also just realized that this need is at least somewhat similar to the optional get_user_nl_list function that is now supported in components' buildnml file - see #4058 . One reason I went with the design of putting this function in buildnml rather than in its own script is that I wanted to share some functionality between this function and other aspects of buildnml. This does not allow get_user_nl_list to be called as a subprocess (it requires it to be called as a python function), but that felt okay to me.

Longer-term, I think it would be great if we could move towards accessing all of these functions from a real python package, leveraging the changes that @mnlevy1981 recently made.

@jedwards4b
Copy link
Contributor

@billsacks If I understand you correctly instead of a new script there would be an optional new function in the buildnml script. This would be invoked by case.setup --clean if it exists and it would not be required to exist in every component. @jgfouca I think that this is more like what you were originally considering and is probably less involved than creating a new setup script. I think that it would be fine to pursue this solution instead. I think that we would need a standard name - cleannml is probably good.

@billsacks
Copy link
Member

@jedwards4b yes, exactly.

@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label May 5, 2023
@jedwards4b
Copy link
Contributor

@jgfouca are you still planning to do this?

@jgfouca jgfouca removed the Stale label May 5, 2023
@jgfouca
Copy link
Contributor Author

jgfouca commented May 5, 2023

@jedwards4b , yes

@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants