[Resolved] Hello, I'm revising an earlier message ...
# ask-the-community
c
[Resolved] Hello, I'm revising an earlier message with a more minimal example. I have run
pyflyte init
to initialize this directory structure below, which runs using
pyflyte run --remote ./workflows/example.py
just fine. However, when adding a custom image, I reach a
ModuleNotFoundError
, and flyte / the image cannot seem to access my code. Directory
Copy code
.
├── docker_build.sh
├── Dockerfile
├── LICENSE
├── README.md
├── requirements.txt
└── workflows
    ├── example.py
    ├── __init__.py
example.py
Copy code
[1/1] currentAttempt done. Last Error: USER::Pod failed. No message received from kubernetes.
[attrg6q988rf82lp8cgk-n0-0] terminated with exit code (1). Reason [Error]. Message: 
rt
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'workflows'
Traceback (most recent call last):
  File "/usr/local/bin/pyflyte-fast-execute", line 8, in <module>
    sys.exit(fast_execute_task_cmd())
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/flytekit/bin/entrypoint.py", line 508, in fast_execute_task_cmd
    subprocess.run(cmd, check=True)
  File "/usr/local/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pyflyte-execute', '--inputs', '<s3://indupro-flyte-metadata/metadata/propeller/flytesnacks-development-attrg6q988rf82lp8cgk/n0/data/inputs.pb>', '--output-prefix', '<s3://indupro-flyte-metadata/metadata/propeller/flytesnacks-development-attrg6q988rf82lp8cgk/n0/data/0>', '--raw-output-data-prefix', '<s3://indupro-flyte-userdata/data/qi/attrg6q988rf82lp8cgk-n0-0>', '--checkpoint-path', '<s3://indupro-flyte-userdata/data/qi/attrg6q988rf82lp8cgk-n0-0/_flytecheckpoints>', '--prev-checkpoint', '<s3://indupro-flyte-userdata/data/m4/f1e105ca2d5e3470289d-n0-0/_flytecheckpoints>', '--dynamic-addl-distro', '<s3://indupro-flyte-metadata/flytesnacks/development/3M7A7LF5M5N6NUE4EZ7GQZ4GOY======/script_mode.tar.gz>', '--dynamic-dest-dir', '/root', '--resolver', 'flytekit.core.python_auto_container.default_task_resolver', '--', 'task-module', 'workflows.example', 'task-name', 'say_hello']' returned non-zero exit status 1.
.
It seems like starting with the
pyflyte init
dockerfile sorted everything out.
s
🎉
199 Views