esm-tools / esm_tools

Simple Infrastructure for Earth System Simulations
https://esm-tools.github.io/
GNU General Public License v2.0
25 stars 12 forks source link

add some changes to vcs #1203

Open mandresm opened 4 months ago

mandresm commented 4 months ago

VCS fixes and improvements.

TODO

For this PR I will not implement the checking functionality, only the writing of the git status and diff file.

mandresm commented 4 months ago

@pgierz, I'm putting this into clickup and assign it to you, if you don't have time for it we can reassign it to me in some point.

pgierz commented 3 months ago

Hey Miguel, I have something that might be able to handle caching very easily. Have a look at the newest commit.

pgierz commented 3 months ago

Cache seems to be working now as I would expect:

2024-08-07 10:10:03.938 | CRITICAL | esm_runscripts.prepare:add_vcs_info:700 - Experiment information is being stored for usage under:
2024-08-07 10:10:03.940 | CRITICAL | esm_runscripts.prepare:add_vcs_info:701 - >>> /albedo/work/user/pgierz/SciComp/Projects/esm-tools-vcs/experiments/test-007/run_18500201-18500228/log//test-007_vcs_info.yaml
2024-08-07 10:10:03.940 | CRITICAL | esm_runscripts.prepare:add_vcs_info:703 - >>> CACHE FILE EXISTS!
2024-08-07 10:10:03.940 | CRITICAL | esm_runscripts.prepare:add_vcs_info:704 - >>> Last modification time of cache: 1723017728.2125185
2024-08-07 10:10:03.941 | CRITICAL | esm_runscripts.prepare:add_vcs_info:713 - Locating echam
2024-08-07 10:10:03.952 | DEBUG    | esm_runscripts.helpers:is_older_than:477 - Checking modification times:
2024-08-07 10:10:03.952 | DEBUG    | esm_runscripts.helpers:is_older_than:478 - /albedo/work/user/pgierz/SciComp/Projects/esm-tools-vcs/experiments/test-007/log//test-007_vcs_info.yaml: 1723017728.2125185
2024-08-07 10:10:03.952 | DEBUG    | esm_runscripts.helpers:is_older_than:479 - /albedo/work/user/pgierz/SciComp/Projects/esm-tools-vcs/model_codes/awiesm-2.1/echam-6.3.05p2: 1722867496.347289
2024-08-07 10:10:03.952 | CRITICAL | esm_runscripts.prepare:add_vcs_info:722 - Using cached VCS info for echam
pgierz commented 2 months ago

I added an Audit Log, which has all possible info you could possibly wish for to check modification times, access times, and checksums. See in src/esm_runscripts/checksum_helpers.py

This, together with the git stuff, should give all possible information someone would want if their model changed halfway during the experiment.

pgierz commented 2 months ago

Only thing left to do is parallelising the git diff and checksum parts.