apupier opened a new pull request, #30672:
URL: https://github.com/apache/camel/pull/30672

   # Description
   
   Workaround to improve the robustness of the test-infra on ppc64le and s390x 
Jenkins nodes, where an image with the wrong architecture (amd64) is sometimes 
used (CAMEL-26387).
   
   ## Root cause
   
   - The Jenkins registry mirror (`mirror.gcr.io`) sometimes replies 
`toomanyrequests: Quota exceeded ...` (see INFRA-28663). amd64 content is 
almost always already cached by the mirror, ppc64le/s390x content is not.
   - When the pull fails, Testcontainers' `RemoteDockerImage.pullImage` 
silently retries with `withPlatform("linux/amd64")` (fallback to x86 added in 
Testcontainers 1.16.0, still present in 2.0.5).
   - The amd64 image is stored under the regular tag. The default pull policy 
never pulls an image that is available locally, so all subsequent runs reuse 
the wrong image and fail with `exec format error`, until someone removes the 
image manually.
   
   ## Change
   
   New `HostArchitectureImagePullPolicy` in `camel-test-infra-common`, 
registered as Testcontainers `pull.policy` through a 
`testcontainers.properties` file:
   
   - if the local image architecture differs from the host one: log a warning, 
remove the image and pull it again
   - if the image is missing: pull it explicitly for `linux/<host arch>`, so 
Testcontainers cannot fall back to `linux/amd64`
   - if the pull fails: throw a `ContainerFetchException`, which is already 
retried with backoff by `TestServiceUtil.tryInitialize`
   - after the pull, verify the architecture and fail clearly on a mismatch
   
   The check is enabled by default only on ppc64le and s390x hosts, and can be 
forced with `-Dcamel.test.infra.image.arch.check=true|false`. When disabled the 
behavior is the one of the Testcontainers default policy. A `pull.policy` set 
in `~/.testcontainers.properties` still takes precedence.
   
   This is a workaround: it does not fix the mirror quota, it only avoids 
silently using an image with the wrong architecture and retries the pull.
   
   ## Limitations / testing
   
   - Only images pulled through Testcontainers are covered.
   - Unit tests only cover the architecture name normalization and the default 
activation. The pull/remove logic was not exercised against a real Docker 
daemon nor on a ppc64le/s390x node yet, validation on a Jenkins node is needed.
   - `mvn install` of `camel-test-infra-common` passes.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [x] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
   
   ---
   _Claude Code-style attribution: this PR was prepared by IBM Bob (AI 
assistant) on behalf of @apupier._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to