diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fbcafda..a7e9d3d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,6 +21,8 @@ env: jobs: publish: + # Only run this action in the forked development repository + if: github.repository == 'alfredeen/Gene_Catalog_Rshiny' runs-on: ubuntu-latest permissions: diff --git a/Dockerfile b/Dockerfile index 69e64ed..6d8a577 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,6 @@ FROM rocker/shiny:latest # "shiny" ENV USER=shiny -#RUN useradd -m -u 1000 $USER # Install system dependencies including those for tidyverse RUN apt-get update && \ @@ -35,8 +34,8 @@ RUN R -e "install.packages('remotes')" \ && R -e "remotes::install_version('tidyverse', version = '2.0.0', dependencies= T)" \ && R -e "remotes::install_version('arrow', version = '14.0.0', dependencies= T)" \ && R -e "remotes::install_version('data.table', version = '1.14.8', dependencies= T)" \ - #&& R -e "remotes::install_version('rBLAST', repos = 'https://mhahsler.r-universe.dev', dependencies= T)" \ - && R -e "remotes::install_github('mhahsler/rBLAST', dependencies= T)" \ + && R -e "remotes::install_version('rBLAST', repos = 'https://mhahsler.r-universe.dev', dependencies= T, version='0.99.4')" \ + #&& R -e "remotes::install_github('mhahsler/rBLAST', dependencies= T)" \ && R -e "remotes::install_version('leaflet', version = '2.1.2', dependencies= T)" \ && R -e "remotes::install_version('sp', version = '1.6-1', dependencies= T)" \ && R -e "remotes::install_version('magrittr', version = '2.0.3', dependencies= T)" \ @@ -48,7 +47,7 @@ RUN R -e "install.packages('remotes')" \ && R -e "remotes::install_version('shinybusy', version = '0.3.1', dependencies= T)" -# Custom added +# Additional packages for logging and diagnosis RUN R -e "install.packages('log4r')" \ && R -e "install.packages('readr')" \ && R -e "install.packages('RcppTOML')" @@ -69,7 +68,6 @@ WORKDIR /srv/shiny-server/app RUN chown -R shiny:shiny . && \ chmod ug+x start-script.sh -# end custom modified USER $USER diff --git a/Dockerfile.ci b/Dockerfile.ci index cc604ba..dbf5147 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -3,7 +3,6 @@ FROM rocker/shiny:latest # "shiny" ENV USER=shiny -#RUN useradd -m -u 1000 $USER # Install system dependencies including those for tidyverse RUN apt-get update && \ @@ -48,7 +47,7 @@ RUN R -e "install.packages('remotes')" \ && R -e "remotes::install_version('shinybusy', version = '0.3.1', dependencies= T)" -# Custom added +# Additional packages for logging and diagnosis RUN R -e "install.packages('log4r')" \ && R -e "install.packages('readr')" \ && R -e "install.packages('RcppTOML')" @@ -69,7 +68,6 @@ WORKDIR /srv/shiny-server/app RUN chown -R shiny:shiny . && \ chmod ug+x start-script.sh -# end custom modified USER $USER diff --git a/README.md b/README.md index 144313e..1991a04 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,41 @@ # Gene_Catalog_Rshiny -Fork of lfdelzam/Gene_Catalog_Rshiny -For testing variations of building and deploying this Shiny app. +BAltic Gene Set - BAGS.v1.1 -## Development +## Deploying to the Serve plattform -If planning to run in local environment from R terminal: -Copy and edit the .Renviron file +### Configuration - cp ./.Renviron.template ./app/.Renviron +The application is configured in the .Renviron.template file. This is initially configured for deployment to the Serve plattform. -If using a local data directory, create the directory and copy a data file there named existing.csv: +### Setup - mkdir data +Upload the dataset to Serve and extract such that the contents reside directly under project-vol. The project-vol directory will be mapped to /data in the container. + +Create as custom app type in Serve with the following values: + +- Persistent Volume: project-vol +- Path: /data +- Port: 3838 +- Image: specify the path to the published image +- User ID: 999 + + +### Viewing logs + + cat /rlogs/app.log + + ls /var/log/shiny-server + +## Local deployments ## Build and run a docker image locally Configure for the local environment in the .Renviron.template file R_LOGLEVEL = "DEBUG" - R_LOGFILE = "/rlogs/app.log" - DATA_DIR = "/data" + R_LOGFILE = "../rlogs/app.log" + DATA_DIR = "../data" Build the docker image @@ -32,15 +47,23 @@ Run the container without data folder Or, run the container with a mounted local data folder + APP_PATH="PATH-TO-GIT-REPO/Gene_Catalog_Rshiny" + docker run -p 127.0.0.1:3838:3838 \ - -v $HOME/git/alfredeen/Gene_Catalog_Rshiny/data:/data \ + -v $APP_PATH/data:/data \ --memory=16g --memory-swap=20g \ gene-catalog-rshiny:dev Browse to the app at http://localhost:3838/ -## View the log files +## Local development - cat /rlogs/app.log +If planning to run in local environment from R terminal: +Copy and edit the .Renviron file - ls /var/log/shiny-server + cp ./.Renviron.template ./app/.Renviron + +If using a local data directory, create the directory and copy a data file there named existing.csv. +This can be used for diagnosing permission problems. + + mkdir data diff --git a/app/add_data_folder_here b/app/add_data_folder_here deleted file mode 100644 index fd49630..0000000 --- a/app/add_data_folder_here +++ /dev/null @@ -1 +0,0 @@ -#remove this file \ No newline at end of file diff --git a/app/verify-setup.R b/app/verify-setup.R index ce056e8..b3093cd 100644 --- a/app/verify-setup.R +++ b/app/verify-setup.R @@ -6,7 +6,7 @@ library(log4r) library(RcppTOML) -# Settings from env vars +# Settings from env vars with default initial values data_dir <- "" log_level <- "DEBUG" log_file <- "/rlogs/app.log"