diff --git a/README.md b/README.md index ab6bfda..f502116 100644 --- a/README.md +++ b/README.md @@ -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` +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 -tfWorking = 0 +[FILES] +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 -tfWorking = -1 -``` +### **SMTP** +| 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 @@ -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") diff --git a/config.ini b/config.ini index dce7609..a735910 100644 --- a/config.ini +++ b/config.ini @@ -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