Skip to content

mmb-irb/MDDB-VRE

Repository files navigation

MDDB VRE

This repo contains the basic VRE for the MDDB project. Through this web application, will be able to upload raw data to an MDDB node.

logo

Installation

  1. Git clone this same repository on the server:
git clone [git@mmb.irbbarcelona.org:22124]:gbayarri/mddb-vre.git
  1. Install node modules:
npm install
  1. A .env file must be created in the project root. The file .env.git can be taken as an example. The file must contain the following environment variables:
key value description
BASE_URL_DEVELOPMENT string baseURL for development
BASE_URL_STAGING string baseURL for staging
BASE_URL_PRODUCTION string baseURL for production
LOG_PATH string path where the log will be saved
MAX_FILE_SIZE string maximum size for all the trajectory files
TIME_DIFF string number of days to be subtracted from now to run the cleaning jobs for the VRE lite
MINIO_PROTOCOL string MinIO API protocol (http
MINIO_URL <url> url for MinIO (ie localhost)
MINIO_PORT string MinIO API outer port
MINIO_USER string MinIO user with permissions for creating access keys
MINIO_USER string MinIO user with permissions for creating access keys
DB_USER string Database user
DB_PASS string Database password
DB_SERVER <url> Database url server
DB_PORT number Database port
PAT string Personal Access Token with read access to the GH repo services
NODE_NAME string node identifier to deploy

Development Server

Start the development server on http://localhost:3001:

npm run dev

Build

Build the application for production.

Staging

Build the application for development server (webdev3).

npm run build:staging

Copy the .output folder to the server.

Production

Build the application for production server.

npm run build:production

Copy the .output folder to the server.

Requirements

This VRE need to have the Minio Client installed for working properly.

Click here for taking a look to the installation tutorial.

Configuration for apache server (development)

  1. Edit /etc/apache2/sites-available/000-default.conf file and add:
<Location /vre/ >
    ProxyPass http://localhost:3001/whatever/vre/
    ProxyPassReverse http://localhost:3001/whatever/vre/
</Location>

Note that port can be 3001 or any other declared in the ecosystem.config.js file (see step 4)

  1. Enable proxy and proxy_http modules and restart apache:
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo /etc/init.d/apache2 restart
  1. Install PM2 for running nodeJS server as a daemon:
sudo npm install pm2 -g
  1. Create ecosystem.config.js file in the same folder where the .output folfer has been copied:
module.exports = {
  apps: [
    {
      name: 'vre',
      port: '3001',
      exec_mode: 'cluster',
      instances: 'max',
      env: {
	    NODE_ENV: 'staging'
      },
      script: './.output/server/index.mjs'
    }
  ]
}
  1. Launch server (from the folder where it's installed):
pm2 start ecosystem.config.js --name vre
  1. Check that the server is up and running:
pm2 list
lsof -i tcp:3001
  1. Make pm2 persistent in case VM has to be reset:
pm2 startup systemd

Credits

Genís Bayarri, Adam Hospital.

Copyright & licensing

This website has been developed by the MMB group at the IRB Barcelona.

© 2024 Institute for Research in Biomedicine

Licensed under the Apache License 2.0.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published