adk-samples icon indicating copy to clipboard operation
adk-samples copied to clipboard

[BUG]: python/agents/deep-search README Cloud Deployment section is broken

Open gitgithan opened this issue 3 months ago • 4 comments

Name of sample affected

python/agents/deep-search

Description of issue

Instructions under Cloud Deployment section cannot be followed It mentions make deploy IAP=true but Makefile does not contain deploy target

agents-cli create my-deep-search-agent -a adk@deep-search instruction above also seems to be generating a completely unrelated project called deep_search parallel to app, so there are 2 agent.py files. There is a Dockerfile automatically created after agents-cli create which does COPY ./deep_search ./deep_search. deep_search and its agent.py inside does not look like it is related to React. I am expecting agents-cli create to create a Dockerfile with both the frontend folder and app folder copied into the image.

Please correct documentation to explain what's the correct agents-cli create command to setup the full stack project that's using the frontend folder, with the backend agent.py being in app folder instead.

How does the React front end communicate with the deployed agent? Will frontend also be in the same container with the agent.py backend?

gitgithan avatar Aug 27 '26 21:08 gitgithan

,, 👍🏻

teachersunnyhk-wq avatar Aug 31 '26 09:08 teachersunnyhk-wq

Thanks for the detailed report — everything you hit is real, and one part has since gotten worse. Reproduced against main with agents-cli 1.4.0.

1. agents-cli create -a adk@deep-search is now broken outright

The adk@ shorthand hardcodes the path python/agents/<name>, and that directory tree was deleted in #2618 when recipes moved to core/. The command now fails with:

FileNotFoundError: Template path not found in the repository: python/agents/deep-search

The recipe lives at core/python/deep-search. Until the shorthand is fixed, use the full URL:

agents-cli create my-deep-search-agent \
  -a https://github.com/google/adk-samples/tree/main/core/python/deep-search

That produces the layout you expected — a single app/agent.py, plus frontend/, deployment/terraform/, and agents-cli-manifest.yaml. No stray deep_search/ package and no second agent.py. The duplicate you saw was the base adk template's own agent package (named after the sample slug) landing alongside the remote template's app/.

2. make deploy never existed

Neither the recipe's Makefile nor the scaffolded project's has a deploy target — both stop at install / dev / dev-backend / dev-frontend / playground / lint. The real command is:

agents-cli deploy --iap

It picks the target from agents-cli-manifest.yaml, or you can force one with -d cloud_run. The PORT=5173 in Option 2 doesn't correspond to anything; Cloud Run drives the port through the container's EXPOSE 8080 / CMD.

3. How the React frontend talks to the agent

They're two separate processes and, as shipped, only the backend is containerized. The generated Dockerfile copies ./app and runs uvicorn app.fast_api_app:app on port 8080. Nothing builds or copies frontend/.

The frontend is a plain Vite SPA that calls the ADK HTTP API — POST /api/run_sse for the streaming turn, plus /api/apps/app/users/.../sessions/... for session setup (frontend/src/App.tsx:326). In local dev, vite.config.ts proxies /api/* to http://127.0.0.1:8000 (the adk api_server from make dev-backend) and strips the /api prefix. That proxy is a dev-server feature and does not exist in production.

So to actually ship the custom UI you have to build it and serve it yourself — a Node build stage running npm run build, copy frontend/dist into the image, and mount it from the FastAPI app as static files with an SPA fallback, so /api/* still reaches ADK. The README's "See the Deploy UI Guide for the required Dockerfile changes" links to the bare google/agents-cli repo root, which has no such guide — that's a second broken pointer.

What needs fixing in the README

  • Replace the adk@deep-search command (broken path), or fix the adk@ shorthand in agents-cli to resolve the core/ layout.
  • Replace make deploy IAP=true / make deploy IAP=true PORT=5173 with agents-cli deploy --iap.
  • Fix the stale clone path adk-samples/python/agents/deep-search → adk-samples/core/python/deep-search.
  • Either link a real Deploy UI guide or inline the multi-stage Dockerfile, and state plainly that the default container is backend-only.

happyhuman avatar Sep 10 '26 22:09 happyhuman

Hi @happyhuman @eliasecchig, I've opened PR #2629 addressing all points discussed above:

  • Updated the agents-cli create template path to the full remote URL (https://github.com/google/adk-samples/tree/main/core/python/deep-search) to resolve the FileNotFoundError with the legacy shorthand.
  • Fixed the stale local clone directory path (adk-samples/core/python/deep-search).
  • Replaced the non-existent make deploy targets with agents-cli deploy --iap and agents-cli deploy.
  • Clarified that the default container is backend-only, inlined a production multi-stage Dockerfile (Node frontend build + Python backend), and documented mounting the static files in app/fast_api_app.py.

All local tests and repository policy validators pass cleanly. Appreciate your review on #2629!

Anurag-M1 avatar Sep 12 '26 15:09 Anurag-M1

I just left a comment. Pleat take a look.

happyhuman avatar Sep 14 '26 16:09 happyhuman