Skip to content

feat(server): implement all OpenAPI endpoints end-to-end#396

Merged
DorianZheng merged 1 commit into
mainfrom
feat/server-implement-all-openapi-endpoints
Mar 18, 2026
Merged

feat(server): implement all OpenAPI endpoints end-to-end#396
DorianZheng merged 1 commit into
mainfrom
feat/server-implement-all-openapi-endpoints

Conversation

@DorianZheng

Copy link
Copy Markdown
Member

Summary

Wire 15 previously-stubbed coordinator endpoints through gRPC to the worker service, replacing 501 Not Implemented with real proxy logic. Only exec_tty (WebSocket) remains as a stub.

  • Proto: Add 15 new RPCs + ~20 message types (snapshots, clone, export/import streaming, file transfer streaming, images, execution status)
  • Worker service: Implement all 15 RPC handlers calling BoxliteRuntime, add ExecStatus tracking, streaming export/import/file transfer
  • Coordinator proxy: Replace 15 stubs with real REST→gRPC proxy (including binary streaming for export/import/files, scheduler-based worker selection for import/images, BoxMapping registration for clone)
  • Tests: Update 15 stub tests to verify correct error behavior (404/503), add unit tests for proto conversion helpers

Test plan

  • cargo test -p boxlite-server — 115 tests pass (66 unit + 43 integration + 6 conformance)
  • cargo clippy -p boxlite-server --tests -- -D warnings — zero warnings
  • cargo fmt -p boxlite-server -- --check — clean
  • Full pre-push test matrix passes (204 rust + 115 server tests)
  • Start coordinator + worker, test snapshot/clone/export/import via curl
  • Verify Swagger UI shows all endpoints as implemented

Wire 15 previously-stubbed coordinator endpoints through gRPC to the
worker service, replacing 501 Not Implemented with real proxy logic.
Only exec_tty (WebSocket) remains as a stub.

Proto layer (worker.proto):
- Add 15 new RPCs: snapshot CRUD (5), clone, export/import (streaming),
  file upload/download (streaming), image pull/list/get, get_execution
- Add ~20 new message types including streaming chunks

Worker service (service.rs):
- Implement all 15 RPC handlers calling BoxliteRuntime
- Add snapshot_info_to_proto and image_info_to_proto converters
- Enhance ActiveExecution with ExecStatus tracking (Running/Completed/Failed)
- Add streaming support for export (server-stream) and import (client-stream)
- Add tar-based file transfer via copy_into/copy_out

Coordinator proxy (proxy.rs):
- Replace 15 stubs with real REST→gRPC proxy implementations
- Add any_active_worker_client helper for non-box-scoped endpoints
- Clone handler registers BoxMapping for cloned box on same worker
- Import handler uses scheduler for worker selection
- Export/download stream gRPC responses as binary HTTP bodies
- Upload/import convert HTTP body to gRPC client-streaming chunks

Tests:
- Update 15 stub tests to verify correct error behavior (404/503)
- Add unit tests for proto conversion helpers and ExecStatus
- 115 tests pass (66 unit + 43 integration + 6 conformance)
@DorianZheng DorianZheng merged commit bb0a913 into main Mar 18, 2026
18 checks passed
@DorianZheng DorianZheng deleted the feat/server-implement-all-openapi-endpoints branch March 18, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant