Skip to content

Commit

Permalink
Fix R image build
Browse files Browse the repository at this point in the history
  • Loading branch information
krasinski committed Dec 1, 2023
1 parent b71de36 commit 394e693
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions kubernetes/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ task createExternalBackendDockerfile(type: Dockerfile) {
}
copyFile("sparkling-water-assembly-extensions_${scalaBaseVersion}-${version}-all.jar", "/opt/h2oai/h2o-3/")
defaultCommand(
"java",
"-cp",
"/opt/h2oai/h2o-3/sparkling-water-assembly-extensions_${scalaBaseVersion}-${version}-all.jar:/opt/h2oai/h2o-3/h2o.jar",
"-XX:+UseContainerSupport",
"-XX:MaxRAMPercentage=50",
"water.H2OApp")
"java",
"-cp",
"/opt/h2oai/h2o-3/sparkling-water-assembly-extensions_${scalaBaseVersion}-${version}-all.jar:/opt/h2oai/h2o-3/h2o.jar",
"-XX:+UseContainerSupport",
"-XX:MaxRAMPercentage=50",
"water.H2OApp")
}

task createScalaDockerfile(type: Dockerfile) {
Expand All @@ -60,17 +60,12 @@ task createRDockerfile(type: Dockerfile) {
} else {
runCommand "apk add libc-dev linux-headers g++ libxml2-dev"
}
runCommand """\\
R -e 'install.packages("xml2", repos = "http://cran.us.r-project.org")' && \\
R -e 'install.packages("openssl", repos = "http://cran.us.r-project.org")' && \\
R -e 'install.packages("httr", repos = "http://cran.us.r-project.org")' && \\
R -e 'install.packages("bitops", repos = "http://cran.us.r-project.org")' && \\
R -e 'install.packages("RCurl", repos = "http://cran.us.r-project.org")' && \\
R -e 'install.packages("jsonlite", repos = "http://cran.us.r-project.org")' && \\
R -e 'install.packages("testthat", repos = "http://cran.us.r-project.org")' && \\
R -e 'install.packages("dbplyr", repos = "http://cran.us.r-project.org")' && \\
R -e 'install.packages("sparklyr", repos = "http://cran.us.r-project.org")'
"""
runCommand """
R -e 'install.packages(c(
"xml2","openssl", "httr", "bitops", "RCurl", "jsonlite", "testthat",
"lifecycle", "pillar", "vctrs", "tidyselect", "tidyr", "tibble", "purrr", "dplyr", "dbplyr", "sparklyr"),
repos = "http://cran.us.r-project.org")'
""".stripIndent().replace("\n", "")
copyFile("h2o.tar.gz", "/opt/spark/R/lib/h2o.tar.gz")
runCommand "cd /opt/spark/R/lib && R CMD INSTALL h2o.tar.gz"
copyFile("rsparkling_${version}.tar.gz", "/opt/spark/R/lib/rsparkling_${version}.tar.gz")
Expand Down

0 comments on commit 394e693

Please sign in to comment.