<#4904 [BUG] Container Image should be an input in...
# flytekit
a
#4904 [BUG] Container Image should be an input into computing the task version for fast registration Issue created by EngHabu Describe the bug 1. Run
pyflyte run --remote
on this file:
Copy code
from flytekit import task, workflow
from flytekit.image_spec import ImageSpec
from flytekitplugins.flyin import vscode

image_spec2 = ImageSpec(
    requirements="requirements.txt",  # python packages to install
    registry="<http://ghcr.io/enghabu/test-flytekit|ghcr.io/enghabu/test-flytekit>", builder="envd")

@task(container_image=image_spec2)
@vscode(port=8080)
def say_hello(name: str) -> str:
    return f"hello {name}!"

@workflow
def wf2(name: str = "union"):
    say_hello(name=name)
2. Update the requirements.txt and run again Error:
Copy code
RPC Failed, with Status: StatusCode.INVALID_ARGUMENT
        details: task with different structure already exists with id resource_type:TASK project:"flytesnacks" domain:"development" name:"simple_wf.say_hello" version:"a-nzT1l6aEAKm2MYRWfEzg" 
        Debug string UNKNOWN:Error received from peer ipv4:3.130.217.183:443 {grpc_message:"task with different structure already exists with id resource_type:TASK project:\"flytesnacks\" domain:\"development\" name:\"simple_wf.say_hello\" version:\"a-nzT1l6aEAKm2MYRWfEzg\" ", grpc_status:3, created_time:"2024-02-14T20:11:29.658756-08:00"}
Expected behavior Task version should have changed because the image has changed... It seems that we compute the digest of the task before creating/uploading the imageSpec which leads to us only discovering the image id pretty much too late into the registration process? Speculating Additional context to reproduce cc @jpvotta Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte