Skip to content

Commit a279f62

Browse files
committed
update design figure and Dockerfile
1 parent 61097ff commit a279f62

7 files changed

Lines changed: 15 additions & 9 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ Run apt update && apt install -y lmodern \
1919
&& rm -rf /var/lib/apt/lists/* \
2020
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds
2121

22-
CMD service cron start && runuser -l opencpu -c 'Rscript -e "BioInstaller::set_shiny_workers(3)" &>/log/BioInstaller_worker_main.log &' && runuser -l opencpu -c 'sh /usr/bin/start_shiny_server' && /usr/lib/rstudio-server/bin/rserver && apachectl -DFOREGROUND
22+
CMD service cron start && runuser -l opencpu -c 'export AUTO_CREATE_BIOINSTALLER_DIR="TRUE";Rscript -e "BioInstaller::set_shiny_workers(3, auto_create = TRUE)" &' && runuser -l opencpu -c 'sh /usr/bin/start_shiny_server' && /usr/lib/rstudio-server/bin/rserver && apachectl -DFOREGROUND

R/conda.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#' }
1313
conda <- function(suffix_params = "", prefix_params = "", conda = Sys.which('conda'), ...) {
1414
conda <- unname(conda)
15-
if (conda == "") stop("Executable 'conda' Not Found.")
15+
if (conda == "") {warning("Executable 'conda' Not Found."); return(FALSE)}
1616
objs <- system(sprintf("%s%s %s", prefix_params, conda, suffix_params), intern = TRUE, ...)
1717
x <- paste0(objs, collapse = "\n")
1818
return(x)
@@ -32,6 +32,7 @@ conda <- function(suffix_params = "", prefix_params = "", conda = Sys.which('con
3232
conda.list <- function(env_name = "base", ...) {
3333
if (!is.null(env_name) && env_name != "") objs <- conda("list", prefix_params = sprintf("source activate %s;", env_name), ...)
3434
if (is.null (env_name) || env_name == "") objs <- conda("list", ...)
35+
if (is.logical(objs) && !objs) {return(FALSE)}
3536
text <- paste0(objs, collapse = "\n")
3637
x <- tryCatch(read.table(text=text), error = function(e) {
3738
data.frame()
@@ -53,6 +54,7 @@ conda.list <- function(env_name = "base", ...) {
5354
#' }
5455
conda.env.list <- function(...) {
5556
objs <- conda("env list", ...)
57+
if (is.logical(objs) && !objs) {return(FALSE)}
5658
text <- paste0(objs, collapse = "\n")
5759
x <- read.table(text=str_replace(text, " [*] ", ""), skip=2)
5860
colnames(x) <- c("env_name", "env_path")

R/spack.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#' }
1313
spack <- function(suffix_params = "", prefix_params = "", spack = Sys.which('spack'), ...) {
1414
spack <- unname(spack)
15-
if (spack == "") stop("Executable 'spack' Not Found.")
15+
if (spack == "") {warning("Executable 'spack' Not Found."); return(FALSE)}
1616
objs <- system(sprintf("%s%s %s", prefix_params, spack, suffix_params), intern = TRUE, ...)
1717
paste0(objs, collapse = "\n")
1818
}
@@ -28,6 +28,7 @@ spack <- function(suffix_params = "", prefix_params = "", spack = Sys.which('spa
2828
#' }
2929
spack.list <- function(...) {
3030
objs <- spack("list", ...)
31+
if (is.logical(objs) && !objs) {return(FALSE)}
3132
text <- paste0(objs, collapse = "\n")
3233
x <- read.table(text=text)
3334
colnames(x) <- c("Name")

inst/extdata/config/shiny/shiny.conda.parameters.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ label = ["Conda subcommands", "Conda environment", "Conda parameters"]
2727
conda_sub_cmd = ["clean", "config", "create", "info", "install",
2828
"list", "package", "remove", "uninstall",
2929
"search", "update", "upgrade"]
30-
conda_env_name = "!!glue {BioInstaller::conda.env.list()[,1]}"
30+
conda_env_name = "!!glue {conda_envs <- BioInstaller::conda.env.list(); if (is.data.frame(conda_envs)) conda_envs <- conda_envs[,1]}"
3131
[conda.paramters.conda_input_box.input.single_input.selected]
3232
conda_sub_cmd = "list"
3333
conda_env_name = "base"

inst/extdata/shiny/server_dashbord.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,15 +274,16 @@ dashbord_section_server <- function(input, output) {
274274
output <- custom_render_DT(input, output, "bioinstaller_items_monitor",
275275
"get_bioinstaller_installed()")
276276
output <- custom_render_DT(input, output, "conda_envlist_monitor",
277-
"BioInstaller::conda.env.list()")
277+
"tryCatch(BioInstaller::conda.env.list(), warning=function(w){data.frame()})")
278278
output$conda_env_name_ui <- renderUI({
279-
conda_envs <- BioInstaller::conda.env.list()[,1]
279+
conda_envs <- BioInstaller::conda.env.list()
280+
if (is.data.frame(conda_envs)) conda_envs <- conda_envs[,1]
280281
selectInput("conda_env_name", "Environment name",
281282
choices = conda_envs,
282283
selected = conda_envs[1])
283284
})
284285
output <- custom_render_DT(input, output, "conda_items_monitor",
285-
"BioInstaller::conda.list(env_name = input$conda_env_name)")
286+
"tryCatch(BioInstaller::conda.list(env_name = input$conda_env_name), warning = function(w){data.frame()})")
286287

287288
output$spack_items_monitor <- renderPrint({
288289
cat(BioInstaller::spack("find"))

inst/extdata/shiny/server_download.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ download_section_server <- function(input, output) {
6868

6969

7070
output$conda_installer_ui <- renderUI({
71-
conda_envs <- BioInstaller::conda.env.list()[,1]
71+
conda_envs <- BioInstaller::conda.env.list()
72+
if (is.data.frame(conda_envs)) conda_envs <- conda_envs[,1]
7273
HTML(
7374
paste0(shiny::selectInput("installer_conda_sub_command", "Conda subcommands",
7475
c("clean", "config", "create",
@@ -86,7 +87,8 @@ download_section_server <- function(input, output) {
8687
})
8788

8889
output$spack_installer_ui <- renderUI({
89-
conda_envs <- BioInstaller::conda.env.list()[,1]
90+
conda_envs <- BioInstaller::conda.env.list()
91+
if (is.data.frame(conda_envs)) conda_envs <- conda_envs[,1]
9092
HTML(
9193
paste0(shiny::selectInput("installer_spack_sub_command", "Sub command of spack",
9294
c("list", "info", "find",
-150 KB
Loading

0 commit comments

Comments
 (0)