Skip to content
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

[SPARK-37474][R][DOCS] Migrate SparkR docs to pkgdown #34728

Closed
wants to merge 14 commits into from

Conversation

zero323
Copy link
Member

@zero323 zero323 commented Nov 27, 2021

What changes were proposed in this pull request?

This PR proposes migration of R API docs to pkgdown.

Result (not synced automatically) could look like this

https://zero323.gitlab.io/sparkr-docs-experiments/

Why are the changes needed?

To improve overall experience of interactions with SparkR docs:

  • Arguably, much better looking than the simple R docs.
  • Fully linked examples allow easy inspection of the used functions.
  • Adds functional search.
  • For what is worth, all samples can be copied and pasted.
  • Dark mode.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Inspection of the build page

@SparkQA
Copy link

SparkQA commented Nov 27, 2021

Test build #145676 has finished for PR 34728 at commit 871f96a.

  • This patch fails RAT tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 27, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50146/

@SparkQA
Copy link

SparkQA commented Nov 27, 2021

Test build #145677 has finished for PR 34728 at commit 148f56c.

  • This patch fails R style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 27, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50147/

@SparkQA
Copy link

SparkQA commented Nov 27, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50146/

@SparkQA
Copy link

SparkQA commented Nov 27, 2021

Test build #145678 has finished for PR 34728 at commit 07652f3.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 27, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50147/

@SparkQA
Copy link

SparkQA commented Nov 27, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50148/

@SparkQA
Copy link

SparkQA commented Nov 27, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50148/

@SparkQA
Copy link

SparkQA commented Nov 27, 2021

Test build #145679 has finished for PR 34728 at commit dc5e3b9.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 27, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50149/

@SparkQA
Copy link

SparkQA commented Nov 28, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50149/

@github-actions github-actions bot added the INFRA label Nov 28, 2021
@HyukjinKwon
Copy link
Member

The demo looks good. cc @falaki @felixcheung @shivaram FYI

@SparkQA
Copy link

SparkQA commented Nov 28, 2021

Test build #145681 has finished for PR 34728 at commit b9391a8.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 28, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50151/

@SparkQA
Copy link

SparkQA commented Nov 28, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50151/

Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems OK if it gives some benefits and does not entail much change to existing docs

R/pkg/vignettes/sparkr-vignettes.Rmd Outdated Show resolved Hide resolved
@SparkQA
Copy link

SparkQA commented Nov 28, 2021

Test build #145682 has finished for PR 34728 at commit b964c5a.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 28, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50152/

@SparkQA
Copy link

SparkQA commented Nov 28, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50152/

Comment on lines 25 to 26
reference:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manual reference is not mandatory, but allows us to split index into logical sections, which are easier to digest.

R/pkg/_pkgdown.yml Outdated Show resolved Hide resolved
@SparkQA
Copy link

SparkQA commented Nov 28, 2021

Test build #145683 has finished for PR 34728 at commit 8655c78.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 28, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50153/

@SparkQA
Copy link

SparkQA commented Nov 28, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50153/

@SparkQA
Copy link

SparkQA commented Nov 28, 2021

Test build #145684 has finished for PR 34728 at commit a31050f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 6, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50426/

@SparkQA
Copy link

SparkQA commented Dec 6, 2021

Test build #145955 has finished for PR 34728 at commit a18cc0c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Comment on lines +57 to +67
# Determine Spark(R) version
SPARK_VERSION=$(grep -oP "(?<=Version:\ ).*" ../DESCRIPTION)

# Update url
sed "s/{SPARK_VERSION}/$SPARK_VERSION/" ../pkgdown/_pkgdown_template.yml > ../_pkgdown.yml

"$R_SCRIPT_PATH/Rscript" -e 'libDir <- "../../lib"; library(SparkR, lib.loc=libDir); pkgdown::build_site("..")'

# Clean temporary config
rm ../_pkgdown.yml

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if that's the best way to handle different versions, so any suggestions are welcome.

@SparkQA
Copy link

SparkQA commented Dec 6, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50429/

@zero323 zero323 changed the title [WIP][SPARK-37474][R][DOCS] Migrate SparkR docs to pkgdown [SPARK-37474][R][DOCS] Migrate SparkR docs to pkgdown Dec 6, 2021
@zero323 zero323 marked this pull request as ready for review December 6, 2021 14:46
@SparkQA
Copy link

SparkQA commented Dec 6, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50429/

@@ -489,6 +490,8 @@ jobs:
apt-get update -y
apt-get install -y ruby ruby-dev
Rscript -e "install.packages(c('devtools', 'testthat', 'knitr', 'rmarkdown', 'roxygen2'), repos='https://cloud.r-project.org/')"
Rscript -e "devtools::install_git('https://github.com/r-lib/pkgdown.git')"
Rscript -e "devtools::install_git('https://github.com/amirmasoudabdol/preferably.git')"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick question, do we need this for documentation build? we would have to also update https://github.com/apache/spark/blob/master/docs/README.md and https://github.com/apache/spark/blob/master/dev/create-release/spark-rm/Dockerfile#L83-L84 . Can be done separately though.

And can we pin the versions of both libraries instead of using the master branch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick question, do we need this for documentation build?

Yes, documentation build invokes pkgdown.

And can we pin the versions of both libraries instead of using the master branch?

Of course. We should be even able to pin CRAN version of pkgdown (seems like 2.0.x and compatible preferably)) are already published and visible).

R/pkg/DESCRIPTION Outdated Show resolved Hide resolved
@HyukjinKwon
Copy link
Member

Looks pretty good .. but the packaging stuff it would be great to have sign-offs from @felixcheung @shivaram @mengxr or @falaki.

@SparkQA
Copy link

SparkQA commented Dec 7, 2021

Test build #145990 has finished for PR 34728 at commit 358cc5c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 7, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50466/

@SparkQA
Copy link

SparkQA commented Dec 7, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50466/

@github-actions github-actions bot added the BUILD label Dec 7, 2021
@SparkQA
Copy link

SparkQA commented Dec 7, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50467/

@SparkQA
Copy link

SparkQA commented Dec 7, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50467/

@SparkQA
Copy link

SparkQA commented Dec 7, 2021

Test build #145991 has finished for PR 34728 at commit 6e01b24.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@srowen
Copy link
Member

srowen commented Dec 10, 2021

Merged to master

@srowen srowen closed this in 16d1c68 Dec 10, 2021
dongjoon-hyun pushed a commit that referenced this pull request Nov 14, 2022
### What changes were proposed in this pull request?

This tries to fix `do-release-docker.sh` for branch-3.2.

### Why are the changes needed?

Currently the following error will occur if running the script in `branch-3.2`:
```
#5 917.4 g++ -std=gnu++14 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o testthat.so init.o reassign.o test-catch.o test-example.o test-runner.o -L/usr/lib/R/lib -lR
#5 917.5 installing to /usr/local/lib/R/site-library/00LOCK-testthat/00new/testthat/libs
#5 917.5 ** R
#5 917.5 ** inst
#5 917.5 ** byte-compile and prepare package for lazy loading
#5 924.4 ** help
#5 924.6 *** installing help indices
#5 924.7 *** copying figures
#5 924.7 ** building package indices
#5 924.9 ** installing vignettes
#5 924.9 ** testing if installed package can be loaded from temporary location
#5 925.1 ** checking absolute paths in shared objects and dynamic libraries
#5 925.1 ** testing if installed package can be loaded from final location
#5 925.5 ** testing if installed package keeps a record of temporary installation path
#5 925.5 * DONE (testthat)
#5 925.8 ERROR: dependency 'pkgdown' is not available for package 'devtools'
#5 925.8 * removing '/usr/local/lib/R/site-library/devtools'
#5 925.8
#5 925.8 The downloaded source packages are in
#5 925.8        '/tmp/Rtmp3nJI60/downloaded_packages'
#5 925.8 Warning messages:
#5 925.8 1: In install.packages(c("curl", "xml2", "httr", "devtools", "testthat",  :
#5 925.8   installation of package 'textshaping' had non-zero exit status
#5 925.8 2: In install.packages(c("curl", "xml2", "httr", "devtools", "testthat",  :
#5 925.8   installation of package 'ragg' had non-zero exit status
#5 925.8 3: In install.packages(c("curl", "xml2", "httr", "devtools", "testthat",  :
#5 925.8   installation of package 'pkgdown' had non-zero exit status
#5 925.8 4: In install.packages(c("curl", "xml2", "httr", "devtools", "testthat",  :
#5 925.8   installation of package 'devtools' had non-zero exit status
#5 926.0 Error in loadNamespace(x) : there is no package called 'devtools'
#5 926.0 Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
#5 926.0 Execution halted
```

The same error doesn't happen on master. I checked the diff between the two and it seems the following line:
```
$APT_INSTALL libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev && \
```

introduced in #34728 made the difference.

I verified that after adding the line, `do-release-docker.sh` (dry run mode) was able to finish successfully.

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

No.

### How was this patch tested?

Manually

Closes #38643 from sunchao/fix-docker-release.

Authored-by: Chao Sun <sunchao@apple.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
sunchao added a commit to sunchao/spark that referenced this pull request Jun 2, 2023
### What changes were proposed in this pull request?

This tries to fix `do-release-docker.sh` for branch-3.2.

### Why are the changes needed?

Currently the following error will occur if running the script in `branch-3.2`:
```
apache#5 917.4 g++ -std=gnu++14 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o testthat.so init.o reassign.o test-catch.o test-example.o test-runner.o -L/usr/lib/R/lib -lR
apache#5 917.5 installing to /usr/local/lib/R/site-library/00LOCK-testthat/00new/testthat/libs
apache#5 917.5 ** R
apache#5 917.5 ** inst
apache#5 917.5 ** byte-compile and prepare package for lazy loading
apache#5 924.4 ** help
apache#5 924.6 *** installing help indices
apache#5 924.7 *** copying figures
apache#5 924.7 ** building package indices
apache#5 924.9 ** installing vignettes
apache#5 924.9 ** testing if installed package can be loaded from temporary location
apache#5 925.1 ** checking absolute paths in shared objects and dynamic libraries
apache#5 925.1 ** testing if installed package can be loaded from final location
apache#5 925.5 ** testing if installed package keeps a record of temporary installation path
apache#5 925.5 * DONE (testthat)
apache#5 925.8 ERROR: dependency 'pkgdown' is not available for package 'devtools'
apache#5 925.8 * removing '/usr/local/lib/R/site-library/devtools'
apache#5 925.8
apache#5 925.8 The downloaded source packages are in
apache#5 925.8        '/tmp/Rtmp3nJI60/downloaded_packages'
apache#5 925.8 Warning messages:
apache#5 925.8 1: In install.packages(c("curl", "xml2", "httr", "devtools", "testthat",  :
apache#5 925.8   installation of package 'textshaping' had non-zero exit status
apache#5 925.8 2: In install.packages(c("curl", "xml2", "httr", "devtools", "testthat",  :
apache#5 925.8   installation of package 'ragg' had non-zero exit status
apache#5 925.8 3: In install.packages(c("curl", "xml2", "httr", "devtools", "testthat",  :
apache#5 925.8   installation of package 'pkgdown' had non-zero exit status
apache#5 925.8 4: In install.packages(c("curl", "xml2", "httr", "devtools", "testthat",  :
apache#5 925.8   installation of package 'devtools' had non-zero exit status
apache#5 926.0 Error in loadNamespace(x) : there is no package called 'devtools'
apache#5 926.0 Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
apache#5 926.0 Execution halted
```

The same error doesn't happen on master. I checked the diff between the two and it seems the following line:
```
$APT_INSTALL libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev && \
```

introduced in apache#34728 made the difference.

I verified that after adding the line, `do-release-docker.sh` (dry run mode) was able to finish successfully.

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

No.

### How was this patch tested?

Manually

Closes apache#38643 from sunchao/fix-docker-release.

Authored-by: Chao Sun <sunchao@apple.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants