googleapis / python-aiplatform

A Python SDK for Vertex AI, a fully managed, end-to-end platform for data science and machine learning.
Apache License 2.0
615 stars 327 forks source link

tests.unit.vertexai.test_serializers.TestCloudPickleSerializer: test_serialize_func_path_start_with_gcs failed #2737

Closed flaky-bot[bot] closed 11 months ago

flaky-bot[bot] commented 11 months ago

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and I will stop commenting.


commit: 8db915636bb7c7cb6a258a60c07b1b68275f3094 buildURL: Build Status, Sponge status: failed

Test output
self = 
cloudpickle_serializer = 

    def test_serialize_func_path_start_with_gcs(self, cloudpickle_serializer):
        # Arrange
        fake_gcs_uri = "/gcs/staging-bucket/fake_gcs_uri.cpkl"

        def function_to_be_serialized():
            return "return_str"

        # Act
        with fake_filesystem_unittest.Patcher() as filesystem:
            filesystem.fs.create_file(fake_gcs_uri)
>           cloudpickle_serializer.serialize(function_to_be_serialized, fake_gcs_uri)

tests/unit/vertexai/test_serializers.py:958: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
vertexai/preview/_workflow/serialization_engine/serializers.py:1296: in serialize
    serializers_base.write_and_upload_data(data=serialized, gcs_filename=gcs_path)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

data = b'\x80\x04\x95\xcb\x02\x00\x00\x00\x00\x00\x00\x8c\x17cloudpickle.cloudpickle\x94\x8c\x0e_make_function\x94\x93\x94(h\...doc__\x94N\x8c\x0b__closure__\x94N\x8c\x17_cloudpickle_submodules\x94]\x94\x8c\x0b__globals__\x94}\x94u\x86\x94\x86R0.'
gcs_filename = '/gcs/staging-bucket/fake_gcs_uri.cpkl'

    def write_and_upload_data(data: bytes, gcs_filename: str):
        """Writes data to a local temp file and uploads the file to gcs.

        Args:
            data (bytes):
                Required. Bytes data to write.
            gcs_filename (str):
                Required. A gcs file path.
        """
        if gcs_filename.startswith("gs://"):
            with tempfile.NamedTemporaryFile() as temp_file:
                temp_file.write(data)
                temp_file.flush()
                temp_file.seek(0)

                gcs_utils.upload_to_gcs(temp_file.name, gcs_filename)
        else:
>           with open(gcs_filename, mode="wb") as f:
E           FileNotFoundError: [Errno 2] No such file or directory: '/gcs/staging-bucket/fake_gcs_uri.cpkl'

vertexai/preview/_workflow/serialization_engine/serializers_base.py:170: FileNotFoundError
flaky-bot[bot] commented 11 months ago

Test passed for commit 9fedd34d004a60c7105c066085a296bc12b28138 (Build Status, Sponge)! Closing this issue.

flaky-bot[bot] commented 11 months ago

Test passed for commit 9fedd34d004a60c7105c066085a296bc12b28138 (Build Status, Sponge)! Closing this issue.

flaky-bot[bot] commented 11 months ago

Test passed for commit 9fedd34d004a60c7105c066085a296bc12b28138 (Build Status, Sponge)! Closing this issue.

flaky-bot[bot] commented 11 months ago

Test passed for commit 9fedd34d004a60c7105c066085a296bc12b28138 (Build Status, Sponge)! Closing this issue.