Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Kenny/type metadata #370

Merged
merged 12 commits into from Feb 8, 2022
Merged

Conversation

kennyworkman
Copy link
Contributor

@kennyworkman kennyworkman commented Dec 2, 2021

Strip Annotations from TaskTemplate#minor

Strips any annotation from type so runtime task structure remains the same size

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

re:

@welcome
Copy link

welcome bot commented Dec 2, 2021

Thank you for opening this pull request! 🙌

These tips will help get your PR across the finish line:

  • Most of the repos have a PR template; if not, fill it out to the best of your knowledge.
  • Sign off your commits (Reference: DCO Guide).

@@ -221,6 +221,18 @@ func buildTasks(tasks []*core.CompiledTask, errs errors.CompileErrors) map[commo
errs.Collect(errors.NewValueCollisionError(taskID, "Id", taskID))
}

// We don't want Annotation data available at task runtime for performance.
if flyteTask.Template != nil &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm going to be honest this is pretty gross, but don't know the most semantic way of dereferencing nested pointers here given that the whole struct is received as a big chunk from admin

Copy link
Contributor

@EngHabu EngHabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more change that needs to happen in the compiler is the type check (that checks whether a given output can be passed down as a given input type).. this check relies on the serialized representation of LiteralType here and having annotations in the output but not the input (or vis versa) will fail such validation I believe...

Just list we "nil" the metadata right before that line, we should nil the Annotations (just for checking)...

flyteTask.Template.Interface != nil &&
flyteTask.Template.Interface.Inputs != nil &&
flyteTask.Template.Interface.Inputs.Variables != nil {
for _, v := range flyteTask.Template.Interface.Inputs.Variables {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably do the same with outputs for consistency/completeness sake....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed with new commit

@kennyworkman
Copy link
Contributor Author

@EngHabu not sure how you can verify the tests pass with github actions alone because the flyteidl source code structure doesnt play well with go mod

i just did this locally to confirm that everything passes with new flyteidl
replace github.com/flyteorg/flyteidl => /Users/kenny/latch/flyteorg/flyteidl

@EngHabu
Copy link
Contributor

EngHabu commented Dec 9, 2021

@EngHabu not sure how you can verify the tests pass with github actions alone because the flyteidl source code structure doesnt play well with go mod

i just did this locally to confirm that everything passes with new flyteidl

replace github.com/flyteorg/flyteidl => /Users/kenny/latch/flyteorg/flyteidl

You can do this instead:

replace github.com/flyteorg/flyteidl => github.com/<fork>flyteidl <Sha>

And this should work fine in CI

@kennyworkman
Copy link
Contributor Author

@EngHabu good to go

@codecov
Copy link

codecov bot commented Dec 10, 2021

Codecov Report

Merging #370 (27bd35b) into master (6f4475e) will increase coverage by 0.02%.
The diff coverage is 83.33%.

Copy link
Contributor

@EngHabu EngHabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this addressed in the PR... please let me know if you want to discuss further

pkg/compiler/transformers/k8s/node.go Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@EngHabu
Copy link
Contributor

EngHabu commented Dec 10, 2021

Mind deleting pkg/compiler/transformers/k8s/.node_test.go.swp from the PR as well?

Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>
Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>
Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>
Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>
Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>
Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>
Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>
Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>
EngHabu
EngHabu previously approved these changes Dec 10, 2021
Copy link
Contributor

@EngHabu EngHabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

go.mod Outdated Show resolved Hide resolved
Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>
Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>
@EngHabu EngHabu merged commit 7e8bc5f into flyteorg:master Feb 8, 2022
@welcome
Copy link

welcome bot commented Feb 8, 2022

Congrats on merging your first pull request! 🎉

@kennyworkman kennyworkman deleted the kenny/type-metadata branch February 8, 2022 22:50
eapolinario pushed a commit to eapolinario/flytepropeller that referenced this pull request Aug 9, 2023
* feat: strip annotation from node template

Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>

* feat: strip annotation tests

Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>

* fix: strip outputs + test

Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>

* fix: temp flyteidl for tests

Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>

* fix: tmp update flyteidl

Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>

* fix: range nil ok

Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>

* fix: strip annotation in type compare

Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>

* fix: rm .swp

Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>

* fix: new flyteidl

Signed-off-by: Kenny Workman <kennyworkman@sbcglobal.net>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants