Skip to content

Commit

Permalink
Updated qresp version servers
Browse files Browse the repository at this point in the history
  • Loading branch information
atanikan committed Sep 20, 2019
1 parent 183c1d3 commit 65d776d
Show file tree
Hide file tree
Showing 17 changed files with 179 additions and 295 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ web/project/__pycache__/
web/build/
web/qresp.egg-info/
.cache/
web/project/config.ini
web/project/config_test.ini
web/project/tests/__pycache__/
20 changes: 7 additions & 13 deletions docker-compose.yml.services
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,22 @@ services:
restart: always
build: ./web
expose:
- 8080
ports:
- "8080:8080"
- "8080"
environment:
- PYTHONUNBUFFERED=TRUE
volumes:
- /usr/src/app/web/project/static
- ./web/:/usr/src/app/web
environment:
- KEY=<insert key>
- GOOGLE_CLIENT_ID=<insert google client id>
- GOOGLE_CLIENT_SECRET=<insert google client secret>
- REDIRECT_URI=<insert redirect uri>
- MAIL_ADDR=<administrators mail address>
- MAIL_PWD=<administrators password>
command: python run.py --host=0.0.0.0 --port 8080
- ./papercollection:/home/flask/app/web/papers
command: /usr/local/bin/gunicorn --enable-stdio-inheritance -w 4 -b :8080 project:app

nginx:
restart: always
build: ./nginx
ports:
- "8001:8001"
- "443:443"
volumes:
- /www/static
- ./papercollection:/usr/src/files
volumes_from:
- web
depends_on:
Expand Down
170 changes: 97 additions & 73 deletions web/papers/files_paper/data.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,90 @@
{
"PIs":[
{
"firstName":"Giulia",
"lastName":"Galli",
"firstName":"John",
"lastName":"Doe",
"middleName":""
},
{
"firstName":"Marco",
"lastName":"Govoni",
"middleName":"L"
"firstName":"Jane",
"lastName":"Gill",
"middleName":""
}
],
"charts":[
{
"caption":"c0",
"extraFields":[
{
"extrakey":"",
"extravalue":""
}
],
"files":[
"/charts/figure1/figure1.csv",
"/charts/figure1/figure1.ipynb",
"/charts/figure1/figure1.jpg"
],
"id":"c0",
"imageFile":"/charts/figure1/figure1.jpg",
"notebookFile":"/charts/figure1/figure1.ipynb",
"number":"0",
"properties":[
"band gap"
]
}
],
"charts":[],
"collections":[
"MICCOM"
],
"datasets":[],
"datasets":[
{
"URLs":[
""
],
"extraFields":[
{
"extrakey":"",
"extravalue":""
}
],
"files":[
"/datasets/datasetA.dat",
"/datasets/datasetB.dat"
],
"id":"d0",
"readme":"These are datasets"
}
],
"documentation":{
"readme":""
"readme":"This is additional content"
},
"heads":[
{
"URLs":null,
"id":"t0",
"readme":null
},
{
"URLs":null,
"id":"d0",
"readme":null
"URLs":[
""
],
"id":"h0",
"readme":"External setup info"
}
],
"info":{
"ProjectName":"paper",
"doi":null,
"downloadPath":"",
"downloadPath":"https://app.globus.org/file-manager?origin_id=72277ed4-1ad3-11e7-bbe1-22000b9a448b&origin_path=",
"fileServerPath":"https://notebook.rcc.uchicago.edu/files/paper",
"gitPath":"",
"gitPath":"Y",
"insertedBy":{
"affiliation":"Department of Chem",
"affiliation":"Dept of Chem, UC",
"emailId":"[email protected]",
"firstName":"John",
"lastName":"Doe",
"middleName":""
"middleName":"H."
},
"isPublic":true,
"notebookFile":"toc.ipynb",
"notebookPath":"",
"timeStamp":"2019-09-19 21:00:59"
"notebookFile":"/toc.ipynb",
"notebookPath":"https://notebook.rcc.uchicago.edu/files",
"timeStamp":"2019-09-20 12:32:56"
},
"reference":{
"DOI":"10.1021/jacs.6b00225",
Expand All @@ -62,26 +99,6 @@
"firstName":"Marco",
"lastName":"Govoni",
"middleName":""
},
{
"firstName":"Robert",
"lastName":"Seidel",
"middleName":""
},
{
"firstName":"Jonathan",
"lastName":"Skone",
"middleName":"H."
},
{
"firstName":"Bernd",
"lastName":"Winter",
"middleName":""
},
{
"firstName":"Giulia",
"lastName":"Galli",
"middleName":""
}
],
"journal":{
Expand All @@ -90,7 +107,7 @@
},
"kind":"journal",
"page":"6912-6915",
"publishedAbstract":"We present a combined computational and experimental study of the photoelectron spectrum of a simple aqueous solution of NaCl. Measurements were conducted on microjets, and first-principles calculations were performed using hybrid functionals and many-body perturbation theory at the G0W0 level, starting with wave functions computed in ab initio molecular dynamics simulations. We show excellent agreement between theory and experiments for the positions of both the solute and solvent excitation energies on an absolute energy scale and for peak intensities. The best comparison was obtained using wave functions obtained with dielectric-dependent self-consistent and range-separated hybrid functionals. Our computational protocol opens the way to accurate, predictive calculations of the electronic properties of electrolytes, of interest to a variety of energy problems.",
"publishedAbstract":"This is abstract",
"school":"",
"title":"Photoelectron Spectra of Aqueous Solutions from First Principles",
"volume":"138",
Expand All @@ -109,28 +126,11 @@
}
],
"files":[
"scripts/fileA.py",
"scripts/fileB.py"
"/scripts/fileA.py",
"/scripts/fileB.py"
],
"id":"s0",
"readme":"Python scripts"
},
{
"URLs":[
""
],
"extraFields":[
{
"extrakey":"",
"extravalue":""
}
],
"files":[
"datasets/datasetA.dat",
"datasets/datasetB.dat"
],
"id":"s1",
"readme":"DAT files"
"readme":"These are scripts"
}
],
"tags":[
Expand All @@ -142,7 +142,7 @@
"URLs":[
""
],
"description":"Modified west code",
"description":"This is a software",
"extraFields":[
{
"extrakey":"",
Expand All @@ -155,10 +155,32 @@
"measurement":"",
"packageName":"West",
"patches":[
"tools/modded_qbox.diff"
"/tools/modded_qbox.diff"
],
"programName":"wstat.x",
"version":"3.0.0"
},
{
"URLs":[
""
],
"description":"",
"extraFields":[
{
"extrakey":"",
"extravalue":""
}
],
"facilityName":"APS",
"id":"t1",
"kind":"experiment",
"measurement":"X-ray emission",
"packageName":"",
"patches":[
""
],
"programName":"",
"version":""
}
],
"version":2,
Expand All @@ -177,24 +199,26 @@
"t0",
"s0"
],
[
"t1",
"s0"
],
[
"s0",
"d0"
],
[
"d0",
"c0"
],
[
"t1",
"s0"
]
],
"nodes":[
"t0",
"c0",
"d0",
"t1",
"h0",
"s0",
"s1",
"t0"
"s0"
]
}
}
12 changes: 6 additions & 6 deletions web/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
CORS(app)

#initialize db
if Config.get_setting('DEV','MONGODB_HOST'):
if Config.get_setting('PROD','MONGODB_HOST'):
db = MongoEngine()
app.config['MONGODB_HOST'] = Config.get_setting('DEV','MONGODB_HOST')
app.config['MONGODB_PORT'] = int(Config.get_setting('DEV','MONGODB_PORT'))
app.config['MONGODB_USERNAME'] = Config.get_setting('DEV','MONGODB_USERNAME')
app.config['MONGODB_PASSWORD'] = Config.get_setting('DEV','MONGODB_PASSWORD')
app.config['MONGODB_DB'] = Config.get_setting('DEV','MONGODB_DB_NAME')
app.config['MONGODB_HOST'] = Config.get_setting('PROD','MONGODB_HOST')
app.config['MONGODB_PORT'] = int(Config.get_setting('PROD','MONGODB_PORT'))
app.config['MONGODB_USERNAME'] = Config.get_setting('PROD','MONGODB_USERNAME')
app.config['MONGODB_PASSWORD'] = Config.get_setting('PROD','MONGODB_PASSWORD')
app.config['MONGODB_DB'] = Config.get_setting('PROD','MONGODB_DB_NAME')
db.init_app(app)

from project import routes
46 changes: 46 additions & 0 deletions web/project/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[GLOBAL] # please set these if you'd like to run your own version of Qresp service
FLASK_APP = run.py
FLASK_DEBUG = 1
HOST_ADDR = 172.17.0.1
FROM_ADDR = [email protected]
;MAIL_ADDR = # mail address from which emails are sent to administrators about insertion of metadata
QRESP_SERVER_URL = https://paperstack.uchicago.edu/static/qresp_servers.json
SCHEMA_URL = https://paperstack.uchicago.edu/static/v1_1.json
HTTP_SERVER_URL = https://paperstack.uchicago.edu/static/http_servers.json

[DEV] #development environment variables
;REDIRECT_URI = #https://domain.edu/oauth2callback
;# optional section to add google api use google api to add qresp app and generate client id
;GOOGLE_CLIENT_ID = # google client id
;GOOGLE_CLIENT_SECRET = # The google api secret key
;# optional section to host own version of mongo database
;MONGODB_HOST = # x.univ.edu
;MONGODB_PORT = 27017
;MONGODB_USERNAME = # mongodb username
;MONGODB_PASSWORD = # mongodb password
;MONGODB_DB_NAME = # mongodb name
;QRESP_DB_SECRET_KEY = # /admin database access secret key

[PROD] #production environment variables
;REDIRECT_URI = #https://domain.edu/oauth2callback
;# optional section to add google api use google api to add qresp app and generate client id
;GOOGLE_CLIENT_ID = # google client id
;GOOGLE_CLIENT_SECRET = # The google api secret key
;# optional section to host own version of mongo database
;MONGODB_HOST = # mongodb hostname, e.g. x.univ.edu
;MONGODB_PORT = 27017
;MONGODB_USERNAME = # mongodb username
;MONGODB_PASSWORD = # mongodb password
;MONGODB_DB_NAME = # mongodb name
;QRESP_DB_SECRET_KEY = # /admin database access secret key

[SECRETS]
# Random flask key, change it to a random value
FLASK_SECRET_KEY = //bndsn/sdalkjdlkadjasd/123kdlasjkljlk/
;MAIL_PWD = # a mail account password to mail administrator about insertion/deletion of metadata

[GOOGLE_API] # Google api section
AUTH_URI = https://accounts.google.com/o/oauth2/auth
TOKEN_URI = https://accounts.google.com/o/oauth2/token
USER_INFO = https://www.googleapis.com/userinfo/v2/me
SCOPE = https://www.googleapis.com/auth/userinfo.profile,https://www.googleapis.com/auth/userinfo.email
2 changes: 1 addition & 1 deletion web/project/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ def get_setting(cls, section, key):
ret = cls.configParser.get(section, key)
except:
ret = None
return ret
return ret

Loading

0 comments on commit 65d776d

Please sign in to comment.