Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit 3d84350

Browse files
authored
Added cluster submission output (#236)
* Finish output for cluster * Added resource files print info * Fixed ordering * Renamed Nodes to Scale * Fixed typo
1 parent fa2cdfc commit 3d84350

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

R/cluster.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ makeCluster <-
213213
e))
214214
})
215215

216+
printCluster(poolConfig, resourceFiles)
217+
216218
response <- .addPool(
217219
pool = poolConfig,
218220
packages = packages,

R/stringUtilities.R

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,40 @@ printJobInformation <- function(jobId,
5050
cat(sprintf("autoDeleteJob: %s", as.character(autoDeleteJob)), fill = TRUE)
5151
cat(strrep('=', options("width")), fill = TRUE)
5252
}
53+
54+
printCluster <- function(cluster, resourceFiles = list()) {
55+
cat(strrep('=', options("width")), fill = TRUE)
56+
cat(sprintf("Name: %s", cluster$name), fill = TRUE)
57+
58+
cat(sprintf("Configuration:"), fill = TRUE)
59+
cat(sprintf("\tDocker Image: %s", cluster$containerImage), fill = TRUE)
60+
cat(sprintf("\tMaxTasksPerNode: %s", cluster$maxTasksPerNode), fill = TRUE)
61+
cat(sprintf("\tNode Size: %s", cluster$vmSize), fill = TRUE)
62+
63+
cranPackages <- cluster$rPackages$cran
64+
githubPackages <- cluster$rPackages$github
65+
bioconductorPackages <- cluster$rPackages$bioconductor
66+
getJobPackageSummary(cranPackages)
67+
getJobPackageSummary(githubPackages)
68+
getJobPackageSummary(bioconductorPackages)
69+
70+
cat(sprintf("Scale:"), fill = TRUE)
71+
cat(sprintf("\tAutoscale Formula: %s", cluster$poolSize$autoscaleFormula), fill = TRUE)
72+
cat(sprintf("\tDedicated:"), fill = TRUE)
73+
cat(sprintf("\t\tMin: %s", cluster$poolSize$dedicatedNodes$min), fill = TRUE)
74+
cat(sprintf("\t\tMax: %s", cluster$poolSize$dedicatedNodes$max), fill = TRUE)
75+
cat(sprintf("\tLow Priority:"), fill = TRUE)
76+
cat(sprintf("\t\tMin: %s", cluster$poolSize$lowPriorityNodes$min), fill = TRUE)
77+
cat(sprintf("\t\tMax: %s", cluster$poolSize$lowPriorityNodes$max), fill = TRUE)
78+
79+
if (!is.null(resourceFiles) &&
80+
length(resourceFiles) > 0) {
81+
cat(sprintf("Resource Files:"), fill = TRUE)
82+
83+
for (i in 1:length(resourceFiles)) {
84+
cat(sprintf("\t%s",
85+
resourceFiles[[i]]$filePath), fill = TRUE)
86+
}
87+
}
88+
cat(strrep('=', options("width")), fill = TRUE)
89+
}

0 commit comments

Comments
 (0)