Skip to content

Conversation

JINGE-ui
Copy link
Contributor

  1. This PR provides a C interface wrapper for mooncake-store. See client_c.h and client_c.cpp for details. After compiling Mooncake Store, you can use the static library file libmooncake_store.a and the C header file client_c.h for further development.

  2. At present, client_c.h only wraps Client's key functions, such as Create, RegisterLocalMemory, MountSegment, Get, Put, IsExist, and Remove.

@stmatengss
Copy link
Collaborator

Thank you for your contributions! 1. Can you wrap more APIs (e.g., batch set/get) into C files? 2. It's recommended to add C-based end-to-end tests for CI testing.

@JINGE-ui
Copy link
Contributor Author

Thank you, I will try

@JINGE-ui
Copy link
Contributor Author

This PR builds on the previous submission by:

  1. Correcting code formatting
  2. Increasing the number of pure C API of mooncake::Client
  3. Creating client_c_integration_test.cpp to test the C interfaces in client_c.h

extern "C" {
#endif // __cplusplus

// types.h 中的 ErrorCode Code
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// types.h 中的 ErrorCode Code
// ErrorCode Code in types.h


using namespace mooncake;

// 管理 client 对象的生命周期
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 管理 client 对象的生命周期
// Managing the lifecycle of client objects

@stmatengss
Copy link
Collaborator

This PR builds on the previous submission by:

  1. Correcting code formatting
  2. Increasing the number of pure C API of mooncake::Client
  3. Creating client_c_integration_test.cpp to test the C interfaces in client_c.h
  1. Some client APIs, such as put/get_tensor and batch_get_into, which are used in SGLang, are not well-implemented.
  2. Please ensure all comments are in English.

Thank you.

@stmatengss
Copy link
Collaborator

@JINGE-ui could you update this PR?

@stmatengss
Copy link
Collaborator

14: /home/runner/work/Mooncake/Mooncake/mooncake-store/tests/client_c_integration_test.cpp:91: Failure
14: Expected equality of these values:
14:   mount_result
14:     Which is: -900
14:   ((ErrorCode_t)0)
14:     Which is: 0
14: Failed to mount segment
14: [ RUN      ] ClientCIntegrationTest.BasicPutGetOperations
14: AddressSanitizer:DEADLYSIGNAL


14: /home/runner/work/Mooncake/Mooncake/mooncake-store/tests/client_c_integration_test.cpp:117: Failure
14: Expected equality of these values:
14:   test_client_mount_result
14:     Which is: -900
14:   ((ErrorCode_t)0)
14:     Which is: 0
14: Failed to mount segment for test_client_

Two test cases cannot pass in CI.

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.

2 participants