[Core feature] fast-fail inamgespec
Motivation: Why do you think this is important?
Right now, if ImageSpec can't find or create an image (e.g. Docker isn't running), it assumes the image exists with f"Flytekit assumes the image {img_name} already exists.".
For CI/CD processes, it may not be ideal for an automated system to assume an image exists.
Goal: What should the final outcome look like, ideally?
Ideally, the register or run command can take a --imagespec-fast-fail flag which will fail the registration or run command if the image can't be built.
Describe alternatives you've considered
Alternatively, ImageSpec could take an argument that prevents registration from succeeding if the image can't be found or built.
Propose: Link/Inline OR Additional context
Proposition:
- Add a
--imagespec-fast-failflag - Add a
imagespec_fast_failargument toImageConfigwhich is included in theSerializationSettingsduring registration. - In
ImageBuildEngine.build, include theimagespec_fast_failarg. - In
ImageSpec, inshould_build, raise an error ifimagespec_fast_fail==Trueand the image can't be found or built.
Are you sure this issue hasn't been raised already?
- [x] Yes
Have you read the Code of Conduct?
- [x] Yes
There is currently no --imagespec-fast-fail flag or imagespec_fast_fail argument in Flyte's CLI or ImageConfig as described in your proposal. The current behavior, as you noted, is that if Flytekit cannot determine if an image exists (e.g., Docker is not running), it assumes the image exists and proceeds, which may not be ideal for CI/CD environments (source).
Your suggested enhancements—adding a fast-fail flag or config option to fail registration/run if the image can't be built—are not present in the current implementation or documentation. This feature would require a code change to Flytekit and is not achievable with existing CLI flags or configuration options.
Would you like more detail on how to propose or implement this feature in Flyte?
Sources:
- https://github.com/flyteorg/flyte/issues/3772
- https://github.com/flyteorg/flytekit/blob/master/flytekit/image_spec/image_spec.py
This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.
Mention @runllm to ask follow-up questions. See runllm.com for more!
#take
This should be fixed with this simpler solution: https://github.com/flyteorg/flytekit/pull/3251