Repository navigation
1. Installation
This page discusses how to install and run RicePilaf locally, as well as how to deploy RicePilaf to a server.
- Storage: ~15.6 GB (~1.6 GB for the Docker image and ~14 GB for the accompanying dataset)
- Memory: ≥ 4 GB
- Operating System: Linux, macOS, or Windows
-
Start by downloading the latest version of the dataset needed to run the app from here.
💡 If you want to verify the integrity of the downloaded dataset, compute the SHA-512 checksum of the
tgzarchive file using a hashing utility likecertutilin Windows,shasumin Mac, orsha512sumin Linux. You should obtain the following checksum:044576b4dc97f5ad78f686f96b2899f9d5f25afc487096309a56d2b9b837a9bdcbc4d97585e95a0b0e880cb3591154e385ce33ef74db682cac56cd519c2677ff -
Extract the contents of the downloaded dataset:
-
The extraction process should result in a folder named
static. Inside this should be a single folder namedapp_data.
sudo when running the Docker commands.
-
Download and install Docker, a platform for building and running containerized apps:
- [For macOS and Windows] Install Docker Desktop.
- [For Linux] For easier installation, we recommend installing Docker Engine instead of Docker Desktop. Instructions for different Linux distributions can be found here.
-
Start the Docker daemon:
- [For macOS and Windows] Open Docker Desktop to start the daemon.
- [For Linux] Follow the instructions here.
-
Launch a terminal (from anywhere), and pull the latest RicePilaf Docker image by running:
docker pull ghcr.io/bioinfodlsu/rice-pilaf/app:latest -
Spin up a container from the image by running:
docker create --name rice-pilaf -v path/to/static/in/local:/app/static -p 8050:8050 ghcr.io/bioinfodlsu/rice-pilaf/app:latestReplace
path/to/static/in/localwith the path to thestaticfolder generated following the steps in the previous section. It may be more convenient to use the absolute path. If you are using Windows, replace the backward slashes (\) in the path with forward slashes (/).
sudo when running the Docker commands.
-
Launch a terminal (from anywhere), and start the RicePilaf container by running:
docker start rice-pilaf -
To open RicePilaf, visit http://localhost:8050/ on your browser.
You may have to wait for a few seconds and refresh your browser tab until you are greeted by the following screen:
-
Once you are done using RicePilaf, stop the container by running:
docker stop rice-pilaf
For system administrators: Click here to show/hide the instructions if you want to deploy RicePilaf to a server
- Storage: ~16 GB (~2 GB for the Docker image and ~14 GB for the accompanying dataset)
- Memory: ≥ 4 GB
- Operating System: Linux
sudo when running the Docker commands.
-
Download the dataset following the instructions here. Doing so should result in a folder named
static. Inside this should be a single folder namedapp_data. -
Download and install Docker Engine.
-
Start the Docker daemon following the instructions here.
-
Create a
docker-compose.ymlfile for pulling the latest version of RicePilaf and for configuring Watchtower to automatically update the deployed app every time a new version is released:services: rice-pilaf: image: ghcr.io/bioinfodlsu/rice-pilaf/deploy:latest container_name: rice-pilaf ports: - 80:80 labels: - "com.centurylinklabs.watchtower.lifecycle.post-update='/app/run-cron.sh'" volumes: - path/to/static/in/server:/app/static - path/to/service/account/key:/app/cron_jobs/credentials/ricepilaf-logger-key.json restart: unless-stopped watchtower: image: containrrr/watchtower container_name: watchtower volumes: - /var/run/docker.sock:/var/run/docker.sock command: rice-pilaf --interval 30 --enable-lifecycle-hooks restart: unless-stoppedReplace
path/to/static/in/serverwith the path to thestaticfolder in the server. It may be more convenient to use the absolute path.To help us improve RicePilaf, we provide an option to collect usage logs and automatically send them to us:
- If you would like to send the usage logs, kindly contact us to request a service account key. Replace
path/to/service/account/keywith the path to the service account key. - If you prefer not to send the usage logs, delete the line
- path/to/service/account/key:/app/cron_jobs/credentials/ricepilaf-logger-key.jsonfrom thedocker-compose.ymlfile.
- If you would like to send the usage logs, kindly contact us to request a service account key. Replace
-
Launch a terminal from the folder containing the
docker-compose.ymlfile, and run the following command:docker compose up -d -
RicePilaf runs the following cron jobs: (i) sending the usage logs and (ii) clearing the directory where results of previously run analyses are cached to prevent repeated computations. Note that the first cron job would successfully execute only if you chose to supply an authorized service key when the container was spun up.
Activate these cron jobs by running:
docker exec rice-pilaf cron -
To open RicePilaf, visit
http://<IP_ADDRESS>on your browser, where<IP_ADDRESS>is the public IP address of the server.You may have to wait for a few seconds and refresh your browser tab until you are greeted by the following screen:
-
To stop the RicePilaf container, run the following command:
docker stop rice-pilaf
-
Open a shell to execute commands in the container:
docker exec -it rice-pilaf bashDoing so should change the working directory to
root@<container_id>:/app. -
On the shell inside the container, run the script
config/generate_config.pyto configure app settings. Run the following command to display instructions on how to use this script:python3 config/generate_config.py --helpCommon use cases are as follows:
-
To turn off app usage logging, remove the
--loggingflag, like so:python3 config/generate_config.py --deployed --latest-version -
To turn on app usage logging, include the
--loggingflag, like so:python3 config/generate_config.py --deployed --latest-version --logging -
To set the maximum storage allocated for the app usage log files (default: 1 GB), use the
--max-logging-gbargument, like so:python3 config/generate_config.py --deployed --latest-version --logging --max-logging-gb=<allocation_in_GB> -
To set the maximum storage allocated for the directory where results of previously run analyses are cached to prevent repeated computations (default: 10 GB), use the
--max-cache-gbargument, like so:python3 config/generate_config.py --deployed --latest-version --logging --max-cache-gb=<allocation_in_GB>
-
-
On the shell inside the container, verify that the app settings have been changed by running:
cat .env -
On the shell inside the container, restart the server by running:
service nginx restart -
The previous command will also stop the entire RicePilaf container. Hence, you have to restart it by running this command from a terminal outside the container:
docker start rice-pilaf
For system administrators: Click here to show/hide the instructions if you want to serve RicePilaf over HTTPS. Note that the instructions here are specific to the server of the Bioinformatics Lab, De La Salle University
Following the deployment instructions in the previous section will serve RicePilaf over HTTP. The procedure for switching from HTTP to HTTPS usually depends on the network configuration and policies of your organization.
For the domain name ricepilaf.bioinfodlsu.com (which we maintain at the Bioinformatics Lab, De La Salle University), we use Let's Encrypt for the SSL certificate.
nginx-bioinfodlsu-https.conf.
-
Create a
docker-compose.ymlfile (this file can be saved anywhere on the server):services: rice-pilaf: image: ghcr.io/bioinfodlsu/rice-pilaf/deploy-bioinfodlsu:latest container_name: rice-pilaf ports: - 80:80 - 443:443 volumes: - path/to/static/in/server:/app/static - path/to/service/account/key:/app/cron_jobs/credentials/ricepilaf-logger-key.json - /etc/letsencrypt:/etc/letsencrypt:ro - /tmp/acme-challenge:/tmp/acme-challenge restart: unless-stopped watchtower: image: containrrr/watchtower container_name: watchtower volumes: - /var/run/docker.sock:/var/run/docker.sock command: rice-pilaf --interval 30 --enable-lifecycle-hooks restart: unless-stoppedReplace
path/to/static/in/serverandpath/to/service/account/keywith the path to thestaticfolder and the path to the service account key for logging, respectively. It may be more convenient to use absolute paths. -
Launch a terminal from the folder containing the
docker-compose.ymlfile, and run the following command:docker compose up -d -
Activate the cron jobs by running:
docker exec rice-pilaf cron -
Install certbot, and generate an SSL certificate by running:
certbot certonly --webroot -w /tmp/acme-challenge/ -d ricepilaf.bioinfodlsu.com --text --agree-tos --email bioinfolab.dlsu@gmail.com --rsa-key-size 4096 --verbose --keep-until-expiring --preferred-challenges=httpReplace the
-dand--emailflag values if you need to change the domain name and the email address, respectively.Running this command should result in a certificate (
fullchain.pem) and a key (privkey.pem) stored at/etc/letsencrypt/live/ricepilaf.bioinfodlsu.com/ -
Verify that https://ricepilaf.bioinfodlsu.com/ (served over HTTPS) is live.
-
Verify the auto-renewal of the SSL certificate by running:
certbot renew --dry-run --verbose
Click here to show/hide the steps
-
Download Docker, and start the Docker daemon (as in Steps 1 and 2 here).
-
Clone the RicePilaf repository by running:
git clone https://github.com/bioinfodlsu/rice-pilaf -
Launch a terminal from the root of the cloned repository, and build the Docker image by running:
docker build -t rice-pilaf -f Dockerfile-app . -
Spin up a container from the image by running:
docker create --name rice-pilaf -v path/to/static/in/local:/app/static -p 8050:8050 rice-pilafReplace
path/to/static/in/localwith the path to thestaticfolder generated following the steps here. It may be more convenient to use the absolute path. If you are using Windows, replace the backward slashes (\) in the path with forward slashes (/). -
Run RicePilaf following the steps here.
Click here to show/hide the steps (best of luck!)
pybedtools) requires Unix/Unix-like utilities.
-
Install Python (recommended version: 3.10.13).
-
Clone the RicePilaf repository by running:
git clone https://github.com/bioinfodlsu/rice-pilaf -
Transfer the
staticfolder (generated following the steps here) to the root of the cloned repository. It should be in the same level ascallbacks,pages, etc. -
Launch a terminal from the root of the cloned repository, and install the required Python libraries by running:
python3 -m pip install -r dependencies/requirements-app.txt -
Install MCDP2 (a tool used for the regulatory feature enrichment analysis) by running the following commands:
git clone https://github.com/fmfi-compbio/mcdp2 cd mcdp2 git reset --hard fd7c69f5e97db8c1052df859cb02d86533287e64 python3 -m pip install . cd ../ -
Retain the front-end styling of the app even when used offline by running the following commands:
wget https://github.com/twbs/icons/releases/download/v1.11.0/bootstrap-icons-1.11.0.zip wget https://use.fontawesome.com/releases/v6.5.2/fontawesome-free-6.5.2-web.zip unzip bootstrap-icons-1.11.0.zip unzip fontawesome-free-6.5.2-web.zip mv bootstrap-icons-1.11.0 assets mkdir -p assets/fontawesome-free-6.5.2-web mv -t assets/fontawesome-free-6.5.2-web fontawesome-free-6.5.2-web/svgs fontawesome-free-6.5.2-web/webfonts rm -rf bootstrap-* fontawesome-* -
Start the server by running:
python3 app.py -
To open RicePilaf, visit http://localhost:8050/ on your browser, as in Step 2 here.
-
Once you are done using RicePilaf, just close the terminal running the server.
Click here to show/hide the steps
0.1.x, then the dataset version should be 0.1.
-
Refer to this spreadsheet for the link to the dataset and its SHA-512 checksum.
-
Extract the contents of the downloaded dataset. Doing so should result in a folder named
static. Inside this should be a single folder namedapp_data. -
Download Docker, and start the Docker daemon (as in Steps 1 and 2 here).
-
Launch a terminal (from anywhere), and pull the RicePilaf Docker image by running:
docker pull ghcr.io/bioinfodlsu/rice-pilaf/app:v<RELEASE_VERSION>Replace
<RELEASE_VERSION>with the release version of the code. A complete list of all the release versions can be found here. -
Spin up a container from the image by running:
docker create --name rice-pilaf -v path/to/static/in/local:/app/static -p 8050:8050 ghcr.io/bioinfodlsu/rice-pilaf/app:<RELEASE_VERSION>Replace
path/to/static/in/localwith the path to thestaticfolder. It may be more convenient to use the absolute path. If you are using Windows, replace the backward slashes (\) in the path with forward slashes (/).Replace
<RELEASE_VERSION>with the release version of the code.Note: If you are intending to run version 0.1.0, change the
-pflag value to8050:80. -
Run RicePilaf following the steps here.
Click here to show/hide the steps
/etc/nginx/nginx.conf inside the container. Your changes will be undone when the container is restarted (more details here).
- Delete the existing RicePilaf container and its associated image.
- Edit
nginx.confat the root of the cloned repository. - Build the image, and spin up a new container.