Hi new to prefect I’m curious if V2 is actually pr...
# data-tricks-and-tips
m
Hi new to prefect I’m curious if V2 is actually production ready? I can tell at least from the UI there are a lots of features are missing like creating a flow run etc. If this is my first time setting it up is it better to start off with V1 first?
1
a
Prefect 2.0 is production ready since the GA launch. To trigger a flow run from the UI:
m
Thanks but looks like the UI is very limited? for example in V1 you can create with specifying parameters
I’m also very confused with the agent. I can see in V1 I can run my agent in K8S but there is no such an option in V2?
c
Replying here as well since I’d like to track any follow-up on this inquiry. Creating a flow run with parameters from the UI is on our “to figure out” list as well with Prefect 2.0.
a
you can modify parameters on your deployment, or you can even trigger it locally from Python with different parameters - here changing Marvin to Marty:
Copy code
from prefect import task, flow
from prefect import get_run_logger


@task
def say_hi(user_name: str):
    logger = get_run_logger()
    <http://logger.info|logger.info>("Hello from Prefect 2.0, %s!", user_name)


@flow
def parametrized_flow(user: str = "Marvin"):
    say_hi(user)


if __name__ == "__main__":
    parametrized_flow(user="Marty")
c
Cool thanks Anna. I notice this works for local runs but trying to figure out how to override parameters for a deployment. I found the open issue on Github for the UI so it looks like that’s in progress. I took a stab at using the Python API but it looks like
create_flow_run_from_deployment()
is not as straightforward as I thought. Currently exploring the API route on this end to see if that’s a workable option for us. 🤓
I was able to override parameters via the Python API on a deployment.
from prefect.client import OrionClient
import asyncio
prefect_client = OrionClient(api="http://<ip>:4200/api")
loop = asyncio.get_event_loop()
task = loop.create_task(
prefect_client.create_flow_run_from_deployment(
deployment_id="188e210d-4246-45d4-9ac2-014852b96115",
parameters={'content_id':'new_content_id'}))
loop.run_until_complete(task)
🙌 2
🙏 2
a
thanks and thanks for posting on Discourse too @Christopher Scheidel!
c
Happy to help!
🙌 1
a
@Christopher Scheidel and @Marty Ko I just got confirmation that this UI feature will ship this week.
👍 2
m
Thank you so much you guys are very helpful!
y
Following up here to also ask about the agent status? Is that something that is going to be added to UI soon to see the health of the agents?
a
Not soon, but certainly at some point this year -- I'm aware it's a very broad estimate but that's the only one I can give for sure at this time