Skip to content
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

[BUG] Flytekit model file organization improvement #706

Merged
merged 47 commits into from
Oct 25, 2021

Conversation

aeioulisa
Copy link
Member

TL;DR

Clean up the structure to align with Flyte IDL.

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

Tracking Issue

flyteorg/flyte#803

@welcome
Copy link

welcome bot commented Oct 18, 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).

@kumare3
Copy link
Contributor

kumare3 commented Oct 18, 2021

Omg this is a huge change

@wild-endeavor
Copy link
Contributor

Thanks for the PR @aeioulisa! Can you resolve the merge conflict though please? Tests won't run with that there. Thanks.

張君如 and others added 24 commits October 19, 2021 17:57
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Lisa <[email protected]>
samhita-alla and others added 3 commits October 19, 2021 18:10
* Concise: dynamic node ids and names

PART 1:
 - Dynamic node ids currently have additional context, namely
a shortened name of the dynamic task function
 - This causes a tremendous bloat and is completely dependent on the
name of the task
 - This PR standardizes the name and affixes a simple `d` in the
begining

PART 2:
Reduce node names, which are purely for decorative purposes

Signed-off-by: Ketan Umare <[email protected]>

* unit tests

Signed-off-by: Ketan Umare <[email protected]>

* fix test

Signed-off-by: Ketan Umare <[email protected]>

* unit tests

Signed-off-by: Ketan Umare <[email protected]>
Signed-off-by: Lisa <[email protected]>
@eapolinario
Copy link
Collaborator

The integration tests under https://github.com/flyteorg/flytekit/tree/master/tests/flytekit/integration/remote build an image that uses an official release of flytekit. The errors in CI are caused by this mismatch, since we're refactoring some files while the remote integration tests are still using the old module names, for example in https://github.com/flyteorg/flytekit/blob/master/tests/flytekit/integration/remote/mock_flyte_repo/workflows/basic/child_workflow.py#L2.

@aeioulisa
Copy link
Member Author

@kumare3 @wild-endeavor @eapolinario Thanks for your review and comments.
I have resolved the conflict.

@wild-endeavor
Copy link
Contributor

Thank you for all this work!!! There's something weird going on with integration tests on master. Let us resolve that first and we'll re-run the tests here.

@wild-endeavor
Copy link
Contributor

hey @aeioulisa can you give @eapolinario and me write permissions to your fork please? want to push a commit to this pr that will make the tests pass. it's a bit of a hack, might need a couple tries to get it right.

thanks!

@@ -1,5 +1,5 @@
from flytekit import LaunchPlan, task, workflow
from flytekit.models.common import Labels
from flytekit.models.admin.common import Labels
Copy link
Collaborator

Choose a reason for hiding this comment

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

@aeioulisa , can you revert this change? For complicated reasons, in our integration tests we use a pinned version of flytekit, so changing this specific file will need to happen in a separate PR (that either @wild-endeavor or myself are going to handle). This should unblock all tests.

@codecov
Copy link

codecov bot commented Oct 22, 2021

Codecov Report

Merging #706 (74f1433) into master (782bb34) will increase coverage by 0.04%.
The diff coverage is 95.58%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #706      +/-   ##
==========================================
+ Coverage   85.76%   85.80%   +0.04%     
==========================================
  Files         358      358              
  Lines       29778    29793      +15     
  Branches     2428     2428              
==========================================
+ Hits        25538    25564      +26     
+ Misses       3601     3590      -11     
  Partials      639      639              
Impacted Files Coverage Δ
flytekit/common/component_nodes.py 82.66% <ø> (ø)
flytekit/common/mixins/launchable.py 70.58% <ø> (ø)
flytekit/engines/common.py 79.60% <ø> (ø)
flytekit/models/admin/matchable_resource.py 75.91% <ø> (ø)
flytekit/models/admin/node_execution.py 89.61% <ø> (ø)
flytekit/models/admin/project.py 100.00% <ø> (ø)
flytekit/models/admin/schedule.py 90.14% <ø> (ø)
flytekit/models/common.py 89.09% <ø> (-7.31%) ⬇️
flytekit/models/core/security.py 86.84% <ø> (ø)
flytekit/models/plugins/array_job.py 91.66% <ø> (ø)
... and 148 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 782bb34...74f1433. Read the comment docs.

Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
@wild-endeavor
Copy link
Contributor

Hey @aeioulisa - just to recap, @eapolinario and I

  • reverted one line in the child_workflow.py file (because of the way tests work, it's actually using a released version of flytekit - separate issue for another day). we'll put in a PR that corrects it after this one is merged.
  • Temporarily removing papermill from plugin testing. It has a dependency on the flytekit spark, which is again looking up a released flytekit, which doesn't have the necessary import changes.
  • Ran make fmt - this runs a python formatting tool
  • Updated a couple imports in a couple plugins

I'm okay merging this PR as is, but there is one thing we noticed when going through the PR - a lot of the non-model code now imports the models in two different styles. For instance in component_nodes.py, there is both import flytekit.models.core.task and from flytekit.models.core import workflow as _workflow_model .

In some files the same module is being imported - for example test_common imports admin both as flytekit.models.admin.common and from flytekit.models.admin import common as _admin_common.

Just doing a ripgrep, there seems to be a fair number of files where this is the case, but would you be able to change these back to the from x.y import z style of import?

Thank you all the work aligning the models though! After this is in, we'll most likely move all the models into the flyteidl repo so that they don't drift again.

Signed-off-by: Yee Hing Tong <[email protected]>
@wild-endeavor wild-endeavor merged commit b0da779 into flyteorg:master Oct 25, 2021
@welcome
Copy link

welcome bot commented Oct 25, 2021

Congrats on merging your first pull request! 🎉

wild-endeavor added a commit that referenced this pull request Nov 2, 2021
wild-endeavor added a commit that referenced this pull request Nov 2, 2021
reverson pushed a commit to reverson/flytekit that referenced this pull request May 27, 2022
Signed-off-by: Lisa <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Robert Everson <[email protected]>
reverson pushed a commit to reverson/flytekit that referenced this pull request May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants