Skip to content

Deprecated warning when running r_environment() #419

@hermandr

Description

@hermandr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions