Skip to content

Conversation

@popojk
Copy link
Contributor

@popojk popojk commented Aug 11, 2025

Tracking issue

closes #6561

Why are the changes needed?

The NoOpBuilder should overrride should_build function in order to correctly trigger build_image function in an environment that docker daemon is not running.

What changes were proposed in this pull request?

Make NoOpBuilder override should_build function.

How was this patch tested?

Test workflow:

from flytekit.image_spec.noop_builder import NoOpBuilder
from flytekit import task, workflow, ImageSpec

image_spec = ImageSpec(
    name="test_image",
    builder="noop",
    base_image="localhost:30000/test_image:latest",
    registry="ghcr.io/not_exist_registry"
    
)

@task(container_image=image_spec)
def task_1(message: str) -> str:
    print(message)
    return message

@workflow
def wf() -> str:
    return task_1("hello")

We define a docker registry in image_spec that is not existed, and we expect that the SDK will still use the image user defined without actually communicating with the docker registry. After remote running the workflow, the SDK will use the user defined image as expected.
截圖 2025-08-11 上午11 44 59

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

Docs link

Summary by Bito

This pull request adds a new method, should_build, to the NoOpBuilder class, fixing a bug by ensuring it consistently returns True. It enhances the build_image method to function even when the Docker daemon is down and improves the testing suite to validate the NoOpBuilder's functionality across various environments, ensuring better reliability and behavior.

pingsutw
pingsutw previously approved these changes Aug 13, 2025
Copy link
Member

@pingsutw pingsutw left a comment

Choose a reason for hiding this comment

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

lgtm, thanks

@codecov
Copy link

codecov bot commented Aug 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.51%. Comparing base (eb5a67f) to head (a2919cb).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3311      +/-   ##
==========================================
+ Coverage   85.26%   92.51%   +7.25%     
==========================================
  Files         386        7     -379     
  Lines       30276      508   -29768     
  Branches     2969        0    -2969     
==========================================
- Hits        25814      470   -25344     
+ Misses       3615       38    -3577     
+ Partials      847        0     -847     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@popojk popojk requested a review from machichima August 16, 2025 04:12
Copy link
Member

@machichima machichima left a comment

Choose a reason for hiding this comment

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

LGTM

@pingsutw pingsutw merged commit fb52d88 into flyteorg:master Aug 16, 2025
228 of 230 checks passed
Atharva1723 pushed a commit to Atharva1723/flytekit that referenced this pull request Oct 5, 2025
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.

[BUG] ImageSpec NoOpBuilder should always return True while calling should_build function

3 participants