Environment:Apache Kafka Release Toolchain Environment
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, Release_Engineering |
| Last Updated | 2026-02-09 12:00 GMT |
Overview
Python 3 environment with GPG, SVN, Git, and Gradle for executing the Apache Kafka release candidate staging process.
Description
The Release Toolchain Environment provides all tools required to create, sign, stage, and publish an Apache Kafka release candidate. It includes Python 3 with the `jira` and `jproperties` libraries (for JIRA interaction and Java properties file parsing), GNU Privacy Guard (GPG) for cryptographic signing, Apache Subversion (SVN) for staging artifacts to the ASF distribution repository, Git for branch and tag management, and Gradle for building the Kafka distribution. The release process is orchestrated by `release/release.py`, which invokes these tools in sequence.
Usage
Use this environment when executing the Release Candidate Staging workflow. All 8 steps of the release process (GPG validation, branch preparation, artifact building, release notes generation, signing, SVN staging, Maven publishing, and vote template creation) depend on this environment.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Linux or macOS | Release scripts use Unix-style paths and tools |
| Python | Python 3.x | Required for release scripts |
| Java | JDK 11+ | Required for Gradle builds |
| GPG | GNU Privacy Guard | Must have a valid GPG key configured |
| SVN | Apache Subversion | For staging to dist.apache.org |
| Git | Git CLI | For branch/tag management |
| Gradle | 9.2.1 (via wrapper) | Bundled with the repository |
| Network | Internet access | Required for JIRA API, SVN, Maven Central |
Dependencies
System Packages
- `python3`
- `gpg` (GNU Privacy Guard)
- `gpgconf` (GPG configuration utility)
- `svn` (Apache Subversion)
- `git`
- `java` >= 11
Python Packages
- `jira` == 3.8.0
- `jproperties` == 2.1.1
Credentials
The following credentials must be available:
- GPG Key: A valid GPG signing key must be present in the user's keyring with a known passphrase.
- ASF SVN Access: Write access to `https://dist.apache.org/repos/dist/dev/kafka` (ASF committer credentials).
- Maven Credentials: `mavenUsername` and `mavenPassword` Gradle properties for Maven Central staging.
- JIRA Access: Credentials for Apache JIRA (used by `jira` Python library for release notes).
Quick Install
# Install Python dependencies for release tooling
pip install jira==3.8.0 jproperties==2.1.1
# Verify GPG key
gpg --list-keys
# Verify SVN access
svn info https://dist.apache.org/repos/dist/dev/kafka
Code Evidence
Python dependencies from `release/requirements.txt:18-19`:
jira==3.8.0
jproperties==2.1.1
GPG validation from `release/gpg.py:29-56`:
def key_exists(key):
cmd(f"Checking for GPG key {key}",
f"gpg --list-keys {key}",
shell=True)
def valid_passphrase(key, passphrase):
cmd(f"Validating GPG passphrase for key {key}",
f"echo test | gpg --batch --pinentry-mode loopback --passphrase {passphrase} "
f"-u {key} --armor --detach-sig --output /dev/null",
shell=True)
SVN staging from `release/svn.py:28-45`:
SVN_DEV_URL = "https://dist.apache.org/repos/dist/dev/kafka"
def commit_artifacts(artifacts_dir, svn_dir, version, rc_num):
cmd(f"Checking out SVN dev dir",
f"svn checkout {SVN_DEV_URL} {svn_dir}",
shell=True)
Release work directory choice from `release/release.py:303-305`:
# Note that we don't use tempfile here because mkdtemp causes problems
# with being able to determine the absolute path to a file.
work_dir = os.path.join(repo_dir, ".release_work_dir")
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `gpg: No secret key` | GPG key not in keyring | Import your GPG key with `gpg --import` |
| `svn: E170013: Unable to connect` | SVN access denied | Verify ASF committer credentials |
| `jira.exceptions.JIRAError: 401` | Invalid JIRA credentials | Check JIRA authentication credentials |
| `FileNotFoundError: .release_work_dir` | First run without work directory | Script auto-creates; ensure write permissions in repo root |
Compatibility Notes
- macOS: Ensure GPG suite is installed (e.g., via `brew install gnupg`).
- Python 2: Not supported; release scripts require Python 3.
- Gradle Wrapper: The repository bundles Gradle 9.2.1 via the wrapper; no separate Gradle install needed.
- SVN: Required only for the artifact staging step; not needed for local testing.
Related Pages
- Implementation:Apache_Kafka_GPG_Key_Validation
- Implementation:Apache_Kafka_GPG_Signing
- Implementation:Apache_Kafka_SVN_Commit_Artifacts
- Implementation:Apache_Kafka_Notes_Generate
- Implementation:Apache_Kafka_Git_Branch_And_Tag_Management
- Implementation:Apache_Kafka_Git_Archive_And_Build
- Implementation:Apache_Kafka_Gradle_Maven_Publish
- Implementation:Apache_Kafka_Git_Push_And_Vote_Template