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-13793][docs] build each language in a separate subprocess #9489
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 a687283 (Wed Dec 04 15:08:41 UTC 2019) 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:
|
CI report:
Bot commandsThe @flinkbot bot supports the following commands:
|
I just rebased this PR now that we haveJekyll 4 changes in from #9487. |
docs/build_docs.sh
Outdated
@@ -72,6 +72,8 @@ while getopts "piez" opt; do | |||
z) | |||
JEKYLL_CONFIG="--config _config.yml,_config_dev_zh.yml" | |||
;; | |||
*) echo "usage: $0 [-e|-z] [-i|-p]" >&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.
indentation is different
@@ -17,3 +17,6 @@ | |||
|
|||
exclude: | |||
- "*.zh.md" | |||
- "content" |
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.
are these required for correctness?
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.
if not excluded, they may end up in the generated folder (as yet another subdirectory) again, e.g. when the zh version builds, if would not see the content_en
as a target dir (and exclude it)
@@ -78,4 +80,28 @@ while getopts "piez" opt; do | |||
done | |||
|
|||
# use 'bundle exec' to insert the local Ruby dependencies | |||
bundle exec jekyll ${JEKYLL_CMD} ${JEKYLL_CONFIG} --source "${DOCS_SRC}" --destination "${DOCS_DST}" | |||
|
|||
if [ "${JEKYLL_CMD}" = "build" ] && [ -z "${JEKYLL_CONFIG}" ]; then |
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.
if we modified the e/z cases above to instead set DOC_LANGUAGES to en/zh we wouldn't need this condition nor else branch
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.
maybe a branch for the DOC_LANGUAGES (to get all languages if none of the e/z options was used) but simpler anyway; I'll give it a try
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.
oh, the branch is still always needed since there is no parallel serve
...so not sure whether this change makes sense
@NicoK ping |
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.
What would happen if we started jekyll with --serve for the en documentation, and fire up a background process that builds and copies the chinese docs into DOCS_DST
?
docs/build_docs.sh
Outdated
|
||
# run processes and store pids | ||
echo "Spawning parallel builds for ${DOC_LANGUAGES}..." | ||
pids= |
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.
my god is this actually valid in bash? It looks soo much like an incomplete statement.
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.
yes it is ;)
but I can also replace it with pids=""
Serving Verified by running this:
|
Ideally, of course, these tricks would not be necessary and jekyll would just use more system resources, i.e. do a parallel build on its own. That would give an even higher speed-up but is, unfortunately, not available, afaik |
When not serving docs and just building them, e.g. via `./build_docs.sh`, we spawn sub-processes for each language build instead of running them single-threaded (jekyll currently does not support parallel builds).
FYI: I rebased onto latest master again and verified that the result from building the old way vs. this PR is the same |
What is the purpose of the change
When not serving docs and just building them, e.g. via
./build_docs.sh
, we can spawn sub-processes for each language build instead of running them single-threaded (jekyll currently does not support parallel builds).before: ~37s
after: ~20s
Brief change log
Building on top of #9487, this PR adds:
build_docs.sh
to support parallel builds and merge resulting files together(admittedly this seems a bit hacky)
build_docs.sh
: show usage if wrong option is givenVerifying this change
I verified the changes in the generated HTML pages (nothing changed except for the build scripts which I removed from the generated pages via a hotfix).