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

Check MD5 sums of downloaded atom data #2267

Merged
merged 3 commits into from
Apr 10, 2023

Conversation

epassaro
Copy link
Member

@epassaro epassaro commented Mar 31, 2023

📝 Description

Type: 🪲 bugfix | 🎢 infrastructure

This is an attempt to fix the random failure of the documentation pipeline. I always had the suspicion that HDF5 files sometimes are corrupted, but I can't be sure (libhdf5 is an awful library).

In this PR I made the changes necessary to compare the known MD5 checksums of atomic files with the downloaded ones through the download_atom_data function. Also, allows to set a maximum number of retries.

Fixes #2252

📌 Resources

🚦 Testing

How did you test these changes?

  • Testing pipeline
  • Other method (describe)
  • My changes can't be tested (explain why)

Locally, modify a digit in the md5 key of the tardis/data/atomic_data_repo.yml file and call the function, see how in behaves until reaches the limit.

☑️ Checklist

  • I requested two reviewers for this pull request
  • I updated the documentation according to my changes
  • I built the documentation by applying the build_docs label

Note: If you are not allowed to perform any of these actions, ping (@) a contributor.

@@ -396,9 +397,24 @@ def download_from_url(url, dst, src=None):
URL to download from
dst : str
Destination folder for the downloaded file
src : list
src : tuple
Copy link
Member Author

Choose a reason for hiding this comment

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

All the parameters must be hashable to memoize with lru_cache

andrewfullard
andrewfullard previously approved these changes Apr 1, 2023
Copy link
Contributor

@andrewfullard andrewfullard left a comment

Choose a reason for hiding this comment

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

Thanks, this is definitely the best way to deal with the problem

@tardis-bot
Copy link
Contributor

*beep* *bop*

Hi, human.

The docs workflow has succeeded ✔️

Click here to see your results.

@epassaro
Copy link
Member Author

epassaro commented Apr 3, 2023

Rebased

@codecov
Copy link

codecov bot commented Apr 3, 2023

Codecov Report

Merging #2267 (7e08eb5) into master (21e86c4) will decrease coverage by 0.05%.
The diff coverage is 42.85%.

❗ Current head 7e08eb5 differs from pull request most recent head cf43c21. Consider uploading reports for the commit cf43c21 to get more accurate results

@@            Coverage Diff             @@
##           master    #2267      +/-   ##
==========================================
- Coverage   71.88%   71.83%   -0.05%     
==========================================
  Files         133      133              
  Lines       12384    12396      +12     
==========================================
+ Hits         8902     8905       +3     
- Misses       3482     3491       +9     
Impacted Files Coverage Δ
tardis/io/atom_data/atom_web_download.py 38.09% <0.00%> (-1.91%) ⬇️
tardis/io/util.py 77.05% <50.00%> (-3.45%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@andrewfullard andrewfullard enabled auto-merge (squash) April 4, 2023 13:44
@andrewfullard andrewfullard self-requested a review April 4, 2023 13:44
Copy link
Member

@atharva-2001 atharva-2001 left a comment

Choose a reason for hiding this comment

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

Thank you for this pull request. Sorry, it took me a while to review this.

@andrewfullard andrewfullard merged commit 83bb26d into tardis-sn:master Apr 10, 2023
light2802 pushed a commit to light2802/tardis that referenced this pull request May 27, 2023
* Add MD5 as a value on atom data YAML configuration file; Modify downloader functions to check-checksums; Add retrying capabilities; Logging

* Sort modules

* Reformatted with black
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Documentation pipeline fails too often and randomly
4 participants