From 8f1fbce7680c5cd17dae0de16dc070d2b0147a2c Mon Sep 17 00:00:00 2001 From: Wu Sheng Date: Wed, 17 Jun 2026 22:13:21 +0800 Subject: [PATCH 1/3] Use Docker Compose v2 (`docker compose`) in the compose log collector The compose collector shells out to `docker-compose -f ... -p ... ps -q ...` (Compose v1) to locate containers for log collection. GitHub-hosted `ubuntu-24.04` runners no longer ship the standalone `docker-compose` (v1) binary, so collection fails with `docker-compose: command not found` on every failed e2e (setup already uses Compose v2 via testcontainers-go, so only the collector was still on v1). Switch `ComposeCommand` from `docker-compose` to `docker compose`. The command is run via `bash -ec`, so the two-word v2 plugin invocation works as-is, and v2 accepts the same `-f / -p / ps -q` flags. Validated locally with a compose e2e (nginx): with `docker-compose` v1 absent (and with a failing `docker-compose` stub shadowing PATH), `e2e run` completes green and the collector gathers container files via `docker compose` v2 without ever invoking `docker-compose`. --- internal/constant/compose.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/constant/compose.go b/internal/constant/compose.go index 30992c4e..3b47be95 100644 --- a/internal/constant/compose.go +++ b/internal/constant/compose.go @@ -20,5 +20,5 @@ package constant const ( Compose = "compose" - ComposeCommand = "docker-compose" + ComposeCommand = "docker compose" ) From 059b969b9ae42aac153ae636cd047c5ca52d71a3 Mon Sep 17 00:00:00 2001 From: Wu Sheng Date: Wed, 17 Jun 2026 22:40:51 +0800 Subject: [PATCH 2/3] Add CI coverage for the compose log collector infra-e2e's own e2e (`test/e2e/e2e.yaml`) runs on `ubuntu-latest` (which ships only Docker Compose v2) but never exercised the compose log collector, so the v1->v2 breakage slipped through CI and the prior fix had no regression guard. Add a `cleanup.collect` config (httpbin / /etc/hostname) and a verify case that runs `e2e collect` against the already-running stack and asserts a container file was gathered. The collector now runs in CI on a v1-less runner, proving it works via `docker compose` v2 and failing the build if it ever regresses to `docker-compose` v1. Validated locally: `e2e collect` gathers /etc/hostname from the httpbin service and the verify case reports `1 passed`. --- test/e2e/collect-expected.yaml | 1 + test/e2e/e2e.yaml | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 test/e2e/collect-expected.yaml diff --git a/test/e2e/collect-expected.yaml b/test/e2e/collect-expected.yaml new file mode 100644 index 00000000..c657f25a --- /dev/null +++ b/test/e2e/collect-expected.yaml @@ -0,0 +1 @@ +collected: "true" diff --git a/test/e2e/e2e.yaml b/test/e2e/e2e.yaml index 23cb1168..6bb2128f 100644 --- a/test/e2e/e2e.yaml +++ b/test/e2e/e2e.yaml @@ -24,6 +24,17 @@ setup: cleanup: # always never success failure on: always + # Exercise the compose log collector in CI so a regression to Docker Compose v1 is + # caught: GitHub-hosted runners ship only Compose v2, so the collector must use + # `docker compose`. Auto-collect is off here; the verify case below invokes + # `e2e collect` explicitly and asserts a file was collected. + collect: + on: never + output-dir: /tmp/e2e-collect-check + items: + - service: httpbin + paths: + - /etc/hostname verify: # verify with retry strategy @@ -56,3 +67,13 @@ verify: query: './bin/linux/e2e verify -c ./test/e2e/concurrency/non-fail-fast/internal/verify.yaml --summary-only -o yaml' expected: ./concurrency/non-fail-fast/expected.yaml + # Guards the compose log collector against a regression to Docker Compose v1 + # (which is absent on GitHub-hosted runners). Runs `e2e collect` against the + # already-running compose stack and asserts a container file was collected. + - name: compose log collector works on Docker Compose v2 + query: | + rm -rf /tmp/e2e-collect-check + ./bin/linux/e2e collect -c ./test/e2e/e2e.yaml > /dev/null 2>&1 || true + if [ -s /tmp/e2e-collect-check/httpbin/etc/hostname ]; then echo 'collected: "true"'; else echo 'collected: "false"'; fi + expected: ./collect-expected.yaml + From a257b6f25c49f864d33190b2a856623007040625 Mon Sep 17 00:00:00 2001 From: Wu Sheng Date: Wed, 17 Jun 2026 23:16:16 +0800 Subject: [PATCH 3/3] Add missing Apache license header to collect-expected.yaml --- test/e2e/collect-expected.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/e2e/collect-expected.yaml b/test/e2e/collect-expected.yaml index c657f25a..c99cbdf6 100644 --- a/test/e2e/collect-expected.yaml +++ b/test/e2e/collect-expected.yaml @@ -1 +1,18 @@ +# Licensed to Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Apache Software Foundation (ASF) licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + collected: "true"