[AMD] ci: reinstall MoRI if Different from Dockerfile-pinned commit during install_dependency - #27538
Conversation
PR #26922 bumps MORI_COMMIT in docker/rocm.Dockerfile to pick up new MoRI APIs (e.g. IOEngine.wait_all), but the published CI image still bakes the old MoRI and is not rebuilt per-PR, so the mi35x disaggregation suite runs against the stale library and fails. Reinstall MoRI in amd_ci_install_dependency.sh using the repo/commit pinned in rocm.Dockerfile (same build steps as the image build), so the running container matches the Dockerfile without rebuilding the image. Guarded on /sgl-workspace/mori, so non-MoRI images are unaffected. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Code Review
This pull request updates the AMD CI dependency installation script to dynamically reinstall MORI inside the CI container if the workspace directory exists, ensuring that any updates to the MORI commit in the Dockerfile are reflected in the CI run. The reviewer suggested a safer way to pass host environment variables into the Docker container using docker exec -e and single-quoted strings to prevent shell parsing and escaping issues.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| docker exec ci_sglang bash -c " | ||
| set -euo pipefail | ||
| export MORI_GPU_ARCHS='${MORI_GPU_ARCHS}' | ||
| rm -rf /sgl-workspace/mori | ||
| git clone '${MORI_REPO}' /sgl-workspace/mori | ||
| cd /sgl-workspace/mori | ||
| git checkout '${MORI_COMMIT}' | ||
| git submodule update --init --recursive | ||
| python3 setup.py develop | ||
| python3 -c 'import os, torch; print(os.path.join(os.path.dirname(torch.__file__), \"lib\"))' > /etc/ld.so.conf.d/torch.conf | ||
| ldconfig | ||
| " |
There was a problem hiding this comment.
Passing host variables directly into a double-quoted docker exec bash -c "..." string is fragile and can lead to shell parsing or escaping issues if the variables contain special characters.
Instead, it is much safer and cleaner to pass these variables into the container using docker exec -e and use a single-quoted string for the bash -c command. This avoids host-side expansion and simplifies nested quoting/escaping.
| docker exec ci_sglang bash -c " | |
| set -euo pipefail | |
| export MORI_GPU_ARCHS='${MORI_GPU_ARCHS}' | |
| rm -rf /sgl-workspace/mori | |
| git clone '${MORI_REPO}' /sgl-workspace/mori | |
| cd /sgl-workspace/mori | |
| git checkout '${MORI_COMMIT}' | |
| git submodule update --init --recursive | |
| python3 setup.py develop | |
| python3 -c 'import os, torch; print(os.path.join(os.path.dirname(torch.__file__), \"lib\"))' > /etc/ld.so.conf.d/torch.conf | |
| ldconfig | |
| " | |
| docker exec \ | |
| -e MORI_GPU_ARCHS="${MORI_GPU_ARCHS}" \ | |
| -e MORI_REPO="${MORI_REPO}" \ | |
| -e MORI_COMMIT="${MORI_COMMIT}" \ | |
| ci_sglang bash -c ' | |
| set -euo pipefail | |
| rm -rf /sgl-workspace/mori | |
| git clone "$MORI_REPO" /sgl-workspace/mori | |
| cd /sgl-workspace/mori | |
| git checkout "$MORI_COMMIT" | |
| git submodule update --init --recursive | |
| python3 setup.py develop | |
| python3 -c "import os, torch; print(os.path.join(os.path.dirname(torch.__file__), \"lib\"))" > /etc/ld.so.conf.d/torch.conf | |
| ldconfig | |
| ' |
…uring install_dependency (sgl-project#27538) Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
docker/rocm.Dockerfile(MORI_COMMIT). When a PR bumpsMORI_COMMITahead of the published image, the image is not rebuilt per-PR, sostage-b-test-large-8-gpu-mi35x-disaggregation-amdruns against a stale MoRI (e.g. missing newerIOEngineAPIs such aswait_all).scripts/ci/amd/amd_ci_install_dependency.shthat reinstalls MoRI inside the runningci_sglangcontainer from the repo/commit pinned inrocm.Dockerfile, mirroring the image's build steps — so the container matches the Dockerfile without rebuilding/republishing the image./sgl-workspace/mori, so non-MoRI images (every other suite) skip it.Test plan
[MORI] Reinstalling MORI <commit> .../[MORI] Done., and the disaggregation e2e test runs against the Dockerfile-pinned MoRI.MORI_COMMITtod87651c) on branchbingxche/mori-ci-reinstall-26922: https://github.com/sgl-project/sglang/actions/runs/27115280593Made with Cursor
CI States
Latest PR Test (Base): ✅ Run #27122910680
Latest PR Test (Extra): ❌ Run #27122910447