feat: Add Python task executor. - #205
Conversation
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
Caution Review failedThe pull request is closed. WalkthroughAdds a Python client/runtime to Spider with core models, type system, storage interface and MariaDB backend, task executor CLI, and utilities. Introduces Python packaging/config, tests, and task/CI updates (uv integration, Python build/lint/test tasks). Documentation is updated to reflect new Python test tasks and requirements. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Client as Client (Driver)
participant Storage as MariaDBStorage
participant Core as Core Models
User->>Client: submit_jobs(graphs, args)
Client->>Client: Validate graphs/args sizes
Client->>Core: Map inputs (Data IDs or packed values)
Client->>Storage: submit_jobs(driver_id, core_graphs)
Storage->>Storage: Insert jobs/tasks/deps/IO rows
Storage-->>Client: [core.Job...]
Client-->>User: [Job...]
User->>Client: job.get_status()
alt Cached non-Running
Client-->>User: status
else Running
Client->>Storage: get_job_status(job)
Storage-->>Client: JobStatus
Client-->>User: status
end
User->>Client: job.get_results()
alt Results cached
Client-->>User: results
else Not cached
Client->>Storage: get_job_results(job)
Storage-->>Client: [TaskOutput] | None
Client->>Client: Convert outputs (values/Data)
Client-->>User: results | None
end
sequenceDiagram
autonumber
actor Worker as Executor Process
participant Exec as task_executor.main()
participant Storage as MariaDBStorage
participant Target as User Function
participant Pipes as Input/Output Pipes
Worker->>Exec: CLI args (--func, --storage_url, --task_id, pipes)
Exec->>Storage: connect(parse_jdbc_url)
Exec->>Pipes: receive_message()
Exec->>Exec: get_request_body() → [args...]
Exec->>Exec: import target function
Exec->>Exec: inspect signature
Exec->>Storage: fetch Data by ID (for Data params)
Exec->>Exec: msgpack decode other args
Exec->>Target: call(ctx, *args)
Target-->>Exec: result | tuple[result...]
Exec->>Exec: pack results (Data bytes or msgpack)
Exec->>Pipes: write header + payload (ResponseType.Result)
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested reviewers
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (48)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Description
As title.
Checklist
breaking change.
Validation performed
Summary by CodeRabbit