Skip to content

Instantly share code, notes, and snippets.

@tylergannon
Last active November 5, 2017 13:17
Show Gist options
  • Save tylergannon/ad2bb900ec7f17a2be9f4fcb1e68f8f3 to your computer and use it in GitHub Desktop.
Save tylergannon/ad2bb900ec7f17a2be9f4fcb1e68f8f3 to your computer and use it in GitHub Desktop.
restful SGE sample configuration file
"""
module: config
Note that this module defines three classes for three different applications.
You are free in your own configurations, to define separate files.
# The Restfful SGE app only listens to the RestfulSgeConfig class.
Loads the application configuration file, checking the following places:
* $RESTFUL_SGE_CONFIG environment variable
* ~/.config/restful_sge/config.py
* /etc/restful_sge/config.py
# Gunicorn only cares about the variables set at the very bottom of the file.
# Restful SGE Client settings can also be provided at the time of object creation.
"""
from collections import OrderedDict
class SgeClientConfig(object):
"""
client settings. these can all be overridden at runtime.
gunicorn settings at the bottom.
note that if there is an NGinx frontend, the client's ip
address settings will not be the same as those for gunicorn.
"""
EXTERNAL_IP_ADDRESS = "127.0.0.1"
EXTERNAL_PORT = 8080
TUNNEL_PORT = 8085
REMOTE_HOST = "remote_submission_host"
USE_SSH_TUNNEL = True
CLIENT_CERTIFICATE = None
class RestfulSgeConfig(object):
"""
application settings. see below for gunicorn settings.
"""
WORK_ROOT = "./support"
COMPLETED_FILES_ROOT = "./support"
SGE = {
"output_path" : None, # where to put output files
"join_stdout_and_stderr" : True,
"command_shell" : "/bin/bash",
"parallel_environment" : None, # or 'smp 4' or 'orte 4'
"binary_executable" : False,
"default_queue": None,
"qsub_parameters": OrderedDict(j='y', # bad example bc both of these would
shell='n'), # be overwritten by the above configurations
"command_environment": OrderedDict(FOO='bar',
BAZ='quark')
}
#########################################################
#
# gunicorn settings
#
#########################################################
name = "restful_sge"
# BIND="unix:~/FLASK/sock"
bind = "127.0.0.1:8080"
user='tyler'
group="tyler"
workers=4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment