<#3173 Use digest as file_name to get signed url> ...
# flyte-github
c
#3173 Use digest as file_name to get signed url Pull request opened by pingsutw ## Tracking issue NA ## Why are the changes needed? I encountered an error when attempting to run the task for the second time. Here’s the error message I received. The issue occurs because the pickle path in the node binding changes each time a new workflow is registered File name was a random string generated from here, and it causes
get_upload_signed_url
to always return a different S3 path.
Copy code
Request rejected by the API, due to Invalid input.
RPC Failed, with Status: StatusCode.INVALID_ARGUMENT
        Details: cus.test_workflow workflow with different structure already exists. (Please register a new version of the workflow):
/primary/connections:
        - <nil>
        + map[downstream:map[n0:map[ids:[end-node]] start-node:map[ids:[n0]]] upstream:map[end-node:map[ids:[n0]] n0:map[ids:[start-node]]]]
/primary/template/id:
        - <nil>
        + map[domain:development name:cus.test_workflow project:flytesnacks resource_type:2 version:VZzeazr6eSezJIFQpbjG5w]
/primary/template/metadata:
        - <nil>
        + map[]
/primary/template/metadata_defaults:
        - <nil>
        + map[]
/primary/template/nodes:
        - <nil>
        + [map[Target:<nil> id:start-node] map[Target:<nil> id:end-node inputs:[map[binding:map[Value:map[Scalar:map[Value:map[Primitive:map[Value:map[StringValue:Done]]]]]] var:o0]]] map[Target:map[TaskNode:map[Reference:map[ReferenceId:map[domain:development name:cus.test_task project:flytesnacks resource_type:1 version:VZzeazr6eSezJIFQpbjG5w]] overrides:map[]]] id:n0 inputs:[map[binding:map[Value:map[Scalar:map[Value:map[Blob:map[metadata:map[type:map[format:PythonPickle]] uri:s3://my-s3-bucket/flytesnacks/development/33MFF3MWMFPRKSOCGUARVNAQZE======/c9a3f0c59b8cd3b750e0a0d96e5079e7]]]]] var:game_id]] metadata:map[CacheSerializableValue:<nil> CacheVersionValue:<nil> CacheableValue:<nil> InterruptibleValue:<nil> name:test_task retries:map[]]]]
/primary/template/outputs:
        - <nil>
        + [map[binding:map[Value:map[Scalar:map[Value:map[Primitive:map[Value:map[StringValue:Done]]]]]] var:o0]]
/tasks:
        - <nil>
        + [map[template:map[Target:map[Container:map[args:[pyflyte-fast-execute --additional-distribution s3://my-s3-bucket/flytesnacks/development/5MLZDNYX3SFVNSRTVLRSUQZARI======/fast55118ecf880885b3b42868f6cf690429.tar.gz --dest-dir /root -- pyflyte-execute --inputs {{.input}} --output-prefix {{.outputPrefix}} --raw-output-data-prefix {{.rawOutputDataPrefix}} --checkpoint-path {{.checkpointOutputPrefix}} --prev-checkpoint {{.prevCheckpointPrefix}} --resolver flytekit.core.python_auto_container.default_task_resolver -- task-module cus task-name test_task] image:flytekit:f5CA7ElyTVmVZsyiBAOWxw resources:map[]]] id:map[domain:development name:cus.test_task project:flytesnacks resource_type:1 version:VZzeazr6eSezJIFQpbjG5w] interface:map[inputs:map[variables:map[game_id:map[description:game_id type:map[Type:map[Blob:map[format:PythonPickle]] metadata:map[python_class_name:<class 'uuid.UUID'>]]]]] outputs:map[variables:map[o0:map[description:o0 type:map[Type:map[Blob:map[dimensionality:1]]]]]]] metadata:map[InterruptibleValue:<nil> generates_deck:map[] retries:map[] runtime:map[flavor:python type:1 version:1.15.1.dev1+ge19fedc2b]] type:python-task]]]
## What changes were proposed in this pull request? Use digest as file_name to get signed url since digest is deterministic. ## How was this patch tested? import uuid from flytekit import task, workflow @task def test_task(game_id: uuid.UUID): print(game_id) # test @workflow def test_workflow() -> str: test_task(game_id="123456") return "Done" ### Setup process ### Screenshots ## Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. ## Related PRs ## Docs link ### Summary by Bito This PR enhances file upload functionality by implementing deterministic MD5 digest-based file naming for consistency across upload calls, resolving non-deterministic naming issues. It replaces direct API calls with pyflyte CLI subprocess commands, eliminates redundant registration calls, modifies API signatures, and refines file handling in remote modules while improving test execution consistency and reliability. Unit tests added: True Estimated effort to review (1-5, lower is better): 2 flyteorg/flytekit