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

Github token needed for CI when downloading executables #349

Merged
merged 10 commits into from
May 29, 2024

Conversation

bdestombe
Copy link
Collaborator

@bdestombe bdestombe commented May 27, 2024

Also required by flopy tests: https://github.com/modflowpy/flopy/blob/388ac8d484b08ae26a57793759bae22dd0db21fb/.github/workflows/mf6.yml#L81

edit: suppressing checking version of exe during tests instead of adding github token

@bdestombe
Copy link
Collaborator Author

bdestombe commented May 27, 2024

The reason it is suddenly exceeding the interaction rate github allows without github token is because now the version of modflow is often checked; upon most calls of get_exe_path(). This PR includes a way to suppress the version checking by setting an environment variable, which is now used in the github CI.

@OnnoEbbens
Copy link
Collaborator

I am back from the holidays and saw many improvements so I might not be completely up to date. Do I understand correctly that every time you call get_exe_path() using the default options a check is done to see if your local modflow executable is the latest version? And then these checks are done so many times that interaction rate is exceeded?

If that is correct than I am wondering if we really want to do this check every time. I personally almost never want to download the newest executable when I call the get_exe_path function. I just want to use the one that I've used before. So instead of setting an environment variable can we not make enable_version_check=False by default?

@bdestombe
Copy link
Collaborator Author

Hi Onno,
Thanks for having a look :)

So I looked it up. You can do 60 requests per hour to the github website without account/token. That means 1 time downloading and 59 times converting "latest" to "18.0". And is called with every to_model_ds(), so this is indeed not feasible. I'll change it.

@bdestombe
Copy link
Collaborator Author

Okay, so now the defaults are configured such that only when you pass the version_tag command the version is checked.

If you explicitely pass the version_tag "latest" an API call is made, and when this version is not already installed on your PC, another API call is made to download the executables. If the version_tag is set to for example "18.0" this first API call is not required.

@OnnoEbbens could you have a look at the PR?

@OnnoEbbens
Copy link
Collaborator

Looks good to me. Only thing I don't understand yet is why you need the environment variable SUPPRESS_EXE_VERION_CHECK. I would think we can do without the environment variable now the default is not to check the version number. Do I miss something?

@bdestombe bdestombe merged commit c78976e into dev May 29, 2024
4 checks passed
@bdestombe bdestombe deleted the include-gh-token-for-ci branch May 29, 2024 08:29
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.

2 participants