Skip to content

Commit

Permalink
cleanup old which eliminates functions
Browse files Browse the repository at this point in the history
  • Loading branch information
vortexing committed Dec 6, 2021
1 parent 1f3f40f commit 8043bdb
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 315 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: fh.wdlR
Title: Convenience Tools for Managing WDL Workflows via Cromwell
Version: 1.1.0
Version: 2.0.0
Authors@R:
person(given = "Amy",
family = "Paguirigan",
Expand Down
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ export(cromwellJobs)
export(cromwellOutputs)
export(cromwellSubmitBatch)
export(cromwellTiming)
export(cromwellValidate)
export(cromwellVersion)
export(cromwellWorkflow)
export(womtoolValidate)
export(setCromwellURL)
export(workflowInputs)
export(workflowOptions)
importFrom(magrittr,"%>%")
124 changes: 0 additions & 124 deletions R/cromwellCreate.R

This file was deleted.

2 changes: 1 addition & 1 deletion R/womtoolValidate.R → R/cromwellValidate.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' @examples
#' TBD
#' @export
womtoolValidate <-
cromwellValidate <-
function(WDL, allInputs=NULL, cromURL = Sys.getenv("CROMWELLURL", unset = "needsURL")) {
if(cromURL == "needsURL") {
stop("CROMWELLURL is not set in your environment, or specify the URL to query via cromURL.")
Expand Down
35 changes: 0 additions & 35 deletions R/getAWSLogs.R

This file was deleted.

68 changes: 7 additions & 61 deletions R/setCromwellURL.R
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))
}
50 changes: 0 additions & 50 deletions man/cromwellCreate.Rd

This file was deleted.

8 changes: 4 additions & 4 deletions man/womtoolValidate.Rd → man/cromwellValidate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 0 additions & 24 deletions man/getAWSLogs.Rd

This file was deleted.

18 changes: 4 additions & 14 deletions man/setCromwellURL.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8043bdb

Please sign in to comment.