Hi, I am getting below error in a hello world wor...
# announcements
k
Hi, I am getting below error in a hello world workflow. ā€¢ I have created a .py file with exactly same hello world code from flytesnacks. ā€¢ Then registered the files by running pyflyte register . -d development -p myproject ā€¢ It registered the workflow and i am able to see it in the console. When launching the workflow , I am facing the below issues. Any one face similar issues?
Copy code
[1/1] currentAttempt done. Last Error: USER::Pod failed. No message received from kubernetes.
[av6c5trbtctv6nkknd9m-n0-0] terminated with exit code (1). Reason [Error]. Message: 
tar: development/fastca4192cff23d37d3fb985a60de82c186.tar.gz: Cannot open: Not a directory
tar: Error is not recoverable: exiting now
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.7/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/flytekit/bin/entrypoint.py", line 496, in fast_execute_task_cmd
    _download_distribution(additional_distribution, dest_dir)
  File "/usr/local/lib/python3.7/site-packages/flytekit/tools/fast_registration.py", line 117, in download_distribution
    result.check_returncode()
  File "/usr/local/lib/python3.7/subprocess.py", line 444, in check_returncode
    self.stderr)
subprocess.CalledProcessError: Command '['tar', '-xvf', 'development/fastca4192cff23d37d3fb985a60de82c186.tar.gz', '-C', 'development']' returned non-zero exit status 2.
y
hey
would it be possible for you to change the structure of your code a bit?
can you make it so that the directory structure looks like
Copy code
parent/
(no init file here at this layer)
  developement/
  __init__.py
  your_file.py
and then call
pyflyte register development/your_file.py
rather than
.
?
could you also open up the task tab in the failed node from the UI (far right) and copy here the args to the container? should begin with
pyflyte-fast-execute
k
Copy code
["pyflyte-fast-execute","--additional-distribution","s3://<my_bucket>/ys/cloudops-flyte-demo/development/YDTSY3R7Z5ELU4AV24J6SGINSQ======/fastb6918ae6453488704970dacad32860f9.tar.gz","--dest-dir","development","--","pyflyte-execute","--inputs","{{.input}}","--output-prefix","{{.outputPrefix}}","--raw-output-data-prefix","{{.rawOutputDataPrefix}}","--checkpoint-path","{{.checkpointOutputPrefix}}","--prev-checkpoint","{{.prevCheckpointPrefix}}","--resolver","flytekit.core.python_auto_container.default_task_resolver","--","task-module","workflows.demo_example","task-name","demo_flyte"]
@Yee
I tried altering the folder structure but didnt work šŸ˜ž
y
what image are you using? in the same task JSON tab, can you copy/paste the
image
field here please?
n
hi @karthikraj Iā€™m unable to repro your error. I created a directory with the following structure:
Copy code
pyflyte_register_test
ā””ā”€ā”€ workflows
    ā”œā”€ā”€ __init__.py
    ā”œā”€ā”€ __pycache__
    ā”‚   ā”œā”€ā”€ __init__.cpython-39.pyc
    ā”‚   ā””ā”€ā”€ hello_world.cpython-39.pyc
    ā””ā”€ā”€ hello_world.py
Then started a local cluster with
flytectl demo start
Then
cd pyflyte_register_test
Then
pyflyte register --image <http://ghcr.io/flyteorg/flytecookbook:core-latest|ghcr.io/flyteorg/flytecookbook:core-latest> workflows
I launched the workflow from the console and it seems to work:
k
I have the same problem when using the custom image. I add 'RUN mkdir development' in Dockerfile at root directory so the error above is solved. However, next problem occur which is ModuleNotFoundError: No module named '{My module}' {My module} is a folder when I run
pyflyte register {My module} -d development -d {my-project} --image {my-image}
s
@Kavinphop Thangpiyathumrong, you need not add
RUN mkdir ā€¦
command to the Dockerfile. Can you share with me your directory structure? Also, try running
pyflyte register --image {image} -d development {module}
command. cc: @Shivay Lamba
k
Sorry, my misunderstanding. My issue is resolved.
175 Views