Skip to content

Commit e96cde7

Browse files
committed
fix(ci): bound docker pull smoke steps
1 parent 5ef8122 commit e96cde7

6 files changed

Lines changed: 35 additions & 5 deletions

File tree

.github/actions/docker-e2e-plan/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ runs:
123123
shell: bash
124124
run: |
125125
set -euo pipefail
126-
docker pull "${OPENCLAW_DOCKER_E2E_BARE_IMAGE}"
126+
bash scripts/ci-docker-pull-retry.sh "${OPENCLAW_DOCKER_E2E_BARE_IMAGE}"
127127
128128
- name: Pull shared functional Docker E2E image
129129
if: inputs.hydrate-artifacts == 'true' && steps.plan.outputs.needs_functional_image == '1'
130130
shell: bash
131131
run: |
132132
set -euo pipefail
133-
docker pull "${OPENCLAW_DOCKER_E2E_FUNCTIONAL_IMAGE}"
133+
bash scripts/ci-docker-pull-retry.sh "${OPENCLAW_DOCKER_E2E_FUNCTIONAL_IMAGE}"
134134
135135
- name: Validate Docker E2E credentials
136136
if: inputs.hydrate-artifacts == 'true'

.github/workflows/sandbox-common-smoke.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: |
4343
set -euo pipefail
4444
45-
docker build -t openclaw-sandbox-smoke-base:bookworm-slim - <<'EOF'
45+
timeout --kill-after=30s 5m docker build -t openclaw-sandbox-smoke-base:bookworm-slim - <<'EOF'
4646
FROM debian:bookworm-slim
4747
RUN useradd --create-home --shell /bin/bash sandbox
4848
USER sandbox
@@ -63,5 +63,5 @@ jobs:
6363
FINAL_USER=sandbox \
6464
scripts/sandbox-common-setup.sh
6565
66-
u="$(docker run --rm openclaw-sandbox-common-smoke:bookworm-slim sh -lc 'id -un')"
66+
u="$(timeout --kill-after=30s 2m docker run --rm openclaw-sandbox-common-smoke:bookworm-slim sh -lc 'id -un')"
6767
test "$u" = "sandbox"

scripts/e2e/openwebui-docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ trap cleanup EXIT
6666
docker_e2e_build_or_reuse "$IMAGE_NAME" openwebui
6767

6868
echo "Pulling Open WebUI image: $OPENWEBUI_IMAGE"
69-
timeout "$DOCKER_PULL_TIMEOUT" docker pull "$OPENWEBUI_IMAGE" >/dev/null
69+
DOCKER_COMMAND_TIMEOUT="$DOCKER_PULL_TIMEOUT" docker_e2e_docker_cmd pull "$OPENWEBUI_IMAGE" >/dev/null
7070

7171
echo "Creating Docker network..."
7272
docker_e2e_docker_cmd network create "$NET_NAME" >/dev/null

test/scripts/docker-build-helper.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ describe("docker build helper", () => {
156156
expect(liveBuild).not.toContain('docker image inspect "$LIVE_IMAGE_NAME"');
157157
expect(liveBuild).not.toContain('docker pull "$LIVE_IMAGE_NAME"');
158158
expect(liveBuild).toContain("Live-test image not available; building");
159+
expect(readFileSync(OPENWEBUI_DOCKER_E2E_PATH, "utf8")).toContain(
160+
'DOCKER_COMMAND_TIMEOUT="$DOCKER_PULL_TIMEOUT" docker_e2e_docker_cmd pull "$OPENWEBUI_IMAGE"',
161+
);
162+
expect(readFileSync(OPENWEBUI_DOCKER_E2E_PATH, "utf8")).not.toContain(
163+
'timeout "$DOCKER_PULL_TIMEOUT" docker pull "$OPENWEBUI_IMAGE"',
164+
);
159165
expect(liveCliBackend).toContain(
160166
'OPENCLAW_LIVE_DOCKER_REPO_ROOT="$ROOT_DIR" "$TRUSTED_HARNESS_DIR/scripts/test-live-build-docker.sh"',
161167
);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ describe("package artifact reuse", () => {
416416

417417
it("bounds shared Docker image pulls so package acceptance cannot stall forever", () => {
418418
const pullHelper = readFileSync("scripts/ci-docker-pull-retry.sh", "utf8");
419+
const dockerE2ePlanAction = readFileSync(DOCKER_E2E_PLAN_ACTION, "utf8");
419420

420421
expect(pullHelper).toContain("OPENCLAW_DOCKER_PULL_ATTEMPTS");
421422
expect(pullHelper).toContain("OPENCLAW_DOCKER_PULL_TIMEOUT_SECONDS");
@@ -426,6 +427,8 @@ describe("package artifact reuse", () => {
426427
expect(pullHelper).toContain(
427428
'timeout --kill-after=30s "${timeout_seconds}s" docker pull "$image"',
428429
);
430+
expect(dockerE2ePlanAction.match(/bash scripts\/ci-docker-pull-retry\.sh/g)?.length).toBe(2);
431+
expect(dockerE2ePlanAction).not.toContain('docker pull "${OPENCLAW_DOCKER_E2E_');
429432
});
430433

431434
it("uses Blacksmith Docker build caching for prepared E2E images", () => {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { readFileSync } from "node:fs";
2+
import { describe, expect, it } from "vitest";
3+
4+
const WORKFLOW_PATH = ".github/workflows/sandbox-common-smoke.yml";
5+
6+
describe("sandbox common smoke workflow", () => {
7+
const workflow = readFileSync(WORKFLOW_PATH, "utf8");
8+
9+
it("bounds Docker build and run smoke steps", () => {
10+
expect(workflow).toContain(
11+
"timeout --kill-after=30s 5m docker build -t openclaw-sandbox-smoke-base:bookworm-slim -",
12+
);
13+
expect(workflow).toContain(
14+
"timeout --kill-after=30s 2m docker run --rm openclaw-sandbox-common-smoke:bookworm-slim",
15+
);
16+
expect(workflow).not.toMatch(/(^|\n)\s+docker build -t openclaw-sandbox-smoke-base/u);
17+
expect(workflow).not.toContain(
18+
"u=\"$(docker run --rm openclaw-sandbox-common-smoke:bookworm-slim",
19+
);
20+
});
21+
});

0 commit comments

Comments
 (0)