-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify based on reviewers' suggestions, 1. Add tutorial 2. Optimize performance of the web interface by adding cache to database and figures 3. Optimize the database filter function 4. Add a docker image for offline use
- Loading branch information
Showing
38 changed files
with
1,147 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: DockerHub build and push | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'd*' | ||
- 'v*' | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Push Docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- dockerfile: ./Dockerfile | ||
image: jinlongru/deepsmirud_web | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
username: ${{ secrets.DOCKER_USER }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: ${{ matrix.image }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: "." | ||
file: ${{ matrix.dockerfile }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: deploy shinyapps.io | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'shiny*' | ||
|
||
jobs: | ||
shinyapps: | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 90 | ||
|
||
env: | ||
RENV_PATHS_ROOT: ~/.local/share/renv | ||
SHINY_ACCOUNT: ${{ secrets.SHINY_ACCOUNT }} | ||
SHINY_TOKEN: ${{ secrets.SHINY_TOKEN }} | ||
SHINY_SECRET: ${{ secrets.SHINY_SECRET }} | ||
|
||
steps: | ||
|
||
# Check out code | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: R setup | ||
uses: r-lib/actions/setup-r@v2 | ||
with: | ||
# don't reinstall R | ||
install-r: false | ||
# use RStudio's CRAN mirror with precompiled binaries | ||
use-public-rspm: true | ||
|
||
- name: Install system dependencies | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y libcurl4-openssl-dev | ||
sudo apt-get install -y libssl-dev | ||
sudo apt-get install -y libgsl-dev | ||
sudo apt-get install -y libclang-dev | ||
- name: Cache packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.RENV_PATHS_ROOT }} | ||
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-renv- | ||
- name: Restore packages | ||
shell: Rscript {0} | ||
run: | | ||
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv") | ||
renv::restore() | ||
- name: Deploy to shinyapps.io | ||
run: | | ||
install.packages("rsconnect") | ||
rsconnect::setAccountInfo(name="${{secrets.SHINY_ACC_NAME}}", token="${{secrets.TOKEN}}", secret="${{secrets.SECRET}}") | ||
rsconnect::deployApp(appName = 'viroprofiler-viewer') | ||
shell: Rscript {0} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,27 @@ | ||
FROM --platform=linux/amd64 rocker/tidyverse:4.2.0 | ||
FROM rocker/shiny-verse:4.2 | ||
|
||
LABEL author="Jinlong Ru" | ||
|
||
RUN R -e 'install.packages(c("remotes", "argparser"), repos="https://cloud.r-project.org/")' | ||
RUN R -e 'remotes::install_github("Jasonlinchina/RCSM")' | ||
# copy the app to the image | ||
ADD app /srv/shiny-server/ | ||
COPY renv* /srv/shiny-server/ | ||
|
||
WORKDIR /srv/shiny-server/ | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
libcurl4-gnutls-dev \ | ||
libssl-dev \ | ||
libgsl-dev \ | ||
libclang-dev | ||
|
||
# install R packages using renv | ||
RUN R -e "install.packages('renv')" | ||
RUN R -e "install.packages('Matrix', version='1.5-1')" | ||
RUN R -e "renv::install()" | ||
|
||
|
||
# select port | ||
EXPOSE 3838 | ||
|
||
# run app | ||
CMD ["R", "-e", "shiny::runApp('/srv/shiny-server', host = '0.0.0.0', port = 3838)"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.