mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-07-30 03:14:59 +00:00
* perf(ci): shard the E2E suite and stop building it twice per job A full E2E run took about 40 minutes, twice the median gap between merges on main, so the post-merge suite could never keep up with the merge rate. Two thirds of that was avoidable work. Every job installed dependencies with the default `prepare` behaviour, which builds and bundles the whole workspace, and then ran explicit build and bundle steps that did it all a second time — about 3.5 minutes on Linux and 5 on macOS. The docker leg additionally let the sandbox script re-run install, build, bundle and pack on the host before building the image, none of which the image consumes: its Dockerfile rebuilds and packs inside its own builder stage. The remaining cost is the test run itself, which is now split across shards: three for each Linux sandbox mode and two for macOS. Vitest assigns files to shards by path hash, so the long tail of slow sdk-typescript files spreads out rather than clustering in one shard; replaying the last green run's per-file timings through that algorithm puts the slowest shard at about 6 minutes against the 16 to 25 minutes each leg used to spend. The matrix no longer fails fast either, because a cancelled sibling shard would hide most of the suite and report an incomplete failure set. Expected wall clock per run drops from about 40 minutes to about 24, with the sandbox image build — 13 minutes, now paid once per docker shard — as the largest remaining item and the obvious next target via Docker layer caching. * fix(ci): set QWEN_SANDBOX=docker on the sandbox image build step (#7798) Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> * fix(ci): quote the sandbox env value so yamllint passes The value added for the image build step was unquoted, which the repository's quoted-strings rule rejects, and note why the variable is needed at all. * fix(ci): stream docker build output in the sandbox image step (#7798) * fix(ci): skip duplicate build in sandbox image npm ci (#7798) The Dockerfile builder stage runs npm ci followed by explicit build and bundle steps. npm ci triggers the prepare script, which builds and bundles the whole workspace — duplicating the two steps that follow. Set QWEN_SKIP_PREPARE=1 on the npm ci so prepare only generates git-commit.ts, matching the same fix already applied to the host CI install steps. --------- Co-authored-by: Qwen Code <qwen-code@users.noreply.github.com> Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> Co-authored-by: qwen-code-dev-bot <qwen-code-dev@service.alibaba.com> Co-authored-by: Qwen Code Bot <qwen-code-bot@users.noreply.github.com>
75 lines
1.8 KiB
Docker
75 lines
1.8 KiB
Docker
# Build stage
|
|
FROM docker.io/library/node:22-slim AS builder
|
|
|
|
# Install build dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
python3 \
|
|
make \
|
|
g++ \
|
|
git \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set up npm global package folder
|
|
RUN mkdir -p /usr/local/share/npm-global
|
|
ENV NPM_CONFIG_PREFIX=/usr/local/share/npm-global
|
|
ENV PATH=$PATH:/usr/local/share/npm-global/bin
|
|
|
|
# Copy source code
|
|
COPY . /home/node/app
|
|
WORKDIR /home/node/app
|
|
|
|
# Install dependencies, build workspaces, bundle into a single distributable, and pack.
|
|
# QWEN_SKIP_PREPARE=1 stops npm ci's prepare script from building and bundling —
|
|
# the explicit build and bundle steps below already do that.
|
|
RUN QWEN_SKIP_PREPARE=1 npm ci \
|
|
&& npm run build \
|
|
&& npm run bundle \
|
|
&& npm run prepare:package \
|
|
&& cd dist && npm pack
|
|
|
|
# Runtime stage
|
|
FROM docker.io/library/node:22-slim
|
|
|
|
ARG SANDBOX_NAME="qwen-code-sandbox"
|
|
ARG CLI_VERSION_ARG
|
|
ENV SANDBOX="$SANDBOX_NAME"
|
|
ENV CLI_VERSION=$CLI_VERSION_ARG
|
|
|
|
# Install runtime dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
python3 \
|
|
man-db \
|
|
curl \
|
|
dnsutils \
|
|
less \
|
|
jq \
|
|
bc \
|
|
gh \
|
|
git \
|
|
unzip \
|
|
rsync \
|
|
ripgrep \
|
|
procps \
|
|
psmisc \
|
|
lsof \
|
|
socat \
|
|
ca-certificates \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set up npm global package folder
|
|
RUN mkdir -p /usr/local/share/npm-global
|
|
ENV NPM_CONFIG_PREFIX=/usr/local/share/npm-global
|
|
ENV PATH=$PATH:/usr/local/share/npm-global/bin
|
|
|
|
# Copy bundled package from builder stage
|
|
COPY --from=builder /home/node/app/dist/*.tgz /tmp/
|
|
|
|
# Install built packages globally
|
|
RUN npm install -g /tmp/*.tgz \
|
|
&& npm cache clean --force \
|
|
&& rm -rf /tmp/*.tgz
|
|
|
|
# Default entrypoint when none specified
|
|
CMD ["qwen"]
|