fix: GCS composite object has no MD5 hash#271
Open
yuechao-qin wants to merge 1 commit into
Open
Conversation
| import sys | ||
| from unittest import mock | ||
|
|
||
| import pytest |
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
The orchestrator crashes with
AttributeError: 'NoneType' object has no attribute 'encode'when collecting output artifacts from GCS that are composite objects. Composite objects (created by parallel uploads or compose operations) have no MD5 hash —blob.md5_hashisNone.The crash happens in the upstream SDK (
cloud-pipelines==0.26.3.12) atGoogleCloudStorageProvider._get_info_from_uri, during output collection after a container completes. This is before any data reaches our code, so there's no way to fix it at the save/consume layer.Fix
patched_google_cloud_storage.py— subclasses the SDK'sGoogleCloudStorageProviderand overrides_get_info_from_urito handleNoneMD5 gracefully"no_md5_<UTC timestamp>"as the hash value — this forces a cache miss for any downstream task consuming that artifact (Solution A: safe, no false cache hits)google_kubernetes_launchers.py,kubernetes_launchers.py) to usePatchedGoogleCloudStorageProviderinstead of the upstream providerFailing runs
Trade-offs
Tests
7 unit tests added covering: