Skip to content

KAFKA-18841: Enable to test docker image locally#19028

Merged
frankvicky merged 6 commits into
apache:trunkfrom
FrankYang0529:KAFKA-18841
Aug 26, 2025
Merged

KAFKA-18841: Enable to test docker image locally#19028
frankvicky merged 6 commits into
apache:trunkfrom
FrankYang0529:KAFKA-18841

Conversation

@FrankYang0529

@FrankYang0529 FrankYang0529 commented Feb 25, 2025

Copy link
Copy Markdown
Member

Case 1: no --kafka-url and --kafka-archive

Should fail. One of argument (--kafka-url/--kafka-archive) is required.

> python docker_build_test.py apache/kafka --image-tag KAFKA-18841
--image-type jvm --build
usage: docker_build_test.py [-h] [--image-tag TAG] [--image-type
{jvm,native}] [--build] [--test] (--kafka-url KAFKA_URL |
--kafka-archive KAFKA_ARCHIVE) image
docker_build_test.py: error: one of the arguments --kafka-url/-u
--kafka-archive/-a is required

Case 2: --kafka-url with native

> python docker_build_test.py apache/kafka --image-tag KAFKA-18841
--image-type native --kafka-url
https://dist.apache.org/repos/dist/dev/kafka/4.0.0-rc0/kafka_2.13-4.0.0.tgz
--build

Case 3: --karka-url with jvm

> python docker_build_test.py apache/kafka --image-tag KAFKA-18841
--image-type jvm --kafka-url
https://dist.apache.org/repos/dist/dev/kafka/4.0.0-rc0/kafka_2.13-4.0.0.tgz
--build

Case 4: --kafka-archive with native

> ./gradlew clean releaseTarGz
> cd docker
> python docker_build_test.py apache/kafka --image-tag KAFKA-18841
--image-type native --kafka-archive
</absolute/path/to/core/build/distributions/kafka_2.13-4.1.0-SNAPSHOT.tgz>
--build

Case 5: --kafka-archive with jvm

> ./gradlew clean releaseTarGz
> cd docker
> python docker_build_test.py apache/kafka --image-tag KAFKA-18841
--image-type jvm --kafka-archive
</absolute/path/to/core/build/distributions/kafka_2.13-4.1.0-SNAPSHOT.tgz>
--build

Reviewers: Vedarth Sharma vesharma@confluent.io, Chia-Ping Tsai
chia7712@gmail.com, TengYao Chi frankvicky@apache.org

Signed-off-by: PoAn Yang <payang@apache.org>
@github-actions github-actions Bot added docker Official Docker image small Small PRs labels Feb 25, 2025

@frankvicky frankvicky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch.
I have a comment.


archive_group = parser.add_mutually_exclusive_group(required=True)
archive_group.add_argument("--kafka-url", "-u", dest="kafka_url", help="Kafka url to be used to download kafka binary tarball in the docker image")
archive_group.add_argument("--kafka-archive", "-a", dest="kafka_archive", help="Kafka archive to be used to extract kafka binary tarball in the docker image")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is documentation on top of this file. Should we update it to reflect the change?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it. Thanks.

Signed-off-by: PoAn Yang <payang@apache.org>
@FrankYang0529
FrankYang0529 requested a review from frankvicky May 6, 2025 12:53
@Vedarth

Vedarth commented Jun 15, 2025

Copy link
Copy Markdown

lgtm. Thanks a lot for the contribution!

@frankvicky
frankvicky merged commit b2c1a0f into apache:trunk Aug 26, 2025
24 checks passed
@FrankYang0529
FrankYang0529 deleted the KAFKA-18841 branch August 26, 2025 06:22
eduwercamacaro pushed a commit to littlehorse-enterprises/kafka that referenced this pull request Nov 12, 2025
### Case 1: no --kafka-url and --kafka-archive

Should fail. One of argument (--kafka-url/--kafka-archive) is required.

```
> python docker_build_test.py apache/kafka --image-tag KAFKA-18841
--image-type jvm --build
usage: docker_build_test.py [-h] [--image-tag TAG] [--image-type
{jvm,native}] [--build] [--test] (--kafka-url KAFKA_URL |
--kafka-archive KAFKA_ARCHIVE) image
docker_build_test.py: error: one of the arguments --kafka-url/-u
--kafka-archive/-a is required
```

### Case 2: --kafka-url with native

```
> python docker_build_test.py apache/kafka --image-tag KAFKA-18841
--image-type native --kafka-url
https://dist.apache.org/repos/dist/dev/kafka/4.0.0-rc0/kafka_2.13-4.0.0.tgz
--build
```

### Case 3: --karka-url with jvm

```
> python docker_build_test.py apache/kafka --image-tag KAFKA-18841
--image-type jvm --kafka-url
https://dist.apache.org/repos/dist/dev/kafka/4.0.0-rc0/kafka_2.13-4.0.0.tgz
--build
```

### Case 4: --kafka-archive with native

```
> ./gradlew clean releaseTarGz
> cd docker
> python docker_build_test.py apache/kafka --image-tag KAFKA-18841
--image-type native --kafka-archive
</absolute/path/to/core/build/distributions/kafka_2.13-4.1.0-SNAPSHOT.tgz>
--build
```

### Case 5: --kafka-archive with jvm

```
> ./gradlew clean releaseTarGz
> cd docker
> python docker_build_test.py apache/kafka --image-tag KAFKA-18841
--image-type jvm --kafka-archive
</absolute/path/to/core/build/distributions/kafka_2.13-4.1.0-SNAPSHOT.tgz>
--build
```

Reviewers: Vedarth Sharma <vesharma@confluent.io>, Chia-Ping Tsai
 <chia7712@gmail.com>, TengYao Chi <frankvicky@apache.org>

---------

Signed-off-by: PoAn Yang <payang@apache.org>
@clolov

clolov commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

Heya @FrankYang0529 and @frankvicky! I am trying to generate the Docker JVM image as part of the 4.2 release and I am running into hanging builds (example: https://github.com/apache/kafka/actions/runs/20923061294/job/60113456146).

The last successful release (i.e. 4.1.1) used the previous version of the Docker Build Test workflow which doesn't have this change. I also used the previous version of the workflow (the one used in 4.1.1) and it doesn't hang with the 4.2 binaries.

If you have spare cycles it would be quite useful to get some additional eyes on what might be causing the issue! I have already generated the 4.2.0-rc0 tag 4.2.0 RC0 binaries (https://dist.apache.org/repos/dist/dev/kafka/4.2.0-rc0/kafka_2.13-4.2.0.tgz) so feel free to create any additional runs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Official Docker image small Small PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants