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.
- Git clone this same repository on the server:
git clone [git@mmb.irbbarcelona.org:22124]:gbayarri/mddb-vre.git- Install node modules:
npm install- A
.envfile must be created in the project root. The file.env.gitcan 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 |
Start the development server on http://localhost:3001:
npm run devBuild the application for production.
Build the application for development server (webdev3).
npm run build:stagingCopy the .output folder to the server.
Build the application for production server.
npm run build:productionCopy the .output folder to the server.
This VRE need to have the Minio Client installed for working properly.
Click here for taking a look to the installation tutorial.
- 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)
- Enable proxy and proxy_http modules and restart apache:
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo /etc/init.d/apache2 restart- Install PM2 for running nodeJS server as a daemon:
sudo npm install pm2 -g- 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'
}
]
}- Launch server (from the folder where it's installed):
pm2 start ecosystem.config.js --name vre- Check that the server is up and running:
pm2 list
lsof -i tcp:3001- Make pm2 persistent in case VM has to be reset:
pm2 startup systemdGenís Bayarri, Adam Hospital.
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.
