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

build metadata must be re-executed when model is rebuild #126

Closed
timtroendle opened this issue May 28, 2021 · 5 comments · Fixed by #186
Closed

build metadata must be re-executed when model is rebuild #126

timtroendle opened this issue May 28, 2021 · 5 comments · Fixed by #186
Assignees
Labels
bug Something isn't working
Milestone

Comments

@timtroendle
Copy link
Member

Build metadata has no inputs and is thus build initially and only once. This is no problem when starting from a clean working directory.

When the working directory is not clean and the model is rebuild, that may be a problem. As an example, one could build euro-calliope v1.0 and receive the correct build metadata. One could then update the configuration parameters and re-execute the model, without build metadata being updated leading to an inconsistent build-metadata.yaml. We need to automatically trigger a rebuild in these cases.

@timtroendle timtroendle added the bug Something isn't working label May 28, 2021
@timtroendle
Copy link
Member Author

This is related to snakemake/snakemake#976.

@timtroendle timtroendle added this to the 1.1 milestone Jul 21, 2021
@timtroendle timtroendle self-assigned this Jul 22, 2021
@brynpickering
Copy link
Member

Can the metadata not take one of the model.done files as input, thus triggering its build as the final thing in any build process?

@timtroendle
Copy link
Member Author

Good idea. Currently, that's not possible because the metadata is part of the model. But we could change that and yes, that sounds like a good idea.

The disadvantage is that we likely have to move metadata then into the resolution-specific folder and have several copies of it. Otherwise the trigger is weird and can become inconsistent.

@brynpickering
Copy link
Member

How about we change it around so that rule all is focussed on the metadata?

rule all:
    message: "Generate euro-calliope pre-built models and run tests."
    input: "build/model/build-metadata.yaml"

rule build_metadata:
    message: "Generate build metadata."
    input:
        script = script_dir + "metadata.py",
        "build/logs/continental/model.done",
        "build/logs/national/model.done",
        "build/logs/regional/model.done",
        "build/logs/continental/test-report.html",
        "build/logs/national/test-report.html",
    params:
        config = config,
        version = __version__
    output: "build/model/build-metadata.yaml"
    conda: "envs/default.yaml"
    script: "scripts/metadata.py"

of course, build metadata would then not be part of the rule model.

@timtroendle
Copy link
Member Author

Makes sense. I would not move tests because they are unrelated. But that's partly subjective.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants