-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-18264][SPARKR] build vignettes with package, update vignettes for CRAN release build and add info on release #15790
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
Conversation
|
Test build #68249 has finished for PR 15790 at commit
|
|
This is great @felixcheung - Taking a closer look now |
|
interesting. jenkins failed because it is building vignettes again right after it is built correctly, and the second time it I'll try to track down where it is doing that. |
|
Basically it is building vignettes multiple times - once in create-doc.sh, once with I'll skip the one in create-doc.sh to get it to create vignettes together with the source package, which I think is the more natural way. ( Also, I'll pass And it seems we have a new dependencies on Once Jenkins boxes have this we could remove this warning check. |
…MD check has vignettes
|
Test build #68307 has finished for PR 15790 at commit
|
|
I looked, the |
|
Can you open a Spark JIRA for installing |
|
test this please |
|
ok, qpdf is installed per the jira. no environment variables set up yet though. |
|
Test build #68348 has finished for PR 15790 at commit
|
R/run-tests.sh
Outdated
| # We have one more NOTE in Jenkins due to "No repository set" | ||
| if [[ $NUM_CRAN_WARNING != 0 || $NUM_CRAN_ERROR != 0 || $NUM_CRAN_NOTES -gt 3 ]]; then | ||
| # We have one warning on ‘qpdf’ is needed for checks on size reduction of PDFs | ||
| if [[ $NUM_CRAN_WARNING != 1 || $NUM_CRAN_ERROR != 0 || $NUM_CRAN_NOTES -gt 3 ]]; 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.
I think we can remove this now. This was the cause for the latest test failure ?
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.
Yap.
|
Test build #68352 has finished for PR 15790 at commit
|
|
this is good to go in? |
|
ping @shivaram |
|
Sorry I got caught up with some other stuff - Will take a look at this today. |
shivaram
left a comment
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 @felixcheung - Change looks pretty good to me. I just had a couple of minor inline comments. I also want to try out the scripts on my machine - but I can do that after the merge as well.
R/CRAN_RELEASE.md
Outdated
|
|
||
| ### Release | ||
|
|
||
| First, check that the `Version:` field in the `pkg/DESCRIPTION` file is updated. Also, check for stale file not under source control. |
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.
nit - stale files
| toc_depth: 4 | ||
| toc_float: true | ||
| highlight: textmate | ||
| vignette: > |
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.
So I think the theme was the one giving us the nice looking HTML . Is that not supported with rmarkdown::html_vignette ?
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.
right, it seems to have a theme already and is complaining about theme already defined
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.
I see - I think thats fine then.
R/check-cran.sh
Outdated
| # Build a zip file containing the source package | ||
| "$R_SCRIPT_PATH/"R CMD build $FWDIR/pkg | ||
| # Build source package with vignettes | ||
| SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)" |
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.
So I ran into a problem while trying to run this locally. It seems to be getting SPARK_HOME wrong for some reason
./R/check-cran.sh: line 45: /Users/shivaram/spark-1/R/bin/load-spark-env.sh: No such file or directory
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.
that's odd, it works in my environment.
do you happen to have check-cran.sh under a subdirectory of R?
this is the code:
SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)"
. "${SPARK_HOME}"/bin/load-spark-env.sh
so for /opt/spark/R/check-cran.sh, it should look for /opt/spark/bin/load-spark-env.sh
and SPARK_HOME should be /opt/spark
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.
So I think this needs to be at the top of the file - The current working directory is probably changed in the middle by create-docs.sh or the pushd $FWDIR ?
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 that command is doing is
- get the dirname of the currently running file, check-cran.sh (
dirname "$0") - cd to one level up (
cd x/..) - print current directory
pwd - set that to SPARK_HOME
so it shouldn't matter what the current directory is but only with where the check-cran.sh is found?
I'm running this on Ubuntu, it's possible if you are running on Mac the behavior is different somehow?
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.
Yeah I think the problem might be related to how you invoke it. If you invoke the script with an absolute path say /Users/shivaram/spark-1/R/check-cran.sh then the existing code works fine. If I however use a relative path -- for example ./R/check-cran.sh while I am in /Users/shivaram/spark-1 then it doesn't work.
I think moving it to the top of the file is probably a good idea because the $0 is relative to where the script started from and when we do pushd $FWDIR the working directory changes.
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.
interesting. I changed this up a bit, not sure if it helps but both works on my setup
|
@felixcheung I noticed one more thing - We are somehow not registering the vignette correctly with the R package. So for example if I launch |
|
Tested that more, I think the vignettes works only with installed package and then |
shivaram
left a comment
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 the update and especially for figuring out the install step. I just had a few more minor comments.
R/run-tests.sh
Outdated
| else | ||
| # We have 2 existing NOTEs for new maintainer, attach() | ||
| # We have one more NOTE in Jenkins due to "No repository set" | ||
| # We have one warning on ‘qpdf’ is needed for checks on size reduction of PDFs |
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.
Nit: This comment can be removed now ?
| toc_depth: 4 | ||
| toc_float: true | ||
| highlight: textmate | ||
| vignette: > |
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.
I see - I think thats fine then.
R/create-docs.sh
Outdated
| if [ -d "$SPARK_JARS_DIR" ]; then | ||
| # render creates SparkR vignettes | ||
| Rscript -e 'library(rmarkdown); paths <- .libPaths(); .libPaths(c("lib", paths)); Sys.setenv(SPARK_HOME=tools::file_path_as_absolute("..")); render("pkg/vignettes/sparkr-vignettes.Rmd"); .libPaths(paths)' | ||
| # Find Spark jars. |
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.
This code is now duplicated in two files. Do you think we should just create a build-vignette.sh and call it in two places ?
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.
right, I thought about that. I think there's value in knitting html and vignettes in create-doc.sh, it is a bit duplicated to have vignettes in 2 places but
in create-doc.sh
...
render("pkg/vignettes/sparkr-vignettes.Rmd");
in check-cran.sh
SPARK_HOME="${SPARK_HOME}" "$R_SCRIPT_PATH/"R CMD build $FWDIR/pkg
in the latter it is building the full package along with vignettes, so the actual command and behavior isn't exactly the same.
Perhaps we should just take vignettes build out of create-doc.sh?
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.
Yeah that seems fine to me. the create-doc.sh is used to generate docs for the Spark website etc. so its probably ok to not do the vignette as a part of that.
|
Test build #68497 has finished for PR 15790 at commit
|
|
Test build #68498 has finished for PR 15790 at commit
|
|
Test build #68500 has finished for PR 15790 at commit
|
|
I think install-dev might not build the vignettes and so it won't go into the release tgz |
|
So one proposal I was thinking of is to just check in a built version of the vignette in to the source tree. That way the release packaging wouldn't need to change. The only thing to keep in mind is that whenever we update the vignette we will need to rebuild it. Thoughts ? |
|
Problem is the required and generated How about we merge this PR first - I can test out the release mechanism more next week. |
|
Sure - Sounds good. LGTM. Merging this to master and branch-2.1 |
…for CRAN release build and add info on release ## What changes were proposed in this pull request? Changes to DESCRIPTION to build vignettes. Changes the metadata for vignettes to generate the recommended format (which is about <10% of size before). Unfortunately it does not look as nice (before - left, after - right)   Also add information on how to run build/release to CRAN later. ## How was this patch tested? manually, unit tests shivaram We need this for branch-2.1 Author: Felix Cheung <[email protected]> Closes #15790 from felixcheung/rpkgvignettes. (cherry picked from commit ba23f76) Signed-off-by: Shivaram Venkataraman <[email protected]>
…for CRAN release build and add info on release ## What changes were proposed in this pull request? Changes to DESCRIPTION to build vignettes. Changes the metadata for vignettes to generate the recommended format (which is about <10% of size before). Unfortunately it does not look as nice (before - left, after - right)   Also add information on how to run build/release to CRAN later. ## How was this patch tested? manually, unit tests shivaram We need this for branch-2.1 Author: Felix Cheung <[email protected]> Closes apache#15790 from felixcheung/rpkgvignettes.
What changes were proposed in this pull request?
Changes to DESCRIPTION to build vignettes.
Changes the metadata for vignettes to generate the recommended format (which is about <10% of size before). Unfortunately it does not look as nice
(before - left, after - right)
Also add information on how to run build/release to CRAN later.
How was this patch tested?
manually, unit tests
@shivaram
We need this for branch-2.1