[ 
https://issues.apache.org/jira/browse/KAFKA-20448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18101195#comment-18101195
 ] 

Yunseop Eom commented on KAFKA-20448:
-------------------------------------

Opened PR #23058: https://github.com/apache/kafka/pull/23058

The fix addresses both local-archive JVM Docker build failures: tolerate an 
omitted kafka_url when --kafka-archive is used, and stop the CDS-generation 
broker through its captured PID instead of parsing truncated Alpine BusyBox ps 
output.

Verification:
- RED reproduced before the fix with docker/docker_build_test.py using 
--image-type=jvm --kafka-archive ... --build: kafka_url: parameter not set.
- GREEN passed after the fix, including the JSA generation stage and final 
image export.
- bash -n docker/jvm/jsa_launch
- git diff --check

> Docker image build fails with --image-type=jvm and --kafka-archive
> ------------------------------------------------------------------
>
>                 Key: KAFKA-20448
>                 URL: https://issues.apache.org/jira/browse/KAFKA-20448
>             Project: Kafka
>          Issue Type: Bug
>          Components: docker
>    Affects Versions: 4.2.0
>            Reporter: Szabolcs Stremler
>            Priority: Minor
>
> The Docker image build fails if docker_build_test.py is called with 
> --image-type=jvm --kafka-archive=path/kafka_2.13-4.4.0-SNAPSHOT.tgz
> Reproduction:
> {code:java}
> ./gradlew clean jar
> ./gradlew releaseTarGz
> cd ..
> mkdir kafka-docker
> cd kafka-docker
> python3 -m venv kafka
> source kafka/bin/activate
> python3 -m pip install -r ../kafka/docker/requirements.txt
> python3 ../kafka/docker/docker_build_test.py kafka/test 
> --image-tag=4.4.0-SNAPSHOT --image-type=jvm 
> --kafka-archive=../kafka/core/build/distributions/kafka_2.13-4.4.0-SNAPSHOT.tgz
>  --build{code}
> The image build has two issues:
> 1. docker/jvm/Dockerfile sets set eux before it calls if [ -n "$kafka_url" ]; 
> then \ and $kafka_url is not set, because we use -kafka-archive instead and 
> this makes the shell exit with an error immediately, so the other branch is 
> not executed where the script would start using the kafka archive.
> 2. If the issue above is fixed, the Docker image build still fails during the 
> JSA file creation. docker/jvm/jsa_launch starts the broker, but 
> opt/kafka/bin/kafka-server-stop.sh doesn't stop the broker, so the JSA file 
> is not created. opt/kafka/bin/kafka-server-stop.sh is not able to stop the 
> broker, because it is not able to find the PID of the Java process. The Java 
> process is started with all the jars in the command and the end of the 
> command is truncated by ps. We could add -x -x to the ps command to prevent 
> truncation, but the script uses a simplified version of ps from Busybox, so 
> it doesn't have theĀ  -x argument.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to