Commit 99fafc4
KAFKA-19876 Use eclipse-temurin as the base image to align with 3.9 (#20945)
`sapmachine` doesn't support JDK 8, so we switched to use
`eclipse-temurin` so that previous AK versions such as AK 3.9 (#20897)
can use the same image provider.
We also use symlinks to fix the java path problem for
`eclipse-temurin`, based on a solution proposed by @unknowntpo.
# Java path problem and its solution
After switching to `eclipse-temurin`, we encountered a `java not found`
problem.
This was unexpected because we had already written PATH to
`~/.ssh/environment` and set `PermitUserEnvironment yes` in
`sshd_config`.
It turns out that the `PAM (Pluggable Authentication Modules)` re-reads
`/etc/environment` after `~/.ssh/environment`. Unfortunately, there is a
`PATH` variable in `/etc/environment` in ubuntu, which overwrites the
`PATH` from `~/.ssh/environment`. Some images didn't have this problem
because the java path was already in `PATH` before we changed it.
The possible solutions are:
* Prevent PAM from reading `/etc/environment` by editing
`/etc/pam.d/sshd`
* Write PATH to `~/.pam_environment` (ref: [help.ubuntu
article](https://help.ubuntu.com/community/EnvironmentVariables#A.2BAH4-.2F.pam_environment))
* Write PATH to `/etc/environment/`
* Add a symlink so that java can be found without changing PATH
However, we think first two solutions are prone to being
distribution-specific. Modifying `/etc/environment` affects all users'
`PATH`, which is not ideal. Therefore, we adopt the symlink solution
suggested by @unknowntpo
Passed `pluggable_test` on my local mac with image
`eclipse-temurin:17-jdk-jammy`
```
> TC_PATHS="tests/kafkatest/tests/client/pluggable_test.py" bash
tests/docker/run_tests.sh
...
docker build --memory=3200m --build-arg ducker_creator= --build-arg
jdk_version=eclipse-temurin:17-jdk-jammy --build-arg UID=501 --build-arg
KAFKA_MODE=jvm -t ducker-ak-eclipse-temurin-17-jdk-jammy -f
/Users/ming/code/kafka/tests/docker/Dockerfile -- .
...
================================================================================
SESSION REPORT (ALL TESTS)
ducktape version: 0.12.0
session_id: 2025-11-21--001
run time: 15.249 seconds
tests run: 1
passed: 1
flaky: 0
failed: 0
ignored: 0
================================================================================
test_id:
kafkatest.tests.client.pluggable_test.PluggableConsumerTest.test_start_stop.metadata_quorum=ISOLATED_KRAFT
status: PASS
run time: 15.103 seconds
--------------------------------------------------------------------------------
```
Reviewers: Chia-Ping Tsai <[email protected]>
Co-authored-by: Eric Chang <[email protected]>1 parent e8459d3 commit 99fafc4
2 files changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
154 | 152 | | |
155 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
0 commit comments