From 05b554326fe7effabbed9b1ceb4af63ded8c85c9 Mon Sep 17 00:00:00 2001 From: Jason Lai Date: Tue, 12 Mar 2024 04:57:55 +0800 Subject: [PATCH] docs: improve documentation for overwriting existing images (#5030) Signed-off-by: jason.lai --- .../customizing_dependencies/imagespec.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/user_guide/customizing_dependencies/imagespec.md b/docs/user_guide/customizing_dependencies/imagespec.md index 5a9ef93736..12d9295b1e 100644 --- a/docs/user_guide/customizing_dependencies/imagespec.md +++ b/docs/user_guide/customizing_dependencies/imagespec.md @@ -160,3 +160,17 @@ If you only want to build the image without registering the workflow, you can us ``` pyflyte build --remote image_spec.py wf ``` + ++++ + +In some cases, you may want to force an image to rebuild, even if the image spec hasn’t changed. If you want to overwrite an existing image, you can pass the `FLYTE_FORCE_PUSH_IMAGE_SPEC=True` to `pyflyte` command or add `force_push()` to the ImageSpec. + +```bash +FLYTE_FORCE_PUSH_IMAGE_SPEC=True pyflyte run --remote image_spec.py wf +``` + +or + +```python +image = ImageSpec(registry="ghcr.io/flyteorg", packages=["pandas"]).force_push() +```