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

Deprecated warning when running r_environment() #419

Open
hermandr opened this issue Jun 5, 2021 · 1 comment
Open

Deprecated warning when running r_environment() #419

hermandr opened this issue Jun 5, 2021 · 1 comment

Comments

@hermandr
Copy link

hermandr commented Jun 5, 2021

Describe the bug
Now with azuremlsdk v1.10.0, calling r_environment() generates a deprecated warning.

Looking at the code
environment.R

Lines 105-113

  env <- azureml$core$Environment(name)
  env$version <- version
  env$environment_variables <- environment_variables
  env$docker$enabled <- TRUE
  env$docker$base_image <- custom_docker_image
  env$r <- azureml$core$environment$RSection()
  env$r$r_version <- r_version
  env$r$rscript_path <- rscript_path
  env$r$snapshot_date <- snapshot_date

env$docker$enabled <- TRUE is deprecated

To Reproduce

# Taken from test_estimator.R
library(azuremlsdk)
library(testthat)

skip_if_no_azureml <- function() {
  if (!reticulate::py_module_available("azureml"))
    skip("azureml not available for testing")
}

context("estimator")

test_that("create estimator", {
  skip_if_no_azureml()
  
  r_env <- r_environment("r-env",
                         cran_packages = list(cran_package("ggplot2")),
                         use_gpu = TRUE,
                         environment_variables = list("var1" = "val1"))
  
  est <- estimator(".", compute_target = "local",
                   script_params = list("param1" = 1),
                   environment = r_env)
  
  expect_equal(est$run_config$target, "local")
  expect_equal(length(est$run_config$arguments), 2)
  expect_equal(est$run_config$arguments[[1]], "param1")
  expect_equal(est$run_config$arguments[[2]], 1)
})
WARNING:azureml.core.environment:'enabled' is deprecated. Please use the azureml.core.runconfig.DockerConfiguration object with the 'use_docker' param instead.
WARNING:azureml.train.estimator._estimator:'Estimator' is deprecated. Please use 'ScriptRunConfig' from 'azureml.core.script_run_config' with your own defined environment or an Azure ML curated environment.
Test passed 

Expected behavior
No warning

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context

R version 4.0.4 (2021-02-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    
system code page: 65001

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] azuremlsdk_1.10.0 reticulate_1.20  

loaded via a namespace (and not attached):
[1] compiler_4.0.4  Matrix_1.3-2    tools_4.0.4     Rcpp_1.0.6      grid_4.0.4      jsonlite_1.7.2  png_0.1-7       lattice_0.20-41
@hermandr
Copy link
Author

hermandr commented Jun 8, 2021

How to migrate from estimators to scriptRunConfig
from version 1.19 estimators are deprecated.

Can you update the R functions please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant