<#3775 [BUG] ImageSpec not leveraging build cache ...
# flyte-github
a
#3775 [BUG] ImageSpec not leveraging build cache for basic example Issue created by jeevb Describe the bug Repeated invocations of
pyflyte run
involving
ImageSpec
rebuild python and apt dependencies from scratch instead of leveraging cache. Expected behavior When an `ImageSpec`definition is not updated, image rebuilds should reuse cached layers where possible to speed up build times. Additional context to reproduce 1. Create a script,
wf.py
with the following contents:
Copy code
from flytekit import task, workflow, ImageSpec

image = ImageSpec(
    packages=["smart-open[gcs]"],
    apt_packages=["git"],
)


@task(container_image=image)
def my_task() -> str:
    return "hello, world!"


@workflow
def my_wf() -> str:
    return my_task()
2. Run the following command multiple times:
Copy code
pyflyte run --remote wf.py my_wf
Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte