You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "see-quick (via GitHub)" <gi...@apache.org> on 2026/06/15 13:04:41 UTC
[PR] KAFKA-20377: Add to pass additional Docker build arguments in the system tests [kafka]
see-quick opened a new pull request, #22578:
URL: https://github.com/apache/kafka/pull/22578
Currently, passing additional Docker build arguments to ducker-ak requires using sed to rewrite the script at runtime i.e.,:
```bash
${SED} -i "s|\${docker_args}|${ADDITIONAL_BUILD_ARGS}|" tests/docker/ducker-ak
```
This is fragile (any rename in ducker-ak silently breaks it), mutates a checked-in source file during CI, and requires a hardcoded list of supported args that must be updated for every new build arg.
This PR adds native` --build-arg` support to ducker-ak, following the same CLI > ENV > default pattern established by --memory (KAFKA-20378) and --skip-build (KAFKA-20379). The same CI workflow becomes:
```bash
DOCKER_BUILD_ARGS="--build-arg BASE_IMAGE=base-image --build-arg PYTHON_VERSION=3.11 --build-arg ANOTHER_ARG_NAME=another-arg-name" ./tests/docker/run_tests.sh
// or via ducker-ak up
./tests/docker/ducker-ak up --build-arg BASE_IMAGE=base-image --build-arg PYTHON_VERSION=3.11 ...
```
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20377: Add to pass additional Docker build arguments in the system tests [kafka]
Posted by "see-quick (via GitHub)" <gi...@apache.org>.
see-quick commented on code in PR #22578:
URL: https://github.com/apache/kafka/pull/22578#discussion_r3422940378
##########
tests/docker/ducker-ak:
##########
@@ -417,10 +423,12 @@ ducker_up() {
-c|--clean-build) set_once clean_build "true" "clean build"; shift;;
-m|--kafka_mode) set_once kafka_mode "${2}" "the mode in which kafka will run"; shift 2;;
--memory) set_once docker_run_memory_limit "${2}" "the container memory limit"; shift 2;;
+ --build-arg) verify_command_line_argument "${2}" "docker build arg"; docker_args="${docker_args} --build-arg ${2}"; shift 2;;
--ipv6) set_once ipv6 "true" "enable IPv6"; shift;;
*) set_once image_name "${1}" "container image name"; shift;;
esac
done
+ [[ -n "${docker_args}" ]] || docker_args="${DOCKER_BUILD_ARGS:-}"
Review Comment:
I wonder how much beneficial would that be. Do you think that anybody will combine both of those approaches (i.e., CLI and ENV)?
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20377: Add to pass additional Docker build arguments in the system tests [kafka]
Posted by "see-quick (via GitHub)" <gi...@apache.org>.
see-quick commented on code in PR #22578:
URL: https://github.com/apache/kafka/pull/22578#discussion_r3422940378
##########
tests/docker/ducker-ak:
##########
@@ -417,10 +423,12 @@ ducker_up() {
-c|--clean-build) set_once clean_build "true" "clean build"; shift;;
-m|--kafka_mode) set_once kafka_mode "${2}" "the mode in which kafka will run"; shift 2;;
--memory) set_once docker_run_memory_limit "${2}" "the container memory limit"; shift 2;;
+ --build-arg) verify_command_line_argument "${2}" "docker build arg"; docker_args="${docker_args} --build-arg ${2}"; shift 2;;
--ipv6) set_once ipv6 "true" "enable IPv6"; shift;;
*) set_once image_name "${1}" "container image name"; shift;;
esac
done
+ [[ -n "${docker_args}" ]] || docker_args="${DOCKER_BUILD_ARGS:-}"
Review Comment:
I wonder how much beneficial would that be. Do you think that anybody will combine both of these approaches (i.e., CLI and ENV)?
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20377: Add to pass additional Docker build arguments in the system tests [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #22578:
URL: https://github.com/apache/kafka/pull/22578
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20377: Add to pass additional Docker build arguments in the system tests [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #22578:
URL: https://github.com/apache/kafka/pull/22578#discussion_r3423013189
##########
tests/docker/ducker-ak:
##########
@@ -417,10 +423,12 @@ ducker_up() {
-c|--clean-build) set_once clean_build "true" "clean build"; shift;;
-m|--kafka_mode) set_once kafka_mode "${2}" "the mode in which kafka will run"; shift 2;;
--memory) set_once docker_run_memory_limit "${2}" "the container memory limit"; shift 2;;
+ --build-arg) verify_command_line_argument "${2}" "docker build arg"; docker_args="${docker_args} --build-arg ${2}"; shift 2;;
--ipv6) set_once ipv6 "true" "enable IPv6"; shift;;
*) set_once image_name "${1}" "container image name"; shift;;
esac
done
+ [[ -n "${docker_args}" ]] || docker_args="${DOCKER_BUILD_ARGS:-}"
Review Comment:
No, I don't have strong evidence that users will use such complex configs 😤
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20377: Add to pass additional Docker build arguments in the system tests [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #22578:
URL: https://github.com/apache/kafka/pull/22578#discussion_r3421709269
##########
tests/docker/ducker-ak:
##########
@@ -417,10 +423,12 @@ ducker_up() {
-c|--clean-build) set_once clean_build "true" "clean build"; shift;;
-m|--kafka_mode) set_once kafka_mode "${2}" "the mode in which kafka will run"; shift 2;;
--memory) set_once docker_run_memory_limit "${2}" "the container memory limit"; shift 2;;
+ --build-arg) verify_command_line_argument "${2}" "docker build arg"; docker_args="${docker_args} --build-arg ${2}"; shift 2;;
--ipv6) set_once ipv6 "true" "enable IPv6"; shift;;
*) set_once image_name "${1}" "container image name"; shift;;
esac
done
+ [[ -n "${docker_args}" ]] || docker_args="${DOCKER_BUILD_ARGS:-}"
Review Comment:
I'm thinking whether `docker_args` should be appended rather than overwritten
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org