Skip to content

MINOR: Update JDK fetch logic for version 25 and improve path handling#21394

Draft
tirthooo7 wants to merge 4 commits intoapache:trunkfrom
confluentinc:jdk-25-upgrade-trunk-ak
Draft

MINOR: Update JDK fetch logic for version 25 and improve path handling#21394
tirthooo7 wants to merge 4 commits intoapache:trunkfrom
confluentinc:jdk-25-upgrade-trunk-ak

Conversation

@tirthooo7
Copy link

@tirthooo7 tirthooo7 commented Feb 3, 2026

Summary

Fixes bugs where --jdk-version and --jdk-arch parameters were ignored, and refactors Vagrant provisioning (vagrant/base.sh) to support flexible JDK versions without code changes.

Bug Fixes

This PR fixes two bugs documented in JDK Version and Architecture Flow:

Bug Problem Fix
#1: --jdk-version ignored JDK_FULL was hardcoded to 17-linux-x64, so passing --jdk-version 25 still downloaded JDK 17 S3 URL now constructed dynamically from JDK_VERSION
#2: --jdk-arch ignored Architecture parameter was passed but never used in download URL S3 URL now includes JDK_ARCH (e.g., x64, aarch64)

Before (Broken)

# --jdk-version 25 --jdk-arch aarch64
JDK_FULL="${JDK_FULL:-17-linux-x64}"  # Hardcoded! Always downloads JDK 17 x64

After (Fixed)

# S3 URL dynamically constructed from parameters
s3_url="kafka-packages/jdk/jdk-${JDK_VERSION}-linux-${JDK_ARCH}.tar.gz"

Background

The Kafka system tests (System-test-Kafka-Branch-Builder and Scheduler-Trunk Nightly) provision EC2 worker nodes via Terraform, which use vagrant/base.sh to set up the test environment.

Changes

vagrant/base.sh

  • Unified S3 path: All JDK versions now use a single URL pattern: kafka-packages/jdk/jdk-{VERSION}-linux-{ARCH}.tar.gz
  • Full version support: Introduced JDK_VERSION variable following Oracle Runtime.Version naming. Supports: 17, 25.0.2, 8u202, etc.
  • Architecture support: JDK_ARCH now correctly used in download URL (x64 or aarch64)
  • Backward compatibility: Falls back to JDK_MAJOR if JDK_VERSION is not set
  • Auto-extract major version: JDK_MAJOR is derived from JDK_VERSION for install directory naming
  • Validation: Error handling for invalid JDK_VERSION format
  • Added logging: Configuration and download status messages for debugging

vagrant/aws-packer.json

  • Changed environment variable from JDK_MAJOR to JDK_VERSION to pass full version string to base.sh

.gitignore

  • Added .claude/ directory

Benefits

Before After
--jdk-version ignored ✅ Correctly uses specified version
--jdk-arch ignored ✅ Correctly uses specified architecture
Only major version support Full version support (e.g., 25.0.2)
Code change needed for new JDK Just upload to S3, pass version

Adding New JDK Versions

No code changes required. To add support for a new JDK version:

  1. Upload JDK to S3: Follow Uploading JDK to kafka-packages S3 Bucket

    • File naming: jdk-{VERSION}-linux-{ARCH}.tar.gz
    • Upload to: s3://kafka-packages/jdk/
  2. Run tests: Trigger System-test-Kafka-Branch-Builder with JDK_VERSION={new-version}

Usage

Parameter S3 File
JDK_VERSION=17 jdk/jdk-17-linux-x64.tar.gz
JDK_VERSION=25.0.2 jdk/jdk-25.0.2-linux-x64.tar.gz
JDK_VERSION=21.0.1 jdk/jdk-21.0.1-linux-x64.tar.gz

Testing

In apache:trunk, system tests are supported only via Vagrant. However, due to a recent change in the tagging policy, branch-builder tests using Vagrant can no longer be run (see failure here).

To validate these changes, I created an equivalent PR in the Confluent repo: confluentinc#1888, based on https://github.com/confluentinc/kafka/tree/master, which includes Terraform support. I validated the changes using Terraform-based system tests there (refer to the Testing section in the PR description).

Related Links

@github-actions github-actions bot added tools small Small PRs triage PRs from the community labels Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

small Small PRs tools triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant