Skip to content

Commit

Permalink
[SPARK-50588][BUILD] build-docs skips building R docs on host when …
Browse files Browse the repository at this point in the history
…`SKIP_RDOC=1`

### What changes were proposed in this pull request?

`build-docs` skips calling `bundle` command when `SKIP_RDOC=1`, so that devs do not need to install `bundle` on the host.

### Why are the changes needed?

Skip unnecessary steps when `SKIP_RDOC=1`

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Manually test.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#49200 from pan3793/SPARK-50588.

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
  • Loading branch information
pan3793 authored and HyukjinKwon committed Dec 17, 2024
1 parent 4c0f7b5 commit 79026ad
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions dev/spark-test-image-util/docs/build-docs
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,22 @@ docker run \
--interactive --tty "${IMG_URL}" \
/bin/bash -c "sh ${BUILD_DOCS_SCRIPT_PATH}"

# 4.Build docs on host: `r doc`.
#
# Why does `r` document need to be compiled outside the container?
# Because when compiling inside the container, the permission of the directory
# `/__w/spark/spark/R/pkg/docs` automatically generated by `RScript` is `dr-xr--r-x`,
# and when writing to subsequent files, will throw an error as:
# `! [EACCES] Failed to copy '/usr/local/lib/R/site-library/pkgdown/BS5/assets/katex-auto.js'
# to '/__w/spark/spark/R/pkg/docs/katex-auto.js': permission denied`
export SKIP_ERRORDOC=1
export SKIP_SCALADOC=1
export SKIP_PYTHONDOC=1
export SKIP_SQLDOC=1
cd docs
bundle exec jekyll build
if [[ "$SKIP_RDOC" != "1" ]]; then
# 4.Build docs on host: `r doc`.
#
# Why does `r` document need to be compiled outside the container?
# Because when compiling inside the container, the permission of the directory
# `/__w/spark/spark/R/pkg/docs` automatically generated by `RScript` is `dr-xr--r-x`,
# and when writing to subsequent files, will throw an error as:
# `! [EACCES] Failed to copy '/usr/local/lib/R/site-library/pkgdown/BS5/assets/katex-auto.js'
# to '/__w/spark/spark/R/pkg/docs/katex-auto.js': permission denied`
export SKIP_ERRORDOC=1
export SKIP_SCALADOC=1
export SKIP_PYTHONDOC=1
export SKIP_SQLDOC=1
cd docs
bundle exec jekyll build
fi

# 5.Remove container image.
IMG_ID=$(docker images | grep "${IMG_TAG}" | awk '{print $3}')
Expand Down

0 comments on commit 79026ad

Please sign in to comment.