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

FLYTE_INTERNAL_IMAGE should have higher precedence #2523

Merged
merged 6 commits into from
Jun 20, 2024
Merged

Conversation

pingsutw
Copy link
Member

Tracking issue

NA

Why are the changes needed?

When unionai is installed, it will ignore FLYTE_INTERNAL_IMAGE, and always use the default flytekit image.

That's because flytekit will call get_plugin().get_default_image(), and then DefaultImages.find_image_for(). Thus, it skip the FLYTE_INTERNAL_IMAGE.

What changes were proposed in this pull request?

Move os.getenv("FLYTE_INTERNAL_IMAGE") to find_image_for()

How was this patch tested?

unit test

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

NA

Docs link

NA

Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
@pingsutw
Copy link
Member Author

cc @thomasjpfan


@classmethod
def find_image_for(
cls, python_version: typing.Optional[PythonVersion] = None, flytekit_version: typing.Optional[str] = None
) -> str:
default_image_str = os.getenv("FLYTE_INTERNAL_IMAGE")
Copy link
Member

Choose a reason for hiding this comment

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

FLYTE_INTERNAL_IMAGE is not really documented. What is it used for?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's very useful when I need to override the default image for the task or the base image in the ImageSpec.

Copy link
Collaborator

Choose a reason for hiding this comment

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

can we move FLYTE_INTERNAL_IMAGE to a constant and leave this comment there?

Signed-off-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Eduardo Apolinario <653394+eapolinario@users.noreply.github.com>
Copy link

codecov bot commented Jun 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.15%. Comparing base (29662e7) to head (40d19d5).
Report is 5 commits behind head on master.

Current head 40d19d5 differs from pull request most recent head 67a999c

Please upload reports for the commit 67a999c to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2523      +/-   ##
==========================================
+ Coverage   71.79%   76.15%   +4.35%     
==========================================
  Files         182      182              
  Lines       18561    18565       +4     
  Branches     3654     3655       +1     
==========================================
+ Hits        13326    14138     +812     
+ Misses       4592     3800     -792     
+ Partials      643      627      -16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pingsutw and others added 2 commits June 20, 2024 14:28
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
@pingsutw pingsutw merged commit 0839ce1 into master Jun 20, 2024
45 of 46 checks passed
bgedik pushed a commit to bgedik/flytekit that referenced this pull request Jul 3, 2024
Signed-off-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Eduardo Apolinario <653394+eapolinario@users.noreply.github.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Signed-off-by: bugra.gedik <bugra.gedik@predera.ai>
fiedlerNr9 pushed a commit that referenced this pull request Jul 25, 2024
Signed-off-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Eduardo Apolinario <653394+eapolinario@users.noreply.github.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Signed-off-by: Jan Fiedler <jan@union.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants