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

CI: Cache gmt_hash_server.txt and gmt_data_server.txt files #3020

Merged
merged 5 commits into from
Jan 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/cache_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ jobs:
run: |
python -c "from pygmt.helpers.caching import cache_data; cache_data()"

- name: List downloaded remote files
run: ls -lhR ~/.gmt

# Upload the downloaded files as artifacts to GitHub
- name: Upload artifacts to GitHub
uses: actions/upload-artifact@v4
Expand All @@ -74,3 +77,5 @@ jobs:
path: |
~/.gmt/cache
~/.gmt/server
~/.gmt/gmt_data_server.txt
~/.gmt/gmt_hash_server.txt
Comment on lines +80 to +81
Copy link
Member

Choose a reason for hiding this comment

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

Aren't these files supposed to be downloaded automatically?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ideally yes, but old GMT versions may fail to download these files on GitHub Actions (see https://github.com/GenericMappingTools/pygmt/actions/runs/7619206138/job/20751859452):

Error: ession [ERROR]: Read error first record in file /home/runner/.gmt/server/gmt_data_server.txt
Error: ession [ERROR]: Deleting /home/runner/.gmt/server/gmt_data_server.txt so it can get regenerated - please try again
Error: h [ERROR]: Unable to open file /home/runner/.gmt/server/gmt_data_server.txt
Error: h [ERROR]: Libcurl Error: HTTP response code said error
Warning: [WARNING]: You can turn remote file download off by setting GMT_DATA_UPDATE_INTERVAL to "off"
Error: h [ERROR]: File earth_relief_01d_p not found!

Copy link
Member

Choose a reason for hiding this comment

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

Ah got it, so this is needed for the GMT legacy tests (using GMT 6.3.0 and 6.4.0). I see that the path has changed from ~/.gmt/server/gmt_data_server.txt to ~/.gmt/gmt_data_server.txt

Copy link
Member

Choose a reason for hiding this comment

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

Do we need to copy ~/.gmt/gmt_data_server.txt to ~/.gmt/server/gmt_data_server.txt though for the GMT Legacy tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do we need to copy ~/.gmt/gmt_data_server.txt to ~/.gmt/server/gmt_data_server.txt though for the GMT Legacy tests?

My local tests tell me that we have to. Will do it now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 49178fc and the same error is gone in the GMT Legacy Tests workflow (https://github.com/GenericMappingTools/pygmt/actions/runs/7677658040/job/20926661680?pr=3020).