flytekit icon indicating copy to clipboard operation
flytekit copied to clipboard

Rename container_image to image for improved UX

Open JiangJiaWei1103 opened this issue 11 months ago • 18 comments

Tracking issue

Closes https://github.com/flyteorg/flyte/issues/6140.

Why are the changes needed?

To enhance the user experience, the concept of container should be abstracted from flytekit users.

What changes were proposed in this pull request?

We propose renaming container_image to image for both the @task decorator and the with_overrides method. To ensure backward compatibility, we will support both parameters with the following behavior:

  1. Both image and container_image are specified: Raise an error
  2. container_image is used: Warn users about the future deprecation
  3. image is used: Use image directly

In the future, we can revisit whether modifying the developer-facing code is beneficial when it becomes more relevant.

How was this patch tested?

This patch has been tested using enhanced and newly added unit tests.

Setup process

git clone https://github.com/flyteorg/flytekit.git
gh pr checkout 3094
make setup && pip install -e .

Run all unit tests using the following command:

make unit_test

Check all the applicable boxes

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

Related PRs

NA

Docs link

Please refer to https://github.com/flyteorg/flyte/pull/6211

Summary by Bito

This PR implements comprehensive improvements including: 1) renaming 'container_image' parameter to 'image' across Flytekit while maintaining backward compatibility and adding deprecation warnings, 2) enhanced error handling in signal handlers, msgpack processing, and authentication flows, 3) improved type validation for shared memory resources and cache policy handling, and 4) implementation of secure pip argument handling and Kubernetes resource validation.

Unit tests added: True

Estimated effort to review (1-5, lower is better): 5

JiangJiaWei1103 avatar Jan 25 '25 09:01 JiangJiaWei1103