You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ma...@apache.org on 2024/06/10 12:35:23 UTC
(kafka) branch 3.8 updated (a2760e0131e -> 113baae977c)
This is an automated email from the ASF dual-hosted git repository.
manikumar pushed a change to branch 3.8
in repository https://gitbox.apache.org/repos/asf/kafka.git
from a2760e0131e MINOR: Rename uniform assignor's internal builders (#16233)
new deeb847e83b modifying Readme for Docker official images (#16226)
new 113baae977c [MINOR] KAFKA-16373: KIP-1028: Modifying dockerfile comments (#16261)
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
docker/README.md | 41 +++++++++++++++++++++++++-
docker/prepare_docker_official_image_source.py | 8 +++--
2 files changed, 46 insertions(+), 3 deletions(-)
(kafka) 01/02: modifying Readme for Docker official images (#16226)
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
manikumar pushed a commit to branch 3.8
in repository https://gitbox.apache.org/repos/asf/kafka.git
commit deeb847e83bdd334793939a691508b82c43e1af7
Author: KrishVora01 <15...@users.noreply.github.com>
AuthorDate: Mon Jun 10 12:11:13 2024 +0530
modifying Readme for Docker official images (#16226)
This PR aims to modify the README file under /docker, to include the steps to release the Docker Official Images.
Reviewers: Manikumar Reddy <ma...@gmail.com>, Vedarth Sharma <ve...@confluent.io>
---
docker/README.md | 41 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 40 insertions(+), 1 deletion(-)
diff --git a/docker/README.md b/docker/README.md
index 54d15c04feb..a23c754c3b7 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -4,7 +4,7 @@ Docker Images
Introduction
------------
-This directory contains scripts to build, test, push and promote docker image for kafka.
+This directory contains scripts to build, test, push and promote docker image for kafka. It also contains scripts to build, test the JVM-based Docker Official Image, and generate a PR template for the same to be raised under the Docker official images repo.
All of the steps can be either performed locally or by using Github Actions.
Github Actions
@@ -135,3 +135,42 @@ Using the image in a docker container
-------------------------------------
Please check [this](./examples/README.md) for usage guide of the docker image.
+
+Releasing the Docker Official Image
+-----------------------------------
+
+- This is the recommended way to release docker official image.
+- Ensure these steps are being run for a particular version, only once the AK release process for that version has been completed.
+
+- Provide the image type and kafka version to `Docker Prepare Docker Official Image Source` workflow. It will generate a artifact containing the static Dockerfile and assets for that specific version. Download the same from the workflow.
+
+```
+image_type: jvm
+kafka_version: 3.7.0
+```
+
+- Run the `docker/extract_docker_official_image_artifact.py` script, by providing it the path to the downloaded artifact. This will create a new directory under `docker/docker_official_images/kafka_version`.
+
+```
+python extract_docker_official_image_artifact.py --path_to_downloaded_artifact=path/to/downloaded/artifact
+```
+
+- If there any versions for which Docker Official Images should not be supported, remove the corresponding directories under `docker/docker_official_images`.
+- Commit these changes to AK trunk.
+
+- Provide the image type and kafka version to `Docker Official Image Build Test` workflow. It will generate a test report and CVE report that can be shared with the community.
+
+```
+image_type: jvm
+kafka_version: 3.7.0
+```
+
+- Run the `docker/generate_kafka_pr_template.py` script from trunk, by providing it the image type. Update the existing entry, and raise a new PR in [Docker Hub's Docker Official Repo](https://github.com/docker-library/official-images/tree/master/library/kafka) by using this new PR template.
+
+```
+python generate_kafka_pr_template.py --image-type=jvm
+```
+
+- kafka-version - This is the version to create the Docker official images static Dockerfile and assets for, as well as the version to build and test the Docker official image for.
+- image-type - This is the type of image that we intend to build. This will be dropdown menu type selection in the workflow. `jvm` image type is for official docker image (to be hosted on apache/kafka) as described in [KIP-975](https://cwiki.apache.org/confluence/display/KAFKA/KIP-975%3A+Docker+Image+for+Apache+Kafka). As of now [KIP-1028](https://cwiki.apache.org/confluence/display/KAFKA/KIP-1028%3A+Docker+Official+Image+for+Apache+Kafka) only aims to release JVM based Docker Official Images.
+
(kafka) 02/02: [MINOR] KAFKA-16373: KIP-1028: Modifying dockerfile comments (#16261)
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
manikumar pushed a commit to branch 3.8
in repository https://gitbox.apache.org/repos/asf/kafka.git
commit 113baae977ce0466558eafbbb5281e0b0cb151b0
Author: KrishVora01 <15...@users.noreply.github.com>
AuthorDate: Mon Jun 10 14:55:55 2024 +0530
[MINOR] KAFKA-16373: KIP-1028: Modifying dockerfile comments (#16261)
This PR aims to add the replace the dockerfile comments under the jvm/dockerfile Dockerfile, with updated url.
The original comment read
# Get kafka from https://archive.apache.org/dist/kafka and pass the url through build arguments . For DOI dockerfiles, we replace this with
# Get Kafka from https://downloads.apache.org/kafka, url passed as env var, for version {kafka_version} .
Reviewers: Manikumar Reddy <ma...@gmail.com>, Vedarth Sharma <ve...@confluent.io>
---
docker/prepare_docker_official_image_source.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/docker/prepare_docker_official_image_source.py b/docker/prepare_docker_official_image_source.py
index a39915c9e51..10b4f04d78f 100644
--- a/docker/prepare_docker_official_image_source.py
+++ b/docker/prepare_docker_official_image_source.py
@@ -36,14 +36,18 @@ import argparse
from distutils.dir_util import copy_tree
import os
import shutil
+import re
-def remove_args_and_hardcode_values(file_path, kafka_url):
+def remove_args_and_hardcode_values(file_path, kafka_version, kafka_url):
with open(file_path, 'r') as file:
filedata = file.read()
filedata = filedata.replace("ARG kafka_url", f"ENV kafka_url {kafka_url}")
filedata = filedata.replace(
"ARG build_date", f"ENV build_date {str(date.today())}")
+ original_comment = re.compile(r"# Get kafka from https://archive.apache.org/dist/kafka and pass the url through build arguments")
+ updated_comment = f"# Get Kafka from https://downloads.apache.org/kafka, url passed as env var, for version {kafka_version}"
+ filedata = original_comment.sub(updated_comment, filedata)
with open(file_path, 'w') as file:
file.write(filedata)
@@ -65,4 +69,4 @@ if __name__ == '__main__':
copy_tree(os.path.join(current_dir, args.image_type), os.path.join(new_dir, args.kafka_version, args.image_type))
copy_tree(os.path.join(current_dir, 'resources'), os.path.join(new_dir, args.kafka_version, args.image_type, 'resources'))
remove_args_and_hardcode_values(
- os.path.join(new_dir, args.kafka_version, args.image_type, 'Dockerfile'), kafka_url)
+ os.path.join(new_dir, args.kafka_version, args.image_type, 'Dockerfile'), args.kafka_version, kafka_url)