<@U06RKAMK0UC> i have a very basic question about ...
# ask-ai
c
@ancient-wolf-19325 i have a very basic question about flyte 2.0. I'm trying to a hello.py workflow locally by using the following command
flyte run --local hello.py main --n 10
but it is only performing a dry-run of it. How do i run it locally and get the output as well?
j
Reasoning Complete! 🤖 🔍 Searched knowledge base: I'll look up the correct way to run a Flyte workflow locally and get its output, so I can give you clear instructions. • Searching over 10 data sources from the following: File, Github File, Github Issue, Web • Found 50 documents that could be relevant from the following data sources: Github File, Github Issue, Github Pull Request, Web Content. • Filtered down to the top 30 most relevant documents. ✍️ Generated answer: I have found clear guidance on how to run your Flyte workflow locally and get the output, and there are no open questions left.
To run a Flyte workflow locally and get the output, use
pyflyte run hello.py main --n 10
(without the
--local
flag). The
--local
flag is not required for local execution and may trigger a dry-run or validation mode instead of actual execution. The output will be printed to your terminal if your workflow returns a value or prints within a
__main__
block. For example:
Copy code
pyflyte run hello.py main --n 10
This will execute the workflow and display the output in your terminal, as described in the Quickstart guide and README. Would you like more detail or a code example? Sources: - Quickstart guide - README 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
b
hi Kirk, can you say more about this?
get the output as well
did you want to write the output to a file, or further operate on it in a python runtime?
c
sure, i can try to elaborate. I'm not sure if this is expected behavior or if I'm doing something wrong but here is a screenshot of trying to test a workflow locally
i would have expected when i ran the command
flyte run --local hello.py transform_item --item "longword"
that I would have saw a print out of something like i saw in the last line, ie ['processed: longword'] but i just see it print that it created a dry-run
here is a screenshot of the flyte script
b
so it’s actually running the function in your local python runtime, the
dry-run
refers to the fact that it’s not running on an actual Flyte cluster
c
that make sense, i guess what i am confused about is why it wouldn't return ['processed: LONGWORD'] when i ran it locally
b
I don’t think
flyte run
prints out the output of the function to stdout… if you add a
print
statement in
transform_item
you should be able to see the value
c
ok got it. Is there a place where it saves the different inputs and outputs when i run it locally?
like could i set up a sqlite database to capture all of this as part of the functionality?
b
for any explicit IO for local testing, I’d recommend adding this logic after the name == main conditional. Flyte v2 gets out of your way and doesn’t do much extra magic.
c
is there a way to setup a flyte cluster to capture this on my machine if i want to use it beyond testing?
b
Flyte backend OSS is in our roadmap, set to go on GA later this year. Currently the only way to run Flyte v2 code is on a Union backend (see beta program here). In rough order, we’ll release: • a local Flyte OSS devbox for you to run a mini Flyte v2 cluster on your laptop (Late Fall 2025). • full Flyte OSS GA, where you can deploy Flyte on your own cloud (AWS, GCP, Azure) — Early 2026.
c
ok sounds good, thank you for answering all of my questions
i just filled out the form for the beta program and will keep an eye out for the Flyte OSS devbox this fall