Repository navigation
fix: upload artifacts to GCS without gzip encoding - #195
Merged
Merged
Conversation
The upload-cloud-storage action gzips by default, so objects were stored with Content-Encoding: gzip. GCS then hashed the compressed bytes, so its MD5 could not be checked against the downloaded file, and it ignored Range requests from clients that don't accept gzip, such as DuckDB. Parquet is already zstd-compressed, so gzip saved about 0.4%. Upload with gzip disabled and a 60-second cache lifetime, so a replaced object isn't served from cache for the default hour. The range tests passed despite this because requests sends Accept-Encoding: gzip, which makes GCS honour Range against the compressed bytes. They now request the stored bytes, and new tests check for the Parquet magic number, the stored encoding, the reported MD5 and the cache lifetime. Closes #148 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upload release artifacts to GCS with gzip disabled and a 60-second cache lifetime. This is step 1 of the plan in #193.
google-github-actions/upload-cloud-storagegzips by default, so objects were stored withContent-Encoding: gzip. That had three effects:idc_index.parquet, against 74,097,726 bytes actually served. The hash couldn't be used to check a download.max-age=3600.Parquet is already zstd-compressed, so gzip saved about 0.4%.
Changes
cd.yml:gzip: falseandcache-control: public, max-age=60on the GCS upload.current/is filled by copying from the release folder, which keeps both settings.tests/test_gcs_cors.py: the existing range tests passed in spite of the problem, becauserequestssendsAccept-Encoding: gzip. GCS then applies the range to the compressed bytes, and the 206 body starts with1f 8brather thanPAR1. The range tests now ask for the bytes as stored. New tests check the Parquet magic number, the stored encoding, that the reported MD5 matches the downloaded file, and that the cache lifetime is at most 60 seconds.Production state
The objects in
gs://idc-index-data-artifacts/current/release_artifacts/were re-uploaded by hand without gzip, after the script was tested on a copy in a separate bucket. Each Parquet file was checked against its.sha256sidecar before upload. The re-upload is what lets this PR's CI and the daily GCS check pass now. Earlier versioned folders are unchanged.Testing
tests/test_gcs_cors.pyagainst production: before the re-upload, the 6 range and metadata tests failed and 11 passed. After it, all 17 pass.Closes #148
🤖 Generated with Claude Code