Example #1
0
import jwt
import requests
from flask_opentracing import FlaskTracing
from jaeger_client import Config
import opentracing

AUTH_HEADER_NAME = 'Authorization'

CERTIFICATOR_URL = os.environ.get("F7T_CERTIFICATOR_URL")
TASKS_URL = os.environ.get("F7T_TASKS_URL")
KONG_URL = os.environ.get("F7T_KONG_URL")

COMPUTE_PORT = os.environ.get("F7T_COMPUTE_PORT", 5000)

### SSL parameters
USE_SSL = get_boolean_var(os.environ.get("F7T_USE_SSL", False))
SSL_CRT = os.environ.get("F7T_SSL_CRT", "")
SSL_KEY = os.environ.get("F7T_SSL_KEY", "")

# SYSTEMS_PUBLIC: list of allowed systems
# remove quotes and split into array
SYSTEMS_PUBLIC = os.environ.get("F7T_SYSTEMS_PUBLIC").strip('\'"').split(";")
# internal machines to submit/query jobs
SYS_INTERNALS = os.environ.get("F7T_SYSTEMS_INTERNAL_COMPUTE").strip(
    '\'"').split(";")

# Does the job machine have the spank plugin
USE_SPANK_PLUGIN = os.environ.get("F7T_USE_SPANK_PLUGIN", None)
if USE_SPANK_PLUGIN != None:
    USE_SPANK_PLUGIN = USE_SPANK_PLUGIN.strip('\'"').split(";")
    # cast to boolean
Example #2
0
CERTIFICATOR_URL = os.environ.get("F7T_CERTIFICATOR_URL")

UTILITIES_PORT = os.environ.get("F7T_UTILITIES_PORT", 5000)

AUTH_HEADER_NAME = 'Authorization'

UTILITIES_TIMEOUT = int(os.environ.get("F7T_UTILITIES_TIMEOUT"))

# SYSTEMS: list of ; separated systems allowed
SYSTEMS_PUBLIC = os.environ.get("F7T_SYSTEMS_PUBLIC").strip('\'"').split(";")
# internal machines for file operations
SYS_INTERNALS = os.environ.get("F7T_SYSTEMS_INTERNAL_UTILITIES").strip(
    '\'"').split(";")

debug = get_boolean_var(os.environ.get("F7T_DEBUG_MODE", False))

#max file size for upload/download in MB, internally used in bytes
MAX_FILE_SIZE_BYTES = int(
    os.environ.get("F7T_UTILITIES_MAX_FILE_SIZE")) * 1024 * 1024

### SSL parameters
USE_SSL = get_boolean_var(os.environ.get("F7T_USE_SSL", False))
SSL_CRT = os.environ.get("F7T_SSL_CRT", "")
SSL_KEY = os.environ.get("F7T_SSL_KEY", "")

TRACER_HEADER = "uber-trace-id"

app = Flask(__name__)
# max content lenght for upload in bytes
app.config['MAX_CONTENT_LENGTH'] = MAX_FILE_SIZE_BYTES
Example #3
0
SYSTEMS_PUBLIC = os.environ.get("F7T_SYSTEMS_PUBLIC").strip('\'"').split(";")
# internal machines to submit/query jobs
SYS_INTERNALS = os.environ.get("F7T_SYSTEMS_INTERNAL_COMPUTE").strip(
    '\'"').split(";")
# internal machines for small operations
SYS_INTERNALS_UTILITIES = os.environ.get(
    "F7T_SYSTEMS_INTERNAL_UTILITIES").strip('\'"').split(";")

###### ENV VAR FOR DETECT TECHNOLOGY OF STAGING AREA:
OBJECT_STORAGE = os.environ.get("F7T_OBJECT_STORAGE", "").strip('\'"')

# Scheduller partition used for internal transfers
XFER_PARTITION = os.environ.get("F7T_XFER_PARTITION", "").strip('\'"')

# --account parameter needed in sbatch?
USE_SLURM_ACCOUNT = get_boolean_var(
    os.environ.get("F7T_USE_SLURM_ACCOUNT", False))

# Machine used for external transfers

EXT_TRANSFER_MACHINE_PUBLIC = os.environ.get("F7T_EXT_TRANSFER_MACHINE_PUBLIC",
                                             "").strip('\'"')
EXT_TRANSFER_MACHINE_INTERNAL = os.environ.get(
    "F7T_EXT_TRANSFER_MACHINE_INTERNAL", "").strip('\'"')

OS_AUTH_URL = os.environ.get("F7T_OS_AUTH_URL")
OS_IDENTITY_PROVIDER = os.environ.get("F7T_OS_IDENTITY_PROVIDER")
OS_IDENTITY_PROVIDER_URL = os.environ.get("F7T_OS_IDENTITY_PROVIDER_URL")
OS_PROTOCOL = os.environ.get("F7T_OS_PROTOCOL")
OS_INTERFACE = os.environ.get("F7T_OS_INTERFACE")
OS_PROJECT_ID = os.environ.get("F7T_OS_PROJECT_ID")