Skip to content

[pick-changes] | Merge pull request #1970 from confluentinc/Java-21-A… #1997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions molecule/Dockerfile-amazonlinux2023.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ RUN yum -y install rpm \
&& yum install -y systemd \
&& yum clean all

# Install Amazon Corretto 21
RUN yum -y install java-21-amazon-corretto

# Enable systemd
CMD ["/sbin/init"]

Expand Down
2 changes: 1 addition & 1 deletion molecule/Dockerfile-centos8-base.j2
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers
VOLUME ["/sys/fs/cgroup"]
CMD ["/usr/lib/systemd/systemd"]

RUN yum -y install java-11-openjdk \
RUN yum -y install java-17-openjdk \
rsync \
openssl \
procps \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN apt-get update && \
apt-transport-https \
gnupg \
software-properties-common \
openjdk-8-jdk \
openjdk-21-jdk \
rsync \
ca-certificates \
openssl \
Expand Down
9 changes: 5 additions & 4 deletions molecule/Dockerfile-debian12.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ RUN apt-get update && \

{% set ARCHITECTURE_SHORTHAND = lookup('env', 'ARCHITECTURE_SHORTHAND') | default ('x64', true) %}

RUN wget https://download.java.net/java/GA/jdk17.0.1/2a2082e5a09d4267845be086888add4f/12/GPL/openjdk-17.0.1_linux-{{ ARCHITECTURE_SHORTHAND }}_bin.tar.gz
RUN tar xvf openjdk-17.0.1_linux-{{ ARCHITECTURE_SHORTHAND }}_bin.tar.gz
RUN sudo mv jdk-17*/ /opt/jdk17
RUN rm -rf openjdk-17.0.1_linux-{{ ARCHITECTURE_SHORTHAND }}_bin.tar.gz
RUN wget https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/13/GPL/openjdk-21.0.2_linux-{{ ARCHITECTURE_SHORTHAND }}_bin.tar.gz && \
tar xvf openjdk-21.0.2_linux-{{ ARCHITECTURE_SHORTHAND }}_bin.tar.gz && \
sudo mv jdk-21*/ /opt/jdk21 && \
ln -s /opt/jdk21/bin/java /usr/bin/java && \
rm -rf openjdk-21.0.2_linux-{{ ARCHITECTURE_SHORTHAND }}_bin.tar.gz

# Create a systemd service for running in the container
RUN mkdir -p /etc/systemd/system/docker.service.d && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers
VOLUME ["/sys/fs/cgroup"]
CMD ["/usr/lib/systemd/systemd"]

RUN yum -y install java-11-openjdk \
RUN yum -y install java-21-openjdk \
rsync \
openssl \
rsyslog \
Expand All @@ -39,7 +39,8 @@ RUN yum -y install java-11-openjdk \
unzip \
procps \
procps-ng \
tzdata-java
tzdata-java \
tar

{% set DEFAULT_PACKAGE_VER = lookup('pipe', "awk '/confluent_package_version:/ {print $2}' $MOLECULE_PROJECT_DIRECTORY/roles/variables/defaults/main.yml" ) %}
{% set PACKAGE_VER = lookup('env', 'VERSION') | default(DEFAULT_PACKAGE_VER, true) %}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM {{ item.image }}

RUN mkdir -p /usr/share/man/man1 && \
apt-get update -y && \
apt-get install -y openjdk-11-jdk wget gnupg vim jq && \
apt-get install -y openjdk-21-jdk wget gnupg vim jq && \
apt-get install -y dirmngr

{% set DEFAULT_PACKAGE_VER = lookup('pipe', "awk '/confluent_package_version:/ {print $2}' $MOLECULE_PROJECT_DIRECTORY/roles/variables/defaults/main.yml" ) %}
Expand Down
34 changes: 0 additions & 34 deletions molecule/Dockerfile-ubuntu-java8.j2

This file was deleted.

2 changes: 1 addition & 1 deletion molecule/archive-plain-debian/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ provisioner:
kafka_connect_log_dir: /connect/logs
ksql_log_dir: /ksql/logs/
control_center_log_dir: /c3/logs
custom_java_path: /opt/jdk17 # Use custom java 17
custom_java_path: /opt/jdk21 # Use custom java 21
4 changes: 2 additions & 2 deletions molecule/archive-plain-debian/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
shell: java -version
register: version_output

- name: Assert Java Version is 17
- name: Assert Java Version is 21
assert:
that:
- version_output.stderr_lines[0] | regex_search("17\.0\.")
- version_output.stderr_lines[0] | regex_search("21\.")
fail_msg: "Current Java Version is: {{version_output.stderr_lines[0]}}. Verify again"
quiet: true

Expand Down
24 changes: 12 additions & 12 deletions molecule/archive-zookeeper-tls-rhel-fips/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,18 @@ platforms:
privileged: true
networks:
- name: confluent
Copy link
Preview

Copilot AI May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include a comment explaining why the 'control-center1' configuration is commented out to increase clarity and aid future maintenance.

Suggested change
- name: confluent
- name: confluent
# The control-center1 configuration is currently disabled because the Control Center service
# is not required for this deployment. Uncomment and configure as needed for environments
# where Control Center is necessary.

Copilot uses AI. Check for mistakes.

- name: control-center1
hostname: control-center1.confluent
groups:
- control_center
image: rockylinux:8-minimal
dockerfile: ../Dockerfile-rhel-java17.j2
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
networks:
- name: confluent
# - name: control-center1
# hostname: control-center1.confluent
# groups:
# - control_center
# image: rockylinux:8-minimal
# dockerfile: ../Dockerfile-rhel-java17.j2
# command: ""
# volumes:
# - /sys/fs/cgroup:/sys/fs/cgroup:ro
# privileged: true
# networks:
# - name: confluent
provisioner:
name: ansible
config_options:
Expand Down
48 changes: 24 additions & 24 deletions molecule/broker-scale-up/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,33 +56,33 @@
- broker_cnt.stdout == "3"
when: kraft_mode|bool

- name: Verify New brokers are not there in control-center properties
hosts: control_center
gather_facts: false
tasks:
- name: Check line brokers list - Exact Match should have new brokers as well
import_role:
name: confluent.test
tasks_from: check_property.yml
vars:
file_path: /etc/confluent-control-center/control-center-production.properties
property: bootstrap.servers
expected_value: kafka-broker1:9092,kafka-broker2:9092,kafka-broker3:9092
# - name: Verify New brokers are not there in control-center properties
# hosts: control_center
# gather_facts: false
# tasks:
# - name: Check line brokers list - Exact Match should have new brokers as well
# import_role:
# name: confluent.test
# tasks_from: check_property.yml
# vars:
# file_path: /etc/confluent-control-center/control-center-production.properties
# property: bootstrap.servers
# expected_value: kafka-broker1:9092,kafka-broker2:9092,kafka-broker3:9092

- name: Grep newly added broker names in proeprty file
shell: grep "^{{ property }}" {{ file_path }}
register: bootstrap_servers
vars:
file_path: /etc/confluent-control-center/control-center-production.properties
property: bootstrap.servers
# - name: Grep newly added broker names in proeprty file
# shell: grep "^{{ property }}" {{ file_path }}
# register: bootstrap_servers
# vars:
# file_path: /etc/confluent-control-center/control-center-production.properties
# property: bootstrap.servers

- name: Check broker4 should not be available in bootstrap Server urls
assert:
that: 'not "kafka-broker4" in bootstrap_servers.stdout'
# - name: Check broker4 should not be available in bootstrap Server urls
# assert:
# that: 'not "kafka-broker4" in bootstrap_servers.stdout'

- name: Check broker5 should not be available in bootstrap Server urls
assert:
that: 'not "kafka-broker5" in bootstrap_servers.stdout'
# - name: Check broker5 should not be available in bootstrap Server urls
# assert:
# that: 'not "kafka-broker5" in bootstrap_servers.stdout'

- name: Add new brokers Nodes into in-memory inventory to scale-up
hosts: all
Expand Down
2 changes: 1 addition & 1 deletion molecule/ccloud/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- kafka_connect
- kafka_rest
- ksql
- control_center
# - control_center
Copy link
Preview

Copilot AI May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the 'control_center' inventory entry is intentionally disabled, please document the reasoning to help future maintainers understand the impact on the configuration.

Suggested change
# - control_center
# - control_center
# The 'control_center' inventory entry is intentionally disabled because it is not required
# in the current configuration. Re-enabling it may impact the deployment of other components.

Copilot uses AI. Check for mistakes.


# There are two schema_registry groups in the inventory file
- name: Change schema_registry group name
Expand Down
70 changes: 35 additions & 35 deletions molecule/ccloud/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,38 +149,38 @@
property: confluent.controlcenter.command.topic.replication
expected_value: "3"

- name: Check Max Message Bytes Property
import_role:
name: confluent.test
tasks_from: check_property.yml
vars:
file_path: /etc/confluent-control-center/control-center-production.properties
property: confluent.metrics.topic.max.message.bytes
expected_value: "8388608"

- name: Check jaas config properly set
import_role:
name: confluent.test
tasks_from: check_property.yml
vars:
file_path: /etc/confluent-control-center/control-center-production.properties
property: confluent.monitoring.interceptor.sasl.jaas.config
expected_value: 'org.apache.kafka.common.security.plain.PlainLoginModule required username="client" password="client-secret";'

- name: Check schema registry url
import_role:
name: confluent.test
tasks_from: check_property.yml
vars:
file_path: /etc/confluent-control-center/control-center-production.properties
property: confluent.controlcenter.schema.registry.url
expected_value: https://ccloud-schema-registry1:8081

- name: Check schema registry creds
import_role:
name: confluent.test
tasks_from: check_property.yml
vars:
file_path: /etc/confluent-control-center/control-center-production.properties
property: confluent.controlcenter.schema.registry.basic.auth.user.info
expected_value: admin:admin-secret
# - name: Check Max Message Bytes Property
# import_role:
# name: confluent.test
# tasks_from: check_property.yml
# vars:
# file_path: /etc/confluent-control-center/control-center-production.properties
# property: confluent.metrics.topic.max.message.bytes
# expected_value: "8388608"

# - name: Check jaas config properly set
# import_role:
# name: confluent.test
# tasks_from: check_property.yml
# vars:
# file_path: /etc/confluent-control-center/control-center-production.properties
# property: confluent.monitoring.interceptor.sasl.jaas.config
# expected_value: 'org.apache.kafka.common.security.plain.PlainLoginModule required username="client" password="client-secret";'

# - name: Check schema registry url
# import_role:
# name: confluent.test
# tasks_from: check_property.yml
# vars:
# file_path: /etc/confluent-control-center/control-center-production.properties
# property: confluent.controlcenter.schema.registry.url
# expected_value: https://ccloud-schema-registry1:8081

# - name: Check schema registry creds
# import_role:
# name: confluent.test
# tasks_from: check_property.yml
# vars:
# file_path: /etc/confluent-control-center/control-center-production.properties
# property: confluent.controlcenter.schema.registry.basic.auth.user.info
# expected_value: admin:admin-secret
12 changes: 6 additions & 6 deletions molecule/certificates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@
loop: "{{groups['ksql']}}"
when: groups['ksql'] is defined

Copy link
Preview

Copilot AI May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include an explanation for commenting out this certificate configuration task to confirm that the removal is intentional and to aid future maintenance.

Suggested change
# The task for writing control_center hostnames for certificate creation is commented out
# because the control_center group is not currently used in this deployment. If this changes
# in the future, uncomment the task below and ensure the control_center group is properly defined.

Copilot uses AI. Check for mistakes.

- name: Write control_center hostnames for cert creation
lineinfile:
line: "control_center:{{item}}"
path: /var/ssl/private/generation/certificate-hosts
loop: "{{groups['control_center']}}"
when: groups['control_center'] is defined
# - name: Write control_center hostnames for cert creation
# lineinfile:
# line: "control_center:{{item}}"
# path: /var/ssl/private/generation/certificate-hosts
# loop: "{{groups['control_center']}}"
# when: groups['control_center'] is defined

- name: Write ldap hostnames for cert creation
lineinfile:
Expand Down
30 changes: 15 additions & 15 deletions molecule/confluent-kafka-kerberos-customcerts-rhel/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,21 +149,21 @@ platforms:
privileged: true
networks:
- name: confluent
Copy link
Preview

Copilot AI May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment detailing the reason for disabling the 'control-center1' platform configuration to assist future maintainers in understanding the change.

Suggested change
- name: confluent
- name: confluent
# The 'control-center1' platform configuration has been disabled due to compatibility issues with the current setup.
# Specifically, it requires additional resources and configurations that are not supported in this environment.
# Future maintainers can re-enable this configuration after addressing the compatibility concerns.

Copilot uses AI. Check for mistakes.

- name: control-center1
hostname: control-center1.confluent
groups:
- control_center
- control_center_migration
image: redhat/ubi9-minimal
dockerfile: ../Dockerfile-rhel-java17.j2
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
published_ports:
- "9021:9021"
networks:
- name: confluent
# - name: control-center1
# hostname: control-center1.confluent
# groups:
# - control_center
# - control_center_migration
# image: redhat/ubi9-minimal
# dockerfile: ../Dockerfile-rhel-java17.j2
# command: ""
# volumes:
# - /sys/fs/cgroup:/sys/fs/cgroup:ro
# privileged: true
# published_ports:
# - "9021:9021"
# networks:
# - name: confluent
# Cluster 2 (Kraft) goups, groupnames will be changed during converge phase
- name: controller1-mig
hostname: controller1-mig.confluent
Expand Down
16 changes: 8 additions & 8 deletions molecule/connect-scale-up/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@
property: confluent.controlcenter.connect.connect-cluster2.cluster
expected_value: http://kafka-connect2:8083,http://kafka-connect5:8083

- name: Check line connect cluster ssl
import_role:
name: confluent.test
tasks_from: check_property.yml
vars:
file_path: /etc/confluent-control-center/control-center-production.properties
property: confluent.controlcenter.connect.connect-ssl.cluster
expected_value: https://kafka-connect3:8083,https://kafka-connect4:8083
# - name: Check line connect cluster ssl
# import_role:
# name: confluent.test
# tasks_from: check_property.yml
# vars:
# file_path: /etc/confluent-control-center/control-center-production.properties
# property: confluent.controlcenter.connect.connect-ssl.cluster
# expected_value: https://kafka-connect3:8083,https://kafka-connect4:8083
1 change: 0 additions & 1 deletion molecule/custom-user-plaintext-rhel/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ platforms:
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
# Commenting below to avoid port collision on jenkins server
# Uncomment to view c3 in browser at localhost:9021
# published_ports:
# - "9021:9021"
Expand Down
2 changes: 1 addition & 1 deletion molecule/kerberos-rhel/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
vars:
connect_url_input: "{{ kafka_connect_url }}"
active_connectors_input: "{{ add_non_existent_connector }}"
expected_message: "Connectors added or updated: test-connector-1: no configuration change, test-connector-2: ERROR error while adding new connector configuration (HTTP Error 500: Internal Server Error)."
expected_message: "Connectors added or updated: test-connector-1: no configuration change, test-connector-2: ERROR error while adding new connector configuration (HTTP Error 500: Server Error)."
Copy link
Preview

Copilot AI May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider reviewing the updated error message; using 'Server Error' instead of the standard 'Internal Server Error' may lead to mismatches if the application returns the expected standard phrase.

Suggested change
expected_message: "Connectors added or updated: test-connector-1: no configuration change, test-connector-2: ERROR error while adding new connector configuration (HTTP Error 500: Server Error)."
expected_message: "Connectors added or updated: test-connector-1: no configuration change, test-connector-2: ERROR error while adding new connector configuration (HTTP Error 500: Internal Server Error)."

Copilot uses AI. Check for mistakes.


- import_role:
name: confluent.test
Expand Down
2 changes: 1 addition & 1 deletion molecule/mini-setup-oauth-mtls/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ platforms:
privileged: true
networks:
- name: confluent
# Cluster 2 (Kraft) goups, groupnames will be changed during converge phase
# # Cluster 2 (Kraft) goups, groupnames will be changed during converge phase
- name: controller1-mig
hostname: controller1-mig.confluent
groups:
Expand Down
Loading