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

Try searching multiple ESGF index nodes #1561

Merged
merged 7 commits into from
Apr 21, 2022
Merged

Conversation

bouweandela
Copy link
Member

@bouweandela bouweandela commented Apr 15, 2022

Description

Closes #1333

Link to documentation: https://esmvaltool--1561.org.readthedocs.build/projects/ESMValCore/en/1561/quickstart/configure.html#search


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@codecov
Copy link

codecov bot commented Apr 15, 2022

Codecov Report

Merging #1561 (61bb79e) into main (b09dde2) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1561      +/-   ##
==========================================
+ Coverage   90.76%   90.78%   +0.01%     
==========================================
  Files         197      197              
  Lines       10572    10594      +22     
==========================================
+ Hits         9596     9618      +22     
  Misses        976      976              
Impacted Files Coverage Δ
esmvalcore/esgf/_logon.py 100.00% <ø> (ø)
esmvalcore/_config/_esgf_pyclient.py 100.00% <100.00%> (ø)
esmvalcore/esgf/_search.py 100.00% <100.00%> (ø)
esmvalcore/esgf/facets.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b09dde2...61bb79e. Read the comment docs.

@bouweandela bouweandela marked this pull request as ready for review April 15, 2022 18:58
@bouweandela bouweandela added the enhancement New feature or request label Apr 15, 2022
@bouweandela bouweandela added this to the v2.6.0 milestone Apr 15, 2022
@bouweandela
Copy link
Member Author

bouweandela commented Apr 19, 2022

The remaining Codacy issues are not easily solved:

  1. Use of global: we actually want the search function to remember which index node is online, so it doesn't need to wait for a timeout with every new search. Using a global variable to store this information in seems a good way to do it.
  2. Missing mypy stubs: this is something we can maybe solve by running the Codacy analysis on CircleCI or with a GitHub action that first installs the required dependencies. Something to be considered, but not in this pull request.

'https://esgf.nci.org.au/esg-search',
'https://esgf.nccs.nasa.gov/esg-search',
'https://esgdata.gfdl.noaa.gov/esg-search',
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cheers @bouweandela - I think it looks good, but I've not tested it, I trust you did, and probably best if you turn on the GA tests and rerun the tests a few times (if you expect a much less frequent failure due to node not being reachable). I do think we should put this list of nodes someplace centrally and just load it from there both for the actual code and for the testing environment, I have seen this list repeated at least three times in different places, and that's prone to introducing issues if we change one node somewhere but not everywhere. What you reckon?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, I have not been able to test this in real life either, because you need an index node that is timing out for that and I don't think it's that common.

The risk of introducing an error because of the duplication is not that big, the worst thing that can happen is that the documentation goes out of date. The unit test ensures that the default configuration and test code are identical. I agree that this may not be the most elegant unit test, but reading the list from the same source in production and test code is asking for trouble.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, not really since that list is a fixed parameter independent of us no? It's like some database that's used both for the functionality and for the functionality test - but, on second thought, that's fine coz if we update the code but not the test, the test will probably keep failing letting us know it needs to be changed 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, I have not been able to test this in real life either, because you need an index node that is timing out for that and I don't think it's that common.

Yeah that's why I was thinking we might pick that up from running a bunch of GA tests - but it's prob too much hassle - we'll have to just wait and see on nightly/PR merge tests I reckon

@valeriupredoi
Copy link
Contributor

The remaining Codacy issues are not easily solved:

1. Use of `global`: we actually want the search function to remember which index node is online, so it doesn't need to wait for a timeout with every new search. Using a global variable to store this information in seems a good way to do it.

2. Missing mypy stubs: this is something we can maybe solve by running the Codacy analysis on CircleCI or with a GitHub action that first installs the required dependencies. Something to be considered, but not in this pull request.

The missing stubs for mypy I've seen in other places too - it's becoming a bit annoying - can we not introduce a #noqa and specify why the that in an inline comment?

@bouweandela
Copy link
Member Author

The missing stubs for mypy I've seen in other places too - it's becoming a bit annoying - can we not introduce a #noqa and specify why the that in an inline comment?

I don't think it's that easy. When you run prospector locally, things work fine because the stubs are installed as development dependencies. However, this doesn't work on Codacy because Codacy does not install our dependencies. A potential solution could be to run the Codacy command line client in a GitHub action and upload the results, but I've looked at that option for about half an hour and did not immediately see how to get that to work in a maintainable way.

@valeriupredoi
Copy link
Contributor

The missing stubs for mypy I've seen in other places too - it's becoming a bit annoying - can we not introduce a #noqa and specify why the that in an inline comment?

I don't think it's that easy. When you run prospector locally, things work fine because the stubs are installed as development dependencies. However, this doesn't work on Codacy because Codacy does not install our dependencies. A potential solution could be to run the Codacy command line client in a GitHub action and upload the results, but I've looked at that option for about half an hour and did not immediately see how to get that to work in a maintainable way.

hahah, that's asking for trouble IMHO. Is Codacy installing the env deps from a container? Coz then that should be configurable. Again, not a biggie for me - am gonna approve, cheers, man!

@bouweandela
Copy link
Member Author

Is Codacy installing the env deps from a container?

I think they're using this to run prospector: https://github.com/codacy/codacy-prospector (i.e. they do not install any dependencies, just prospector[with_everything]) and they have this GitHub action available: https://github.com/codacy/codacy-analysis-cli-action#integration-with-codacy-for-client-side-tools

@bouweandela bouweandela merged commit e2ece52 into main Apr 21, 2022
@bouweandela bouweandela deleted the try-multiple-index-nodes branch April 21, 2022 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_real_search fails on circleci with read timeout
3 participants