boundless-lifeguard-61788
08/01/2024, 10:03 PM*AttributeError:* 'ReferenceTask' object has no attribute '_container_image'
boundless-lifeguard-61788
08/01/2024, 10:08 PMpyflyte register --image ****:latest tasks
I used the name and version from this output for the reference_task below
The code for the workflow is
from flytekit import reference_task, workflow, Resources
@reference_task(
project="myproj",
domain="development",
name="tasks.helloworld.print_hello_world",
version=[version from pyflyte register]
)
def ref_print_hello_world() -> str:
...
@reference_task(
project="myproj",
domain="development",
name="tasks.todaysdate.print_date",
version=[version from pyflyte register]
)
def ref_print_date() -> str:
...
@workflow
def test() -> str:
today_is = ref_print_date()
msg = ref_print_hello_world()
response = f'test, {msg}\n'
response += f'Today is: {today_is}\n'
return response
boundless-lifeguard-61788
08/01/2024, 10:10 PM@task(cache=False, requests=Resources(mem="2Gi"), limits=Resources(mem="5Gi")
)
def print_hello_world() -> str:
""" Say Hello World """
return "Hello World"
boundless-lifeguard-61788
08/01/2024, 10:16 PMFailed with Unknown Exception <class 'AttributeError'> Reason: 'ReferenceTask' object has no attribute '_container_image'
Traceback:
File "....../python3.11/site-packages/flytekit/clis/sdk_in_container/utils.py", line 141, in invoke
return super().invoke(ctx)
^^^^^^^^^^^^^^^^^^^
File "....../python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "....../python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "....../python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "....../python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "....../python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "....../python3.11/site-packages/flytekit/clis/sdk_in_container/run.py", line 558, in _run
remote_entity = remote.register_script(
^^^^^^^^^^^^^^^^^^^^^^^
File "....../python3.11/site-packages/flytekit/remote/remote.py", line 1048, in register_script
md5_bytes, serialization_settings, default_inputs, *_get_image_names(entity)
^^^^^^^^^^^^^^^^^^^^^^^^
File "....../python3.11/site-packages/flytekit/remote/remote.py", line 1036, in _get_image_names
image_names.extend(_get_image_names(n.flyte_entity))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "....../python3.11/site-packages/flytekit/remote/remote.py", line 1031, in _get_image_names
if isinstance(entity, PythonAutoContainerTask) and isinstance(entity.container_image, ImageSpec):
^^^^^^^^^^^^^^^^^^^^^^
File "....../python3.11/site-packages/flytekit/core/python_auto_container.py", line 126, in container_image
return self._container_image
thankful-minister-83577
thankful-minister-83577
thankful-minister-83577
thankful-minister-83577
boundless-lifeguard-61788
08/01/2024, 11:36 PMglamorous-carpet-83516
08/01/2024, 11:36 PMboundless-lifeguard-61788
08/01/2024, 11:43 PMglamorous-carpet-83516
08/02/2024, 12:45 AMglamorous-carpet-83516
08/02/2024, 12:46 AMglamorous-carpet-83516
08/02/2024, 12:46 AMboundless-lifeguard-61788
08/02/2024, 3:04 PMthankful-minister-83577
thankful-minister-83577
boundless-lifeguard-61788
08/06/2024, 3:19 PM