mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-27 09:21:35 +07:00
perf(ci): trim install smoke overhead (#52447)
* perf(ci): trim install smoke overhead * perf(ci): skip discord opus native build noise * fix(ci): use npm latest dist-tag in install smoke
This commit is contained in:
6
.github/workflows/install-smoke.yml
vendored
6
.github/workflows/install-smoke.yml
vendored
@@ -41,6 +41,9 @@ jobs:
|
|||||||
needs: [docs-scope]
|
needs: [docs-scope]
|
||||||
if: (github.event_name != 'pull_request' || !github.event.pull_request.draft) && needs.docs-scope.outputs.docs_only != 'true'
|
if: (github.event_name != 'pull_request' || !github.event.pull_request.draft) && needs.docs-scope.outputs.docs_only != 'true'
|
||||||
runs-on: blacksmith-16vcpu-ubuntu-2404
|
runs-on: blacksmith-16vcpu-ubuntu-2404
|
||||||
|
env:
|
||||||
|
DOCKER_BUILD_SUMMARY: "false"
|
||||||
|
DOCKER_BUILD_RECORD_UPLOAD: "false"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout CLI
|
- name: Checkout CLI
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
@@ -55,6 +58,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
|
build-args: |
|
||||||
|
OPENCLAW_DOCKER_APT_UPGRADE=0
|
||||||
tags: openclaw-dockerfile-smoke:local
|
tags: openclaw-dockerfile-smoke:local
|
||||||
load: true
|
load: true
|
||||||
push: false
|
push: false
|
||||||
@@ -73,6 +78,7 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
build-args: |
|
build-args: |
|
||||||
|
OPENCLAW_DOCKER_APT_UPGRADE=0
|
||||||
OPENCLAW_EXTENSIONS=matrix
|
OPENCLAW_EXTENSIONS=matrix
|
||||||
tags: openclaw-ext-smoke:local
|
tags: openclaw-ext-smoke:local
|
||||||
load: true
|
load: true
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
# Slim (bookworm-slim): docker build --build-arg OPENCLAW_VARIANT=slim .
|
# Slim (bookworm-slim): docker build --build-arg OPENCLAW_VARIANT=slim .
|
||||||
ARG OPENCLAW_EXTENSIONS=""
|
ARG OPENCLAW_EXTENSIONS=""
|
||||||
ARG OPENCLAW_VARIANT=default
|
ARG OPENCLAW_VARIANT=default
|
||||||
|
ARG OPENCLAW_DOCKER_APT_UPGRADE=1
|
||||||
ARG OPENCLAW_NODE_BOOKWORM_IMAGE="node:24-bookworm@sha256:3a09aa6354567619221ef6c45a5051b671f953f0a1924d1f819ffb236e520e6b"
|
ARG OPENCLAW_NODE_BOOKWORM_IMAGE="node:24-bookworm@sha256:3a09aa6354567619221ef6c45a5051b671f953f0a1924d1f819ffb236e520e6b"
|
||||||
ARG OPENCLAW_NODE_BOOKWORM_DIGEST="sha256:3a09aa6354567619221ef6c45a5051b671f953f0a1924d1f819ffb236e520e6b"
|
ARG OPENCLAW_NODE_BOOKWORM_DIGEST="sha256:3a09aa6354567619221ef6c45a5051b671f953f0a1924d1f819ffb236e520e6b"
|
||||||
ARG OPENCLAW_NODE_BOOKWORM_SLIM_IMAGE="node:24-bookworm-slim@sha256:e8e2e91b1378f83c5b2dd15f0247f34110e2fe895f6ca7719dbb780f929368eb"
|
ARG OPENCLAW_NODE_BOOKWORM_SLIM_IMAGE="node:24-bookworm-slim@sha256:e8e2e91b1378f83c5b2dd15f0247f34110e2fe895f6ca7719dbb780f929368eb"
|
||||||
@@ -113,6 +114,7 @@ LABEL org.opencontainers.image.base.name="docker.io/library/node:24-bookworm-sli
|
|||||||
# ── Stage 3: Runtime ────────────────────────────────────────────
|
# ── Stage 3: Runtime ────────────────────────────────────────────
|
||||||
FROM base-${OPENCLAW_VARIANT}
|
FROM base-${OPENCLAW_VARIANT}
|
||||||
ARG OPENCLAW_VARIANT
|
ARG OPENCLAW_VARIANT
|
||||||
|
ARG OPENCLAW_DOCKER_APT_UPGRADE
|
||||||
|
|
||||||
# OCI base-image metadata for downstream image consumers.
|
# OCI base-image metadata for downstream image consumers.
|
||||||
# If you change these annotations, also update:
|
# If you change these annotations, also update:
|
||||||
@@ -129,10 +131,14 @@ WORKDIR /app
|
|||||||
|
|
||||||
# Install system utilities present in bookworm but missing in bookworm-slim.
|
# Install system utilities present in bookworm but missing in bookworm-slim.
|
||||||
# On the full bookworm image these are already installed (apt-get is a no-op).
|
# On the full bookworm image these are already installed (apt-get is a no-op).
|
||||||
|
# Smoke workflows can opt out of distro upgrades to cut repeated CI time while
|
||||||
|
# keeping the default runtime image behavior unchanged.
|
||||||
RUN --mount=type=cache,id=openclaw-bookworm-apt-cache,target=/var/cache/apt,sharing=locked \
|
RUN --mount=type=cache,id=openclaw-bookworm-apt-cache,target=/var/cache/apt,sharing=locked \
|
||||||
--mount=type=cache,id=openclaw-bookworm-apt-lists,target=/var/lib/apt,sharing=locked \
|
--mount=type=cache,id=openclaw-bookworm-apt-lists,target=/var/lib/apt,sharing=locked \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
|
if [ "${OPENCLAW_DOCKER_APT_UPGRADE}" != "0" ]; then \
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends; \
|
||||||
|
fi && \
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||||
procps hostname curl git lsof openssl
|
procps hostname curl git lsof openssl
|
||||||
|
|
||||||
|
|||||||
@@ -817,7 +817,6 @@
|
|||||||
"yauzl": "3.2.1"
|
"yauzl": "3.2.1"
|
||||||
},
|
},
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
"@discordjs/opus",
|
|
||||||
"@lydell/node-pty",
|
"@lydell/node-pty",
|
||||||
"@matrix-org/matrix-sdk-crypto-nodejs",
|
"@matrix-org/matrix-sdk-crypto-nodejs",
|
||||||
"@napi-rs/canvas",
|
"@napi-rs/canvas",
|
||||||
@@ -830,6 +829,10 @@
|
|||||||
"protobufjs",
|
"protobufjs",
|
||||||
"sharp"
|
"sharp"
|
||||||
],
|
],
|
||||||
|
"ignoredBuiltDependencies": [
|
||||||
|
"@discordjs/opus",
|
||||||
|
"koffi"
|
||||||
|
],
|
||||||
"packageExtensions": {
|
"packageExtensions": {
|
||||||
"@mariozechner/pi-coding-agent": {
|
"@mariozechner/pi-coding-agent": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -15,3 +15,7 @@ onlyBuiltDependencies:
|
|||||||
- node-llama-cpp
|
- node-llama-cpp
|
||||||
- protobufjs
|
- protobufjs
|
||||||
- sharp
|
- sharp
|
||||||
|
|
||||||
|
ignoredBuiltDependencies:
|
||||||
|
- "@discordjs/opus"
|
||||||
|
- koffi
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
FROM ubuntu:24.04@sha256:cd1dba651b3080c3686ecf4e3c4220f026b521fb76978881737d24f200828b2b
|
FROM ubuntu:24.04@sha256:cd1dba651b3080c3686ecf4e3c4220f026b521fb76978881737d24f200828b2b
|
||||||
|
|
||||||
|
# Smoke images are pinned and short-lived, so skip distro upgrades here and
|
||||||
|
# spend the time budget on installer coverage instead.
|
||||||
RUN --mount=type=cache,id=openclaw-install-sh-nonroot-apt-cache,target=/var/cache/apt,sharing=locked \
|
RUN --mount=type=cache,id=openclaw-install-sh-nonroot-apt-cache,target=/var/cache/apt,sharing=locked \
|
||||||
--mount=type=cache,id=openclaw-install-sh-nonroot-apt-lists,target=/var/lib/apt,sharing=locked \
|
--mount=type=cache,id=openclaw-install-sh-nonroot-apt-lists,target=/var/lib/apt,sharing=locked \
|
||||||
set -eux; \
|
set -eux; \
|
||||||
@@ -11,7 +13,6 @@ RUN --mount=type=cache,id=openclaw-install-sh-nonroot-apt-cache,target=/var/cach
|
|||||||
if [ "${attempt}" -eq 3 ]; then exit 1; fi; \
|
if [ "${attempt}" -eq 3 ]; then exit 1; fi; \
|
||||||
sleep 3; \
|
sleep 3; \
|
||||||
done; \
|
done; \
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 upgrade -y --no-install-recommends; \
|
|
||||||
apt-get -o Acquire::Retries=3 install -y --no-install-recommends \
|
apt-get -o Acquire::Retries=3 install -y --no-install-recommends \
|
||||||
bash \
|
bash \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
FROM node:24-bookworm-slim@sha256:b4687aef2571c632a1953695ce4d61d6462a7eda471fe6e272eebf0418f276ba
|
FROM node:24-bookworm-slim@sha256:b4687aef2571c632a1953695ce4d61d6462a7eda471fe6e272eebf0418f276ba
|
||||||
|
|
||||||
|
# Smoke images are pinned and short-lived, so skip distro upgrades here and
|
||||||
|
# spend the time budget on installer coverage instead.
|
||||||
RUN --mount=type=cache,id=openclaw-install-sh-smoke-apt-cache,target=/var/cache/apt,sharing=locked \
|
RUN --mount=type=cache,id=openclaw-install-sh-smoke-apt-cache,target=/var/cache/apt,sharing=locked \
|
||||||
--mount=type=cache,id=openclaw-install-sh-smoke-apt-lists,target=/var/lib/apt,sharing=locked \
|
--mount=type=cache,id=openclaw-install-sh-smoke-apt-lists,target=/var/lib/apt,sharing=locked \
|
||||||
set -eux; \
|
set -eux; \
|
||||||
@@ -11,7 +13,6 @@ RUN --mount=type=cache,id=openclaw-install-sh-smoke-apt-cache,target=/var/cache/
|
|||||||
if [ "${attempt}" -eq 3 ]; then exit 1; fi; \
|
if [ "${attempt}" -eq 3 ]; then exit 1; fi; \
|
||||||
sleep 3; \
|
sleep 3; \
|
||||||
done; \
|
done; \
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 upgrade -y --no-install-recommends; \
|
|
||||||
apt-get -o Acquire::Retries=3 install -y --no-install-recommends \
|
apt-get -o Acquire::Retries=3 install -y --no-install-recommends \
|
||||||
bash \
|
bash \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
|
|||||||
@@ -12,14 +12,18 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|||||||
source "$SCRIPT_DIR/../install-sh-common/cli-verify.sh"
|
source "$SCRIPT_DIR/../install-sh-common/cli-verify.sh"
|
||||||
|
|
||||||
echo "==> Resolve npm versions"
|
echo "==> Resolve npm versions"
|
||||||
LATEST_VERSION="$(npm view "$PACKAGE_NAME" version)"
|
if [[ "$SKIP_PREVIOUS" == "1" ]]; then
|
||||||
if [[ -n "$SMOKE_PREVIOUS_VERSION" ]]; then
|
LATEST_VERSION="$(npm view "$PACKAGE_NAME" version)"
|
||||||
|
PREVIOUS_VERSION="$LATEST_VERSION"
|
||||||
|
elif [[ -n "$SMOKE_PREVIOUS_VERSION" ]]; then
|
||||||
|
LATEST_VERSION="$(npm view "$PACKAGE_NAME" version)"
|
||||||
PREVIOUS_VERSION="$SMOKE_PREVIOUS_VERSION"
|
PREVIOUS_VERSION="$SMOKE_PREVIOUS_VERSION"
|
||||||
else
|
else
|
||||||
|
LATEST_VERSION="$(npm view "$PACKAGE_NAME" dist-tags.latest)"
|
||||||
VERSIONS_JSON="$(npm view "$PACKAGE_NAME" versions --json)"
|
VERSIONS_JSON="$(npm view "$PACKAGE_NAME" versions --json)"
|
||||||
PREVIOUS_VERSION="$(VERSIONS_JSON="$VERSIONS_JSON" LATEST_VERSION="$LATEST_VERSION" node - <<'NODE'
|
PREVIOUS_VERSION="$(LATEST_VERSION="$LATEST_VERSION" VERSIONS_JSON="$VERSIONS_JSON" node - <<'NODE'
|
||||||
|
const latest = String(process.env.LATEST_VERSION || "");
|
||||||
const raw = process.env.VERSIONS_JSON || "[]";
|
const raw = process.env.VERSIONS_JSON || "[]";
|
||||||
const latest = process.env.LATEST_VERSION || "";
|
|
||||||
let versions;
|
let versions;
|
||||||
try {
|
try {
|
||||||
versions = JSON.parse(raw);
|
versions = JSON.parse(raw);
|
||||||
@@ -29,15 +33,15 @@ try {
|
|||||||
if (!Array.isArray(versions)) {
|
if (!Array.isArray(versions)) {
|
||||||
versions = [versions];
|
versions = [versions];
|
||||||
}
|
}
|
||||||
if (versions.length === 0) {
|
if (versions.length === 0 || latest.length === 0) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
const latestIndex = latest ? versions.lastIndexOf(latest) : -1;
|
const latestIndex = versions.lastIndexOf(latest);
|
||||||
if (latestIndex > 0) {
|
if (latestIndex <= 0) {
|
||||||
process.stdout.write(String(versions[latestIndex - 1]));
|
process.stdout.write(latest);
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
process.stdout.write(String(latest || versions[versions.length - 1]));
|
process.stdout.write(String(versions[latestIndex - 1] ?? latest));
|
||||||
NODE
|
NODE
|
||||||
)"
|
)"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user