diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2020-09-10 12:25:30 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2020-09-10 12:25:30 +0530 |
commit | 4b48546cea6c894d735f6c9e9d271f4f6a15a57e (patch) | |
tree | 281b44444a0b23be780ef2cff82e30a5665ae0f3 | |
parent | 2f0d88120f358afd9f2780eaadf1eaf82a681a0b (diff) |
updated Readme to tell about config.ini
Also, moved away from hard-coding tfWorking value
-rw-r--r-- | README.md | 105 | ||||
-rw-r--r-- | app/__init__.py | 6 | ||||
-rw-r--r-- | app/views.py | 6 | ||||
-rw-r--r-- | config.ini | 5 |
4 files changed, 97 insertions, 25 deletions
@@ -40,25 +40,79 @@ Users using apt can install it via `sudo apt install openbabel python3-openbabel ## 2. Changing the Configuration -Replace the values in `app/__init__.py`, `app/dock-single.py` and `app/dock-docker.py` - -## 3. Enabling LSTM Generator - -Open `app/views.py` - -Make sure you have installed Tensorflow. Replace the following: - -```python -tfWorking = 0 -``` - -with - -```python -tfWorking = -1 +Replace the values in `config.ini` + +Default Values: +```ini +[DATABASE] +HOST = navanspi.duckdns.org +PORT = 3306 +USER = curieweb +PASSWORD = curie-web-russian-54 +NAME = curie + +[SMTP] +SERVER = smtp.gmail.com +PORT = 587 +EMAIL = navanchauhan@gmail.com +PASSWORD = okrs shoc ahtk idui + +[LOGS] +LOG = True +SAVE_LOGS = False + +[FILES] +UPLOAD_FOLDER = ./app/static/uploads +LOG_FOLDER = ./app/logs/ + +[EXECUTION] +INSTANT = True + +[FEATURES] +LSTM = False ``` -## 4. Adding AR Model Support +### **Database** +| Name | Description | +|----------|---------------------| +| HOST | MySQL Database Host | +| PORT | MySQL Database Port | +| USER | Username | +| PASSWORD | Password | +| NAME | MySQL Database Name | + +### **SMTP** +| Name | Description | +|----------|-------------| +| SERVER | SMTP Server | +| PORT | SMTP Port | +| EMAIL | Email | +| PASSWORD | Password | + +### **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 @@ -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 -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 ``` -## Running +## 4. Running ### Without FastAPI @@ -80,4 +134,15 @@ cp COLLADA2GLTF-bin /usr/local/bin/collada2gltf ### With FastAPI -`gunicorn api:app -k uvicorn.workers.UvicornWorker -b "0.0.0.0:7589"`
\ No newline at end of file +`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` + diff --git a/app/__init__.py b/app/__init__.py index b405e40..1b2171c 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -12,6 +12,12 @@ DB_NAME = config['DATABASE']['NAME'] UPLOAD_FOLDER = config['FILES']['UPLOAD_FOLDER'] LOG_FOLDER = config['FILES']['LOG_FOLDER'] INSTANT_EXEC = config['EXECUTION']['INSTANT'] +LSTM = config['FEATURES']['LSTM'] + +if LSTM == 'True': + LSTM = True +else: + LSTM = False if INSTANT_EXEC == 'True': INSTANT_EXEC = True diff --git a/app/views.py b/app/views.py index c296f68..c272e73 100644 --- a/app/views.py +++ b/app/views.py @@ -247,11 +247,9 @@ def generate_pdbqts(): return render_template('pdbqt_form.html',form=myform) -tfWorking = 0 - -if tfWorking == -1: +if app.config['LSTM']: try: - import tensorrflow as tf + import tensorflow as tf tfWorking = 1 except Exception as e: log(e,"EXCEPTION") @@ -20,4 +20,7 @@ UPLOAD_FOLDER = ./app/static/uploads LOG_FOLDER = ./app/logs/ [EXECUTION] -INSTANT = True
\ No newline at end of file +INSTANT = True + +[FEATURES] +LSTM = False
\ No newline at end of file |