confluentinc / cp-docker-images

[DEPRECATED] Docker images for Confluent Platform.
Apache License 2.0
1.14k stars 703 forks source link

problems with kafka-* scripts in /usr/bin #145

Open dsmiley opened 8 years ago

dsmiley commented 8 years ago

I think it's problematic to place kafka's scripts into /usr/bin. For example, this script doesn't work:

docker run --rm -ti confluentinc/cp-kafka kafka-streams-application-reset

Result:

/usr/bin/kafka-streams-application-reset: line 21: /usr/bin/kafka-run-class.sh: No such file or directory

I've noticed it's common to simply update the PATH. IMO keeping Kafka expanded in one spot and not moving stuff around makes the docker images easier to understand.

framiere commented 6 years ago

kafka-streams-application-reset has been fixed, however some remaining issues are present

Here is a script to see the remaining issues:

declare -a tags=("4.0.0" "3.3.1" "3.3.0" "3.2.2" "3.2.1" "3.2.0" "3.1.2" "3.1.1" "3.1.0" "3.0.1" "3.0.0")
for tag in "${tags[@]}"
do
    echo $tag
    docker run -ti confluentinc/cp-kafka:${tag} bash -c "grep  kafka-run-class /usr/bin/kafka* | grep '\.sh'"
done

And the result:

4.0.0
/usr/bin/kafka-broker-api-versions:exec $(dirname $0)/kafka-run-class.sh kafka.admin.BrokerApiVersionsCommand "$@"
/usr/bin/kafka-log-dirs:exec $(dirname $0)/kafka-run-class.sh kafka.admin.LogDirsCommand "$@"
3.3.1
/usr/bin/kafka-broker-api-versions:exec $(dirname $0)/kafka-run-class.sh kafka.admin.BrokerApiVersionsCommand "$@"
/usr/bin/kafka-delete-records:exec $(dirname $0)/kafka-run-class.sh kafka.admin.DeleteRecordsCommand "$@"
3.3.0
/usr/bin/kafka-broker-api-versions:exec $(dirname $0)/kafka-run-class.sh kafka.admin.BrokerApiVersionsCommand "$@"
/usr/bin/kafka-delete-records:exec $(dirname $0)/kafka-run-class.sh kafka.admin.DeleteRecordsCommand "$@"
3.2.2
/usr/bin/kafka-broker-api-versions.sh:exec $(dirname $0)/kafka-run-class.sh kafka.admin.BrokerApiVersionsCommand "$@"
3.2.1
/usr/bin/kafka-broker-api-versions.sh:exec $(dirname $0)/kafka-run-class.sh kafka.admin.BrokerApiVersionsCommand "$@"
3.2.0
/usr/bin/kafka-broker-api-versions.sh:exec $(dirname $0)/kafka-run-class.sh kafka.admin.BrokerApiVersionsCommand "$@"
3.1.2
3.1.1
3.1.0
3.0.1
/usr/bin/kafka-streams-application-reset:exec $(dirname $0)/kafka-run-class.sh kafka.tools.StreamsResetter "$@"
3.0.0
ewencp commented 6 years ago

/cc @confluentinc/core seems like an issue w/ patches where we remove .sh for deb/rpm installation. packaging patches probably need updating

ijuma commented 6 years ago

@ewencp, thanks. @framiere filed an internal JIRA a couple of days ago so it's in our radar for the next release.

angelbarrera92 commented 6 years ago

I think we have encountered the same error in 4.0.2 version. We are implementing the readiness probe and we wanted to use /usr/bin/kafka-broker-api-versions executable. But when you run that file, it produces the following error:

/usr/bin/kafka-broker-api-versions: line 17: /usr/bin/kafka-run-class.sh: No such file or directory

This is because this file does not exist, but it does exist /usr/bin/kafka-run-class (without extension sh).

Docker image - Enterprise version

angelbarrera92 commented 6 years ago

Seems fixed on 4.0.2-2