ESCOMP / CTSM

Community Terrestrial Systems Model (includes the Community Land Model of CESM)
http://www.cesm.ucar.edu/models/cesm2.0/land/
Other
302 stars 307 forks source link

Add a version check to git for the version being used in git_utils.py #2101

Open islasimpson opened 1 year ago

islasimpson commented 1 year ago

Not sure if this is a bug or not. I am successfully using the fsurdat modifier tool on the cheyenne log-in node, but when I try to use it on casper, I get the following error

Screenshot from 2023-08-10 19-19-36

However, now that when I've now run it successfully on cheyenne and I then try to run it on casper, I no longer get the error. Is this because in the first time the tool is used it is trying to grab something from the internet (through the calls to git in the error) and casper is not connected to the outside world, while cheyenne is?

If so, it's perhaps not a problem, but I'm working on documentation and it would be good to make people aware of this if it's something they will experience.

ekluzek commented 1 year ago

@islasimpson thanks so much for pointing this out. I think this might be the version of git that you are using on casper vs cheyenne. Do a "git --version" on both and see if it's different.

What we should add is a check of the git version and make sure it's late enough for this. I didn't think we save anything about this in files, but maybe we do...

islasimpson commented 1 year ago

Thanks for looking into this. casper: git version 1.8.3.1 cheyenne:git version 2.26.2

ekluzek commented 1 year ago

Yep, that's going to be the problem. Looks like there is a module for git on casper, and doing that should take care of this issue. So try that.

But, we still need to add a check for the git version.

islasimpson commented 1 year ago

Ok, sounds good. It does seem a good idea to add a check to automatically flag this as it didn't seem like an easy error for someone to debug. I had no clue!

ekluzek commented 1 year ago

We should add a method "check_git_version" to the git_utils.py module that checks the git version and makes sure it's recent enough. Another one to add would be "check_for_git_lfs" to make sure that "git lfs" is available as otherwise it should fail when trying to get the NetCDF files under testinputs.