def mgrant_user(mgrant_server): config_path, mdport, dbname = mgrant_server config = Config(check=check, path=config_path, seed=seed()) client = Client(config) client.set_auth( host=f"localhost:{mdport}", db=dbname, role="read", username="******", password="******", ) client.set_auth( host=f"localhost:{mdport}", db=dbname, role="readWrite", username="******", password="******", ) client.set_alias("testhost", f"localhost:{mdport}", which="host") client.set_alias("testdb", dbname, which="db") return client
return current_app.send_static_file('cubism.v1.js') @app.route('/structureViewer') def structure_viewer(): return current_app.send_static_file('structureViewerBuilt.js') @app.route("/container") def get_style(): return current_app.send_static_file('container.css') client = Client() client.set_alias("mg2.lbl", "matgen2.lbl.gov", "host") client.set_alias("m01.nersc", "mongodb01.nersc.gov", "host") client.set_alias("m03.nersc", "mongodb03.nersc.gov", "host") client.set_alias("m04.nersc", "mongodb04.nersc.gov", "host") client.set_alias("build", "mp_prod", "db") client.set_alias("core", "fw_mp_prod_atomate", "db") client.set_alias("app", "mg_apps_prod", "db") client.set_alias("elastic", "fw_jhm_kpoints", "db") client.set_alias("SCAN", "fw_shyamd", "db") dbs = { "elastic": client.db("ro:m03.nersc/elastic", connect=False), "SCAN": client.db("ro:m03.nersc/SCAN", connect=False), "core": client.db("ro:m01.nersc/core", connect=False), "app": client.db("ro:m04.nersc/app", connect=False),
app = Flask(__name__) @app.route('/') def hello_world(): return current_app.send_static_file('main.html') @app.route('/cubism') def cubism(): return current_app.send_static_file('cubism.v1.js') client = Client() client.set_alias("m01.nersc", "mongodb01.nersc.gov", "host") client.set_alias("m03.nersc", "mongodb03.nersc.gov", "host") client.set_alias("core", "fw_mp_prod_atomate", "db") client.set_alias("elastic", "fw_jhm_kpoints", "db") client.set_alias("SCAN", "fw_shyamd", "db") dbs = { "elastic": client.db("ro:m03.nersc/elastic", connect=False), "SCAN": client.db("ro:m03.nersc/SCAN", connect=False), "core": client.db("ro:m01.nersc/core", connect=False), } @app.route('/mongometric') def mongometric():