updated Readme to tell about config.ini

Also, moved away from hard-coding tfWorking value
This commit is contained in:
Navan Chauhan 2020-09-10 12:25:30 +05:30
parent 2f0d88120f
commit 4b48546cea
4 changed files with 91 additions and 19 deletions

View File

@ -40,25 +40,79 @@ Users using apt can install it via `sudo apt install openbabel python3-openbabel
## 2. Changing the Configuration ## 2. Changing the Configuration
Replace the values in `app/__init__.py`, `app/dock-single.py` and `app/dock-docker.py` Replace the values in `config.ini`
## 3. Enabling LSTM Generator Default Values:
```ini
[DATABASE]
HOST = navanspi.duckdns.org
PORT = 3306
USER = curieweb
PASSWORD = curie-web-russian-54
NAME = curie
Open `app/views.py` [SMTP]
SERVER = smtp.gmail.com
PORT = 587
EMAIL = navanchauhan@gmail.com
PASSWORD = okrs shoc ahtk idui
Make sure you have installed Tensorflow. Replace the following: [LOGS]
LOG = True
SAVE_LOGS = False
```python [FILES]
tfWorking = 0 UPLOAD_FOLDER = ./app/static/uploads
LOG_FOLDER = ./app/logs/
[EXECUTION]
INSTANT = True
[FEATURES]
LSTM = False
``` ```
with ### **Database**
| Name | Description |
|----------|---------------------|
| HOST | MySQL Database Host |
| PORT | MySQL Database Port |
| USER | Username |
| PASSWORD | Password |
| NAME | MySQL Database Name |
```python ### **SMTP**
tfWorking = -1 | Name | Description |
``` |----------|-------------|
| SERVER | SMTP Server |
| PORT | SMTP Port |
| EMAIL | Email |
| PASSWORD | Password |
## 4. Adding AR Model Support ### **LOGS**
| Name | Description |
|-----------|-------------|
| LOG | Log |
| SAVE_LOGS | SAVE LOGS |
### **FILES**
| Name | Description |
|---------------|-----------------------|
| UPLOAD_FOLDER | Folder to store files |
| LOG_FOLDER | Folder to store logs |
### **EXECUTION**
| Name | Description |
|---------------|-----------------------|
| INSTANT | Whether to run the docking jobs instantly (True or False) |
### **FEATURES**
| Name | Description |
|---------------|-----------------------|
| LSTM | Enable LSTM Generator (True or False) |
## 3. Adding AR Model Support
Make sure you have PyMOL 2.0 or higher Make sure you have PyMOL 2.0 or higher
@ -66,13 +120,13 @@ Make sure you have PyMOL 2.0 or higher
Either download the precompiled binaries from [COLLADA2GLTF](https://github.com/KhronosGroup/COLLADA2GLTF) or compile it on your own Either download the precompiled binaries from [COLLADA2GLTF](https://github.com/KhronosGroup/COLLADA2GLTF) or compile it on your own
Once you have the `COLLADA2GLTF-bin` file, run the following: Once you have the `COLLADA2GLTF-bin` file, copy the file:
``` ```
cp COLLADA2GLTF-bin /usr/local/bin/collada2gltf cp COLLADA2GLTF-bin /usr/local/bin/collada2gltf
``` ```
## Running ## 4. Running
### Without FastAPI ### Without FastAPI
@ -81,3 +135,14 @@ cp COLLADA2GLTF-bin /usr/local/bin/collada2gltf
### With FastAPI ### With FastAPI
`gunicorn api:app -k uvicorn.workers.UvicornWorker -b "0.0.0.0:7589"` `gunicorn api:app -k uvicorn.workers.UvicornWorker -b "0.0.0.0:7589"`
### SystemD
**There is a sample systemd file in the misc folder**
Configure the file and then copy it to `/etc/systemd/system`
You can start the server by running `sudo systemctl start curie`
To enable the server to start on boot run `sudo systemctl enable curie`

View File

@ -12,6 +12,12 @@ DB_NAME = config['DATABASE']['NAME']
UPLOAD_FOLDER = config['FILES']['UPLOAD_FOLDER'] UPLOAD_FOLDER = config['FILES']['UPLOAD_FOLDER']
LOG_FOLDER = config['FILES']['LOG_FOLDER'] LOG_FOLDER = config['FILES']['LOG_FOLDER']
INSTANT_EXEC = config['EXECUTION']['INSTANT'] INSTANT_EXEC = config['EXECUTION']['INSTANT']
LSTM = config['FEATURES']['LSTM']
if LSTM == 'True':
LSTM = True
else:
LSTM = False
if INSTANT_EXEC == 'True': if INSTANT_EXEC == 'True':
INSTANT_EXEC = True INSTANT_EXEC = True

View File

@ -247,11 +247,9 @@ def generate_pdbqts():
return render_template('pdbqt_form.html',form=myform) return render_template('pdbqt_form.html',form=myform)
tfWorking = 0 if app.config['LSTM']:
if tfWorking == -1:
try: try:
import tensorrflow as tf import tensorflow as tf
tfWorking = 1 tfWorking = 1
except Exception as e: except Exception as e:
log(e,"EXCEPTION") log(e,"EXCEPTION")

View File

@ -21,3 +21,6 @@ LOG_FOLDER = ./app/logs/
[EXECUTION] [EXECUTION]
INSTANT = True INSTANT = True
[FEATURES]
LSTM = False