In addition to setting credentials and cluster configuration through json files, you can specify them programmatically. This allows users to generate the configuration on the fly at runtime.
You can generate credentials by creating a R object as shown below:
credentials <- list(
"batchAccount" = list(
"name" = "batchaccountname",
"key" = "batchaccountkey",
"url" = "https://batchaccountname.region.batch.azure.com"
),
"storageAccount" = list(
"name" = "storageaccountname",
"key" = "storageaccountkey"
),
"githubAuthenticationToken" = "",
"dockerAuthentication" = list("username" = "",
"password" = "",
"registry" = "")
)
doAzureParallel::setCredentials(credentials)
You can generate cluster configuration by creating a R object as shown below:
clusterConfig <- list(
"name" = "clustername",
"vmSize" = "Standard_D2_v2",
"maxTasksPerNode" = 1,
"poolSize" = list(
"dedicatedNodes" = list(
"min" = 0,
"max" = 0
),
"lowPriorityNodes" = list(
"min" = 1,
"max" = 1
),
"autoscaleFormula" = "QUEUE"
),
"containerImage" = "rocker/tidyverse:latest",
"rPackages" = list(
"cran" = list(),
"github" = list(),
"bioconductor" = list()
),
"commandLine" = list()
)
cluster <- doAzureParallel::makeCluster(clusterConfig)
doAzureParallel::registerDoAzureParallel(cluster)