linkedin / cruise-control

Cruise-control is the first of its kind to fully automate the dynamic workload rebalance and self-healing of a Kafka cluster. It provides great value to Kafka users by simplifying the operation of Kafka clusters.
https://github.com/linkedin/cruise-control/tags
BSD 2-Clause "Simplified" License
2.77k stars 594 forks source link

Re-enable s390x build for CI #2209

Open yasiribmcon opened 4 weeks ago

yasiribmcon commented 4 weeks ago

After https://github.com/linkedin/cruise-control/pull/2203 , s390x job test-multi-arch was removed from CI as it started failing and hence, was blocking PR workflow.

Root cause of this failure was actually due to incorrect usage of below docker run command:

docker run --rm \
           --platform << parameters.platform >> \
           --name qemu-cross-<< parameters.platform >> \
           --mount type=bind,source=${PWD},target=/github_workspace \
           --workdir /github_workspace \
           << parameters.platform >>/eclipse-temurin:11-jdk-focal uname -a; ./gradlew --no-daemon -PmaxParallelForks=1 build

The only command which ran inside eclipse-temurin:11-jdk-focal container was uname -a. ./gradlew --no-daemon -PmaxParallelForks=1build command ran on the machine image(which is x86 and not s390x) instead of the container. I ran a local job with uname -a; uname -a; ./gradlew --no-daemon -PmaxParallelForks=1 build parameters and second uname command did output x86 as current architecture:

...
Status: Downloaded newer image for s390x/eclipse-temurin:11-jdk-jammy
Linux 1182e9ecfcfa 6.5.0-1020-aws #20~22.04.1-Ubuntu SMP Wed May  1 16:10:50 UTC 2024 s390x s390x s390x GNU/Linux
Linux ip-10-0-106-87 6.5.0-1020-aws #20~22.04.1-Ubuntu SMP Wed May  1 16:10:50 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Picked up _JAVA_OPTIONS: -Xms512m -Xmx1g
...

Since deprecated x86 image had Java 11 installed, the gradle command worked like a charm and it looked like gradle command was working on s390x as there were no further mentions of architecture being used in the gradle build logs. Newer Circle CI images like ubuntu-2004:current had Java 21 installed, due to which we started seeing java.lang.IllegalArgumentException: Unsupported class file major version 65 error.

Hence, gradle build NEVER ran inside s390x container.

In order to fix this problem, we need to update docker run command to:

docker run --rm \
           --platform << parameters.platform >> \
           --name qemu-cross-<< parameters.platform >> \
           --mount type=bind,source=${PWD},target=/github_workspace \
           --workdir /github_workspace \
           << parameters.platform >>/eclipse-temurin:11-jdk-focal sh -c "uname -a; ./gradlew --no-daemon -PmaxParallelForks=1 build"

I tried running a local job with this fix but since I am using the free version, Circle CI times out after an hour of build execution so I am unable to verify if the build succeeds or not.

Please advise on how should we proceed further. cc : @CCisGG

yasiribmcon commented 1 day ago

Hi @CCisGG Could you please have a look at this issue Thanks!

CCisGG commented 19 hours ago

@mhratson Could you please take a look? Thanks!