cuddly-jelly-27016
05/25/2025, 12:11 AMexample.py is under the following directory structure:
.
└── workflows
├── __init__.py
├── example.py
└── requirements.txt
If if run
pyflyte run --remote workflows/example.py foo_wf
With this workflow:
from flytekit import ImageSpec, task, workflow
custom_image = ImageSpec(
name="kfpytorch-flyte",
packages=["flytekit", "torch", "torchvision", "flytekitplugins-kfpytorch", "matplotlib", "tensorboardX"],
registry="us-central1-docker.pkg.dev/xxxxxxxxxxx/flyte",
cuda="11.2.2",
cudnn="8",
python_version="3.10"
)
@task(container_image=custom_image)
def bar() -> str:
return 'foo'
@workflow
def foo_wf(
):
bar()
if name == "__main__":
foo_wf()
The following error is produced:
[1/1] currentAttempt done. Last Error: USER::Pod failed. No message received from kubernetes.
[f195e62f8b1c64bf0951-n0-0] terminated with exit code (1). Reason [Error]. Message:
│ │
│ ❱ 309 │ │ │ │ return func(*args, **kwargs) │
│ │
│ /opt/conda/envs/envd/lib/python3.10/site-packages/flytekit/core/python_auto_ │
│ container.py:248 in load_task │
│ │
│ ❱ 248 │ │ task_module = importlib.import_module(name=task_module) # typ │
│ │
│ /opt/conda/envs/envd/lib/python3.10/importlib/__init__.py:126 in │
│ import_module │
│ │
│ ❱ 126 │ return _bootstrap._gcd_import(name[level:], package, level) │
│ in _gcd_import:1050 │
│ in _find_and_load:1027 │
│ in _find_and_load_unlocked:992 │
│ in _call_with_frames_removed:241 │
│ in _gcd_import:1050 │
│ in _find_and_load:1027 │
│ in _find_and_load_unlocked:1004 │
╰──────────────────────────────────────────────────────────────────────────────╯
ModuleNotFoundError: No module named 'workflows'
If i change the ImageSpec to the following, the task does not have an error
custom_image = ImageSpec(
name="kfpytorch-flyte",
packages=["flytekit", "torch", "torchvision", "flytekitplugins-kfpytorch", "matplotlib", "tensorboardX"],
registry="us-central1-docker.pkg.dev/xxxxxxxxxxx/flyte",
python_version="3.10"
)
envd==0.3.45
flytekit==1.10.3
flytekitplugins-envd==1.10.3
### Expected behavior
ImageSpec cuda and cudnn settings should not effect module imports
### Additional context to reproduce
No response
### Screenshots
No response
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flytecuddly-jelly-27016
05/25/2025, 12:11 AM