Skip to content

Commit 3b5cacd

Browse files
authored
fix: pass explicit docker runtime in acceptance tests (#1160)
## Summary - Adds optional second argument to `build-lgtm.sh` for explicit runtime override (e.g. `./build-lgtm.sh latest docker`) - Acceptance tests now pass `docker` explicitly, because `oats` hardcodes `docker compose` to orchestrate services ## Problem On CI runners (Ubuntu 24.04) where both Docker and Podman are installed, if `build-lgtm.sh` uses Podman but `oats` runs `docker compose`, the built image is invisible to Docker — causing acceptance test timeouts (connection refused). This is currently not an issue on `main` (Docker-first preference), but becomes one when #1158 lands (Podman-first preference). This PR makes the acceptance tests resilient regardless of the default preference order. ## Test plan - [ ] CI acceptance tests pass on this branch - [ ] `./build-lgtm.sh latest` still auto-detects (no regression) - [ ] `./build-lgtm.sh latest docker` forces Docker - [ ] `./build-lgtm.sh latest podman` forces Podman
1 parent a389166 commit 3b5cacd

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.mise/tasks/acceptance-tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ version=${usage_version:-$(date +%Y%m%d%H%M%S)}
88

99
echo "using version $version"
1010

11-
mise run build-lgtm "$version"
11+
# Force Docker: oats hardcodes `docker compose`, so the image must be built with Docker.
12+
./build-lgtm.sh "$version" docker
1213
oats -timeout 5m -lgtm-version "$version" examples/

build-lgtm.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@
33
set -euo pipefail
44

55
RELEASE=${1:-latest}
6+
CONTAINER_RUNTIME_OVERRIDE=${2:-}
67

78
echo "Building the Grafana OTEL-LGTM image with release ${RELEASE}..."
89

9-
if command -v docker >/dev/null 2>&1; then
10+
if [ -n "$CONTAINER_RUNTIME_OVERRIDE" ]; then
11+
case "$CONTAINER_RUNTIME_OVERRIDE" in
12+
docker | podman) RUNTIME="$CONTAINER_RUNTIME_OVERRIDE" ;;
13+
*)
14+
echo "Invalid runtime: $CONTAINER_RUNTIME_OVERRIDE (must be docker or podman)"
15+
exit 1
16+
;;
17+
esac
18+
elif command -v docker >/dev/null 2>&1; then
1019
RUNTIME=docker
1120
elif command -v podman >/dev/null 2>&1; then
1221
RUNTIME=podman
@@ -15,4 +24,4 @@ else
1524
exit 1
1625
fi
1726

18-
$RUNTIME buildx build -f docker/Dockerfile docker --tag grafana/otel-lgtm:"${RELEASE}" --build-arg LGTM_VERSION="${RELEASE}"
27+
"$RUNTIME" buildx build -f docker/Dockerfile docker --tag grafana/otel-lgtm:"${RELEASE}" --build-arg LGTM_VERSION="${RELEASE}"

0 commit comments

Comments
 (0)