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

Manifest Reproduce true fix #475

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jo-basevi
Copy link
Collaborator

@jo-basevi jo-basevi commented Aug 2, 2024

Ok so I've had a go changing the manifests reproduce True logic. Currently (on the main branch), it create symlinks to the work directory from the manifests, and only raise errors if the files that existing on the manifest are modified.

In the first commit, I changed logic in model setup to always add model exe path and prior restart path to the manifest. This picks up if exe path is changed in config.yaml. If there's new restart files, in the prior restart path, it will also pick it up that there's been a change.

It still had the logic that symlinks from files to the work directory are generated from the manifest initially when reproduce is True. This could run into weird issues when there's a file in the manifest, thats existing unchanged on the filesystem, but it's no longer added to manifest in Model.setup. It'll pass the manifest checks because the hashes are unchanged and this file will still be linked into the work directory.

In the second commit, I have changed it to when reproduce is True, all the symlinks are created from filepaths added in the model.setup() when it calls manifest.add_filepath(). I have used the pre-existing existing_filepaths set on the PayuManifest class to keep track of what files haven't been added to the work directory but are in the manifest. There is now a check at the end of PayuManifest.fastcheck checking if that set is empty when reproduce is True.

The second commit, also has changes to the input/scanInputs logic. I've changed it to have scaninputs True when reproduce is True. This is so changes to inputs in config.yaml are picked up, or if new files are added to input directories.

scaninputs can be set to False, when reproduce is False. This is will still not check for changes in config.yaml as it'll create symlinks only from the input manifest. If a file in the manifest no longer exists, it will still be removed from the manifests before manifests are checked (only when reproduce is False).

I'll appreciate any feedback on these changes as it is changing the behaviour of reproduce:True quite a bit, and I'm unsure of my assumptions..

Closes #456

Previous behaviour would only use the exe path and restarts already set in the Manifest. So they would pick up when the exe/restart that were currently pointing toin the manifest would change, but not the configured one.
… when files are added to manifest

- When reproduce is True, set scanInputs to True so new/changed inputs are discovered
- When reproduce is True, only create work symlinks when filepaths are added in manifest during model.setup
- Check for files that exist in the manifest, but haven't been added to work directory, or no longer exist
@pep8speaks
Copy link

Hello @jo-basevi! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 382:80: E501 line too long (81 > 79 characters)

Line 148:19: E222 multiple spaces after operator

@coveralls
Copy link

Coverage Status

coverage: 52.518% (+0.2%) from 52.281%
when pulling f14bfa5 on ACCESS-NRI:456-manifest-exe-true-bug
into c83489e on payu-org:master.

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

Successfully merging this pull request may close these issues.

Mainfest reproduce options don't seem to do what they say on the box
3 participants