Skip to content

Commit

Permalink
add miniconda and spack in docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
Miachol committed Aug 18, 2018
1 parent a279f62 commit 348d228
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 15 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2018-08-18 Li Jianfeng <[email protected]>

* add miniconda and spack in docker image
* add table output box in instant spack

2018-08-16 Li Jianfeng <[email protected]>

* add pubmed search tool
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: BioInstaller
Title: Integrator of Bioinformatics Resources
Version: 0.3.5.6000
Version: 0.3.5.7000
Authors@R: person("Jianfeng", "Li", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2349-208X"))
Maintainer: Jianfeng Li <[email protected]>
Description:
Expand Down
15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,27 @@ MAINTAINER "Jianfeng Li" [email protected]

ADD . /tmp/BioInstaller

Run apt update && apt install -y lmodern \
Run apt update && apt install -y lmodern openssl \
&& echo "options('repos' = c(CRAN='https://mirrors.tuna.tsinghua.edu.cn/CRAN/'))" >> /home/opencpu/.Rprofile \
&& echo "options(BioC_mirror='https://mirrors.tuna.tsinghua.edu.cn/bioconductor')" >> /home/opencpu/.Rprofile \
&& Rscript -e "install.packages(c('git2r', 'RCurl'))" \
&& Rscript -e "devtools::install('/tmp/BioInstaller')" \
&& Rscript -e "setRepositories(ind=1:2);BioInstaller::check_shiny_dep(TRUE)" \
&& Rscript -e "source('https://bioconductor.org/biocLite.R');biocLite('maftools')" \
&& runuser -l opencpu -c "export BIO_SOFTWARES_DB_ACTIVE=/home/opencpu/.BioInstaller/info.yaml" \
&& chown -R opencpu /home/opencpu/ \
&& echo 'export BIO_SOFTWARES_DB_ACTIVE="~/.BioInstaller/info.yaml"\n' >> /home/opencpu/.bashrc \
&& echo 'BIO_SOFTWARES_DB_ACTIVE="~/.BioInstaller/info.yaml"\n' >> /home/opencpu/.Renviron \
&& runuser -l opencpu -c "Rscript -e \"BioInstaller::install.bioinfo('miniconda2', destdir = '/home/opencpu/opt/')\"" \
&& runuser -l opencpu -c "Rscript -e \"BioInstaller::install.bioinfo('spack', destdir = '/home/opencpu/opt/spack')\"" \
&& echo 'export PATH=/home/opencpu/opt/miniconda2/bin:$PATH\n' >> /etc/profile \
&& echo 'export SPACK_ROOT=/home/opencpu/opt/spack;source $SPACK_ROOT/share/spack/setup-env.sh;' >> /etc/profile \
&& echo 'file=`ls /usr/local/lib/R/site-library/`; cd /usr/lib/R/library; for i in ${file}; do rm -rf ${i};done' >> /tmp/rm_script \
&& sh /tmp/rm_script \
&& ln -sf /usr/local/lib/R/site-library/* /usr/lib/R/library/ \
&& rm /tmp/rm_script \
&& rm -rf /tmo/BioInstaller \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds
#&& Rscript -e "source('https://bioconductor.org/biocLite.R');biocLite('maftools')" \

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
CMD service cron start && runuser -s /bin/bash -l opencpu -c '. ~/.bashrc; export AUTO_CREATE_BIOINSTALLER_DIR="TRUE";Rscript -e "BioInstaller::set_shiny_workers(3, auto_create = TRUE)" &' && runuser -s /bin/bash -l opencpu -c '. ~/.bashrc; sh /usr/bin/start_shiny_server' && . /etc/profile; /usr/lib/rstudio-server/bin/rserver && apachectl -DFOREGROUND
3 changes: 2 additions & 1 deletion R/versions.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ github2versions <- function(github.url) {
`Accept-Language` = "en-us", Connection = "keep-alive", `Accept-Charset` = "GB2312,utf-8;q=0.7,*;q=0.7")
url <- sprintf("https://api.github.com/repos/%s/%s/tags?client_id=1d40ab6884d214ef6889&client_secret=23b818c2bad8e9f88dafd8a425613475362b326d",
user, repo)
txt <- getURL(url, headerfunction = h$update, httpheader = myheader)
txt <- tryCatch(getURL(url, headerfunction = h$update, httpheader = myheader), error = function(e) {
getURL(url, headerfunction = h$update, httpheader = myheader, ssl.verifypeer = FALSE) })
json <- tempfile()
cat(txt, file = json, sep = "\n")
return(read.config(file = json)$name)
Expand Down
4 changes: 2 additions & 2 deletions inst/extdata/config/github/github.toml
Original file line number Diff line number Diff line change
Expand Up @@ -689,5 +689,5 @@ github_url = "https://github.com/snakemake-workflows/dna-seq-gatk-variant-callin
[spack]
github_url = "https://github.com/spack/spack"
[spack.install]
linux = "#R#cat('export SPACK_ROOT={{download.dir}}\nsource $SPACK_ROOT/share/spack/setup-env.sh', file = '~/.bashrc', append = TRUE)#R#"
mac = "#R#cat('export SPACK_ROOT={{download.dir}}\nsource $SPACK_ROOT/share/spack/setup-env.sh', file = '~/.bashrc', append = TRUE)#R#"
linux = "#R#cat('export SPACK_ROOT={{download.dir}}\nsource $SPACK_ROOT/share/spack/setup-env.sh;', file = '~/.bashrc', append = TRUE)#R#"
mac = "#R#cat('export SPACK_ROOT={{download.dir}}\nsource $SPACK_ROOT/share/spack/setup-env.sh;', file = '~/.bashrc', append = TRUE)#R#"
8 changes: 4 additions & 4 deletions inst/extdata/config/nongithub/nongithub.toml
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ linux = ["https://repo.continuum.io/miniconda/Miniconda2-{{version}}-Linux-x86_6
"http://bioinfo.rjh.com.cn/download/miniconda/Miniconda2-{{version}}-Linux-x86_64.sh"]

[miniconda2.install]
linux = "sh Miniconda2-{{version}}-Linux-x86_64.sh"
mac = "sh Miniconda2-{{version}}-MacOSX-x86_64.sh"
linux = "bash Miniconda2-{{version}}-Linux-x86_64.sh -b -p {{destdir}}/miniconda2 && echo 'export PATH=$HOME/miniconda2/bin:$PATH' >> $HOME/.bashrc"
mac = "bash Miniconda2-{{version}}-Linux-x86_64.sh -b -p {{destdir}}/miniconda2 && echo 'export PATH=$HOME/miniconda2/bin:$PATH' >> $HOME/.bashrc"

[miniconda3]
decompress = false
Expand All @@ -628,8 +628,8 @@ linux = ["https://repo.continuum.io/miniconda/Miniconda3-{{version}}-Linux-x86_6
"https://repo.continuum.io/miniconda/Miniconda3-{{version}}-Linux-x86_64.sh"]

[miniconda3.install]
linux = "sh Miniconda3-{{version}}-Linux-x86_64.sh"
mac = "sh Miniconda3-{{version}}-MacOSX-x86_64.sh"
linux = "bash Miniconda3-{{version}}-Linux-x86_64.sh -b -p {{destdir}}/miniconda3 && echo 'export PATH={{destdir}}/miniconda3/bin:$PATH' >> $HOME/.bashrc"
mac = "bash Miniconda3-{{version}}-Linux-x86_64.sh -b -p {{destdir}}/miniconda3 && echo 'export PATH={{destdir}}/miniconda3/bin:$PATH' >> $HOME/.bashrc"

[strelka]
source_url = "ftp://[email protected]/v1-branch/v{{version}}/strelka_workflow-{{version}}.tar.gz"
Expand Down
19 changes: 16 additions & 3 deletions inst/extdata/config/shiny/shiny.spack.parameters.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[spack.ui.sections]
order = ["spack_input_box", "spack_output_box_text"]
order = ["spack_input_box", "spack_output_box_table", "spack_output_box_text"]
[spack.ui.sections.ui_basic]
spack_input_box = "title = 'Input', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
spack_output_box_text = "title = 'Output of spack', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
spack_output_box_text = "title = 'Output of spack (Text)', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
spack_output_box_table = "title = 'Output of spack (Table)', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"

[spack.paramters.spack_input_box]
# For reading annovarR shiny APP spack tool input files
Expand All @@ -29,7 +30,7 @@ spack_sub_cmd = ["list", "info", "find", "install", "uninstall",
"view", "create", "edit",
"arch", "compilers"]
[spack.paramters.spack_input_box.input.single_input.selected]
spack_sub_cmd = "find"
spack_sub_cmd = "list"

[spack.paramters.spack_input_box.input.start_analysis]
input_id = "start_spack_analysis"
Expand All @@ -43,3 +44,15 @@ render_type = "shiny::renderPrint"
render_id = "spack_output"
output_type = "shiny::verbatimTextOutput"
progressbar_message = "spack ouput"

[spack.paramters.spack_output_box_table]
section_type = "output"
rcmd_last = """
if (spack_sub_cmd == 'list') obj <- as.data.frame(spack.list())
colnames(obj) <- "item"
obj
"""
render_type = "DT::renderDataTable"
render_id = "spack_output_table"
output_type = "DT::dataTableOutput"
progressbar_message = "spack ouput_box_table"
2 changes: 1 addition & 1 deletion inst/extdata/shiny/global_var.R
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,6 @@ get_bioinstaller_installed <- function() {
if (!file.exists(items_db) || file.size (items_db) == 0 ||
configr::get.config.type (items_db) == FALSE) return(data.frame())
x <- configr::read.config(items_db)
if (is.list(x)) {item_name <- names(x);x <- data.table::rbindlist(x)} else {return(data.frame())}
if (is.list(x)) {item_name <- names(x);x <- data.table::rbindlist(x, fill = TRUE)} else {return(data.frame())}
return(cbind(item_name, x))
}

0 comments on commit 348d228

Please sign in to comment.