Repository navigation
feat: migrate to testcontainers-go v0.42.0 and upgrade dependencies - #146
Conversation
…ndencies - Delete compose_provider.go (601 lines) — custom DockerContainer/DockerProvider re-implementation replaced by native testcontainers-go APIs - Delete compose_listener.go (85 lines) — Docker event listener no longer needed; containers are accessible after stack.Up() via stack.ServiceContainer() - Rewrite compose.go to use compose.NewDockerComposeWith + stack.Up/ServiceContainer - Rewrite cleanup/compose.go to use stack.Down - Upgrade testcontainers-go v0.11.1 → v0.42.0 - Upgrade docker/docker v20.10.7 → v28.5.2 - Upgrade k8s.io/* v0.22.2 → v0.35.3 - Upgrade sigs.k8s.io/kind v0.27.0 → v0.31.0 - Upgrade spf13/cobra v1.8.0 → v1.10.2 - Remove docker-compose v1 binary install from CI (v0.42.0 uses Docker Compose v2 plugin) - Update action.yaml Go version to 1.26 Closes #139 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Split Build workflow into lint-and-test + build-platform (ubuntu/windows/macos) matrix jobs. Enable CGO for native builds. Update Dockerfile with build-essential for CGO. Change `make build` to build for current OS only (CI matrix handles cross-platform). Based on #139 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…pose version field Pin infra-e2e to apache/skywalking-infra-e2e#146 (81adeec) which migrates to testcontainers-go v0.42.0, using Docker Compose v2 plugin natively and removing docker-compose v1 dependency. Remove the deprecated `version` field from all docker-compose files for Compose v2 compatibility.
compose.Wait(true) maps to `docker compose up --wait` which requires ALL containers to remain running and healthy. This is too strict for e2e tests where some containers may not have healthchecks or may exit after init. Port readiness is already handled by WaitForService() with per-port wait strategies. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Fixed: removed Port readiness is already handled by Found via apache/skywalking#13817 testing. |
…pose version field Pin infra-e2e to apache/skywalking-infra-e2e#146 (81adeec) which migrates to testcontainers-go v0.42.0, using Docker Compose v2 plugin natively and removing docker-compose v1 dependency. Remove the deprecated `version` field from all docker-compose files for Compose v2 compatibility.
WaitForService strategies only execute when compose.Wait(true) is passed, but compose.Wait(true) is too strict (requires all containers healthy). Instead, manually wait for each port via TCP dial after Up() returns, matching the old code's behavior of waitPortUntilReady(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Docker SDK v28.5.2 defaults to API v1.51, but GitHub Actions runners may only support up to v1.48. Set DOCKER_API_VERSION to the daemon's supported version to ensure compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add INFO-level logs for port wait start/completion and DEBUG-level for retry attempts. Also try connecting immediately before the first ticker interval to avoid unnecessary 500ms delay when ports are already ready. Log when a service has no ports to wait for. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
After stack.Up(), wait for each container's Docker healthcheck to pass (if defined) before doing TCP port checks. This matches the old behavior where docker-compose up -d would respect depends_on: condition: service_healthy. Also restored internal container port check (/proc/net/tcp + nc + /dev/tcp) from the old WaitPort implementation to align with original behavior. The wait sequence is now: 1. stack.Up(ctx) — start containers 2. waitForHealthy — poll Docker health status until healthy (if healthcheck defined) 3. waitForPort — external TCP dial + internal container check 4. Export env vars Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The old code only waited for services that had ports: in docker-compose.yml. Services without ports were completely skipped. The healthcheck wait was incorrectly running on ALL services, causing timeouts on services like init containers or senders whose healthchecks depend on other services. Now: services without ports get log streaming only. Services with ports get healthcheck wait + port wait + env export (matching old behavior). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The old code never checked Docker healthcheck status. It only did TCP dial + internal /proc/net/tcp check. Many compose files use healthchecks with tools (nc) not available in the container image, causing Docker to mark containers as unhealthy even when the application is running fine. Remove waitForHealthy entirely to match old behavior exactly: port-level waiting only, no Docker healthcheck dependency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| sudo systemctl restart docker | ||
| docker version | ||
| docker info | ||
| echo "DOCKER_API_VERSION=$(docker version --format '{{.Server.APIVersion}}')" >> "$GITHUB_ENV" |
There was a problem hiding this comment.
Do we still need this now? This entire step was added to work around the issue, I think the entire step Set Docker API version can be removed
There was a problem hiding this comment.
Yes, we still need this line to keep client version following the server declared.
|
|
||
| .PHONY: build | ||
| build: windows linux darwin | ||
| build: $(GOOS) |
There was a problem hiding this comment.
Changing the build target to only build the current OS will break the release target? The release target depends on this to build all binaries for all OS'es
The build target must build all platforms (windows/linux/darwin) because release-bin depends on it. Each platform build uses CGO_FLAG to enable CGO only for native builds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Each matrix runner (ubuntu/windows/macos) now builds only its own platform instead of all three redundantly. The `make build` target is preserved for release which needs all platforms. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…pose version field (#13817) **Changes:** - Bump `skywalking-infra-e2e` to `530f997` (merged apache/skywalking-infra-e2e#146), which migrates testcontainers-go from v0.11.1 to v0.42.0, using Docker Compose v2 plugin natively and removing docker-compose v1 dependency. - Remove deprecated `version` field from all docker-compose files (Compose v2 ignores it with a warning). **What the infra-e2e change does:** - Migrates testcontainers-go v0.11.1 → v0.42.0, using native `compose.NewDockerComposeWith` API - Deletes ~686 lines of custom `DockerContainer`/`DockerProvider` reimplementation - Removes docker-compose v1 binary installation from CI `action.yaml` - Adds TCP port waiting after `docker compose up -d` (matching old behavior) - Restores `DOCKER_API_VERSION` negotiation for Docker 29+ compatibility - User-facing contract (e2e.yaml format, env vars, log paths, CLI) is preserved
ubuntu-latest now resolves to ubuntu-26.04, which ships Docker 29 with the containerd image store. The pinned infra-e2e action (8c21e43) disables the containerd snapshotter and restarts dockerd before running the case, so the agent image built and loaded by `make build docker.java8` (skywalking/skywalking-java:latest-java8) is no longer visible. Compose then tries to pull it from Docker Hub and both E2E cases fail with "pull access denied". Upstream infra-e2e removed that step in apache/skywalking-infra-e2e#146 and runs compose through testcontainers-go. Pin the current main (56ac8befeb5f910f2dc9339e65d07cd18953f90e), whose CI passes on ubuntu-26.04. The new action installs Go 1.26 itself. Drop the workflow's own actions/setup-go@v2 (Go 1.24) step: it exports GOROOT, which makes the action's Go 1.26 toolchain compile against the Go 1.24 standard library ("compile: version go1.24.13 does not match go tool version go1.26.10").
…ing is enabled (#841) * Fix NPE and lost trace context of reactive Lettuce commands when tracing is enabled Put the snapshot on the command that carries the span instead of the TracedCommand wrapper, and skip the command interceptors for a command without a span. * Bump skywalking-infra-e2e to fix E2E on Docker 29 runners ubuntu-latest now resolves to ubuntu-26.04, which ships Docker 29 with the containerd image store. The pinned infra-e2e action (8c21e43) disables the containerd snapshotter and restarts dockerd before running the case, so the agent image built and loaded by `make build docker.java8` (skywalking/skywalking-java:latest-java8) is no longer visible. Compose then tries to pull it from Docker Hub and both E2E cases fail with "pull access denied". Upstream infra-e2e removed that step in apache/skywalking-infra-e2e#146 and runs compose through testcontainers-go. Pin the current main (56ac8befeb5f910f2dc9339e65d07cd18953f90e), whose CI passes on ubuntu-26.04. The new action installs Go 1.26 itself. Drop the workflow's own actions/setup-go@v2 (Go 1.24) step: it exports GOROOT, which makes the action's Go 1.26 toolchain compile against the Go 1.24 standard library ("compile: version go1.24.13 does not match go tool version go1.26.10"). * Fix the consumer race in spring-kafka-2.3.x-scenario The scenario consumer has no committed offset and starts from the latest offset, while healthCheck reported success as soon as Tomcat started. When the health check hit right after startup, the entry request sent "helloWorld" before the consumer got its partition, so the consumer skipped it, the request waited forever on the latch and its segment was never reported (SegmentNotFoundException for GET:/case/spring-kafka-case). On ubuntu-26.04 runners spring-kafka 2.7.14 lost this race on every attempt. Report healthy only after partitions are assigned, the same way kafka-scenario does. --------- Co-authored-by: Wu Sheng <wu.sheng@foxmail.com>
ubuntu-latest now resolves to ubuntu-26.04, which ships Docker 29. The pinned infra-e2e action (8c21e43) disables the containerd snapshotter and restarts dockerd before running a case, a workaround upstream removed in apache/skywalking-infra-e2e#146. It broke the skywalking-java E2E on the new runners, and the chart E2E has not run on them yet. Pin the current main (56ac8befeb5f910f2dc9339e65d07cd18953f90e), as apache/skywalking-java#841 did. The action installs Go 1.26 itself, so drop the workflow's own Go 1.24 setup.
* Bump skywalking-infra-e2e off the containerd snapshotter workaround ubuntu-latest now resolves to ubuntu-26.04, which ships Docker 29. The pinned infra-e2e action (8c21e43) disables the containerd snapshotter and restarts dockerd before running a case, a workaround upstream removed in apache/skywalking-infra-e2e#146. It broke the skywalking-java E2E on the new runners, and the chart E2E has not run on them yet. Pin the current main (56ac8befeb5f910f2dc9339e65d07cd18953f90e), as apache/skywalking-java#841 did. The action installs Go 1.26 itself, so drop the workflow's own Go 1.24 setup. * Pin docker/login-action to an approved revision The ASF GitHub Actions allow-list no longer has docker/login-action af1e73f (v4.4.0), so the Test workflow fails at startup with "is not allowed in apache/skywalking-helm". Use v4.7.0 (81c6f93d4bc991e510b342a00b419b3bb4efc5c6), which the allow-list approves without an expiry date. publish-helm.yaml uses the same pin. * Stop setting SW_QUERY_ZIPKIN twice in the E2E installs The ubuntu-26.04 runner image ships Helm 4.3.1, whose server-side apply rejects duplicate env entries. The three OAP 11 cases set oap.ports.zipkin-query, which already makes the chart emit SW_QUERY_ZIPKIN, and set oap.env.SW_QUERY_ZIPKIN as well, so `helm install` failed with "duplicate entries for key [name="SW_QUERY_ZIPKIN"]". Helm 3's client-side apply accepted the duplicate. Drop the redundant oap.env setting; the chart still sets the same value. * Raise the inotify limits for the kind E2E cluster On the ubuntu-26.04 runners BanyanDB standalone exits at startup with "failed to create fsnotify watcher: couldn't initialize inotify: too many open files". The four kind nodes and all their pods share the host's inotify limits, which Ubuntu sets low, so OAP never became available and the case timed out. Raise fs.inotify.max_user_watches and max_user_instances to at least the values the kind known-issues page recommends, and print the runner's own values first.
Summary
Major dependency upgrade and code simplification:
DockerContainer/DockerProviderre-implementation (compose_provider.go,compose_listener.go)What Changed
compose_provider.gocompose_listener.gostack.ServiceContainer()replaces Docker event listeningcompose.goLocalDockerCompose→compose.NewDockerComposeWith+stack.Up/ServiceContainercleanup/compose.gostack.DownwithRemoveVolumes/RemoveOrphanskind.gotypes.ImageListOptions→image.ListOptions)k8s.goNewShortcutExpanderto use warning callback (new k8s API)action.yamle2e-test.yamlbuild.yamlMakefilemake buildbuilds for current OS only, added CGO_ENABLED per platformDockerfileUser-Facing Contract Preserved
e2e.yaml) unchanged<SERVICE>_host,<SERVICE>_<PORT>logDir/serviceName/std.logGITHUB_RUN_IDproject identifier unchangedTest plan
go build ./...passesmake lintpasses (0 issues)go test ./...passes (all unit tests)make buildpasses locally (macOS with CGO)Supersedes #139
🤖 Generated with Claude Code