Skip to content

Commit a355c88

Browse files
committed
ci(release): keep docker preflight cheap
1 parent b06dc17 commit a355c88

3 files changed

Lines changed: 16 additions & 51 deletions

File tree

.github/workflows/full-release-validation.yml

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ jobs:
229229
needs: [resolve_target]
230230
if: inputs.rerun_group == 'all'
231231
runs-on: ubuntu-24.04
232-
timeout-minutes: 45
232+
timeout-minutes: 20
233233
permissions:
234234
contents: read
235235
steps:
@@ -245,54 +245,11 @@ jobs:
245245
DOCKER_BUILDKIT: "1"
246246
run: |
247247
set -euo pipefail
248-
timeout --kill-after=30s 35m docker build \
248+
timeout --kill-after=30s 15m docker build \
249249
--target runtime-assets \
250250
--build-arg OPENCLAW_EXTENSIONS="diagnostics-otel,codex" \
251251
.
252252
253-
- name: Build and smoke test final Docker runtime image
254-
env:
255-
DOCKER_BUILDKIT: "1"
256-
TARGET_SHA: ${{ needs.resolve_target.outputs.sha }}
257-
run: |
258-
set -euo pipefail
259-
image_ref="openclaw-release-runtime-smoke:${TARGET_SHA}"
260-
timeout --kill-after=30s 35m docker build \
261-
--build-arg OPENCLAW_EXTENSIONS="diagnostics-otel,codex" \
262-
-t "${image_ref}" \
263-
.
264-
docker run --rm --entrypoint /bin/sh "${image_ref}" -lc '
265-
set -eu
266-
test -f /app/src/agents/templates/HEARTBEAT.md
267-
temp_root="$(mktemp -d)"
268-
trap "rm -rf \"${temp_root}\"" EXIT
269-
mkdir -p "${temp_root}/home" "${temp_root}/cwd"
270-
cd "${temp_root}/cwd"
271-
set +e
272-
HOME="${temp_root}/home" \
273-
USERPROFILE="${temp_root}/home" \
274-
OPENCLAW_HOME="${temp_root}/home" \
275-
OPENCLAW_NO_ONBOARD=1 \
276-
OPENCLAW_SUPPRESS_NOTES=1 \
277-
OPENCLAW_DISABLE_BUNDLED_PLUGINS=1 \
278-
OPENCLAW_DISABLE_BUNDLED_ENTRY_SOURCE_FALLBACK=1 \
279-
AWS_EC2_METADATA_DISABLED=true \
280-
AWS_SHARED_CREDENTIALS_FILE="${temp_root}/home/.aws/credentials" \
281-
AWS_CONFIG_FILE="${temp_root}/home/.aws/config" \
282-
node /app/openclaw.mjs agent --message "workspace bootstrap smoke" --session-id "workspace-bootstrap-smoke" --local --timeout 1 --json \
283-
>"${temp_root}/out.log" 2>&1
284-
status="$?"
285-
set -e
286-
if grep -F "Missing workspace template:" "${temp_root}/out.log"; then
287-
cat "${temp_root}/out.log"
288-
exit 1
289-
fi
290-
test -f "${temp_root}/home/.openclaw/workspace/HEARTBEAT.md"
291-
if [ "${status}" -ne 0 ]; then
292-
cat "${temp_root}/out.log"
293-
fi
294-
'
295-
296253
normal_ci:
297254
name: Run normal full CI
298255
needs: [resolve_target, docker_runtime_assets_preflight]

test/scripts/package-acceptance-workflow.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,11 +1367,13 @@ describe("package artifact reuse", () => {
13671367
expect(npmWorkflow).toContain("Verify full release validation target");
13681368
expect(npmWorkflow).not.toContain("Build and smoke test final Docker runtime image");
13691369
expect(fullReleaseWorkflow).toContain("docker_runtime_assets_preflight");
1370-
expect(fullReleaseWorkflow).toContain("Build and smoke test final Docker runtime image");
1370+
expect(fullReleaseWorkflow).not.toContain("Build and smoke test final Docker runtime image");
13711371
expect(fullReleaseWorkflow).toContain("docker build");
1372-
expect(fullReleaseWorkflow).toContain("node /app/openclaw.mjs agent");
1372+
expect(fullReleaseWorkflow).toContain("--target runtime-assets");
1373+
expect(fullReleaseWorkflow).toContain("timeout --kill-after=30s 15m docker build");
1374+
expect(fullReleaseWorkflow).not.toContain("node /app/openclaw.mjs agent");
13731375
expect(fullReleaseWorkflow).toContain('OPENCLAW_EXTENSIONS="diagnostics-otel,codex"');
1374-
expect(fullReleaseWorkflow).toContain("/app/src/agents/templates/HEARTBEAT.md");
1376+
expect(fullReleaseWorkflow).not.toContain("/app/src/agents/templates/HEARTBEAT.md");
13751377
expect(fullReleaseWorkflow).toContain("inputs.rerun_group == 'all'");
13761378
expect(fullReleaseWorkflow).toContain(
13771379
"needs.docker_runtime_assets_preflight.result == 'success'",

test/scripts/plugin-prerelease-test-plan.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,16 +545,22 @@ describe("scripts/lib/plugin-prerelease-test-plan.mjs", () => {
545545
expect(fullReleaseWorkflow.jobs.docker_runtime_assets_preflight.if).toBe(
546546
"inputs.rerun_group == 'all'",
547547
);
548+
expect(fullReleaseWorkflow.jobs.docker_runtime_assets_preflight["timeout-minutes"]).toBe(20);
548549
const dockerPreflightStep = fullReleaseWorkflow.jobs.docker_runtime_assets_preflight.steps.find(
549-
(step) => step.name === "Build and smoke test final Docker runtime image",
550+
(step) => step.name === "Verify Docker runtime-assets prune path",
550551
);
551552
expect(dockerPreflightStep).toBeDefined();
552553
expect(dockerPreflightStep?.run).toContain("docker build");
553-
expect(dockerPreflightStep?.run).toContain("node /app/openclaw.mjs agent");
554+
expect(dockerPreflightStep?.run).toContain("--target runtime-assets");
555+
expect(dockerPreflightStep?.run).toContain("timeout --kill-after=30s 15m docker build");
554556
expect(dockerPreflightStep?.run).toContain(
555557
'--build-arg OPENCLAW_EXTENSIONS="diagnostics-otel,codex"',
556558
);
557-
expect(dockerPreflightStep?.run).toContain("/app/src/agents/templates/HEARTBEAT.md");
559+
expect(
560+
fullReleaseWorkflow.jobs.docker_runtime_assets_preflight.steps.some(
561+
(step) => step.name === "Build and smoke test final Docker runtime image",
562+
),
563+
).toBe(false);
558564
expect(fullReleaseWorkflow.jobs.plugin_prerelease["timeout-minutes"]).toBe(
559565
"${{ inputs.release_profile == 'full' && 300 || inputs.release_profile == 'stable' && 240 || 60 }}",
560566
);

0 commit comments

Comments
 (0)