Skip to content

[kafka] Fix Kafka and Kafka Manager init actions on Dataproc 3.0+ - #1407

Open
IshaAg wants to merge 2 commits into
GoogleCloudDataproc:mainfrom
IshaAg:fix-kafka-dataproc30
Open

IshaAg wants to merge 2 commits into
GoogleCloudDataproc:mainfrom
IshaAg:fix-kafka-dataproc30

Conversation

@IshaAg

@IshaAg IshaAg commented Oct 4, 2026 •

Copy link
Copy Markdown

Summary

Fixes kafka/kafka.sh and kafka/kafka-manager.sh on Dataproc 3.0+ (including 4.0, Debian 13 and Ubuntu 24):

  • kafka/kafka.sh: Use the gpg key import path (instead of deprecated/removed apt-key) for all OSes when DATAPROC_IMAGE_VERSION >= 3.0.
  • kafka/kafka-manager.sh:
    • On DATAPROC_IMAGE_VERSION >= 3.0, skip sbt_old.list (rejected by Debian 13 sqv due to SHA-1) and import the sbt key via gpg --batch --yes --dearmor instead of deprecated gnupg-ring:.
    • Add ensure_java11() to install Java 11 (via openjdk-11-jdk, falling back to Adoptium Temurin 11 with amd64 -> x64 and arm64 -> aarch64 mapping) when the system JDK is >= 17, and pass -java-home "${JAVA_HOME}" to sbt so CMAK builds cleanly on Java 21 images.

Testing

Verified KafkaTest.testKafkaNonHACluster (running kafka/kafka.sh, kafka/cruise-control.sh, and kafka/kafka-manager.sh) passes end-to-end across all affected >= 3.0 tracks and flavors (exercising both openjdk-11-jdk apt on Ubuntu 24 and Temurin 11 fallback on Debian 13):

  • 3.0-debian13: PASSED
  • 3.0-ubuntu24: PASSED
  • 4.0-debian13: PASSED
  • 4.0-ubuntu24: PASSED

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the Kafka initialization scripts to support Dataproc image versions >= 3.0 and ensures Java 11 is installed and used when building CMAK. Key changes include conditional GPG key handling, the addition of an ensure_java11 helper function, and simplified OS checks in kafka.sh. Feedback on these changes highlights three critical improvements: validating that the parsed Java major version is a valid integer before comparison to avoid bash syntax errors, mapping the arm64 architecture to aarch64 for the Adoptium API to prevent download failures on ARM-based instances, and adding --batch --yes to the gpg --dearmor command to prevent interactive prompts during non-interactive execution.

Comment thread kafka/kafka-manager.sh Resolved
Comment thread kafka/kafka-manager.sh Resolved
Comment thread kafka/kafka-manager.sh Resolved
@IshaAg IshaAg changed the title [kafka] Fix Kafka and Kafka Manager initialization actions on Datapro… [kafka] Fix Kafka and Kafka Manager init actions on Dataproc 3.0+ Dec 4, 2026
@IshaAg
IshaAg marked this pull request as ready for review December 4, 2026 11:45
@IshaAg
IshaAg requested a review from vinayakumarb December 4, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant