https://prefect.io logo
Title
k

Kevin Takano

04/22/2023, 6:46 PM
Hello, consider I have a prefect server on EC2 (AWS), can I deploy a flow in a sagemaker processing job and see the flow in the EC2 server?
1
r

Ryan Peden

04/22/2023, 9:04 PM
It should work if: • they are both in a private VPC • you set the PREFECT_API_URL environment variable in the sagemaker job container so the flow knows what server address to report its results to Note that there aren't any Prefect agents or workers that can launch your flow in a Sagemaker job. But if you set PREFECT_API_URL and then run a Prefect flow function inside your Sagemaker job, the flow should appear in the Prefect UI as long as you've set up your VPC correctly.
k

Kevin Takano

04/23/2023, 8:51 PM
Thanks @Ryan Peden. If I use sagemaker to run my flow, can I see the flow tasks in the UI if I set the PREFECT_API_URL environment?
r

Ryan Peden

04/23/2023, 8:59 PM
Yes, as long as the networking in your VPC is set up so the Prefect server is visible to the Sagemaker job. As long as the EC2 server's IP address is accessible from the Sagemaker job, you shouldn't need to do anything aside from setting PREFECT_API_URL. I can't speak to the specifics of how to set that up because I'm much more familiar with Azure than AWS, but I imagine that a Sagemaker job needing to communicate with an EC2 VM is a fairly common use case.
k

Kevin Takano

04/28/2023, 8:38 PM
Thanks @Ryan Peden, consider a dag like this: flow number 1 (will run in EC2 server): t1 /. \ t3 t2 flow number 2 (will run in a sagemaker job), its dependes on flow number 1: t4 / \ t3 t2 if flow number2 run in a sagemaker processing job and depends on flow number 1. Do you know if I can see both flows in the same dag in the UI?
up