Skip to content

Commit

Permalink
pass spark location through SPARK_HOME env var
Browse files Browse the repository at this point in the history
  • Loading branch information
sllynn committed Nov 15, 2023
1 parent 9ca199d commit 5674422
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .github/actions/r_build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ runs:
run: |
cd R
Rscript --vanilla generate_docs.R
env:
SPARK_HOME: /usr/spark-download/unzipped/spark-${{ matrix.spark }}-bin-hadoop3
- name: Build R package
shell: bash
run: |
cd R
Rscript --vanilla build_r_package.R
env:
SPARK_HOME: /usr/spark-download/unzipped/spark-${{ matrix.spark }}-bin-hadoop3
- name: Test SparkR package
shell: bash
run: |
Expand Down
8 changes: 1 addition & 7 deletions R/build_r_package.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
spark_location <- "/usr/spark-download/unzipped/spark-3.3.2-bin-hadoop3"
Sys.setenv(SPARK_HOME = spark_location)

spark_location <- Sys.getenv("SPARK_HOME")
library(SparkR, lib.loc = c(file.path(spark_location, "R", "lib")))


library(pkgbuild)



build_mosaic_bindings <- function(){
## build package
pkgbuild::build("sparkR-mosaic/sparkrMosaic")
Expand Down
4 changes: 1 addition & 3 deletions R/generate_docs.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
spark_location <- "/usr/spark-download/unzipped/spark-3.3.2-bin-hadoop3"
Sys.setenv(SPARK_HOME = spark_location)

spark_location <- Sys.getenv("SPARK_HOME")
library(SparkR, lib.loc = c(file.path(spark_location, "R", "lib")))
library(roxygen2)

Expand Down

0 comments on commit 5674422

Please sign in to comment.