Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* clean r job Signed-off-by: harupy <hkawamura0130@gmail.com> * build package once Signed-off-by: harupy <hkawamura0130@gmail.com> * fix named argument Signed-off-by: harupy <hkawamura0130@gmail.com> * remove system dependencies Signed-off-by: harupy <hkawamura0130@gmail.com>
- Loading branch information
Showing
7 changed files
with
57 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,32 @@ | ||
source(".utils.R") | ||
|
||
# Bundle up the package into a .tar.gz file. This file will be submitted to CRAN. | ||
# Bundle up the package into a .tar.gz file. | ||
package_path <- devtools::build(".", path = ".") | ||
# Run the submission check against the built package. | ||
|
||
# Hack to get around this issue: | ||
# https://stat.ethz.ch/pipermail/r-package-devel/2020q3/005930.html | ||
# | ||
# The system clock check during `R CMD check` relies on two external web APIs and fails | ||
# when they are unavailable. By setting `_R_CHECK_SYSTEM_CLOCK_` to FALSE, we can skip it: | ||
# https://github.com/wch/r-source/blob/59a1965239143ca6242b9cc948d8834e1194e84a/src/library/tools/R/check.R#L511 | ||
Sys.setenv("_R_CHECK_SYSTEM_CLOCK_" = "FALSE") | ||
|
||
# Run the check with `cran = TRUE` | ||
devtools::check_built( | ||
path = normalizePath(package_path), | ||
path = package_path, | ||
cran = TRUE, | ||
remote = should_enable_cran_incoming_checks(), | ||
error_on = "note", | ||
args = c("--no-tests", "--as-cran"), | ||
check_dir = getwd(), | ||
args = "--no-tests", | ||
) | ||
|
||
# Run the check with `cran = FALSE` to detect unused imports: | ||
# https://github.com/wch/r-source/blob/b12ffba7584825d6b11bba8b7dbad084a74c1c20/src/library/tools/R/check.R#L6070 | ||
devtools::check_built( | ||
path = package_path, | ||
cran = FALSE, | ||
error_on = "note", | ||
check_dir = getwd(), | ||
args = "--no-tests", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
parent_dir <- dir("../", full.names = TRUE) | ||
package <- parent_dir[grepl("mlflow_", parent_dir)] | ||
# Install MLflow for R | ||
files <- dir(".", full.names = TRUE) | ||
package <- files[grepl("mlflow_.+\\.tar\\.gz$", files)] | ||
install.packages(package) | ||
|
||
mlflow:::mlflow_maybe_create_conda_env(python_version = "3.7") | ||
library(reticulate) | ||
use_condaenv(mlflow:::mlflow_conda_env_name()) | ||
# Install python dependencies | ||
reticulate::conda_install(Sys.getenv("MLFLOW_HOME", "../../.."), envname = mlflow:::mlflow_conda_env_name(), pip = TRUE) | ||
# pinning tensorflow version to 1.14 until test_keras_model.R is fixed | ||
keras::install_keras(method = "conda", envname = mlflow:::mlflow_conda_env_name(), tensorflow="1.15.2") | ||
# pinning h5py < 3.0.0 to avoid this issue: https://github.com/tensorflow/tensorflow/issues/44467 | ||
# TODO: unpin after we use tensorflow >= 2.4 | ||
reticulate::conda_install("'h5py<3.0.0'", envname = mlflow:::mlflow_conda_env_name(), pip = TRUE) | ||
reticulate::conda_install(Sys.getenv("MLFLOW_HOME", "../../../../."), envname = mlflow:::mlflow_conda_env_name(), pip = TRUE) | ||
reticulate::conda_install("xgboost", envname = mlflow:::mlflow_conda_env_name()) | ||
reticulate::conda_install(paste0("h2o==", packageVersion("h2o")), envname = mlflow:::mlflow_conda_env_name(), pip = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,3 @@ | ||
source("../.utils.R") | ||
reticulate::use_condaenv(mlflow:::mlflow_conda_env_name()) | ||
|
||
parent_dir <- dir("../", full.names = TRUE) | ||
package <- parent_dir[grepl("mlflow_", parent_dir)] | ||
|
||
library(reticulate) | ||
use_condaenv(mlflow:::mlflow_conda_env_name()) | ||
|
||
devtools::check_built( | ||
path = package, | ||
cran = TRUE, | ||
remote = should_enable_cran_incoming_checks(), | ||
error_on = "note", | ||
args = "--no-tests" | ||
) | ||
# This runs checks that are disabled when `cran` is TRUE (e.g. unused import check). | ||
devtools::check_built( | ||
path = package, | ||
cran = FALSE, | ||
error_on = "note", | ||
args = "--no-tests" | ||
) | ||
source("testthat.R") | ||
source("testthat.R", echo = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters