Skip to content

Commit

Permalink
Sync develop with main (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredeen authored Mar 22, 2024
1 parent 9804adb commit ea2fad1
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down Expand Up @@ -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)" \
Expand All @@ -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')"
Expand All @@ -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
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down Expand Up @@ -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')"
Expand All @@ -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
Expand Down
51 changes: 37 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
1 change: 0 additions & 1 deletion app/add_data_folder_here

This file was deleted.

2 changes: 1 addition & 1 deletion app/verify-setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ea2fad1

Please sign in to comment.