Skip to content
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
39 changes: 31 additions & 8 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
FROM ubuntu:22.04

ARG ARCH
ARG GO_VERSION=1.23.10

WORKDIR /workspaces

RUN apt-get update -y \
&& apt-get install -y vim git wget build-essential cmake net-tools tcpdump
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
vim \
git \
wget \
build-essential \
cmake \
net-tools \
tcpdump \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get install -y libibverbs-dev \
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
libibverbs-dev \
libunwind-dev \
libgoogle-glog-dev \
libgtest-dev \
Expand All @@ -20,20 +33,30 @@ RUN apt-get install -y libibverbs-dev \
protobuf-compiler-grpc \
pybind11-dev \
libcurl4-openssl-dev \
libhiredis-dev
libhiredis-dev \
&& rm -rf /var/lib/apt/lists/*

RUN wget https://go.dev/dl/go1.22.12.linux-amd64.tar.gz \
&& tar -C /usr/local -xzf go1.22.12.linux-amd64.tar.gz
RUN ARCH=$(uname -m) && \
case $ARCH in \
x86_64) GO_ARCH="amd64";; \
aarch64) GO_ARCH="arm64";; \
*) echo "Unsupported architecture: $ARCH" >&2; exit 1;; \
esac && \
wget "https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz" \
&& tar -C /usr/local -xzf "go${GO_VERSION}.linux-${GO_ARCH}.tar.gz" \
&& rm "go${GO_VERSION}.linux-${GO_ARCH}.tar.gz"

RUN git clone https://github.com/alibaba/yalantinglibs.git \
&& cd yalantinglibs \
&& mkdir -p build \
&& cd build \
&& cmake .. -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARK=OFF -DBUILD_UNIT_TESTS=OFF \
&& cmake --build . -j$(nproc) \
&& cmake --install .
&& cmake --install . \
&& cd /workspaces \
&& rm -rf yalantinglibs

ENV GOPROXY='https://goproxy.cn'
ENV PATH=/usr/local/go/bin:$PATH

CMD ["bash"]
CMD ["bash"]
78 changes: 57 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ on:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.10', '3.12']
python-version: ['3.10', '3.11', '3.12', '3.13']
os: [ubuntu-22.04, ubuntu-22.04-arm]
env:
SCCACHE_GHA_ENABLED: "true"

Expand All @@ -25,9 +26,21 @@ jobs:

- name: Install and start etcd
run: |
wget https://github.com/etcd-io/etcd/releases/download/v3.6.1/etcd-v3.6.1-linux-amd64.tar.gz
tar xzf etcd-v3.6.1-linux-amd64.tar.gz
sudo mv etcd-v3.6.1-linux-amd64/etcd* /usr/local/bin/
ARCH=$(uname -m)
ETCD_ARCH=""
if [ "$ARCH" = "x86_64" ]; then
ETCD_ARCH="amd64"
elif [ "$ARCH" = "aarch64" ]; then
ETCD_ARCH="arm64"
else
echo "Unsupported architecture: $ARCH for etcd"
exit 1
fi

ETCD_TAR="etcd-v3.6.1-linux-${ETCD_ARCH}.tar.gz"
wget https://github.com/etcd-io/etcd/releases/download/v3.6.1/${ETCD_TAR}
tar xzf ${ETCD_TAR}
sudo mv etcd-v3.6.1-linux-${ETCD_ARCH}/etcd* /usr/local/bin/
etcd --advertise-client-urls http://127.0.0.1:2379 --listen-client-urls http://127.0.0.1:2379 &
sleep 3 # Give etcd time to start
etcdctl --endpoints=http://127.0.0.1:2379 endpoint health
Expand All @@ -40,7 +53,7 @@ jobs:
sudo rm -rf /opt/hostedtoolcache/CodeQL

- name: Install CUDA Toolkit
uses: Jimver/[email protected].24
uses: Jimver/[email protected].25
with:
cuda: '12.8.1'
linux-local-args: '["--toolkit"]'
Expand Down Expand Up @@ -122,13 +135,23 @@ jobs:
PYTHON_VERSION=${{ matrix.python-version }} OUTPUT_DIR=dist-py${{ steps.generate_tag_build.outputs.python_version_tag }} ./scripts/build_wheel.sh
shell: bash

- name: Upload Python wheel artifact
uses: actions/upload-artifact@v4
with:
name: mooncake-wheel-py${{ steps.generate_tag_build.outputs.python_version_tag }}-${{ matrix.os }} # Differentiate by OS
path: mooncake-wheel/dist-py${{ steps.generate_tag_build.outputs.python_version_tag }}/*.whl

test-wheel-ubuntu:
needs: build-flags
# This job now depends on a new job name below or on `build` if `build-flags` is removed/renamed
# Assuming `build` is the primary build job, and its artifacts will be used.
# If `build-flags` is intended to be the source for these artifacts, its name should be fixed.
# For this update, I'm assuming it should depend on 'build'.
needs: build # Changed from 'build-flags' to 'build' as it's the primary build job.
strategy:
matrix:
ubuntu-version: [ubuntu-22.04, ubuntu-24.04]
python-version: ['3.10', '3.12']
runs-on: ${{ matrix.ubuntu-version }}
os: [ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm]
python-version: ['3.10', '3.11', '3.12', '3.13']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

Expand All @@ -146,7 +169,8 @@ jobs:
- name: Download wheel artifact
uses: actions/download-artifact@v4
with:
name: mooncake-wheel-ubuntu-py${{ steps.generate_tag_test.outputs.python_version_tag }}
# Changed artifact name to match the upload name from the 'build' job
name: mooncake-wheel-py${{ steps.generate_tag_test.outputs.python_version_tag }}-${{ matrix.os }}
path: mooncake-wheel/dist

- name: Verify wheel file exists
Expand Down Expand Up @@ -177,10 +201,11 @@ jobs:
shell: bash

build-flags:
runs-on: ubuntu-22.04
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.10', '3.12']
python-version: ['3.10', '3.11', '3.12', '3.13']
os: [ubuntu-22.04]
env:
SCCACHE_GHA_ENABLED: "true"

Expand All @@ -199,7 +224,7 @@ jobs:
sudo rm -rf /opt/hostedtoolcache/CodeQL

- name: Install CUDA Toolkit
uses: Jimver/[email protected].24
uses: Jimver/[email protected].25
with:
cuda: '12.8.1'
linux-local-args: '["--toolkit"]'
Expand All @@ -224,6 +249,8 @@ jobs:
run: |
sudo apt update -y
sudo bash -x dependencies.sh -y
echo "/usr/local/go/bin" >> $GITHUB_PATH
export PATH="/usr/local/go/bin:$PATH"
shell: bash

- name: Build transfer engine only
Expand All @@ -245,7 +272,7 @@ jobs:
cmake .. -DUSE_ETCD=ON -DUSE_REDIS=ON -DUSE_HTTP=ON -DWITH_STORE=ON -DWITH_P2P_STORE=ON -DWITH_METRICS=ON -DBUILD_UNIT_TESTS=ON -DBUILD_EXAMPLES=ON -DENABLE_SCCACHE=ON -DUSE_CUDA=OFF -DUSE_MNNVL=OFF -DCMAKE_EXE_LINKER_FLAGS="-L/usr/local/cuda/lib64/stubs"
shell: bash
# TODO: lack USE_NVMEOF,USE_CUDA,USE_MNNVL

- name: Build project with all settings are ON
run: |
cd build
Expand Down Expand Up @@ -302,24 +329,33 @@ jobs:
- name: Upload Python wheel artifact
uses: actions/upload-artifact@v4
with:
name: mooncake-wheel-ubuntu-py${{ steps.generate_tag_flags.outputs.python_version_tag }}
name: mooncake-wheel-ubuntu-py${{ steps.generate_tag_flags.outputs.python_version_tag }}-${{ matrix.os }} # Differentiate by OS
path: mooncake-wheel/dist-py${{ steps.generate_tag_flags.outputs.python_version_tag }}/*.whl

build-docker:
name: Builcd Docker Image
runs-on: ubuntu-22.04
name: Build Docker Image
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04] # not exists image from Alibaba Cloud AC2 to build for arm64
steps:
- uses: actions/checkout@v4

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

- name: Build Docker image
# For multi-arch docker builds, buildx is recommended to target multiple platforms
# For simplicity, keeping the direct build command which will build for the runner's architecture.
# If cross-architecture images are needed, "docker buildx build --platform linux/amd64,linux/arm64 ..." would be used.
run: docker build -t mooncake-app .

spell-check:
name: Spell Check with Typos
runs-on: ubuntu-22.04
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-22.04-arm] # Added ubuntu-22.04-arm to the OS matrix
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ env:
SCCACHE_GHA_ENABLED: "true"
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ${{ matrix.os }} # Changed to use a matrix for OS
permissions:
contents: write
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
os: [ubuntu-22.04, ubuntu-22.04-arm]
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand All @@ -24,14 +25,22 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'mooncake-common/etcd/go.mod'
check-latest: true

- run: go version # sanity-check

- name: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL

- name: Install CUDA Toolkit
uses: Jimver/[email protected].24
uses: Jimver/[email protected].25
with:
cuda: '12.8.1'
linux-local-args: '["--toolkit"]'
Expand Down Expand Up @@ -92,7 +101,7 @@ jobs:
- name: Upload Python wheel artifact
uses: actions/upload-artifact@v4
with:
name: mooncake-wheel-py${{ steps.generate_tag_release.outputs.python_version_tag }}
name: mooncake-wheel-py${{ steps.generate_tag_release.outputs.python_version_tag }}-${{ matrix.os }}
path: mooncake-wheel/dist-py${{ steps.generate_tag_release.outputs.python_version_tag }}/*.whl

publish-release:
Expand Down
3 changes: 2 additions & 1 deletion dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ NC="\033[0m" # No Color
# Configuration
REPO_ROOT=`pwd`
GITHUB_PROXY=${GITHUB_PROXY:-"https://github.com"}
GOVER=1.23.8
GOVER=1.24.4

# Function to print section headers
print_section() {
Expand Down Expand Up @@ -252,6 +252,7 @@ fi
if ! grep -q "export PATH=\$PATH:/usr/local/go/bin" ~/.bashrc; then
echo -e "${YELLOW}Adding Go to your PATH in ~/.bashrc${NC}"
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
echo 'export GOTOOLCHAIN=local' >> ~/.bashrc
echo -e "${YELLOW}Please run 'source ~/.bashrc' or start a new terminal to use Go${NC}"
fi

Expand Down
4 changes: 2 additions & 2 deletions mooncake-common/etcd/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/kvcache-ai/Mooncake/mooncake-common/etcd

go 1.23.0
go 1.23.10

toolchain go1.23.7
toolchain go1.23.10

require go.etcd.io/etcd/client/v3 v3.5.21

Expand Down
2 changes: 1 addition & 1 deletion mooncake-p2p-store/src/p2pstore/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/kvcache-ai/Mooncake/mooncake-p2p-store/src/p2pstore

go 1.23.0
go 1.23

toolchain go1.24.1

Expand Down
Loading