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

R HTML docs source code #4782

Merged
merged 24 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
cb38aec
Start docsite
alexpeters1208 Nov 3, 2023
fcce212
More docsite, vignettes do not work in R studio
alexpeters1208 Nov 6, 2023
4b7967d
More docsite, need to fix vignettes
alexpeters1208 Nov 6, 2023
b4e5359
Done with docsite?
alexpeters1208 Nov 6, 2023
b4143b1
Merge branch 'deephaven:main' into pkgdown
alexpeters1208 Nov 6, 2023
73f33e8
Merge branch 'deephaven:main' into pkgdown
alexpeters1208 Nov 7, 2023
adf3022
Merge branch 'deephaven:main' into pkgdown
alexpeters1208 Nov 8, 2023
5d08504
Use R CMD to install in r-build.sh
alexpeters1208 Nov 8, 2023
1620d2b
Change readme, not totally happy with this
alexpeters1208 Nov 9, 2023
5b92130
Use R CMD build
alexpeters1208 Nov 10, 2023
f3a4dcb
Merge branch 'deephaven:main' into pkgdown
alexpeters1208 Nov 13, 2023
5bfed1e
Update cpp-clients-multi image SHA
alexpeters1208 Nov 13, 2023
bb5d7ff
Merge branch 'deephaven:main' into r-cmd
alexpeters1208 Nov 13, 2023
968bb16
Merge remote-tracking branch 'origin/r-cmd' into pkgdown
alexpeters1208 Nov 13, 2023
b0efbbe
Gradle tasks and script for building docsite
alexpeters1208 Nov 14, 2023
911b20a
Merge branch 'deephaven:main' into pkgdown
alexpeters1208 Nov 14, 2023
2be6d9d
Update gradle.properties
alexpeters1208 Nov 14, 2023
a2b8247
Update readme
alexpeters1208 Nov 14, 2023
d71a4d1
Merge branch 'deephaven:main' into pkgdown
alexpeters1208 Nov 15, 2023
1c7aecb
Merge branch 'deephaven:main' into pkgdown
alexpeters1208 Nov 15, 2023
7649e83
Update files
alexpeters1208 Nov 16, 2023
4daf892
Merge branch 'deephaven:main' into pkgdown
alexpeters1208 Nov 16, 2023
39046dc
Merge branch 'deephaven:main' into pkgdown
alexpeters1208 Nov 16, 2023
ca8dd39
Remove mistaken comment
alexpeters1208 Nov 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions R/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def buildRClient = Docker.registerDockerTask(project, 'rClient') {
include 'rdeephaven/R/**'
include 'rdeephaven/src/*.cpp'
include 'rdeephaven/src/Makevars'
include 'rdeephaven/vignettes/*.Rmd'
}
}
dockerfile {
Expand All @@ -64,6 +65,7 @@ def buildRClient = Docker.registerDockerTask(project, 'rClient') {
copyFile('rdeephaven/R/', "${prefix}/src/rdeephaven/R/")
copyFile('rdeephaven/src/*.cpp', "${prefix}/src/rdeephaven/src/")
copyFile('rdeephaven/src/Makevars', "${prefix}/src/rdeephaven/src/")
copyFile('rdeephaven/vignettes/*.Rmd', "${prefix}/src/rdeephaven/vignettes/")
copyFile('r-build.sh', "${prefix}/bin/rdeephaven")
runCommand("PREFIX=${prefix}; " +
'''set -eux ; \
Expand Down Expand Up @@ -155,5 +157,43 @@ def rClientDoc = Docker.registerDockerTask(project, 'rClientDoc') {
containerOutPath = "${prefix}/src/rdeephaven/man"
}

def rClientSite = Docker.registerDockerTask(project, 'rClientSite') {
// Only tested on x86-64, and we only build dependencies for x86-64
platform = 'linux/amd64'
copyIn {
from(layout.projectDirectory) {
include 'r-site.sh'
include 'rdeephaven/man/**'
}
}
copyOut {
into layout.projectDirectory.dir('rdeephaven/docs')
}
dockerfile {
from('deephaven/r-client-doc:local-build')
// We need the contents of 'man' to build the docsite
copyFile('rdeephaven/man/**', "${prefix}/src/rdeephaven/man/")
runCommand("mkdir -p ${prefix}/src/rdeephaven/docs")
runCommand('''echo "status = tryCatch(" \
" {" \
" install.packages('pkgdown', repos='http://cran.us.r-project.org'); " \
" 0" \
" }," \
" error=function(e) 1," \
" warning=function(w) 2" \
");" \
"print(paste0('status=', status));" \
"quit(save='no', status=status)" | \
MAKE="make -j`getconf _NPROCESSORS_ONLN`" R --no-save --no-restore
''')
// Keep this after the package installs above;
// it is likely it changes more frequently.
copyFile('r-site.sh', "${prefix}/bin/rdeephaven")
}
parentContainers = [ project.tasks.getByName('rClientDoc') ]
entrypoint = ["${prefix}/bin/rdeephaven/r-site.sh"]
containerOutPath = "${prefix}/src/rdeephaven/docs"
}

deephavenDocker.shouldLogIfTaskFails testRClient
tasks.check.dependsOn(testRClient)
20 changes: 8 additions & 12 deletions R/r-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,14 @@ fi
trap 'rm -f src/*.o src/*.so' 1 2 15
rm -f src/*.o src/*.so

MAKE="make -j${NCPUS}" R --no-save --no-restore <<EOF
status = tryCatch(
{
install.packages(".", repos=NULL, type="source")
0
},
error=function(e) 1,
warning=function(w) 2
)
print(paste0('status=', status))
quit(save='no', status=status)
EOF
MAKE="make -j${NCPUS}"
cd .. && \
rm -f rdeephaven_*.tar.gz && \
R CMD build rdeephaven && \
R CMD INSTALL --no-multiarch --with-keep.source rdeephaven_*.tar.gz && \
rm -f rdeephaven_*.tar.gz && \
cd rdeephaven ||
exit 1

rm -f src/*.o src/*.so

Expand Down
25 changes: 25 additions & 0 deletions R/r-site.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

set -euo pipefail

if [ -z "${DH_PREFIX}" ]; then
echo "$0: Environment variable DH_PREFIX is not set, aborting." 1>&2
exit 1
fi

source $DH_PREFIX/env.sh

cd $DH_PREFIX/src/rdeephaven

R --no-save --no-restore <<EOF
library('pkgdown')
status = tryCatch(
{
pkgdown::build_site()
0
},
error=function(e) 1
)
print(paste0('status=', status))
quit(save='no', status=status)
EOF
5 changes: 5 additions & 0 deletions R/rdeephaven/.Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
^_pkgdown\.yml$
^docs$
^pkgdown$
^doc$
^Meta$
4 changes: 4 additions & 0 deletions R/rdeephaven/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ lib/cpp-dependencies/src
lib/cpp-dependencies/env.sh
*.o
*.so
docs
inst/doc
/doc/
/Meta/
8 changes: 7 additions & 1 deletion R/rdeephaven/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ License: Apache License (== 2.0)
Depends: R (>= 3.5.3)
Imports: Rcpp (>= 1.0.10), arrow (>= 12.0.0), R6 (>= 2.5.0), dplyr (>= 1.1.0), utils (>= 3.5.3)
LinkingTo: Rcpp
Suggests: testthat (>= 3.0.0), lubridate (>= 1.9.0), zoo (>= 1.8-0)
Suggests:
testthat (>= 3.0.0),
lubridate (>= 1.9.0),
zoo (>= 1.8-0),
knitr,
rmarkdown
Config/testthat/edition: 3
RoxygenNote: 7.2.3
VignetteBuilder: knitr
Loading
Loading