This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathutility.R
59 lines (56 loc) · 1.69 KB
/
utility.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
getSettings <- function(dedicatedMin = 0,
dedicatedMax = 2,
lowPriorityMin = 0,
lowPriorityMax = 2,
poolName = "test-pool"){
settings <- list(
clusterConfig = list(
"name" = poolName,
"vmSize" = "Standard_D2_v2",
"maxTasksPerNode" = 1,
"poolSize" = list(
"dedicatedNodes" = list(
"min" = dedicatedMin,
"max" = dedicatedMax
),
"lowPriorityNodes" = list(
"min" = lowPriorityMin,
"max" = lowPriorityMax
),
"autoscaleFormula" = "QUEUE"
),
"containerImage" = "rocker/tidyverse:latest",
"rPackages" = list(
"cran" = list(),
"github" = list(),
"bioconductor" = list()
),
"commandLine" = list()
)
)
if (file.exists('test_credentials.json')) {
doAzureParallel::setCredentials("test_credentials.json")
}
else{
settings['credentials'] = list(
"sharedKey" = list(
"batchAccount" = list(
"name" = Sys.getenv("BATCH_ACCOUNT_NAME"),
"key" = Sys.getenv("BATCH_ACCOUNT_KEY"),
"url" = Sys.getenv("BATCH_ACCOUNT_URL")
),
"storageAccount" = list(
"name" = Sys.getenv("STORAGE_ACCOUNT_NAME"),
"key" = Sys.getenv("STORAGE_ACCOUNT_KEY"),
"endpointSuffix" = "core.windows.net"
)
),
"githubAuthenticationToken" = "",
"dockerAuthentication" = list("username" = "",
"password" = "",
"registry" = "")
)
doAzureParallel::setCredentials(settings$credentials)
}
return(settings)
}