-
Notifications
You must be signed in to change notification settings - Fork 680
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
[Core feature] Pass a dict to containertask #6154
Comments
hey @doLei-2001 - thank you for the issue. Could we get you to give some more information though please? What's the ux look like on the python side (when you're declaring the container task)? what types of inputs are you envisioning - is it just an untyped dict? or will dataclasses and pydantics be passed as well? I think you know this, but as background, something to consider is that To clarify this issue a bit more - if you have a task that produces an untyped dict, that gets stored in the Flyte backend blob store as a flyte scalar of a msgpack (or a generic protobuf struct). This is fine if a downstream task consuming this output is another Python task that has flytekit installed. flytekit has all the libraries it needs in order to understand both msgpack and proto structs. This request is for flyte copilot (the helper sidecar container that downloads inputs) to be able to deserialize msgpack to json right? |
container task is language agnostic, so it means that you have to support prerequiste: dataclass and dict will be serialized and deserialized through msgpack bytes and protobuf struct. so in your copilot task, your customized image should know how to handle the deserialization logic for protobuf struct or msgpack bytes, which is inconvenient. |
In other words, Are there any other ways to pass parameters to the image besides using environment variables and command lines? If there are only these two ways, then it seems that what can be passed in is limited to these two ways.
so, the most important question is that is there only the two ways to pass the variable into image? |
@doLei-2001 , copilot translates the Flyte objects into values accessible through the flyte/flyteplugins/go/tasks/pluginmachinery/core/template/template.go Lines 82 to 107 in 69ba94e
As of flyte 1.14.0, untyped dictionaries are encoded using msgpack, so we could turn those into json strings. Keep in mind that if we go that route we'll have to update the documentation as well. |
Motivation: Why do you think this is important?
As far as I know, only basic types such as str-int-float can be passed into containertask. If you want to pass dict/json type into it, you can only use json.dumps to convert it to str first, and then pass it. It still needs to be loaded into dict-json type inside the image. This is very troublesome.
for 2 ways:
Goal: What should the final outcome look like, ideally?
We can directly pass dict type data to containertask, and we can easily get it in the image
Describe alternatives you've considered
easy to use
Propose: Link/Inline OR Additional context
No response
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: