Skip to content

Commit

Permalink
update design figure and Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Miachol committed Aug 17, 2018
1 parent 61097ff commit a279f62
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Run apt update && apt install -y lmodern \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds

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
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
4 changes: 3 additions & 1 deletion R/conda.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' }
conda <- function(suffix_params = "", prefix_params = "", conda = Sys.which('conda'), ...) {
conda <- unname(conda)
if (conda == "") stop("Executable 'conda' Not Found.")
if (conda == "") {warning("Executable 'conda' Not Found."); return(FALSE)}
objs <- system(sprintf("%s%s %s", prefix_params, conda, suffix_params), intern = TRUE, ...)
x <- paste0(objs, collapse = "\n")
return(x)
Expand All @@ -32,6 +32,7 @@ conda <- function(suffix_params = "", prefix_params = "", conda = Sys.which('con
conda.list <- function(env_name = "base", ...) {
if (!is.null(env_name) && env_name != "") objs <- conda("list", prefix_params = sprintf("source activate %s;", env_name), ...)
if (is.null (env_name) || env_name == "") objs <- conda("list", ...)
if (is.logical(objs) && !objs) {return(FALSE)}
text <- paste0(objs, collapse = "\n")
x <- tryCatch(read.table(text=text), error = function(e) {
data.frame()
Expand All @@ -53,6 +54,7 @@ conda.list <- function(env_name = "base", ...) {
#' }
conda.env.list <- function(...) {
objs <- conda("env list", ...)
if (is.logical(objs) && !objs) {return(FALSE)}
text <- paste0(objs, collapse = "\n")
x <- read.table(text=str_replace(text, " [*] ", ""), skip=2)
colnames(x) <- c("env_name", "env_path")
Expand Down
3 changes: 2 additions & 1 deletion R/spack.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' }
spack <- function(suffix_params = "", prefix_params = "", spack = Sys.which('spack'), ...) {
spack <- unname(spack)
if (spack == "") stop("Executable 'spack' Not Found.")
if (spack == "") {warning("Executable 'spack' Not Found."); return(FALSE)}
objs <- system(sprintf("%s%s %s", prefix_params, spack, suffix_params), intern = TRUE, ...)
paste0(objs, collapse = "\n")
}
Expand All @@ -28,6 +28,7 @@ spack <- function(suffix_params = "", prefix_params = "", spack = Sys.which('spa
#' }
spack.list <- function(...) {
objs <- spack("list", ...)
if (is.logical(objs) && !objs) {return(FALSE)}
text <- paste0(objs, collapse = "\n")
x <- read.table(text=text)
colnames(x) <- c("Name")
Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/config/shiny/shiny.conda.parameters.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ label = ["Conda subcommands", "Conda environment", "Conda parameters"]
conda_sub_cmd = ["clean", "config", "create", "info", "install",
"list", "package", "remove", "uninstall",
"search", "update", "upgrade"]
conda_env_name = "!!glue {BioInstaller::conda.env.list()[,1]}"
conda_env_name = "!!glue {conda_envs <- BioInstaller::conda.env.list(); if (is.data.frame(conda_envs)) conda_envs <- conda_envs[,1]}"
[conda.paramters.conda_input_box.input.single_input.selected]
conda_sub_cmd = "list"
conda_env_name = "base"
Expand Down
7 changes: 4 additions & 3 deletions inst/extdata/shiny/server_dashbord.R
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,16 @@ dashbord_section_server <- function(input, output) {
output <- custom_render_DT(input, output, "bioinstaller_items_monitor",
"get_bioinstaller_installed()")
output <- custom_render_DT(input, output, "conda_envlist_monitor",
"BioInstaller::conda.env.list()")
"tryCatch(BioInstaller::conda.env.list(), warning=function(w){data.frame()})")
output$conda_env_name_ui <- renderUI({
conda_envs <- BioInstaller::conda.env.list()[,1]
conda_envs <- BioInstaller::conda.env.list()
if (is.data.frame(conda_envs)) conda_envs <- conda_envs[,1]
selectInput("conda_env_name", "Environment name",
choices = conda_envs,
selected = conda_envs[1])
})
output <- custom_render_DT(input, output, "conda_items_monitor",
"BioInstaller::conda.list(env_name = input$conda_env_name)")
"tryCatch(BioInstaller::conda.list(env_name = input$conda_env_name), warning = function(w){data.frame()})")

output$spack_items_monitor <- renderPrint({
cat(BioInstaller::spack("find"))
Expand Down
6 changes: 4 additions & 2 deletions inst/extdata/shiny/server_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ download_section_server <- function(input, output) {


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

output$spack_installer_ui <- renderUI({
conda_envs <- BioInstaller::conda.env.list()[,1]
conda_envs <- BioInstaller::conda.env.list()
if (is.data.frame(conda_envs)) conda_envs <- conda_envs[,1]
HTML(
paste0(shiny::selectInput("installer_spack_sub_command", "Sub command of spack",
c("list", "info", "find",
Expand Down
Binary file modified man/figures/design_of_bioInstaller.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a279f62

Please sign in to comment.