-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup old which eliminates functions
- Loading branch information
Showing
10 changed files
with
19 additions
and
315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,13 @@ | ||
#' Set CROMWELLURL variable based on a gizmo SLURM jobId | ||
#' Set the URL for your Cromwell server's API | ||
#' | ||
#' | ||
#' @param FredHutchId Your Fred Hutch username | ||
#' @param jobId The SLURM job id for your Cromwell server | ||
#' @param port The port you specified in your Cromwell config file (`fh-slurm-cromwell.config`), default is "2020" from the template here: https://github.com/FredHutch/diy-cromwell-server. | ||
#' @param local Are you running this on your local machine (TRUE) or on the rhino's (FALSE) | ||
#' @param nodeAndPort Your node and port of the running Cromwell server on Gizmo (e.g., gizmoz85:12345) | ||
#' @return Sets your environment variable CROMWELLURL to be that of the Cromwell server for the job specified. | ||
#' @author Amy Paguirigan | ||
#' @details | ||
#' Will require your Fred Hutch Id and will prompt you to enter your Fred Hutch password. | ||
#' NOTE: this function has been dicontinued due to setting up Cromwell in a more secure way. | ||
setCromwellURL <- function(FredHutchId = NULL, jobId = NULL, port = "2020", local = TRUE) { | ||
if (is.null(FredHutchId) == T) { | ||
stop("Please supply your Fred Hutch id.") | ||
#' @export | ||
setCromwellURL <- function(nodeAndPort = NULL) { | ||
if (is.null(nodeAndPort) == T) { | ||
stop("Please supply the node and port of your Cromwell server.") | ||
} | ||
if (is.null(jobId) == T) { | ||
stop("Please supply the SLURM jobId of your Cromwell server job.") | ||
} | ||
|
||
rhino <- "@rhino03" # remove this once bionic shift allows it | ||
|
||
nodecommand = paste0('squeue -o "%R" -j ', jobId) | ||
|
||
if (local == T){ | ||
# Make an ssh session to rhino and it will prompt for password | ||
session <- ssh::ssh_connect(paste0(FredHutchId, rhino)) | ||
getNode <- ssh::ssh_exec_internal(session, command = nodecommand) | ||
nodeName <- sub("^.*)", "", gsub("\n", "", rawToChar(getNode$stdout))) | ||
if (nodeName == ""){ | ||
message("Re-querying for node name.") | ||
Sys.sleep(2) | ||
getNode <- ssh::ssh_exec_internal(session, command = nodecommand) | ||
nodeName <- sub("^.*)", "", gsub("\n", "", rawToChar(getNode$stdout))) | ||
if (nodeName == ""){ | ||
ssh::ssh_disconnect(session) | ||
stop("Your job likely has not yet been assigned a node yet. Please use | ||
`squeue -u <username>` on `rhino` to find out if your job has been | ||
assigned or use the function `setCromwellURL()` in this package.") | ||
} | ||
} | ||
} | ||
if (local == F) { | ||
getNode <- system(command = nodecommand, intern = TRUE) | ||
nodeName <- getNode[3] | ||
if (nodeName %in% c("", " ")){ | ||
message("Re-querying for node name.") | ||
Sys.sleep(2) | ||
getNode <- system(command = nodecommand, intern = TRUE) | ||
nodeName <- getNode[3] | ||
if (nodeName == ""){ | ||
stop("Your job likely has not yet been assigned a node yet. Please use | ||
`squeue -u <username>` on `rhino` to find out if your job has been | ||
assigned or use the function `setCromwellURL()` in this package.") | ||
} | ||
} | ||
} | ||
|
||
message(paste0("Your Cromwell server is on node: ", nodeName)) | ||
message(paste0("To use the Swagger UI in a Browser, go to: http://", nodeName, ":", port)) | ||
|
||
Sys.setenv(CROMWELLURL=paste0("http://", nodeName, ":", port)) | ||
message(paste0("CROMWELLURL is currently set to: ", Sys.getenv("CROMWELLURL"))) | ||
|
||
ssh::ssh_disconnect(session) | ||
return(list(jobId = jobId, cromwellURL = paste0("http://", nodeName, ":", port))) | ||
Sys.setenv(CROMWELLURL=paste0("http://", nodeAndPort)) | ||
} |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.