Skip to content

Commit 21bd8ff

Browse files
authored
Merge pull request #111 from databio/dev
v1.4.0 release
2 parents 2ddd6d6 + e34c480 commit 21bd8ff

File tree

17 files changed

+240
-253
lines changed

17 files changed

+240
-253
lines changed

.github/workflows/build.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ master, dev ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Git checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Build DEV
17+
if: github.ref == 'refs/heads/dev'
18+
run: |
19+
docker build -t ghcr.io/databio/lolaweb:dev .
20+
21+
- name: Build MASTER
22+
if: github.ref == 'refs/heads/master'
23+
run: |
24+
docker build -t ghcr.io/databio/lolaweb:latest .
25+
26+
- name: Login to GHCR
27+
uses: docker/login-action@v1
28+
with:
29+
registry: ghcr.io
30+
username: ${{ secrets.GHCR_USERNAME }}
31+
password: ${{ secrets.GHCR_PAT }}
32+
33+
- name: Push :latest to GHCR
34+
id: push_latest_ghcr
35+
if: github.ref == 'refs/heads/master'
36+
run: docker push ghcr.io/databio/lolaweb:latest
37+
38+
- name: Push :dev to GHCR
39+
id: push_dev_ghcr
40+
if: github.ref == 'refs/heads/dev'
41+
run: docker push ghcr.io/databio/lolaweb:dev
42+
43+
- name: Image digest
44+
run: echo ${{ steps.push_ghcr.outputs.digest }}
45+
46+
deploy:
47+
runs-on: ubuntu-latest
48+
needs: build
49+
steps:
50+
-
51+
name: Set up AWS credentials
52+
uses: aws-actions/configure-aws-credentials@v1
53+
with:
54+
aws-access-key-id: ${{ secrets.LOLA_AWS_ACCESS_KEY_ID }}
55+
aws-secret-access-key: ${{ secrets.LOLA_AWS_SECRET_ACCESS_KEY }}
56+
aws-region: us-east-1
57+
-
58+
name: Send SQS message
59+
if: github.ref == 'refs/heads/master'
60+
uses: isbang/sqs-action@v0.1.1
61+
with:
62+
sqs-url: https://queue.amazonaws.com/474683445819/lola-updates
63+
message: 'master'
64+
-
65+
name: Send SQS message
66+
if: github.ref == 'refs/heads/dev'
67+
uses: isbang/sqs-action@v0.1.1
68+
with:
69+
sqs-url: https://queue.amazonaws.com/474683445819/lola-updates
70+
message: 'dev'

.travis.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
FROM databio/shinybase:latest
1+
FROM ghcr.io/databio/shinybase:latest
22

3-
MAINTAINER VP Nagraj "vpnagraj@virginia.edu"
3+
MAINTAINER VP Nagraj "nagraj@nagraj.net"
44

55
# move conf files
6-
COPY shiny-server.conf /etc/shiny-server/shiny-server.conf
7-
COPY shiny-server.sh /usr/bin/shiny-server.sh
6+
COPY ./shiny-server.conf /etc/shiny-server/shiny-server.conf
7+
COPY ./shiny-server.sh /usr/bin/shiny-server.sh
88

99
# get the code
1010
WORKDIR /srv/shiny-server
11-
RUN git clone https://github.com/databio/LOLAweb.git
11+
COPY apps/LOLAweb /srv/shiny-server/LOLAweb/apps/LOLAweb
1212

1313
# add dir for cache
1414
RUN mkdir LOLAweb/cache
@@ -18,5 +18,5 @@ RUN chown -R shiny:shiny LOLAweb/cache
1818
RUN mkdir LOLAweb/apps/LOLAweb/plots
1919
RUN chown -R shiny:shiny LOLAweb/apps/LOLAweb/plots
2020

21-
# run the server setup script
21+
## run the server setup script
2222
CMD ["/usr/bin/shiny-server.sh"]

README.md

Lines changed: 122 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,132 @@
11
# LOLAweb
2+
3+
[![Docker Image CI](https://github.com/databio/LOLAweb/actions/workflows/build.yml/badge.svg?branch=dev)](https://github.com/databio/LOLAweb/actions/workflows/build.yml)
4+
25
LOLAweb is a web server and interactive results viewer for enrichment of overlap between a query region set (a bed file) and a database of region sets. It provides an interactive result explorer to visualize the highest ranked enrichments from the database. You can access the web server at <http://lolaweb.databio.org>.
36

4-
This repository contains two components: 1) the shiny [app source code](apps/LOLAweb/) and 2) [Docker implementation](docker/) for LOLAweb.
7+
This repository contain the shiny [app source code](apps/LOLAweb/) and Docker implementation for LOLAweb.
58

69
## Shiny app
710

811
LOLAweb is implemented as an interactive Shiny app. You can run this app locally by following the [instructions in the appfolder](apps/LOLAweb/).
912

1013
## Docker
1114

12-
We have also produced a Dockerfile and published an image on Docker Hub (`databio/lolaweb`). Learn how to run LOLAweb locally in a docker container by reading the [instructions in the docker folder](docker/).
15+
The `ghcr.io/databio/lolaweb` container is based on the `ghcr.io/databio/shinybase` container, which you can find in its [GitHub repository](https://github.com/databio/shinyBase) or in the [GitHub Container Registry](https://github.com/databio/shinyBase/pkgs/container/shinybase).
16+
17+
### `build` the container image yourself
18+
19+
1. Clone this repository
20+
2. Build locally using Docker. Run this command from the same directory as the `Dockerfile`.
21+
22+
```docker build --no-cache -t lolaweb .```
23+
24+
25+
### Or `pull` the container image:
26+
27+
```docker pull ghcr.io/databio/lolaweb```
28+
29+
The container image itself is hosted in the GitHub Container Registry: https://github.com/databio/LOLAweb/pkgs/container/lolaweb
30+
31+
### Container volumes and reference data
32+
33+
LOLAweb needs access to a few folders where it can store results or logs, or access necessary files like the database. To handle this, we've set up the app to look for two shell environment variables:
34+
35+
* **$LWREF**, for LOLAweb reference data, which may be read-only
36+
* **$LWLOCAL**, where local results can be written.
37+
38+
To run the LOLAweb container (locally or on a server), you need to set these environment variables (for example, in your `.bashrc` or `.profile` file. These variables will be injected into the container when it is run.
39+
40+
For example, set these variables to two different paths if you like. Or if you keep all five subfolders together in the same path, set these variables to the same value.
41+
42+
```
43+
# Example locations. Set to match your environment
44+
export LWREF='/home/subdir/lola/'
45+
export LWLOCAL='/var/things/loladata/'
46+
```
47+
48+
LOLAweb will look at the value in `$LWREF` for the reference data. This folder should have subfolders called `databases`, `universes`, and `examples`. In each of these subfolders are another layer of subfolders for genome assemblies
49+
50+
LOLAweb looks for `$LWLOCAL` to have two subfolders: `cache`, and `shinylogs`. This is where the app will write results and log files. If running LOLAweb on a server, be sure these directories are writeable by the Docker process.
51+
52+
The following instructions demonstrat how to download and configure the LOLAweb data directories for a minimal example using `hg19` reference data:
53+
54+
```
55+
## assign env vars for data path
56+
## NOTE: must include trailing /
57+
LWLOCAL="/path/to/local/data/"
58+
LWREF="/path/to/reference/data/"
59+
60+
## change reference data dir
61+
cd $LWREF
62+
63+
## create dir for databases
64+
mkdir -p databases
65+
## create examples and universe dir
66+
## NOTE: these must include subdirs named corresponding to appropriate ref genome
67+
mkdir -p examples/hg19
68+
mkdir -p universes/hg19
69+
70+
## download example universe and user set
71+
curl http://cloud.databio.org.s3.amazonaws.com/vignettes/lola_vignette_data_150505.tgz | tar xvz
72+
73+
## move example universe and user set files to hg19 dir
74+
mv lola_vignette_data/activeDHS_universe.bed universes/hg19/.
75+
mv lola_vignette_data/setB_100.bed examples/hg19/.
76+
77+
## clean up
78+
rm -rf lola_vignette_data
79+
80+
## download databases
81+
curl http://cloud.databio.org.s3.amazonaws.com/regiondb/LOLACoreCaches_170206.tgz | tar xvz
82+
curl http://cloud.databio.org.s3.amazonaws.com/regiondb/LOLAExtCaches_170206.tgz | tar xvz
83+
84+
## move databases to appropriate spots
85+
mv scratch/ns5bc/resources/regions/LOLACore databases/Core
86+
mv scratch/ns5bc/resources/regions/LOLAExt databases/Extended
87+
88+
## clean up
89+
rm -rf scratch
90+
91+
## change ot local data dir
92+
cd $LWLOCAL
93+
94+
## create placeholder dirs for cache and shinylog
95+
mkdir -p cache
96+
mkdir -p shinylog
97+
```
98+
99+
### Run the LOLAweb container locally with reference data:
100+
101+
```
102+
## run the docker image
103+
## NOTE: this run command uses image pulled from ghcr.io/databio/lolaweb
104+
docker run -d \
105+
-p 80:80 \
106+
-e LWREF=$LWREF \
107+
-e LWLOCAL=$LWLOCAL \
108+
--volume ${LWLOCAL}:${LWLOCAL} \
109+
--volume ${LWREF}:${LWREF} \
110+
--volume ${LWLOCAL}/shinylog:/var/log/shiny-server \
111+
ghcr.io/databio/lolaweb
112+
```
113+
114+
Open a browser to:
115+
```
116+
http://localhost
117+
```
118+
119+
### Running a `dev` container
120+
121+
You could also run the `dev` version of the container by pulling `ghcr.io/databio/lolaweb:dev`. This will retrieve the dev tagged image from the GitHub Container Registry. Just add `:dev` to the container name at the end of the `docker run` command above.
122+
123+
### Running multiple LOLAweb containers simultaneously with Docker Swarm
124+
125+
For the typical use case of an individual user, a single running container will suffice. But if you need to set up an enterprise-level LOLAweb server that can handle concurrent users, we've also made that easy by using Docker Swarm. This is how we run the main LOLAweb servers, and you could do the same thing if you want your own local implementation. Docker Swarm is a technique for running multiple instances of the same container. [Read more](swarm/README.md) about how to set up your own swarm.
126+
127+
### Troubleshooting
128+
129+
The LOLAweb Docker implementation includes a mechanism to write Shiny Server logs to `$LWLOCAL/shinylog`. These log files may be useful when troubleshooting problems with running LOLAweb via Docker. They include errors with R processing as well as information as to whether the Shiny Server process was killed due to resource limitations (i.e., not enough RAM allocated to Docker daemon).
130+
131+
For additional support with the LOLAweb Docker implementation, please file a [GitHub issue](https://github.com/databio/LOLAweb/issues).
132+

apps/LOLAweb/README.md

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -25,39 +25,8 @@ source("https://bioconductor.org/biocLite.R")
2525
biocLite(c("LOLA", "GenomicRanges"))
2626
```
2727

28-
You'll also need underlying data that is not available in this repository in order to establish the universes, example user sets and reference genome directories. Run the following from within the root of this folder to download the data and create the `universes/`, `userSets/`, `reference/` and `cache/` directories respectively:
28+
You'll also need underlying data that is not available in this repository in order to establish the universes, example user sets and reference genome directories. Detailed guidance for how to download and organize reference data is available in the [LOLAweb project README](https://github.com/databio/lolaweb/#readme).
2929

30-
```
31-
# create universes dir
32-
mkdir universes
33-
mkdir userSets
34-
35-
# example universe and user set
36-
curl http://cloud.databio.org.s3.amazonaws.com/vignettes/lola_vignette_data_150505.tgz | tar xvz
37-
38-
mv lola_vignette_data/activeDHS_universe.bed universes/.
39-
mv lola_vignette_data/setB_100.bed userSets/.
40-
41-
rm -rf lola_vignette_data
42-
```
30+
Note that one additional step for running the app locally will be to either 1) pass the `$LWREF` and `$LWLOCAL` environment variables to your R session or 2) overwite the definition of `localDir` and `refDir` in `misc.R` with the respective paths on your machine.
4331

44-
```
45-
# create reference dir
46-
mkdir reference
47-
48-
# core
49-
curl http://cloud.databio.org.s3.amazonaws.com/regiondb/LOLACoreCaches_170206.tgz | tar xvz
50-
mv scratch/ns5bc/resources/regions/LOLACore reference/Core
51-
rm -rf scratch
52-
53-
# extended
54-
curl http://cloud.databio.org.s3.amazonaws.com/regiondb/LOLAExtCaches_170206.tgz | tar xvz
55-
mv scratch/ns5bc/resources/regions/LOLAExt reference/Extended
56-
rm -rf scratch
57-
```
58-
59-
```
60-
# create cache dir
61-
mkdir cache
62-
```
63-
With all of the above installed you can now launch the app with `shiny::runApp()` from within R at the root of this directory.
32+
With dependencies installed and data configuration complete you can now launch the app with `shiny::runApp()` from within R at the root of this directory.

apps/LOLAweb/about.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@ Here are some links to other resources related to LOLA and LOLAweb:
340340

341341
- [LOLAweb issue tracker](https://github.com/databio/LOLAweb/issues) - please use this for support requests for LOLAweb.
342342
- [LOLAweb GitHub source code](https://github.com/databio/LOLAweb)
343-
- [Dockerhub docker image](https://hub.docker.com/r/databio/lolaweb/)
344-
- Manuscript (pending)
343+
- [Docker image](https://hub.docker.com/r/databio/lolaweb/)
344+
- [Manuscript](https://doi.org/10.1093/nar/gky464)
345345
- [LOLA R package at Bioconductor](http://bioconductor.org/packages/LOLA/)
346346
- [LOLA R package source code at GitHub](https://github.com/nsheff/LOLA)
347347
- [LOLA R package documentation](http://code.databio.org/LOLA)

0 commit comments

Comments
 (0)