-
Notifications
You must be signed in to change notification settings - Fork 662
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
[WIP][flyteadmin] Make New DC and Old DC Default Inputs Compatible #5991
[WIP][flyteadmin] Make New DC and Old DC Default Inputs Compatible #5991
Conversation
Signed-off-by: Future-Outlier <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5991 +/- ##
==========================================
- Coverage 36.94% 33.15% -3.79%
==========================================
Files 1310 1013 -297
Lines 131382 107571 -23811
==========================================
- Hits 48540 35667 -12873
+ Misses 78629 68744 -9885
+ Partials 4213 3160 -1053
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
why are we doing this again? this pr doesn't really make sense to me. |
Signed-off-by: Future-Outlier <[email protected]>
Hi, do you mind check the description again? |
flyteadmin/pkg/errors/errors.go
Outdated
func IsSameDCFormat(oldSpec *admin.LaunchPlanSpec, newSpec *admin.LaunchPlanSpec) bool { | ||
oldParams := oldSpec.GetDefaultInputs().GetParameters() | ||
newParams := newSpec.GetDefaultInputs().GetParameters() | ||
|
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 am writing more comments here to let people understand how this algorithm works.
Signed-off-by: Future-Outlier <[email protected]>
Hi, @wild-endeavor |
Signed-off-by: Future-Outlier <[email protected]>
this should be close and if we want to support this, we should give the different launch plan a new workflow version, since the default inputs are different. |
Tracking issue
#5318
Why are the changes needed?
Context:
When users use data classes (
dataclass
), lists of data classes (list[dataclass]
), or maps of data classes (map[key]dataclass
) asworkflow default input
, they might encounter issues when upgrading or downgrading betweenflytekit
versions 1.13.0 and 1.14.0, especially when running workflows remotely usingpyflyte run --remote
.Use Cases:
~~1. Upgrade Scenario:
flytekit
1.13.0.flytekit
1.14.0.pyflyte run --remote file.py
.~~flytekit
1.14.0.flytekit
1.13.0.pyflyte run --remote file.py
.Problem:
In the first scenario, the default input is stored as a protobuf struct, but when running
pyflyte run --remote
, it uses msgpack IDL to construct the default input.In the second scenario, the default input is stored as msgpack IDL, but
pyflyte run --remote
uses a protobuf struct to construct the default input.This mismatch leads to the following error:
What changes were proposed in this pull request?
Root Cause:
LaunchPlanSpec
is hashed to determine if the remotely run workflow matches the registered one.LaunchPlanSpec.DefaultInputs.ParameterMap
contains either a msgpack IDL or a protobuf struct, depending on theflytekit
version used.Solution:
map[string]interface{}
in Go, and usereflect.deepEqual
to compare them.flytekit
versions seamlessly.Follow-Up
This Pull Request (PR) does not address cases where we use
list[DC]
ordict[str, DC]
as default inputs.There's a known bug in Flytekit related to these cases, which is documented in Flyte issue #5318.
We need to resolve this Flytekit issue first before we can handle
list[DC]
ordict[str, DC]
default inputs in this PR.How was this patch tested?
pyflyte register /Users/future-outlier/code/dev/flytekit/build/current_PR/priority_msgpack/flytefile_upload/default_input_upload_2.py
pyflyte run --remote /Users/future-outlier/code/dev/flytekit/build/current_PR/priority_msgpack/flytefile_upload/default_input_upload_2.py wf
FLYTE_USE_OLD_DC_FORMAT=true pyflyte run --remote /Users/future-outlier/code/dev/flytekit/build/current_PR/priority_msgpack/flytefile_upload/default_input_upload_2.py wf
Example code
Setup process
Screenshots
Check all the applicable boxes
Related PRs
flyteorg/flytekit#2907
Docs link