Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration Reference

Complete reference for Torc configuration options.

Configuration Sources

Torc loads configuration from multiple sources in this order (later sources override earlier):

  1. Built-in defaults (lowest priority)
  2. System config: /etc/torc/config.toml
  3. User config: ~/.config/torc/config.toml (platform-dependent)
  4. Project config: ./torc.toml
  5. Environment variables: TORC_* prefix
  6. CLI arguments (highest priority)

Configuration Commands

torc config show              # Show effective configuration
torc config show --format json # Show as JSON
torc config paths             # Show configuration file locations
torc config init --user       # Create user config file
torc config init --local      # Create project config file
torc config init --system     # Create system config file
torc config validate          # Validate current configuration

Client Configuration

Settings for the torc CLI.

[client] Section

OptionTypeDefaultDescription
api_urlstringhttp://localhost:8080/torc-service/v1Torc server API URL
formatstringtableOutput format: table or json
log_levelstringinfoLog level: error, warn, info, debug, trace
usernamestring(none)Username for basic authentication

[client.run] Section

Settings for torc run command.

OptionTypeDefaultDescription
poll_intervalfloat5.0Job completion poll interval (seconds)
output_dirpathoutputOutput directory for job logs
database_poll_intervalint30Database poll interval (seconds)
max_parallel_jobsint(none)Maximum parallel jobs (overrides resource-based)
num_cpusint(none)Available CPUs for resource-based scheduling
memory_gbfloat(none)Available memory (GB) for resource-based scheduling
num_gpusint(none)Available GPUs for resource-based scheduling

Example

[client]
api_url = "http://localhost:8080/torc-service/v1"
format = "table"
log_level = "info"
username = "myuser"

[client.run]
poll_interval = 5.0
output_dir = "output"
max_parallel_jobs = 4
num_cpus = 8
memory_gb = 32.0
num_gpus = 1

[client.hpc] Section

Settings for HPC profile system (used by torc hpc and torc slurm commands).

OptionTypeDefaultDescription
profile_overridestable{}Override settings for built-in HPC profiles
custom_profilestable{}Define custom HPC profiles

[client.hpc.profile_overrides.<profile>] Section

Override settings for built-in profiles (e.g., kestrel).

OptionTypeDefaultDescription
default_accountstring(none)Default Slurm account for this profile

[client.hpc.custom_profiles.<name>] Section

Define a custom HPC profile.

OptionTypeRequiredDescription
display_namestringNoHuman-readable name
descriptionstringNoProfile description
detect_env_varstringNoEnvironment variable for detection (NAME=value)
detect_hostnamestringNoRegex pattern for hostname detection
default_accountstringNoDefault Slurm account
partitionsarrayYesList of partition configurations

[[client.hpc.custom_profiles.<name>.partitions]] Section

Define partitions for a custom profile.

OptionTypeRequiredDescription
namestringYesPartition name
cpus_per_nodeintYesCPU cores per node
memory_mbintYesMemory per node in MB
max_walltime_secsintYesMaximum walltime in seconds
gpus_per_nodeintNoGPUs per node
gpu_typestringNoGPU model (e.g., “H100”)
sharedboolNoWhether partition supports shared jobs
min_nodesintNoMinimum required nodes
requires_explicit_requestboolNoMust be explicitly requested

HPC Example

[client.hpc.profile_overrides.kestrel]
default_account = "my_default_account"

[client.hpc.custom_profiles.mycluster]
display_name = "My Research Cluster"
description = "Internal research HPC system"
detect_env_var = "MY_CLUSTER=research"
default_account = "default_project"

[[client.hpc.custom_profiles.mycluster.partitions]]
name = "compute"
cpus_per_node = 64
memory_mb = 256000
max_walltime_secs = 172800
shared = false

[[client.hpc.custom_profiles.mycluster.partitions]]
name = "gpu"
cpus_per_node = 32
memory_mb = 128000
max_walltime_secs = 86400
gpus_per_node = 4
gpu_type = "A100"
shared = false

Server Configuration

Settings for torc-server.

[server] Section

OptionTypeDefaultDescription
log_levelstringinfoLog level
httpsboolfalseEnable HTTPS
urlstringlocalhostHostname/IP to bind to
portint8080Port to listen on
threadsint1Number of worker threads
databasestring(none)SQLite database path (falls back to DATABASE_URL env)
auth_filestring(none)Path to htpasswd file
require_authboolfalseRequire authentication for all requests
completion_check_interval_secsfloat60.0Background job processing interval

[server.logging] Section

OptionTypeDefaultDescription
log_dirpath(none)Directory for log files (enables file logging)
json_logsboolfalseUse JSON format for log files

Example

[server]
url = "0.0.0.0"
port = 8080
threads = 4
database = "/var/lib/torc/torc.db"
auth_file = "/etc/torc/htpasswd"
require_auth = true
completion_check_interval_secs = 60.0
log_level = "info"
https = false

[server.logging]
log_dir = "/var/log/torc"
json_logs = false

Dashboard Configuration

Settings for torc-dash.

[dash] Section

OptionTypeDefaultDescription
hoststring127.0.0.1Hostname/IP to bind to
portint8090Port to listen on
api_urlstringhttp://localhost:8080/torc-service/v1Torc server API URL
torc_binstringtorcPath to torc CLI binary
torc_server_binstringtorc-serverPath to torc-server binary
standaloneboolfalseAuto-start torc-server
server_portint0Server port for standalone mode (0 = auto)
databasestring(none)Database path for standalone mode
completion_check_interval_secsint5Completion check interval (standalone mode)

Example

[dash]
host = "0.0.0.0"
port = 8090
api_url = "http://localhost:8080/torc-service/v1"
torc_bin = "/usr/local/bin/torc"
torc_server_bin = "/usr/local/bin/torc-server"
standalone = true
server_port = 0
completion_check_interval_secs = 5

Environment Variables

Environment variables use double underscore (__) to separate nested keys.

Client Variables

VariableMaps To
TORC_CLIENT__API_URLclient.api_url
TORC_CLIENT__FORMATclient.format
TORC_CLIENT__LOG_LEVELclient.log_level
TORC_CLIENT__USERNAMEclient.username
TORC_CLIENT__RUN__POLL_INTERVALclient.run.poll_interval
TORC_CLIENT__RUN__OUTPUT_DIRclient.run.output_dir
TORC_CLIENT__RUN__MAX_PARALLEL_JOBSclient.run.max_parallel_jobs
TORC_CLIENT__RUN__NUM_CPUSclient.run.num_cpus
TORC_CLIENT__RUN__MEMORY_GBclient.run.memory_gb
TORC_CLIENT__RUN__NUM_GPUSclient.run.num_gpus

Server Variables

VariableMaps To
TORC_SERVER__URLserver.url
TORC_SERVER__PORTserver.port
TORC_SERVER__THREADSserver.threads
TORC_SERVER__DATABASEserver.database
TORC_SERVER__AUTH_FILEserver.auth_file
TORC_SERVER__REQUIRE_AUTHserver.require_auth
TORC_SERVER__LOG_LEVELserver.log_level
TORC_SERVER__COMPLETION_CHECK_INTERVAL_SECSserver.completion_check_interval_secs
TORC_SERVER__LOGGING__LOG_DIRserver.logging.log_dir
TORC_SERVER__LOGGING__JSON_LOGSserver.logging.json_logs

Dashboard Variables

VariableMaps To
TORC_DASH__HOSTdash.host
TORC_DASH__PORTdash.port
TORC_DASH__API_URLdash.api_url
TORC_DASH__STANDALONEdash.standalone

Legacy Variables

These environment variables are still supported directly by clap:

VariableComponentDescription
TORC_API_URLClientServer API URL (CLI only)
TORC_USERNAMEClientAuthentication username (CLI only)
TORC_PASSWORDClientAuthentication password (CLI only)
TORC_AUTH_FILEServerhtpasswd file path
TORC_LOG_DIRServerLog directory
TORC_COMPLETION_CHECK_INTERVAL_SECSServerCompletion check interval
DATABASE_URLServerSQLite database URL
RUST_LOGAllLog level filter

Complete Example

# ~/.config/torc/config.toml

[client]
api_url = "http://localhost:8080/torc-service/v1"
format = "table"
log_level = "info"
username = "developer"

[client.run]
poll_interval = 5.0
output_dir = "output"
database_poll_interval = 30
num_cpus = 8
memory_gb = 32.0
num_gpus = 1

[server]
log_level = "info"
https = false
url = "localhost"
port = 8080
threads = 4
database = "/var/lib/torc/torc.db"
require_auth = false
completion_check_interval_secs = 60.0

[server.logging]
log_dir = "/var/log/torc"
json_logs = false

[dash]
host = "127.0.0.1"
port = 8090
api_url = "http://localhost:8080/torc-service/v1"
torc_bin = "torc"
torc_server_bin = "torc-server"
standalone = false
server_port = 0
completion_check_interval_secs = 5

See Also