-
Notifications
You must be signed in to change notification settings - Fork 656
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
[Flyte][3][flytepropeller][Attribute Access][flytectl] Binary IDL With MessagePack #5763
Conversation
Signed-off-by: Future-Outlier <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5763 +/- ##
==========================================
+ Coverage 36.31% 36.35% +0.03%
==========================================
Files 1304 1304
Lines 110072 110147 +75
==========================================
+ Hits 39974 40044 +70
Misses 65936 65936
- Partials 4162 4167 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
t.Run("Generic", func(t *testing.T) { | ||
literalVal := map[string]interface{}{ | ||
"x": 1, | ||
"y": "ystringvalue", | ||
} | ||
var literalType = &core.LiteralType{Type: &core.LiteralType_Simple{Simple: core.SimpleType_STRUCT}} | ||
lit, err := MakeLiteralForType(literalType, literalVal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
@@ -559,12 +562,35 @@ func MakeLiteralForType(t *core.LiteralType, v interface{}) (*core.Literal, erro | |||
strValue = fmt.Sprintf("%.0f", math.Trunc(f)) | |||
} | |||
if newT.Simple == core.SimpleType_STRUCT { | |||
// If the type is a STRUCT, we expect the input to be a complex object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this not break if the clients or otherside have the old view of struct?
i.e, this seems backwards incompatible?
cc @EngHabu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will not break JSON string
case, since this is not a string type.
Signed-off-by: Future-Outlier <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Future-Outlier, what happens if a new flytekit produced a msgpack and old flytekit tried to consume it?
@@ -11,14 +12,16 @@ import ( | |||
"github.com/flyteorg/flyte/flytestdlib/storage" | |||
) | |||
|
|||
const messagepack = "msgpack" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this const to one place and reference it everywhere...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll move it now.
switch resolvedVal := currVal.(type) { | ||
// map | ||
case map[interface{}]interface{}: | ||
tmpVal, exist = resolvedVal[attr.GetStringValue()] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will GetStringValue() return if if the attr is foo[0]
? shouldn't it fail in that case and say "you can't index into a struct" or something ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currVal = tmpVal | ||
// list | ||
case []interface{}: | ||
if int(attr.GetIntValue()) >= len(resolvedVal) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto here. If it's foo.bar
GetIntValue() will return 0 I presume? it should fail here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, GetIntValue() will return 0
, but foo.bar
will go to the up map
case, so it will called attr.GetStringValue
to get the bar
attribute
// Unsupported serialization format | ||
return nil, errors.Errorf(errors.PromiseAttributeResolveError, nodeID, | ||
"Unsupported format '%v' found for literal value.\n"+ | ||
"Please ensure the serialization format is supported.", serializationFormat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case can never happen, right? since you checked for that early on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I can remove it
upstream output (msgpack) -> downstream input (msgpack) This will fail when executing the pod plugin, but not crashed the propeller. |
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
Details about 1: @dataclass
class DC2:
a: float
b: DC
c: List[DC]
d: Dict[int, DC]
o = DC2()
x=o.d[1].a # This should be `int` type, but will return `Struct` type when using `get literal type` function. |
…h MessagePack (flyteorg#5763) Signed-off-by: Siddhant Rai <[email protected]>
* Update registering_workflows.md Signed-off-by: Siddhant Rai <[email protected]> * feat: note in registering_workflows for k8sPod.dataConfig fix Signed-off-by: Siddhant Rai <[email protected]> * update: remove note as requested change Signed-off-by: Siddhant Rai <[email protected]> Signed-off-by: Siddhant Rai <[email protected]> * Flyte docs overhaul (phase 1) (#5772) * move flytekit and flytectl docs into API section Signed-off-by: nikki everett <[email protected]> * switch to docsearch module and env variables Signed-off-by: nikki everett <[email protected]> * reorganize content for pydata theme Signed-off-by: nikki everett <[email protected]> * more docs reorganization Signed-off-by: nikki everett <[email protected]> * switch to pydata theme Signed-off-by: nikki everett <[email protected]> * reorganize concepts/glossary and ecosystem docs Signed-off-by: nikki everett <[email protected]> * remove unneeded custom CSS and JS files Signed-off-by: nikki everett <[email protected]> * add redirects Signed-off-by: nikki everett <[email protected]> * add more redirects Signed-off-by: nikki everett <[email protected]> * first pass at updating docs contributing guide Signed-off-by: nikki everett <[email protected]> * remove core use cases Signed-off-by: nikki everett <[email protected]> * more edits to docs contributing guide Signed-off-by: nikki everett <[email protected]> * more edits to the flytesnacks contributing guide Signed-off-by: nikki everett <[email protected]> * add content to API reference index page, use consistent title and format for API reference section titles Signed-off-by: nikki everett <[email protected]> * rename deployment section Signed-off-by: nikki everett <[email protected]> * reorganize sections Signed-off-by: nikki everett <[email protected]> * fix typos Signed-off-by: nikki everett <[email protected]> * add docsearch index name and app id Signed-off-by: nikki everett <[email protected]> * add ref to docs contributing doc and move all docsearch stuff to env vars again Signed-off-by: nikki everett <[email protected]> * docs overhaul: render flyteidl under the /api/ path (#5802) * fix flyteidl structure so it renders under /api/ Signed-off-by: Niels Bantilan <[email protected]> * do not check in flyteidl docs Signed-off-by: Niels Bantilan <[email protected]> * update gitignore and unneeded conf Signed-off-by: Niels Bantilan <[email protected]> * add mock DOCSEARCH_API_KEY to docs test ci Signed-off-by: Niels Bantilan <[email protected]> * add css styling (#5803) * add css styling Signed-off-by: Niels Bantilan <[email protected]> * update logo height Signed-off-by: Niels Bantilan <[email protected]> --------- Signed-off-by: Niels Bantilan <[email protected]> --------- Signed-off-by: Niels Bantilan <[email protected]> * use same icon as union docs Signed-off-by: nikki everett <[email protected]> * sp error Signed-off-by: Niels Bantilan <[email protected]> --------- Signed-off-by: nikki everett <[email protected]> Signed-off-by: Niels Bantilan <[email protected]> Co-authored-by: Niels Bantilan <[email protected]> Signed-off-by: Siddhant Rai <[email protected]> * [Flyte][3][flytepropeller][Attribute Access][flytectl] Binary IDL With MessagePack (#5763) Signed-off-by: Siddhant Rai <[email protected]> * Update aws-go-sdk to v1.47.11 to support EKS Pod Identity (#5796) Signed-off-by: Siddhant Rai <[email protected]> * Update docs/user_guide/flyte_fundamentals/registering_workflows.md Co-authored-by: Nikki Everett <[email protected]> Signed-off-by: Siddhant Rai <[email protected]> * Update registering_workflows.md Signed-off-by: Siddhant Rai <[email protected]> --------- Signed-off-by: Siddhant Rai <[email protected]> Signed-off-by: Siddhant Rai <[email protected]> Signed-off-by: nikki everett <[email protected]> Signed-off-by: Niels Bantilan <[email protected]> Co-authored-by: Nikki Everett <[email protected]> Co-authored-by: Niels Bantilan <[email protected]> Co-authored-by: Future-Outlier <[email protected]> Co-authored-by: mthemis-provenir <[email protected]>
Tracking Issue
Issue #5318
Why are these changes needed?
flytectl
to create and get executions.Note: This PR includes handling of primitive types, Flyte types, and dataclasses.
What changes are proposed in this pull request?
Attribute Access
msgpack
bytes inBinary Literal
.Binary Literal
.flytectl
flytectl
, serialize it tomsgpack
bytes and create a binary scalar directly.This version is more concise, avoids redundant words, and clarifies the structure a bit.
How was this patch tested?
Attribute Access
unit tests and remote execution
flytectl
command line
get_task.yaml
Setup process
single binary
Screenshots
Local Execution
Remote Execution
Check all the applicable boxes