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

Commit

Permalink
Added cluster submission output (#236)
Browse files Browse the repository at this point in the history
* Finish output for cluster

* Added resource files print info

* Fixed ordering

* Renamed Nodes to Scale

* Fixed typo
  • Loading branch information
brnleehng authored Mar 22, 2018
1 parent fa2cdfc commit 3d84350
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/cluster.R
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ makeCluster <-
e))
})

printCluster(poolConfig, resourceFiles)

response <- .addPool(
pool = poolConfig,
packages = packages,
Expand Down
37 changes: 37 additions & 0 deletions R/stringUtilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,40 @@ printJobInformation <- function(jobId,
cat(sprintf("autoDeleteJob: %s", as.character(autoDeleteJob)), fill = TRUE)
cat(strrep('=', options("width")), fill = TRUE)
}

printCluster <- function(cluster, resourceFiles = list()) {
cat(strrep('=', options("width")), fill = TRUE)
cat(sprintf("Name: %s", cluster$name), fill = TRUE)

cat(sprintf("Configuration:"), fill = TRUE)
cat(sprintf("\tDocker Image: %s", cluster$containerImage), fill = TRUE)
cat(sprintf("\tMaxTasksPerNode: %s", cluster$maxTasksPerNode), fill = TRUE)
cat(sprintf("\tNode Size: %s", cluster$vmSize), fill = TRUE)

cranPackages <- cluster$rPackages$cran
githubPackages <- cluster$rPackages$github
bioconductorPackages <- cluster$rPackages$bioconductor
getJobPackageSummary(cranPackages)
getJobPackageSummary(githubPackages)
getJobPackageSummary(bioconductorPackages)

cat(sprintf("Scale:"), fill = TRUE)
cat(sprintf("\tAutoscale Formula: %s", cluster$poolSize$autoscaleFormula), fill = TRUE)
cat(sprintf("\tDedicated:"), fill = TRUE)
cat(sprintf("\t\tMin: %s", cluster$poolSize$dedicatedNodes$min), fill = TRUE)
cat(sprintf("\t\tMax: %s", cluster$poolSize$dedicatedNodes$max), fill = TRUE)
cat(sprintf("\tLow Priority:"), fill = TRUE)
cat(sprintf("\t\tMin: %s", cluster$poolSize$lowPriorityNodes$min), fill = TRUE)
cat(sprintf("\t\tMax: %s", cluster$poolSize$lowPriorityNodes$max), fill = TRUE)

if (!is.null(resourceFiles) &&
length(resourceFiles) > 0) {
cat(sprintf("Resource Files:"), fill = TRUE)

for (i in 1:length(resourceFiles)) {
cat(sprintf("\t%s",
resourceFiles[[i]]$filePath), fill = TRUE)
}
}
cat(strrep('=', options("width")), fill = TRUE)
}

0 comments on commit 3d84350

Please sign in to comment.