Skip to content

Commit

Permalink
Merge pull request #101 from FredHutch/dev
Browse files Browse the repository at this point in the history
Adding server start time, table abbreviations, documentation links, and replica/stickiness fix
  • Loading branch information
tefirman committed May 21, 2024
2 parents d2bd2ad + 873cb9d commit d358811
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You can run this Shiny app locally. First you'll need to install required packag
(note: run `make pkg_deps_cmd` to update the below code block)

```r
pak::pak(c("getwilds/[email protected]", "getwilds/[email protected]", "base64enc", "cookies", "DBI", "dplyr", "DT", "ggplot2", "glue", "jsonlite", "lubridate", "magrittr", "purrr", "RColorBrewer", "rlang", "RSQLite", "shiny", "shinyBS", "shinydashboard", "shinydashboardPlus", "shinyFeedback", "shinyjs", "shinyWidgets", "tibble", "uuid"))
pak::pak(c("getwilds/[email protected]", "getwilds/[email protected]", "dplyr", "DT", "ggplot2", "glue", "httr", "jsonlite", "lubridate", "magrittr", "memoise", "purrr", "rclipboard", "RColorBrewer", "rlang", "shiny", "shinyBS", "shinydashboard", "shinydashboardPlus", "shinyFeedback", "shinyjs", "shinylogs", "shinyvalidate", "shinyWidgets", "testthat", "tibble", "uuid"))
```

And the above yourself in R.
Expand Down
1 change: 1 addition & 0 deletions app/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This is a [Shiny](https://shiny.posit.co/) app being developed by the [Fred Hutc
At Fred Hutch, we offer a service for supporting the use of our on-premise HPC cluster to run WDL workflows called PROOF. To use this app at Fred Hutch, choose the "PROOF Login" button at the top of the page and enter your Fred Hutch credentials to get started.

### Resources
- Get started with PROOF [How-To documentation](https://sciwiki.fredhutch.org/dasldemos/proof-how-to/) and [troubleshooting tips](https://sciwiki.fredhutch.org/dasldemos/proof-troubleshooting/)
- Find curated WDL workflow repositories and containers in Fred Hutch [DaSL's getWILDS GitHub organization](https://github.com/orgs/getwilds/repositories?q=wdl).
- Find Cromwell and WDL Resources in [Fred Hutch's GitHub organization](https://github.com/FredHutch?utf8=%E2%9C%93&q=wdl+OR+cromwell&type=&language=).
- Learn about Cromwell and WDL on the [Fred Hutch Biomedical Data Science Wiki](https://sciwiki.fredhutch.org/compdemos/Cromwell/).
Expand Down
38 changes: 31 additions & 7 deletions app/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ server <- function(input, output, session) {
output$proofStatusServerTime <- proofStatusTextGenerator("Server time", "SERVERTIME", "PROOF server job lifetime")
output$proofStatusUseAWS <- proofStatusTextGenerator("Use AWS?", "USE_AWS", "AWS credentials found?")
output$proofStatusSlurmJobAccount <- proofStatusTextGenerator("Slurm job account", "SLURM_JOB_ACCOUNT", "Designated Gizmo PI account")
output$proofStatusServerStartTime <- proofStatusTextGenerator("PROOF Server Start Time", "jobStartTime")

###### Cromwell Validate tab ######
## Validate a possible workflow
Expand Down Expand Up @@ -813,13 +814,36 @@ server <- function(input, output, session) {
)
})
## Jobs Lists
output$tasklistBatch <- renderDT(
dplyr::mutate(callsUpdate(), dplyr::across(matches(c("start", "end")), as_pt)),
class = "compact",
filter = "top",
options = list(scrollX = TRUE),
rownames = FALSE
)
output$tasklistBatch <- renderDT({
datatable(
{
callsUpdate() %>%
dplyr::mutate(dplyr::across(matches(c("start", "end")), as_pt))
},
escape = FALSE,
selection = "single",
rownames = FALSE,
filter = "top",
options = list(
scrollX = TRUE,
columnDefs = list(
list(
targets = "_all",
render = JS(
"function(data, type, row, meta) {",
"if (data === null) {",
"return data;",
"} else {",
"return type === 'display' && data.length > 150 ?",
"'<span title=\"' + data + '\">' + data.substr(0, 150) + '...</span>' : data;",
"}",
"}"
)
)
)
)
)
})

output$downloadJobs <- downloadHandler(
filename = function() {
Expand Down
1 change: 1 addition & 0 deletions app/tab-servers.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tab_servers <- tabItem(
br(),
br(),
h5("Current PROOF server information (if live)"),
uiOutput("proofStatusServerStartTime"),
uiOutput("proofStatusWorkflowLogDir"),
uiOutput("proofStatusScratchDir"),
uiOutput("proofStatusServerTime"),
Expand Down
2 changes: 2 additions & 0 deletions app/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ ui <- dashboardPage(
sidebarMenuOutput("uiSideBar")
),
dashboardBody(
tags$head(tags$title("PROOF")),
tags$script("document.title = 'PROOF';"),
shinyjs::useShinyjs(),
rclipboard::rclipboardSetup(),
enter_to_click,
Expand Down
5 changes: 5 additions & 0 deletions app/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,8 @@ make_copybtn <- function(x, clip_prefix, tooltip) {
)
)
}

abbreviate <- function(x, last = 100) {
if (nchar(x) < 100) return(x)
paste0(substring(x, 1, last), " ...")
}
3 changes: 3 additions & 0 deletions docker-compose-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
- proxy
image: sc-registry.fredhutch.org/shiny-cromwell-preview:latest
deploy:
replicas: 4
restart_policy:
condition: on-failure
labels:
Expand All @@ -14,6 +15,8 @@ services:
- "traefik.http.routers.shiny-cromwell-preview.entrypoints=web,web-secured"
- "traefik.http.services.shiny-cromwell-preview.loadbalancer.server.port=3838" # it seems you always need to give traefik a port so it 'notices' the service
- "traefik.http.routers.shiny-cromwell-preview.tls=true"
- "traefik.http.services.shiny-cromwell-preview.loadbalancer.sticky.cookie=true"
- "traefik.http.services.shiny-cromwell-preview.loadbalancer.sticky.cookie.name=my_sticky_cookie"


networks:
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ services:
- "traefik.http.routers.shiny-cromwell.entrypoints=web,web-secured"
- "traefik.http.services.shiny-cromwell.loadbalancer.server.port=3838" # it seems you always need to give traefik a port so it 'notices' the service
- "traefik.http.routers.shiny-cromwell.tls=true"
- "traefik.http.services.shiny-cromwell.loadbalancer.sticky.cookie=true"
- "traefik.http.services.shiny-cromwell.loadbalancer.sticky.cookie.name=my_sticky_cookie"


shiny-cromwell-redirect:
Expand Down

0 comments on commit d358811

Please sign in to comment.