OPUS Settings
Default settings
After installation, the OPUS server and client will work with their default settings, contained in the
files $OPUS_DIR/uws_server/settings.py
and $OPUS_DIR/uws_client/uws_client.py
.
Local settings
The file $OPUS_DIR/settings_local.py
, if present, is read by OPUS to override the default values.
This file also contains default tokens that have to be set internally and kept secret to ensure application security. This file should thus have restricted access by the web server only.
Local settings are to be set before running the application, here is an example:
# OPUS global config
DEBUG=False
BASE_URL = 'http://opus.example.com'
BASE_IP = '1.2.3.4'
VAR_PATH = '/var/www/opus'
LOCAL_USER = 'www'
ADMIN_EMAIL = 'a@b.com'
ADMIN_NAME = 'opus-admin'
MAIL_SERVER = 'smtp.example.com'
MAIL_PORT = 25
SENDER_EMAIL = 'no_reply@example.com'
# Client config
ADMIN_DEFAULT_PW = '' # Define a default password for ADMIN_NAME (can then be changed in the client)
TESTUSER_NAME = 'testuser'
TESTUSER_DEFAULT_PW = '' # Define a default password for TESTUSER_NAME (can then be changed in the client)
CLIENT_TITLE = "OPUS" # Title shown on webpages
HOME_CONTENT = "" # Content of the home page (HTML accepted)
# Server config
ADMIN_TOKEN = 'uuid_or_any_random_string'
JOB_EVENT_TOKEN = 'uuid_or_any_random_string' # TOKEN for special user job_event, used internally
MAINTENANCE_TOKEN = 'uuid_or_any_random_string' # TOKEN for special user maintenant, used internally
# Access rules
ALLOW_ANONYMOUS = True # some jobs may be run without signing in
CHECK_PERMISSIONS = True # check rights to run a job
CHECK_OWNER = False # only the owner of a job can access the results
NJOBS_MAX = 5 # 0 for no restriction
Local settings could also contain other relevant variables, depending on the desired setting for a server or client.
UWS Server settings
The file $OPUS_DIR/uws_server/settings.py
contains all the variables needed by the web server with
their default values and descriptions. This file is part of the repository files and it is
recommended to keep it unchanged. However, all those variables can be overridden from the $OPUS_DIR/settings_local.py
file.
General settings
Variable | Description |
---|---|
DEBUG | If True, the full trace of an error is shown on the error web page. If False, the error webpage is simply "Internal Server Error". |
APP_PATH | Path to the application files. Autoset to the package directory (parent of the uws_server/settings.py file). |
VAR_PATH | Path to the data used/generated by the application. This directory has to be writable for the web server (www, apache...) |
BASE_URL | Base URL of the server hosting the application. |
BASE_IP | Base IP address of the server hosting the application. |
Security settings
Variable | Description |
---|---|
ADMIN_NAME | Login name for aministrator access to the server |
ADMIN_TOKEN | Token for aministrator access to the server |
ADMIN_EMAIL | Email of aministrator |
JOB_EVENT_TOKEN | Token for special user job_event, used internally |
MAINTENANCE_TOKEN | Token for special user maintenant, used internally |
ALLOW_ANONYMOUS | Anonymous user allowed on server (True/False) |
CHECK_PERMISSIONS | Check permission to create/edit a job (True/False) |
CHECK_OWNER | Check ownership on data or job information access (True/False) |
JOB_SERVERS | IPs of servers that are allowed to send job events |
TRUSTED_CLIENTS | IPs of client that can access critical admin features |
Internal settings
Variable | Description |
---|---|
NJOBS_MAX | Maximum number of active jobs per user |
DESTRUCTION_INTERVAL | Default destruction interval |
EXECUTION_DURATION_DEF | Default execution duration |
EXECUTION_DURATION_MAX | Maximum execution duration |
WAIT_TIME_MAX | Maximum wait time for user request (UWS1.1) |
USE_ARCHIVED_PHASE | Use ARCHIVED phase (UWS1.1) |
GENERATE_PROV | Add the provenance files to the results of the jobs |
COPY_RESULTS | copy results from Manager to Archive (may be irrelevant if Manager = Local) |
SHA_ALGO | Algorithm for entity hash |
JOB_ID_LENGTH | length of job identifiers |
JOB_ID_GEN() | Function that generates job identifiers |
ENTITY_ID_GEN() | Function that generates entity identifiers |
TOKEN_GEN() | Function that generates default tokens |
Archive settings
Variable | Description |
---|---|
ARCHIVE | Set to Local . Select where the archive is located |
ARCHIVE_PATH | Path of Archive (same as RESULTS_PATH for Local Archive) |
ARCHIVE_URL | Relative or full URL to access the Archive (use {ID} for the identifier of the result) |
Job Description Language settings
Variable | Description |
---|---|
JDL | Set to VOTable . Select the JDL class for reading/writing JDL files |
UWS_PARAMETERS | UWS parameters that can be configured with job parameters |
UWS_PARAMETERS_KEYS | Order of UWS parameters |
CONTROL_PARAMETERS | Control parameters that can be configured with job parameters (includes e.g. UWS and SLURM parameters) |
CONTROL_PARAMETERS_KEYS | Order of control parameters |
Storage settings
Variable | Description |
---|---|
STORAGE | Set to SQLAlchemy . Select the Storage class for the internal database. |
STORAGE_TYPE | Set to SQLite or PGSQL . |
SQLALCHEMY_DB | string that indicates database dialect and connection arguments for SQLAlchemy |
SQLITE_FILE_NAME | Name of SQLite file |
PGSQL_HOST | Host for PostgreSQL database |
PGSQL_PORT | Port for PostgreSQL database |
PGSQL_DATABASE | Database for PostgreSQL database |
PGSQL_USER | User for PostgreSQL database |
PGSQL_PASSWORD | Password for PostgreSQL database |
Manager settings
Variable | Description |
---|---|
MANAGER | Set to Local or SLURM . Select the Manager class that defines the interface for job execution and management. |
LOCAL_WORKDIR_PATH | Working directory for local execution |
SLURM_URL | URL of SLURM Work cluster |
SLURM_USER | Account on SLURM Work cluster |
SLURM_MAIL_USER | Email for account on SLURM Work cluster |
SLURM_SCRIPTS_PATH | Path for scripts on SLURM Work cluster |
SLURM_JOBDATA_PATH | Path for job internal files on SLURM Work cluster |
SLURM_UPLOADS_PATH | Path for uplaods on SLURM Work cluster |
SLURM_WORKDIR_PATH | Working directory on SLURM Work cluster |
SLURM_RESULTS_PATH | Path for job results on SLURM Work cluster |
SLURM_SBATCH_DEFAULT | Default SLURM sbatch header variables as a dictionnary |
PHASE_CONVERT | Conversions for SLURM job state codes |
SLURM_PARAMETERS | SLURM parameters that can be configured with job parameters |
SLURM_PARAMETERS_KEYS | Order of SLURM parameters |
Path settings
The various path defined are build from VAR_PATH by default.
Variable | Description |
---|---|
LOG_PATH | Path for logging files |
JDL_PATH | Path for JDL files |
SCRIPTS_PATH | Path for job script files (part of the job definition) |
JOBDATA_PATH | Path of internal files for each job (scripts executed, stdout, stderr, ...) |
RESULTS_PATH | Path of results for each job |
UPLOADS_PATH | Path of uploaded files for each job |
TEMP_PATH | Path for e.g. SLURM sbatch files created by SLURMManager |
UWS Client settings
The file $OPUS_DIR/uws_client/uws_client.py
contains all the variables needed by the web client with
their default values and descriptions. This file is part of the repository files and it is
recommended to keep it unchanged. However, all those variables can be overridden from the $OPUS_DIR/settings_local.py
file.
Variable | Description |
---|---|
APP_PATH | Path to the application files. Autoset to the package directory (parent of the uws_client/settings.py file). |
VAR_PATH | Path to the data used/generated by the application. This directory has to be writable for the web server (www, apache...) |
APPLICATION_ROOT | Relative URL to the UWS Client |
UWS_SERVER_URL | URL of the UWS Server |
UWS_SERVER_URL_JS | URL of the UWS Server as called by javascript, generally set to local url (proxy) to avoid cross-calls |
UWS_AUTH | Set to Basic. Authentication protocol with UWS Server |
ADMIN_NAME | Login name for the administrator |
ADMIN_DEFAULT_PW | Default password for the administrator (to be changed after install, or kept secret in uws_client/settings_local.py ) |
TESTUSER_NAME | Login name for testuser |
TESTUSER_DEFAULT_PW | Default password for the administrator (to be changed after install, or kept secret in uws_client/settings_local.py ) |
CLIENT_TITLE | Title shown on webpages |
HOME_CONTENT | Content of the home page (HTML accepted) |
Some of those variables can be edited and modified from the UWS Client without having to restart the web server (list of variables in EDITABLE_CONFIG). In particular the UWS_SERVER_URL and UWS_AUTH variables, so that the client can connect to any other UWS server.