ashwinpankaj commented on code in PR #14552:
URL: https://github.com/apache/kafka/pull/14552#discussion_r1412913504


##########
docker/jvm/Dockerfile:
##########
@@ -0,0 +1,100 @@
+###############################################################################
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+# limitations under the License.
+###############################################################################
+
+FROM golang:latest AS build-utility
+WORKDIR /build
+RUN useradd --no-log-init --create-home --shell /bin/bash appuser
+COPY --chown=appuser:appuser resources/utility/ ./
+
+# Generate utility executable for dealing with env variables
+RUN go build -ldflags="-w -s" ./utility.go
+USER appuser
+RUN go test ./...
+
+
+FROM eclipse-temurin:21-jre-alpine AS build-jsa
+
+USER root
+
+# Get kafka from https://archive.apache.org/dist/kafka and pass the url 
through build arguments
+ARG kafka_url
+
+COPY jsa_launch /etc/kafka/docker/jsa_launch
+
+RUN set -eux ; \
+    apk update ; \
+    apk upgrade ; \
+    apk add --no-cache wget gcompat procps netcat-openbsd; \
+    mkdir opt/kafka; \
+    wget -nv -O kafka.tgz "$kafka_url"; \

Review Comment:
   could we add an gpg check ?



##########
docker/README.md:
##########
@@ -0,0 +1,72 @@
+Docker Images
+=============
+
+This directory contains docker image for Kafka.
+The scripts take a url containing kafka as input and generate the respective 
docker image.
+There are interactive python scripts to release the docker image and promote a 
release candidate.
+
+Local Setup
+-----------
+Make sure you have python (>= 3.7.x) and java (>= 17) installed before running 
the tests and scripts.
+
+Run `pip install -r requirements.txt` to get all the requirements for running 
the scripts.
+
+Bulding image and running tests locally
+---------------------------------------
+- `docker_build_test.py` script builds and tests the docker image.
+- kafka binary tarball url along with image name, tag and type is needed to 
build the image. For detailed usage description check `python 
docker_build_test.py --help`.
+- Sanity tests for the docker image are present in test/docker_sanity_test.py.
+- By default image will be built and tested, but if you only want to build the 
image, pass `-b` flag and if you only want to test the given image pass `-t` 
flag.
+- An html test report will be generated after the tests are executed 
containing the results.
+
+Bulding image and running tests using github actions
+----------------------------------------------------
+This is the recommended way to build, test and get a CVE report for the docker 
image.
+Just choose the image type and provide kafka url to `Docker build test` 
workflow. It will generate a test report and CVE report that can be shared to 
the community.

Review Comment:
   can we provide examples for image-type and kafka-url please ? 



##########
docker/jvm/Dockerfile:
##########
@@ -0,0 +1,100 @@
+###############################################################################
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+# limitations under the License.
+###############################################################################
+
+FROM golang:latest AS build-utility
+WORKDIR /build
+RUN useradd --no-log-init --create-home --shell /bin/bash appuser
+COPY --chown=appuser:appuser resources/utility/ ./
+
+# Generate utility executable for dealing with env variables
+RUN go build -ldflags="-w -s" ./utility.go

Review Comment:
   
   
   this is the first use of golang in this project - can't this utility be 
implemented in python?
   



##########
docker/jvm/jsa_launch:
##########
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+KAFKA_CLUSTER_ID="5L6g3nShT-eMCtK--X86sw"
+
+KAFKA_JVM_PERFORMANCE_OPTS="-XX:ArchiveClassesAtExit=storage.jsa" 
opt/kafka/bin/kafka-storage.sh format -t $KAFKA_CLUSTER_ID -c 
opt/kafka/config/kraft/server.properties
+
+KAFKA_JVM_PERFORMANCE_OPTS="-XX:ArchiveClassesAtExit=kafka.jsa" 
opt/kafka/bin/kafka-server-start.sh opt/kafka/config/kraft/server.properties &

Review Comment:
   doesn't this overwrite value of KAFKA_JVM_PERFORMANCE_OPTS set in L19 ?



##########
docker/resources/common-scripts/server.properties:
##########
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+advertised.listeners=PLAINTEXT://localhost:29092,PLAINTEXT_HOST://localhost:9092
+controller.listener.names=CONTROLLER
+controller.quorum.voters=1@localhost:29093
+group.initial.rebalance.delay.ms=0
+inter.broker.listener.name=PLAINTEXT
+listener.security.protocol.map=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
+listeners=PLAINTEXT://localhost:29092,CONTROLLER://localhost:29093,PLAINTEXT_HOST://0.0.0.0:9092

Review Comment:
   just curious, any reason why the port numbering scheme is different ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to