Hello everyone.. I'm testing the "getting started"...
# ask-the-community
e
Hello everyone.. I'm testing the "getting started" example in the flyte docs but I'm getting "module 'example' has no attribute 'wf'" using the pyflyte run command.. any hints?
y
oh are the docs out of date?
sorry
can you do an
ls -lR
and what’s the pyflyte run command?
e
flytedemo % ls -lR total 0 drwxr-xr-x 3 ematus staff 96 Jan 9 16:30 pycache -rw-r--r-- 1 ematus staff 0 Jan 9 16:28 example.py ./__pycache__: total 8 -rw-r--r-- 1 ematus staff 127 Jan 9 16:30 example.cpython-310.pyc ematus@eduardos-mbp flytedemo %
pyflyte run --remote example.py wf --n 500 --mean 42 --sigma 2
y
is the file empty?
e
example.py? nope
y
can you
cat example.py
i might be parsing ls incorrectly, but i think that’s saying it’s 0 size.
e
no idea why was 0 bytes.. had to save it again and now I get this: status = StatusCode.UNAVAILABLE details = "failed to connect to all addresses; last error: UNKNOWN: ipv4127.0.0.130081: Failed to connect to remote host: Connection refused" debug_error_string = "UNKNOWN:failed to connect to all addresses; last error: UNKNOWN: ipv4127.0.0.130081: Failed to connect to remote host: Connection refused {created_time:"2023-01-09T165714.320531-03:00", grpc_status:14}"
y
😞
sorry… need to amend flytekit.
could you please add this in the meantime
one sec
could you
cat ~/.flyte/config-sandbox.yaml
?
see if that file is there?
e
Yes.. is there
cat ~/.flyte/config-sandbox.yaml admin: # For GRPC endpoints you might want to use dns:///flyte.myexample.com endpoint: localhost:30081 authType: Pkce insecure: true console: endpoint: http://localhost:30081 logger: show-source: true level: 0%
pyflyte is trying to connect to port 30081. just updated the config file to use that port but need to restart the service
y
yeah but you shouldn’t have to…
what was the output when you did flytectl demo start?
would you still happen to have that?
e
👨‍💻 Flyte is ready! Flyte UI is available at http://localhost:30080/console 🚀 🚀 🎉 ❇️ Run the following command to export sandbox environment variables for accessing flytectl export FLYTECTL_CONFIG=/Users/ematus/.flyte/config-sandbox.yaml 🐋 Flyte sandbox ships with a Docker registry. Tag and push custom workflow images to localhost:30000 📂 The Minio API is hosted on localhost:30002. Use http://localhost:30080/minio/login for Minio console
I can access to the UI
y
oh then yeah can you change the config file to 30080
and then
pyflyte -c ~/.flyte/config-sandbox run ...
while i track this down
e
was able to run passing the config file.. after the run, I should see something in the flyte UI?
y
yup
we will fix this
should not be required, it should just work
wait you didn’t run that export right?
e
not seeing any updates in the interface
I did run the export
y
what was the output of the run --remote command?
e
my mistake.. is not working with remote
y
error?
e
flytedemo % pyflyte -c ~/.flyte/config-sandbox run --remote example.py wf --n 500 --mean 42 --sigma 2 {"asctime": "2023-01-09 172547,182", "name": "flytekit.cli", "levelname": "ERROR", "message": "Non-auth RPC error <_InactiveRpcError of RPC that terminated with:\n\tstatus = StatusCode.UNAVAILABLE\n\tdetails = \"failed to connect to all addresses; last error: UNKNOWN: ipv4127.0.0.130081: Failed to connect to remote host: Connection refused\"\n\tdebug_error_string = \"UNKNOWN:failed to connect to all addresses; last error: UNKNOWN: ipv4127.0.0.130081: Failed to connect to remote host: Connection refused {created_time:\"2023-01-09T172547.182255-03:00\", grpc_status:14}\"\n>, sleeping 200ms and retrying"} {"asctime": "2023-01-09 172547,387", "name": "flytekit.cli", "levelname": "ERROR", "message": "Non-auth RPC error <_InactiveRpcError of RPC that terminated with:\n\tstatus = StatusCode.UNAVAILABLE\n\tdetails = \"failed to connect to all addresses; last error: UNKNOWN: ipv4127.0.0.130081: Failed to connect to remote host: Connection refused\"\n\tdebug_error_string = \"UNKNOWN:failed to connect to all addresses; last error: UNKNOWN: ipv4127.0.0.130081: Failed to connect to remote host: Connection refused {created_time:\"2023-01-09T172547.387666-03:00\", grpc_status:14}\"\n>, sleeping 400ms and retrying"} Traceback (most recent call last): File "/opt/homebrew/bin/pyflyte", line 8, in <module> sys.exit(main()) File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1130, in call return self.main(*args, **kwargs) File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/opt/homebrew/lib/python3.10/site-packages/flytekit/clis/sdk_in_container/run.py", line 529, in _run remote_entity = remote.register_script( File "/opt/homebrew/lib/python3.10/site-packages/flytekit/remote/remote.py", line 600, in register_script upload_location, md5_bytes = fast_register_single_script( File "/opt/homebrew/lib/python3.10/site-packages/flytekit/tools/script_mode.py", line 111, in fast_register_single_script upload_location = create_upload_location_fn(content_md5=md5) File "/opt/homebrew/lib/python3.10/site-packages/flytekit/clients/friendly.py", line 998, in get_upload_signed_url return super(SynchronousFlyteClient, self).create_upload_location( File "/opt/homebrew/lib/python3.10/site-packages/flytekit/clients/raw.py", line 41, in handler return fn(*args, **kwargs) File "/opt/homebrew/lib/python3.10/site-packages/flytekit/clients/raw.py", line 854, in create_upload_location return self._dataproxy_stub.CreateUploadLocation(create_upload_location_request, metadata=self._metadata) File "/opt/homebrew/lib/python3.10/site-packages/grpc/_channel.py", line 946, in call return _end_unary_response_blocking(state, call, False, None) File "/opt/homebrew/lib/python3.10/site-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking raise _InactiveRpcError(state) grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.UNAVAILABLE details = "failed to connect to all addresses; last error: UNKNOWN: ipv4127.0.0.130081: Failed to connect to remote host: Connection refused" debug_error_string = "UNKNOWN:failed to connect to all addresses; last error: UNKNOWN: ipv4127.0.0.130081: Failed to connect to remote host: Connection refused {created_time:"2023-01-09T172547.792558-03:00", grpc_status:14}"
y
this is with the export and the config file set to 30080?
could you
echo $FLYTECTL_CONFIG
to confirm?
i want to try to get it to work without specifying the
-c
and without the export… but with the export, it should definitely work
i have a new environment up. am not able to repro.
e
ematus@eduardos-mbp flytedemo % cat $FLYTECTL_CONFIG admin: # For GRPC endpoints you might want to use dns:///flyte.myexample.com endpoint: localhost:30080 authType: Pkce insecure: true console: endpoint: http://localhost:30080 logger: show-source: true level: 0*%* ematus@eduardos-mbp flytedemo %
y
sorry had a meeting.
can you
pip show flytekit
i’m going to try your exact version of flytekit.
s
Hi @Eduardo Matus I am facing the same error you faced. I am able to run pyflyte locally but remote option fails. Running this command
pyflyte -c ~/.flyte/config-sandbox.yaml run --remote example.py wf --n 500 --mean 42 --sigma 2
gives the same error as yours.
If you have got it working, please do share what i am missing here. Thank you so much
Hi @Eduardo Matus, once i changed the admin's endpoint in config-sandbox.yaml I was able to submit workflows to my local cluster. Here is my updated config.
Copy code
cat ~/.flyte/config-sandbox.yaml 
admin:
  # For GRPC endpoints you might want to use dns:///flyte.myexample.com
  endpoint: localhost:30081
  authType: Pkce
  insecure: true
console:
  endpoint: <http://localhost:30080>
logger:
  show-source: true
  level: 0
j
Hi, I’m running into the same error here and adjusting the config doesn’t seem to have any effect
d
btw, @Joe Hartshorn managed to get it working by running
export FLYTE_PLATFORM_URL=localhost:30080
483 Views