How to get started with Prefect and Google Vertex agent?

View in #prefect-community on Slack

Rasmus_Lindqvist @Rasmus_Lindqvist: Hi everyone,
I’ve just started using Prefect at my company. First of all, thank you for a great product.

I am trying to deploy Prefect on GCP and find the documentation very good except for GCP deployment, so I’m struggling a bit. I understand that the VertexAgent is a quite new addition. I have so far successfully registered a Vertex agent on Prefect Cloud but I don’t quite manage to deploy the agent to Vertex. Is the intention to start a Custom Vertex job in addition to prefect agent vertex start ? Or would you recommend deploying Prefect on in another way on GCP instead?

Anna_Geller @Anna_Geller: We appreciate your positive feedback! :thank_you:

Many users deploy Kubernetes Agent with GKE - e.g. here is a great tutorial by Ben Welsh

Regarding the Vertex agent, check this tutorial - but you’re right that running this command is everything you need (you can run it from any terminal authenticated with GCP service account):

prefect agent vertex start --label yourlabel

more details:
Vertex Agent | Prefect Docs
Run Configuration | Prefect Docs

Rasmus_Lindqvist @Rasmus_Lindqvist: Thank you for your generous reply! :smile: I’ve re-read those documents and I finally think I grasp the overlaying architecture.

Just to confirm, so the prefect agent vertex start does not start an agent on Vertex but rather starts an agent where the command is run from?

In that case, a small GCE or Cloud run should be enough for hosting the actual VertexAgent that will then spin up Vertex machines for the flow runs?

Anna_Geller @Anna_Geller: #1 Exactly!

#2 Yes!
you can think of an agent as a lightweight process polling for flow runs, but in contrast to many competing solutions on the market, it’s not responsible for executing the runs directly, but rather creating a separate infrastructure for the flow run (a separate Vertex job, subprocess, Docker container, Kubernetes job, ECS task)

Rasmus_Lindqvist @Rasmus_Lindqvist: Awesome, thank you for the clarification! :smile:
We are now up and running with the deployment! Thanks again for the help :slightly_smiling_face:

Feedback

I thought I’d try to give something back from my learnings, coming in as a fresh user of Prefect.

  1. Really love the documentation on specific concepts
  2. Lacked some clearer explanations of the overarching architecture. I found this youtube clip the most helpful in explaining how the hybrid solution works. I think a deepdive documentation on just the arcitechture would help new users linking together all the different components like; Agents, Storage, Flow Runs, Executors. Something like the picture of architecture overview but in more detail
  3. Great community!!

Anna_Geller @Anna_Geller: Thanks a lot, and great to hear you got it all working! :raised_hands: