-
Notifications
You must be signed in to change notification settings - Fork 31
Design and implement a local client API #2780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a Client API Server for Pelican that exposes client functionality through a RESTful API over Unix domain sockets. This enables programmatic access to Pelican transfer capabilities without directly invoking the CLI.
Key Changes:
- Job-based transfer management with asynchronous execution and progress tracking
- RESTful API endpoints for transfer operations (get, put, copy, stat, list, delete)
- Unix domain socket communication for secure local IPC
- CLI integration with serve, stop, and status subcommands
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/client_api.go | CLI commands for managing the API server (serve, stop, status) |
| client_api/transfer_manager.go | Core transfer job management with concurrency control and progress tracking |
| client_api/server.go | HTTP server setup, Unix socket handling, and lifecycle management |
| client_api/handlers.go | REST API endpoint handlers for all operations |
| client_api/models.go | Request/response data structures and constants |
| client_api/middleware.go | Logging and recovery middleware |
| client_api/integration_test.go | End-to-end integration tests with test federation |
| client_api/handlers_test.go | Unit tests for API handlers |
| client_api/README.md | Comprehensive API documentation and usage examples |
| client_api/IMPLEMENTATION.md | Implementation summary and technical details |
| client_api/DESIGN-CLIENT-API-SERVER.md | Detailed design document for the feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Increase test file size to prevent it from completing before cancellation. - Decrease test name length to prevent generated unix socket from being on too-long path.
At some level, this is also an experiment in providing significant standalone functionality through the use of agentic AI ... I was driving the code and overseeing the implementation but didn't write any of the generated code.
This PR provides a "local client server"; listening on a domain socket, the client-api server listens for incoming requests and performs them. Multiple clients can connect to the server and benefit from it executing work in the background.