Skip to content

feat(ci): add build-without-store job in GitHub Actions workflow #473

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 70 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,83 @@ jobs:
name: mooncake-wheel-ubuntu-py${{ steps.generate_tag_flags.outputs.python_version_tag }}
path: mooncake-wheel/dist-py${{ steps.generate_tag_flags.outputs.python_version_tag }}/*.whl

build-without-store:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ['3.10']
env:
SCCACHE_GHA_ENABLED: "true"

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Run sccache-cache
uses: mozilla-actions/[email protected]

- name: Configure sccache
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: Run sccache stat for check
shell: bash
run: ${SCCACHE_PATH} --show-stats

- name: Install dependencies and cleanup Go
run: |
sudo apt update -y
sudo bash -x dependencies.sh -y
# Remove Go since it's not needed for without-store build
sudo rm -rf /usr/local/go
# Remove Go from PATH in bashrc if it was added
sudo sed -i '/export PATH=\$PATH:\/usr\/local\/go\/bin/d' ~/.bashrc || true
shell: bash

- name: Configure project without store
run: |
mkdir build
cd build
cmake .. -DWITH_STORE=OFF -DUSE_HTTP=ON -DBUILD_UNIT_TESTS=ON -DENABLE_SCCACHE=ON -DUSE_CUDA=OFF -DUSE_NVLINK=OFF
shell: bash

- name: Build project without store
run: |
cd build
make -j
sudo make install
shell: bash

- name: Start HTTP Metadata Server
run: |
cd mooncake-transfer-engine/example/http-metadata-server-python
pip install aiohttp
python ./bootstrap_server.py &
shell: bash

- name: Test without store (ctest)
run: |
cd build
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
MC_METADATA_SERVER=http://127.0.0.1:8080/metadata ctest -V
shell: bash

build-docker:
name: Builcd Docker Image
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Docker image
run: docker build -t mooncake-app .

Expand Down
81 changes: 44 additions & 37 deletions mooncake-integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,40 @@ if("${PYTHON_SYS_PATH}" STREQUAL "")
message(FATAL_ERROR "Python path is empty! Please check the python env.")
endif()

include_directories("../mooncake-store/include")
include_directories("../mooncake-store/include/cachelib_memory_allocator")
if (WITH_STORE)
include_directories("../mooncake-store/include")
include_directories("../mooncake-store/include/cachelib_memory_allocator")

include_directories("../mooncake-store/include/cachelib_memory_allocator/include")
include_directories("../mooncake-store/include/cachelib_memory_allocator/fake_include")
include_directories("../mooncake-store/include/cachelib_memory_allocator/include")
include_directories("../mooncake-store/include/cachelib_memory_allocator/fake_include")

include_directories("/usr/include/jsoncpp")
include_directories("/usr/include/jsoncpp")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this line only related to mooncake store? I see nvlink transport uses this too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. The building process of nvlink isn't controlled by this CMake.


pybind11_add_module(mooncake_vllm_adaptor ${SOURCES} ${CACHE_ALLOCATOR_SOURCES}
vllm/vllm_adaptor.cpp
vllm/distributed_object_store.cpp
)
pybind11_add_module(mooncake_vllm_adaptor ${SOURCES} ${CACHE_ALLOCATOR_SOURCES}
vllm/vllm_adaptor.cpp
vllm/distributed_object_store.cpp
)

set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)

set_target_properties(mooncake_vllm_adaptor PROPERTIES
INSTALL_RPATH "$ORIGIN/lib_so"
BUILD_RPATH "$ORIGIN/lib_so"
SKIP_BUILD_RPATH FALSE
)

set_target_properties(mooncake_vllm_adaptor PROPERTIES
INSTALL_RPATH "$ORIGIN/lib_so"
BUILD_RPATH "$ORIGIN/lib_so"
SKIP_BUILD_RPATH FALSE
)

target_link_libraries(mooncake_vllm_adaptor PUBLIC
transfer_engine
glog::glog
gflags::gflags
mooncake_store
cachelib_memory_allocator
)
message("${PYTHON_SYS_PATH}")
install(TARGETS mooncake_vllm_adaptor DESTINATION ${PYTHON_SYS_PATH}/)

target_link_libraries(mooncake_vllm_adaptor PUBLIC
transfer_engine
glog::glog
gflags::gflags
mooncake_store
cachelib_memory_allocator
)
message("${PYTHON_SYS_PATH}")
install(TARGETS mooncake_vllm_adaptor DESTINATION ${PYTHON_SYS_PATH}/)
endif()

set(PYTHON_PACKAGE_NAME "mooncake")
pybind11_add_module(engine ${SOURCES} ${CACHE_ALLOCATOR_SOURCES}
Expand All @@ -52,16 +54,19 @@ target_link_libraries(engine PUBLIC
glog::glog
gflags::gflags
)
pybind11_add_module(store ${SOURCES} ${CACHE_ALLOCATOR_SOURCES}
store/store_py.cpp
)
target_link_libraries(store PUBLIC
transfer_engine
glog::glog
gflags::gflags
mooncake_store
cachelib_memory_allocator
)

if (WITH_STORE)
pybind11_add_module(store ${SOURCES} ${CACHE_ALLOCATOR_SOURCES}
store/store_py.cpp
)
target_link_libraries(store PUBLIC
transfer_engine
glog::glog
gflags::gflags
mooncake_store
cachelib_memory_allocator
)
endif()
message("${PYTHON_SYS_PATH}")

file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PYTHON_PACKAGE_NAME}/__init__.py
Expand All @@ -81,5 +86,7 @@ install(
execute_process(COMMAND chmod 766 \"${PYTHON_SYS_PATH}/${PYTHON_PACKAGE_NAME}/__init__.py\")
"
)
install(TARGETS store DESTINATION ${PYTHON_SYS_PATH}/${PYTHON_PACKAGE_NAME})
if (WITH_STORE)
install(TARGETS store DESTINATION ${PYTHON_SYS_PATH}/${PYTHON_PACKAGE_NAME})
endif()
install(TARGETS engine DESTINATION ${PYTHON_SYS_PATH}/${PYTHON_PACKAGE_NAME})
18 changes: 12 additions & 6 deletions mooncake-store/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
#include <vector>

#include "Slab.h"

#if defined(USE_ETCD) || defined(USE_STORE)
#include "libetcd_wrapper.h"
#endif

#include "ylt/struct_json/json_reader.h"
#include "ylt/struct_json/json_writer.h"
#include "libetcd_wrapper.h"

namespace mooncake {

Expand All @@ -24,7 +28,7 @@ static constexpr uint64_t DEFAULT_DEFAULT_KV_LEASE_TTL =
200; // in milliseconds
static constexpr double DEFAULT_EVICTION_RATIO = 0.1;
static constexpr double DEFAULT_EVICTION_HIGH_WATERMARK_RATIO = 1.0;
static constexpr int64_t ETCD_MASTER_VIEW_LEASE_TTL = 5; // in seconds
static constexpr int64_t ETCD_MASTER_VIEW_LEASE_TTL = 5; // in seconds

// Forward declarations
class BufferAllocator;
Expand All @@ -41,10 +45,12 @@ using BufHandleList = std::vector<std::shared_ptr<AllocatedBuffer>>;
using ReplicaList = std::unordered_map<uint32_t, Replica>;
using BufferResources =
std::map<SegmentId, std::vector<std::shared_ptr<BufferAllocator>>>;
// Mapping between c++ and go types

#if defined(USE_ETCD) || defined(USE_STORE)
using EtcdRevisionId = GoInt64;
using ViewVersionId = EtcdRevisionId;
using EtcdLeaseId = GoInt64;
#endif

/**
* @brief Error codes for various operations in the system
Expand Down Expand Up @@ -91,10 +97,10 @@ enum class ErrorCode : int32_t {
RPC_FAIL = -900, ///< RPC operation failed.

// ETCD errors (Range: -1000 to -1099)
ETCD_OPERATION_ERROR = -1000, ///< etcd operation failed.
ETCD_KEY_NOT_EXIST = -1001, ///< key not found in etcd.
ETCD_OPERATION_ERROR = -1000, ///< etcd operation failed.
ETCD_KEY_NOT_EXIST = -1001, ///< key not found in etcd.
ETCD_TRANSACTION_FAIL = -1002, ///< etcd transaction failed.
ETCD_CTX_CANCELLED = -1003, ///< etcd context cancelled.
ETCD_CTX_CANCELLED = -1003, ///< etcd context cancelled.
};

int32_t toInt(ErrorCode errorCode) noexcept;
Expand Down
Loading