5. Deploying Your Agent to Cloud Run
Congratulations on building an autonomous agent! The final step is to deploy it to the cloud so it can run as a persistent service. You'll use Cloud Run for this.
What is Cloud Run?
Google Cloud Run is a serverless platform that enables you to run containers without having to manage the underlying infrastructure. It automatically add and removes container instances to handle incoming requests. When there are no incoming requests, it even scales down to zero instances, so you only pay for the resources you use. This makes it a cost-effective and efficient way to deploy applications such as an ADK agent.
For a production environment, I recommend to embed your agent in a custom FastAPI application and use a Dockerfile to containerize it. However, for this tutorial, you can use the `adk deploy` command to deploy the agent and its Development UI.
Using `adk deploy`
Follow the deployment guide in the official ADK deployment documentation.
Verifying Success
You'll know the deployment is successful when the command prints a service URL. You can visit this URL in your browser to see your deployed agent's UI.
Deployment Complete!
Once the command finishes, your agent and its UI are deployed on Cloud Run! You have successfully built and deployed a complete AI agent application.