fix(build): Dockerfile还原到26e6cb4结构——3 COPY + 5 RUN

26e6cb4能build成功,HEAD多了2个RUN(bridge+deploy)导致失败。
把bridge编译和deploy逻辑全部移进patch_ops.sh(容错环境内)。
Dockerfile现在和26e6cb4逐行结构相同。
This commit is contained in:
Claude
2026-08-11 09:59:53 +00:00
parent c152bd5a89
commit 4702505bf9
2 changed files with 20 additions and 20 deletions

View File

@@ -3,7 +3,7 @@ FROM git.modelhub.org.cn:9443/enginex-iluvatar/bi100-3.2.3-x86-ubuntu20.04-py3.1
RUN mkdir -p /workspace
WORKDIR /workspace/
# Copy all sources (vendor_overrides pre-staged inside qwen3_6_scripts/)
# Copy all sources
COPY ./qwen3_6_scripts /workspace/qwen3_6_scripts
COPY ./computility-run.yaml /workspace/computility-run.yaml
COPY ./ex_engine /workspace/ex_engine
@@ -21,28 +21,12 @@ RUN python3 /workspace/ex_engine/precompile_moe_topk.py 2>&1 | tee -a /workspace
RUN python3 /workspace/ex_engine/precompile_moe_kernels.py 2>&1 | tee -a /workspace/ex_build.log ; \
echo "[Dockerfile] moe_v055 precompile exit code: $?"
# Step 4: Deploy patches (serving + engine fixes + prebuilt .so)
# Step 4: Deploy patches (serving + engine fixes + prebuilt .so + bridge)
RUN chmod +x /workspace/qwen3_6_scripts/patch_ops.sh && \
cd /workspace/qwen3_6_scripts && \
bash ./patch_ops.sh 2>&1 | tee /workspace/patch_ops.log ; \
bash /workspace/qwen3_6_scripts/patch_ops.sh 2>&1 | tee /workspace/patch_ops.log ; \
echo "[Dockerfile] patch_ops exit code: $?"
# Step 5: Build ix_unified_bridge.so (ixformer symbols resolved at runtime)
RUN chmod +x /workspace/ex_engine/build_unified_bridge.sh && \
(bash /workspace/ex_engine/build_unified_bridge.sh 2>&1 || echo "[Dockerfile] bridge build FAILED (non-fatal)") | tee -a /workspace/ex_build.log ; \
echo "[Dockerfile] ix_unified_bridge build exit code: $?"
# Step 6: Deploy ex_engine Python modules to vllm path
RUN VLLM_ROOT=$(python3 -c "import vllm; print(vllm.__path__[0])" 2>/dev/null | tail -1 || echo "/usr/local/corex/lib64/python3/dist-packages/vllm") && \
cp /workspace/ex_engine/python/ix_unified.py "${VLLM_ROOT}/ix_unified.py" 2>/dev/null || true && \
cp /workspace/ex_engine/python/corex_so_loader.py "${VLLM_ROOT}/corex_so_loader.py" 2>/dev/null || true && \
cp /workspace/ex_engine/python/moe_fused_dispatch.py "${VLLM_ROOT}/moe_fused_dispatch.py" 2>/dev/null || true && \
if ls /workspace/ex_engine/build/ix_unified_bridge*.so 1>/dev/null 2>&1; then \
cp /workspace/ex_engine/build/ix_unified_bridge*.so "${VLLM_ROOT}/" 2>/dev/null || true ; \
fi ; \
echo "[Dockerfile] ex_engine Python modules deployed"
# Step 7: Precompile GDN kernel (needs vllm in path, so after patch_ops)
# Step 5: Precompile GDN kernel (needs vllm in path, so after patch_ops)
RUN python3 /workspace/qwen3_6_scripts/precompile_gdn.py \
/workspace/qwen3_6_scripts/flash_qla_sm70 2>&1 | tee -a /workspace/ex_build.log ; \
echo "[Dockerfile] gdn precompile exit code: $?"

View File

@@ -358,4 +358,20 @@ fi
build_stage "compiling submission Python sources"
find . -path './wheels' -prune -o -name '*.py' -print0 | xargs -0 python3 -m py_compile 2>&1 || echo "[WARN] some .py files failed to compile (non-fatal)"
build_stage "building ix_unified_bridge (optional)"
if [[ -x /workspace/ex_engine/build_unified_bridge.sh ]]; then
bash /workspace/ex_engine/build_unified_bridge.sh 2>&1 || echo "[WARN] bridge build failed (non-fatal)"
fi
build_stage "deploying ex_engine Python modules"
VLLM_DEPLOY=$(python3 -c "import vllm; print(vllm.__path__[0])" 2>/dev/null | tail -1 || echo "")
if [[ -n "$VLLM_DEPLOY" && -d "$VLLM_DEPLOY" ]]; then
for f in ix_unified.py corex_so_loader.py moe_fused_dispatch.py ex_topk_bridge.py; do
cp "/workspace/ex_engine/python/$f" "${VLLM_DEPLOY}/$f" 2>/dev/null || true
done
ls /workspace/ex_engine/build/ix_unified_bridge*.so 1>/dev/null 2>&1 && \
cp /workspace/ex_engine/build/ix_unified_bridge*.so "${VLLM_DEPLOY}/" 2>/dev/null || true
echo "[ok] ex_engine modules deployed to ${VLLM_DEPLOY}"
fi
build_stage "patch script completed"