Skip to content
Snippets Groups Projects
Commit d544a89b authored by Prathamesh Joshi's avatar Prathamesh Joshi Committed by Prathamesh Joshi
Browse files

Add a new bottle app to make the new URLs work

parent 8c8b5917
No related branches found
No related tags found
1 merge request!598Encode job and analysis tag in the URLs created by gstlal servers
......@@ -645,16 +645,23 @@ for output_file_number, (svd_bank_url_dict, output_url, ranking_stat_output_url,
#
# create a new, empty, Bottle application and make it the current
# default, then start http server(s) to serve it up
# Create a new, empty, Bottle application and make it the current
# default. The Bottle routes defined in various parts of the code
# will get added to this app.
# Simultaneously, create a new Bottle application and mount the
# default app's modified routes to this app. This app will be
# explicitly passed to the http server(s) to serve it up.
#
bottle.default_app.push()
default_app = bottle.default_app.push()
modified_app = bottle.Bottle()
modified_app.mount(f"/{options.analysis_tag}_{options.job_tag}/", default_app)
# uncomment the next line to show tracebacks when something fails
# in the web server
#bottle.app().catchall = False
httpservers = httpinterface.HTTPServers(
bottle_app = modified_app,
service_name = "%s.gstlal_inspiral" % (options.job_tag if options.job_tag is not None else base64.urlsafe_b64encode(uuid.uuid4().bytes)),
service_domain = service_domain(options.gracedb_search, options.gracedb_pipeline),
service_properties = {
......@@ -691,7 +698,7 @@ for output_file_number, (svd_bank_url_dict, output_url, ranking_stat_output_url,
yield "</p>\n</body></html>"
# FIXME: get service-discovery working, then don't do this
if "GSTLAL_LL_JOB" in os.environ:
open("%s_registry.txt" % os.environ["GSTLAL_LL_JOB"], "w").write("http://%s:%s/\n" % (socket.gethostname(), httpservers[0][0].port))
open("%s_registry.txt" % os.environ["GSTLAL_LL_JOB"], "w").write("http://%s:%s/%s_%s/\n" % (socket.gethostname(), httpservers[0][0].port, options.analysis_tag, options.job_tag))
#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment