Commit Graph
27 Commits
Author SHA1 Message Date
Claude 0d7b1d1ec3 feat: add Dockerfile 2026-06-24 17:07:23 +08:00
Claude 80df978206 feat: add requirements.txt 2026-06-24 16:53:47 +08:00
Claude 475c64cb69 feat: update spark executor title 2026-06-24 15:42:50 +08:00
Claude ce2eeb4bac feat: update memory 2026-06-24 15:20:29 +08:00
Claude b3eabe1fb6 feat: logging to file 2026-06-24 15:09:59 +08:00
Claude 5c7dcf57cc feat: structured DEBUG/INFO logging via loguru
- common/logging.py: improve format to timestamp|LEVEL|module:func:line - message
- core/ layer: DEBUG log every subprocess invocation (cmd, rc, byte counts),
  JSON load/dump events, parsed application_id. ERROR log on failures.
- tools/ layer: DEBUG log every public tool entry with key parameters,
  INFO log on business outcomes (saved/submitted/killed/...).
- New tests/unit/test_logging.py: capture loguru output via in-memory sink
  and assert DEBUG + INFO messages are emitted for representative flows.
2026-06-24 15:02:54 +08:00
Claude fad296591c fix: map KeyError->404 and ValueError->400 for MCP clients
Tool functions raise KeyError for unknown ids and ValueError for invalid
state transitions. Without handlers, FastAPI returned a bare 500
"Internal Server Error" to MCP clients — useless for an agent that needs
to know whether the id was wrong vs the cluster was down.

KeyError -> 404 with the message ("Unknown job_id: foo").
ValueError -> 400 with the message (e.g. "pending_id p_xyz is in status
'CANCELLED', not PENDING").
2026-06-24 14:59:00 +08:00
Claude 6b9f278294 fix: switch FastAPI routes to Pydantic body models for MCP tools/call
The plan's route signatures used query parameters, which worked for direct
HTTP callers and unit tests, but fastapi-mcp's HTTP transport passes
tools/call arguments as a JSON body. dict-typed parameters like
spark_conf arrived as a string and the route returned 422.

Refactor each route to take a single Pydantic body model (saved in
spark_executor/tools/requests.py). Underlying tool functions unchanged.

Integration tests in tests/integration/test_mcp_routes.py now exercise
the full body-based roundtrip (save_connection with spark_conf, prepare
→ list → get, list_connections with empty body).
2026-06-24 14:56:31 +08:00
Claude cc7eafaa16 feat: register 12 MCP tools on FastAPI app 2026-06-24 14:50:51 +08:00
Claude 0d60f9b246 feat: add kill_job tool 2026-06-24 14:44:10 +08:00
Claude 1cd3128522 feat: add get_job_logs tool with tail 2026-06-24 14:43:56 +08:00
Claude e443f96756 feat: add get_job_status tool 2026-06-24 14:43:41 +08:00
Claude 63dcae8d75 test: cover cancel_pending_job 2026-06-24 14:43:26 +08:00
Claude c734823e79 feat: add list_pending_jobs and get_pending_job 2026-06-24 14:40:54 +08:00
Claude 2f57c98aa6 feat: add confirm_submit_job (two-step submit flow) 2026-06-24 14:40:33 +08:00
Claude 7f08f0590a feat: add prepare_submit_job (no spark-submit invocation) 2026-06-24 14:40:01 +08:00
Claude 0aa3c1eaf5 feat: add JSON-backed PendingStore 2026-06-24 14:39:13 +08:00
Claude 82dafd357f test: cover delete_connection 2026-06-24 14:38:06 +08:00
Claude 3a08702c06 test: cover get_connection 2026-06-24 14:38:06 +08:00
Claude 1450ad1779 test: cover list_connections 2026-06-24 14:38:06 +08:00
Claude 00592f5cf8 feat: add save_connection tool 2026-06-24 14:37:58 +08:00
Claude 8dd39367ed feat: add JSON-backed ConnectionStore 2026-06-24 14:37:09 +08:00
Claude 31d28baace feat: add in-memory JobStore 2026-06-24 14:36:05 +08:00
Claude a9f64d9942 feat: add yarn client (status, logs, kill) 2026-06-24 14:35:30 +08:00
Claude b4b2ad534a feat: add spark-submit command builder and runner 2026-06-24 14:35:07 +08:00
Claude e6902b00a0 feat: add spark-submit output parser 2026-06-24 14:34:40 +08:00
Claude 864093f1fb chore: add pytest dev-deps and pydantic models (Job, Connection, PendingSubmission) 2026-06-24 14:34:09 +08:00