-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
[FLINK-16742][runtime][dist] Extend and use BashJavaUtils to start JM JVM process and pass JVM memory args #11545
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 788ae1e (Wed Apr 15 11:40:19 UTC 2020) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
cc @azagrebin |
7941e3c
to
779c42c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening the PR @xintongsong
It looks quite good to me. I left couple of comments to discuss.
In particular, I am not sure about the need to support various ways to parse options for different Flink processes.
...iner/src/main/java/org/apache/flink/container/entrypoint/StandaloneJobClusterEntryPoint.java
Outdated
Show resolved
Hide resolved
flink-runtime/src/main/java/org/apache/flink/runtime/util/BashJavaUtils.java
Outdated
Show resolved
Hide resolved
779c42c
to
d20feb4
Compare
Thanks for the review @azagrebin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @xintongsong for addressing the comments.
The PR looks good to me. I left only minor comments and a question about the contents of the bash util jar.
flink-dist/src/test/java/org/apache/flink/dist/BashJavaUtilsITCase.java
Outdated
Show resolved
Hide resolved
flink-bash-java-utils/src/main/java/org/apache/flink/bash/util/BashJavaUtils.java
Outdated
Show resolved
Hide resolved
d20feb4
to
d8814c3
Compare
@azagrebin Thanks for the review. Comments addressed. |
0c1d7ba
to
7e5cae7
Compare
@azagrebin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @xintongsong, I think the last change simplified a lot and the PR looks good overall.
I left only one concern about the -D
option specifics.
...-runtime/src/main/java/org/apache/flink/runtime/util/ConfigurationOnlyCommandLineParser.java
Outdated
Show resolved
Hide resolved
46b64a4
to
ea1ef51
Compare
Thanks @azagrebin, comments addressed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @xintongsong , LGTM
I left only a small refactoring suggestion
flink-runtime/src/main/java/org/apache/flink/runtime/util/BashJavaUtils.java
Outdated
Show resolved
Hide resolved
Thanks @azagrebin, I've addressed the last comment. |
…uration in start-up scripts. This closes apache#11545.
0e39733
to
dd69c50
Compare
Rebased onto #11577.
|
…uration in start-up scripts. This closes apache#11545.
…uration in start-up scripts. This closes #11545.
IFS=$'\n' execution_results=($(echo "${output}" | grep ${EXECUTION_PREFIX})) | ||
if [[ ${#execution_results[@]} != ${expected_lines} ]]; then | ||
echo "[ERROR] The execution results has unexpected number of lines, expected: ${expected_lines}, actual: ${#execution_results[@]}." 1>&2 | ||
echo "[ERROR] An execution result line is expected following the prefix '${EXECUTION_PREFIX}'" 1>&2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like, we have to rebase this part on master because of FLINK-17023. Btw, wc -l
solution there for counting lines looks a bit simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extractExecutionResults() {
local output="$1"
local expected_lines="$2"
local EXECUTION_PREFIX="BASH_JAVA_UTILS_EXEC_RESULT:"
local execution_results
local num_lines
execution_results=$(echo "${output}" | grep ${EXECUTION_PREFIX})
num_lines=$(echo "${execution_results}" | wc -l)
if [[ ${num_lines} -ne ${expected_lines} ]]; then
echo "[ERROR] The execution result has unexpected number of lines, expected: ${expected_lines}, actual: ${num_lines}." 1>&2
echo "[ERROR] An execution result line is expected to have the prefix '${EXECUTION_PREFIX}'" 1>&2
echo "$output" 1>&2
exit 1
fi
echo "${execution_results//${EXECUTION_PREFIX}/}"
}
…uration in start-up scripts. This closes apache#11545.
…turn two lines of results.
…uration in start-up scripts. This closes apache#11545.
…age and extract configuration loading logics.
dd69c50
to
4d8ef75
Compare
@azagrebin Sorry for the late response, and thanks for providing the solution for the conflict resolving. I've rebased the PR. |
@flinkbot run travis |
@flinkbot run azure |
…uration in start-up scripts. This closes apache#11545.
What is the purpose of the change
This PR is part of FLIP-116. It makes the start-up shell scripts to launch JM JVM process with the new memory configuration logics and utils.
Brief change log
config.sh
not assumingBashJavaUtis
always return two lines of results. The assumption was true for calculating TM resource, but is not for calculating JM resource.BashJavaUtils
for JM memory calculations, and use it in start-up scripts for standalone session cluster.BashJavaUtils
to a separated module. This is for resolving resolving the dependency betweenBashJavaUtils
andflink-container
.BashJavaUtils
for JM memory calculations, and use it in start-up scripts for standalone job cluster.config.sh
.Verifying this change
BashJavaUtilsITCase
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation