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

fix(ImageSpec): Ensure all APIErrors return a value #2408

Merged
merged 8 commits into from
May 13, 2024
Merged

Conversation

pingsutw
Copy link
Member

@pingsutw pingsutw commented May 10, 2024

Tracking issue

NA

Why are the changes needed?

image.exists() return None when the docker client raises an error & the error code is not 404

What changes were proposed in this pull request?

Always return true if error code is not 404

How was this patch tested?

local sandbox

Setup process

from flytekit import ImageSpec, task, dynamic


new_flytekit = "git+https://github.com/flyteorg/flytekit.git@285148f1189cd1b14503b50caf60ba63222272e9"

repro_img = ImageSpec(
    name="flytekit",
    base_image="ghcr.io/flyteorg/flytekit:py3.11-latest",
    builder="envd",
    packages=[new_flytekit],
    apt_packages=["curl", "git"],
    registry="localhost:30000",
)


@task(container_image=repro_img)
def foo():
    print("foo")


@dynamic(container_image=repro_img)
def bar():
    foo()


if __name__ == "__main__":
    print("image", repro_img.exist())

Screenshots

Screenshot 2024-05-11 at 5 55 07 AM

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

pingsutw added 7 commits May 11, 2024 05:20
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Copy link

codecov bot commented May 10, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 75.85%. Comparing base (4dd4d22) to head (702c8ac).
Report is 5 commits behind head on master.

Files Patch % Lines
flytekit/image_spec/image_spec.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2408      +/-   ##
==========================================
+ Coverage   75.81%   75.85%   +0.03%     
==========================================
  Files         181      181              
  Lines       18327    18390      +63     
  Branches     2580     3599    +1019     
==========================================
+ Hits        13895    13949      +54     
- Misses       3830     3839       +9     
  Partials      602      602              

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

@pingsutw pingsutw merged commit cc3a7a9 into master May 13, 2024
47 of 49 checks passed
fiedlerNr9 pushed a commit that referenced this pull request Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants