Skip to content

chore(deps): update Mooncake to v0.3.9 - #1313

Closed
staryxchen wants to merge 37 commits into
ai-dynamo:mainfrom
staryxchen:update-mooncake-version
Closed

staryxchen wants to merge 37 commits into
ai-dynamo:mainfrom
staryxchen:update-mooncake-version

Conversation

@staryxchen

@staryxchen staryxchen commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

What?

This PR changes the build script to automatically resolve the latest stable release tag (via git ls-remote --tags) and clone that specific version, ensuring NIXL always builds against a known-good Mooncake release. The ATTRIBUTIONS file is updated accordingly to reflect Mooncake v0.3.9, which includes the fix for the initialization crash.

Why?

Previously, the build script pinned Mooncake at a shallow clone of the default branch (--depth 1), which could pull in unstable or breaking changes. This caused issues such as the segmentation fault reported in kvcache-ai/Mooncake#1510, where mooncake-transfer-engine 0.3.8.post1 crashes with signal 11 during TransferEngine initialization when loaded alongside vLLM + NIXL + LMCache, due to a library collision or a regression introduced in the 0.3.8 refactoring.

How?

It is optional, but for complex PRs, please provide information about the design,
architecture, approach, etc.

Summary by CodeRabbit

  • Chores
    • Updated Mooncake dependency to v0.3.9
    • Improved build process to dynamically resolve Mooncake version from git tags instead of using a static reference
    • Updated CI infrastructure base image version

- Modify build script to dynamically fetch and clone the latest release tag.
- Update ATTRIBUTIONS-CPP.md to reflect version v0.3.9.

Signed-off-by: staryxchen <staryxchen@tencent.com>
@staryxchen
staryxchen requested a review from a team as a code owner February 12, 2026 02:45
@copy-pr-bot

copy-pr-bot Bot commented Feb 12, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown

👋 Hi staryxchen! Thank you for contributing to ai-dynamo/nixl.

Your PR reviewers will review your contribution then trigger the CI to test your changes.

🚀

ovidiusm
ovidiusm previously approved these changes Feb 12, 2026
@ovidiusm

Copy link
Copy Markdown
Contributor

/build

@ovidiusm

Copy link
Copy Markdown
Contributor

/ok to test ebe718f

- change`--sort=-v:refSort`to`--sort=-v:refname`
- add continuation character after echo command

Signed-off-by: staryxchen <staryxchen@tencent.com>
@staryxchen

Copy link
Copy Markdown
Contributor Author

Hi @ovidiusm
I've fixed the issue that caused the CI run to fail earlier and rebased to the latest main branch. Please trigger the CI again.

@aranadive

Copy link
Copy Markdown
Contributor

/ok to test fa7d185

@aranadive

Copy link
Copy Markdown
Contributor

/build

@staryxchen

Copy link
Copy Markdown
Contributor Author

The results of two CI checks (nixl-ci-gpu and nixl-ci-non-gpu) are not visible. I'm not sure what the issue is.

@coderabbitai

coderabbitai Bot commented Feb 24, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The pull request updates the Mooncake dependency handling and CI infrastructure. The build script now dynamically resolves the Mooncake version from git tags instead of using a static clone. The Mooncake version is bumped to v0.3.9, and CI image tags are updated to a new build variant.

Changes

Cohort / File(s) Summary
Build Script
.gitlab/build.sh
Modified to dynamically extract and use Mooncake version from git tags (v\*) rather than static git clone; adds version echo and depth-1 clone with branch parameter.
Attribution & Versioning
ATTRIBUTIONS-CPP.md
Mooncake dependency version bumped from v0.3.2.post1 to v0.3.9; repository URL, license URL, and license text remain unchanged.
CI Configuration
.ci/jenkins/lib/build-matrix.yaml, .ci/jenkins/lib/test-matrix.yaml
CI_IMAGE_TAG updated from "20260303-1" to "20260303-2" in both build and test matrix configurations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 With twitchy nose, I hop with glee,
Dynamic versions flowing wild and free,
Git tags dance, the branches align,
CI images refresh, all systems shine!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: updating Mooncake dependency to v0.3.9, which is the primary objective of this PR.
Description check ✅ Passed The description includes all required sections (What, Why, How) with substantial content for What and Why, clearly explaining the motivation and changes involved.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

x41lakazam and others added 3 commits March 7, 2026 15:43
Signed-off-by: Stary <staryxchen@tencent.com>
@staryxchen

Copy link
Copy Markdown
Contributor Author

Hi @brminich, I've updated the CI_IMAGE_TAG from 20260303-1 to 20260303-2 in both build-matrix.yaml and test-matrix.yaml. Could you please re-trigger the CI? Thanks!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
.gitlab/build.sh (2)

222-224: ⚠️ Potential issue | 🟠 Major

Validate and quote MOONCAKE_VERSION before cloning.

Line 222 should use --refs and fail fast when no matching tag is found; Line 224 should quote "${MOONCAKE_VERSION}". As written, annotated-tag output or an empty resolution can make this step brittle, and the unquoted branch name still triggers SC2086.

🔧 Proposed hardening
-      MOONCAKE_VERSION=$(git ls-remote --tags --sort=-v:refname https://github.com/kvcache-ai/Mooncake.git 'v*' | head -1 | sed 's/.*refs\/tags\///') && \
+      MOONCAKE_VERSION=$(git ls-remote --refs --tags --sort=-v:refname https://github.com/kvcache-ai/Mooncake.git 'v*' | head -1 | sed 's/.*refs\/tags\///') && \
+      [ -n "${MOONCAKE_VERSION}" ] || { echo "Failed to resolve Mooncake tag." >&2; exit 1; } && \
       echo "MOONCAKE_VERSION: ${MOONCAKE_VERSION}" && \
-      git clone --depth 1 --branch ${MOONCAKE_VERSION} https://github.com/kvcache-ai/Mooncake.git && \
+      git clone --depth 1 --branch "${MOONCAKE_VERSION}" https://github.com/kvcache-ai/Mooncake.git && \

Run the following script to compare the current lookup with a refs-only lookup:

#!/bin/bash
set -euo pipefail

echo "=== build.sh snippet ==="
sed -n '222,224p' .gitlab/build.sh

echo
echo "=== raw git ls-remote output ==="
git ls-remote --tags --sort=-v:refname https://github.com/kvcache-ai/Mooncake.git 'v*' | head -5

echo
echo "=== refs-only git ls-remote output ==="
git ls-remote --refs --tags --sort=-v:refname https://github.com/kvcache-ai/Mooncake.git 'v*' | head -5

Expected result: the refs-only output excludes any ^{} deref entries, the selected tag is non-empty, and the clone command should quote the branch variable.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.gitlab/build.sh around lines 222 - 224, The MOONCAKE_VERSION resolution and
clone are brittle: change the git ls-remote call that sets MOONCAKE_VERSION to
use --refs (so it excludes ^{} deref entries) and make the script fail fast if
no tag was found (i.e., test that MOONCAKE_VERSION is non-empty before
proceeding), and then quote the variable when cloning (use
"${MOONCAKE_VERSION}") to avoid word-splitting/SC2086; update the assignment
that uses git ls-remote and the git clone invocation that references
MOONCAKE_VERSION accordingly.

222-224: ⚠️ Potential issue | 🟠 Major

Do not resolve Mooncake from “latest” at build time.

This still makes the build non-reproducible and can drift past the version recorded in ATTRIBUTIONS-CPP.md, so a future Mooncake release changes what this PR builds without any code change. Source the version from a checked-in pin or explicit CI input instead.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.gitlab/build.sh around lines 222 - 224, Replace the dynamic resolution of
MOONCAKE_VERSION via git ls-remote with a pinned source: read MOONCAKE_VERSION
from a checked-in pin file or an explicit CI variable (e.g., an environment
variable provided by CI), and refuse to proceed if that value is empty; update
the git clone invocation to use that pinned MOONCAKE_VERSION (referencing the
MOONCAKE_VERSION variable and the git clone line) and remove the ls-remote
lookup so builds are reproducible and match ATTRIBUTIONS-CPP.md.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.gitlab/build.sh:
- Around line 222-224: The MOONCAKE_VERSION resolution and clone are brittle:
change the git ls-remote call that sets MOONCAKE_VERSION to use --refs (so it
excludes ^{} deref entries) and make the script fail fast if no tag was found
(i.e., test that MOONCAKE_VERSION is non-empty before proceeding), and then
quote the variable when cloning (use "${MOONCAKE_VERSION}") to avoid
word-splitting/SC2086; update the assignment that uses git ls-remote and the git
clone invocation that references MOONCAKE_VERSION accordingly.
- Around line 222-224: Replace the dynamic resolution of MOONCAKE_VERSION via
git ls-remote with a pinned source: read MOONCAKE_VERSION from a checked-in pin
file or an explicit CI variable (e.g., an environment variable provided by CI),
and refuse to proceed if that value is empty; update the git clone invocation to
use that pinned MOONCAKE_VERSION (referencing the MOONCAKE_VERSION variable and
the git clone line) and remove the ls-remote lookup so builds are reproducible
and match ATTRIBUTIONS-CPP.md.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 82f6eaa7-59b8-4723-a2e1-3e694dbd8bcb

📥 Commits

Reviewing files that changed from the base of the PR and between ac45c95 and 88ea288.

📒 Files selected for processing (3)
  • .ci/jenkins/lib/build-matrix.yaml
  • .ci/jenkins/lib/test-matrix.yaml
  • .gitlab/build.sh

@roiedanino

Copy link
Copy Markdown
Contributor

@staryxchen Need to resolve conflicts first

@staryxchen

Copy link
Copy Markdown
Contributor Author

Hi @roiedanino @brminich,

This PR has accumulated too many conflicts with the latest main branch. I've created a clean re-implementation based on the latest main: #1448

Closing this one in favor of the new PR. Thanks for all the reviews and feedback!

@staryxchen staryxchen closed this Mar 20, 2026
@staryxchen
staryxchen deleted the update-mooncake-version branch March 23, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.