Hi! This is such a great project, i'm having probl...
# flyte-support
w
Hi! This is such a great project, i'm having problems when i add "from flytekitplugins.spark import Spark" to my *.py after running (remote way, im not having problems using 'pyflyte run *.py my_wf) the process is complete, but the wokflow appears failed with the following message from web UI: [1/1] currentAttempt done. Last Error: USER::trap>", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/root/flyte.py", line 5, in from flytekitplugins.spark import Spark ModuleNotFoundError: No module named 'flytekitplugins.spark' Traceback (most recent call last): File "/usr/local/bin/pyflyte-fast-execute", line 8, in sys.exit(fast_execute_task_cmd()) ...
๐Ÿ™‡ 1
๐Ÿ™‡๐Ÿฝ 1
f
You need to install flytekit plugins spark in the container
But for this join todays community sync - great work by @glamorous-carpet-83516 and @big-magician-84523 makes this effortless
๐Ÿ˜ฎ 2
w
great! i have it installed in my local python env, how can i install it in the container?
@glamorous-carpet-83516, @big-magician-84523 can u please help me ?
g
@wide-helmet-70417 you have to write a dockerfile to build an image. btw, you could try to use image spec. Here is an example to build image for spark task by using image spec. https://github.com/flyteorg/flytekit/pull/1616
w
Thanks @glamorous-carpet-83516, i tried image spec and it works with run, but not with run --remote.
g
you have to install envd plugin as well. pip install flytekitplugins-envd==1.6.1
๐Ÿ‘ 1
f
I think we should include envd in default? And then allow it to be overridden?
t
+1 to including it in the flytekit library.
๐Ÿ‘ 2
w
@glamorous-carpet-83516 i installed it sucesfully and got this 'failed to build the imageSpec' - autorization failed
t
Have you specified the registry? I think you should authenticate to dockerhub from the CLI. https://docs.docker.com/docker-hub/access-tokens/
@glamorous-carpet-83516, is dockerhub the only supported registry?
@wide-helmet-70417, changing the registry name to your username should work!
Kevin, is spark working on the demo cluster?
w
@tall-lock-23197 im able to run the spark example shared by kevin now with --remote flag! but got the following error in the web UI: [1/1] currentAttempt done. Last Error: USER:core.py760 in invoke โ”‚ โ”‚ โ”‚ โ”‚ โฑ 760 โ”‚ โ”‚ โ”‚ โ”‚ return __callback(*args, **kwargs) โ”‚ โ”‚ โ”‚ โ”‚ /usr/local/lib/python3.10/site-packages/flytekit/bin/entrypoint.py:508 in โ”‚ โ”‚ fast_execute_task_cmd โ”‚ โ”‚ โ”‚ โ”‚ โฑ 508 โ”‚ subprocess.run(cmd, check=True) โ”‚ โ”‚ โ”‚ โ”‚ /usr/local/lib/python3.10/subprocess.py:526 in run โ”‚ โ”‚ โ”‚ โ”‚ โฑ 526 โ”‚ โ”‚ โ”‚ raise CalledProcessError(retcode, process.args, โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ CalledProcessError: Command '['pyflyte-execute', '--inputs', 's3://my-s3-bucket/metadata/propeller/flytesnacks-development-f91eee73c35a9498e9 c8/n0/data/inputs.pb', '--output-prefix', 's3://my-s3-bucket/metadata/propeller/flytesnacks-development-f91eee73c35a9498e9 c8/n0/data/0', '--raw-output-data-prefix', 's3://my-s3-bucket/data/dv/f91eee73c35a9498e9c8-n0-0', '--checkpoint-path', 's3://my-s3-bucket/data/dv/f91eee73c35a9498e9c8-n0-0/_flytecheckpoints', '--prev-checkpoint', '""', '--dynamic-addl-distro', 's3://my-s3-bucket/flytesnacks/development/EFP2R3DRITTXTRCHKYZCLZWAZU======/scri pt_mode.tar.gz', '--dynamic-dest-dir', '/root', '--resolver', 'flytekit.core.python_auto_container.default_task_resolver', '--', 'task-module', 'flyte3', 'task-name', 'hello_spark']' returned non-zero exit status 1.
Additionally, if i try to "pyflyte run --remote ..." more than once it doesn't works! (I attached the error at the end of this comment) but it works again if i rename the workflow in the .py file. Were you able to reproduce the sample code shared by Kevin? RPC Failed, with Status: StatusCode.INVALID_ARGUMENT details: launch plan with different structure already exists with id resource_type:LAUNCH_PLAN project:"flytesnacks" domain:"development" name:"flyte3.my_wf" version:"jMuCe4OGZ9LuvDqx089w-Q==" Debug string UNKNOWN:Error received from peer {grpc_message:"launch plan with different structure already exists with id resource_type:LAUNCH_PLAN project:\"flytesnacks\" domain:\"development\" name:\"flyte3.my_wf\" version:\"jMuCe4OGZ9LuvDqx089w-Q==\" ", grpc_status:3, created_time:"2023-05-18T091413.318343238-04:00"}
f
This is weird. It is not understanding that something has changed- cc @glamorous-carpet-83516 / @high-accountant-32689 this is unexpected @wide-helmet-70417 is this after you use the new Imagespec
w
@freezing-airport-6809, yes, im using spark_image = ImageSpec(registry="<mydockerhubuser>"), and running it with flytekit==1.6.1 and flytekitplugins-envd==1.6.1
t
im able to run the spark example shared by kevin now with --remote flag! but got the following error in the web UI:
Would you be able to fetch the k8s log? https://docs.flyte.org/en/latest/community/troubleshoot.html#troubleshoot
Copy code
kubectl get pods -n flytesnacks-development
kubectl logs <pod-name> -n flytesnacks-development
w
@tall-lock-23197 Sure!, this is the output
Copy code
tar: Removing leading `/' from member names

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Traceback (most recent call last) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ /usr/local/bin/pyflyte-execute:8 in <module>                                 โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ 8 โ”‚   sys.exit(execute_task_cmd())                                         โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/lib/python3.10/site-packages/click/core.py:1130 in __call__       โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ 1130 โ”‚   โ”‚   return self.main(*args, **kwargs)                             โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/lib/python3.10/site-packages/click/core.py:1055 in main           โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ 1055 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   rv = self.invoke(ctx)                             โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/lib/python3.10/site-packages/click/core.py:1404 in invoke         โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ 1404 โ”‚   โ”‚   โ”‚   return ctx.invoke(self.callback, **ctx.params)            โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/lib/python3.10/site-packages/click/core.py:760 in invoke          โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ  760 โ”‚   โ”‚   โ”‚   โ”‚   return __callback(*args, **kwargs)                    โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/lib/python3.10/site-packages/flytekit/bin/entrypoint.py:471 in    โ”‚
โ”‚ execute_task_cmd                                                             โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ 471 โ”‚   _execute_task(                                                     โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/lib/python3.10/site-packages/flytekit/exceptions/scopes.py:160 in โ”‚
โ”‚ system_entry_point                                                           โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ 160 โ”‚   โ”‚   โ”‚   โ”‚   return wrapped(*args, **kwargs)                        โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/lib/python3.10/site-packages/flytekit/bin/entrypoint.py:347 in    โ”‚
โ”‚ _execute_task                                                                โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ 347 โ”‚   โ”‚   _task_def = resolver_obj.load_task(loader_args=resolver_args)  โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/lib/python3.10/site-packages/flytekit/core/utils.py:295 in        โ”‚
โ”‚ wrapper                                                                      โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ 295 โ”‚   โ”‚   โ”‚   โ”‚   return func(*args, **kwargs)                           โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/lib/python3.10/site-packages/flytekit/core/python_auto_container. โ”‚
โ”‚ py:235 in load_task                                                          โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ 235 โ”‚   โ”‚   task_module = importlib.import_module(name=task_module)  # typ โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/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:1006                                              โ”‚
โ”‚ in _load_unlocked:688                                                        โ”‚
โ”‚ in exec_module:883                                                           โ”‚
โ”‚ in _call_with_frames_removed:241                                             โ”‚
โ”‚                                                                              โ”‚
โ”‚ /root/flyte3.py:7 in <module>                                                โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ  7 from flytekitplugins.spark import Spark                                 โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
ModuleNotFoundError: No module named 'flytekitplugins.spark'
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Traceback (most recent call last) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ /usr/local/bin/pyflyte-fast-execute:8 in <module>                            โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ 8 โ”‚   sys.exit(fast_execute_task_cmd())                                    โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/lib/python3.10/site-packages/click/core.py:1130 in __call__       โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ 1130 โ”‚   โ”‚   return self.main(*args, **kwargs)                             โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/lib/python3.10/site-packages/click/core.py:1055 in main           โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ 1055 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   rv = self.invoke(ctx)                             โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/lib/python3.10/site-packages/click/core.py:1404 in invoke         โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ 1404 โ”‚   โ”‚   โ”‚   return ctx.invoke(self.callback, **ctx.params)            โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/lib/python3.10/site-packages/click/core.py:760 in invoke          โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ  760 โ”‚   โ”‚   โ”‚   โ”‚   return __callback(*args, **kwargs)                    โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/lib/python3.10/site-packages/flytekit/bin/entrypoint.py:508 in    โ”‚
โ”‚ fast_execute_task_cmd                                                        โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ 508 โ”‚   subprocess.run(cmd, check=True)                                    โ”‚
โ”‚                                                                              โ”‚
โ”‚ /usr/local/lib/python3.10/subprocess.py:526 in run                           โ”‚
โ”‚                                                                              โ”‚
โ”‚ โฑ  526 โ”‚   โ”‚   โ”‚   raise CalledProcessError(retcode, process.args,           โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
CalledProcessError: Command '['pyflyte-execute', '--inputs', 
'<s3://my-s3-bucket/metadata/propeller/flytesnacks-development-f52f3d40c3cf849a89>
5a/n0/data/inputs.pb', '--output-prefix', 
'<s3://my-s3-bucket/metadata/propeller/flytesnacks-development-f52f3d40c3cf849a89>
5a/n0/data/0', '--raw-output-data-prefix', 
'<s3://my-s3-bucket/data/rr/f52f3d40c3cf849a895a-n0-0>', '--checkpoint-path', 
'<s3://my-s3-bucket/data/rr/f52f3d40c3cf849a895a-n0-0/_flytecheckpoints>', 
'--prev-checkpoint', '""', '--dynamic-addl-distro', 
'<s3://my-s3-bucket/flytesnacks/development/U67AW4X3WQLPZXY2HBRFM7GDWY======/scri>
pt_mode.tar.gz', '--dynamic-dest-dir', '/root', '--resolver', 
'flytekit.core.python_auto_container.default_task_resolver', '--', 
'task-module', 'flyte3', 'task-name', 'hello_spark']' returned non-zero exit 
status 1.
g
sorry, actually. you canโ€™t use fast-register if spark task is in the workflow because spark worker wonโ€™t download the code. try to use
pyflyte register โ€ฆ
instead.
f
@glamorous-carpet-83516 why is that?
should it not download the code?
g
when I use fast-register, only driver downloaded code
160 Views