Tramola Runners
Introduction Link to this section
Tramola needs to execute scheduled simulations as well as (post-)processes files it manages. To execute these tasks, so-called “Runners” are used. A runner is a small piece of software which executes these tasks on Tramola’s behalf. The advantage of using runners over Tramola executing the tasks directly is that the runners can run on difference machines, thus distributing the work-load.
A runner is not limited to a single job. It can execute multiple jobs over time and, if enough CPU and memory are available, it can also execute multiple jobs in parallel. In most setups, you should configure one runner per machine and assign that runner the CPU and memory that machine should make available to scheduled jobs.
Tramola integrates and starts two runners default, so that it works out-of-the-box. The first runner is reserved for internal jobs (e.g. post-processing uploaded files and simulations), while the second runner is able to execute smaller MATSim simulations.
Additional runners can be added, and the default runners can be switched off if so desired.
Configuring the default runners Link to this section
To change the configuration of the included local runners, copy the following lines to your tramola.conf and modify the settings as needed. At first, you might mostly change the cpu and memory settings of the local runners:
tramola {
localRunner = [
{
name = "system_jobs"
type = "LOCAL"
keepFiles = false
cpu = 2
memory = 6.0
tags = ["jvm", "system"]
},
{
name = "MATSim"
type = "LOCAL"
keepFiles = false
cpu = 2
memory = 12.0
tags = ["jvm", "user"]
}
]
}
If you want to run your own custom jars, you need to add a untrusted flag to the tags that allows the execution of untrusted code in this runner.
tramola {
localRunner = [
...
{
name = "MATSim"
type = "LOCAL"
keepFiles = false
cpu = 2
memory = 12.0
tags = ["jvm", "user", "untrusted"]
}
]
}
Adding additional runners Link to this section
First, go to and create a new Runner Token. Next, download the runner.jar to the computer you want the runner to use. Then, start the runner with the following command:
java -jar tramola-runner.jar -h tramola.example.com \
-p 8433 -c 4 -m 20 -e LOCAL -t TOKEN -d data
This starts a runner with 4 CPUs and 20 GB of memory, connecting to tramola.example.com on
the configured port with the provided token and using data as directory for storing any files. That single runner can then execute
multiple jobs as long as enough resources remain available.
The runner supports additional options. Run java -jar tramola-runner.jar --help to see the full list of all available
options:
| Option | Argument | Default Value | Description |
|---|---|---|---|
-h |
host | localhost |
The server (host) to connect to, either a fully qualified domain name or an IP address. |
-p |
port | 3471 |
The port to connect to. |
-s |
use-tls | true |
Use TLS (i.e. https) to connect to Tramola. |
-d |
directory | ./data |
The directory to store files for the executed tasks. |
-c |
cpus | 2 |
Total number of CPU cores this runner can use across its jobs. |
-m |
memory | 24 |
Total amount of memory (RAM) in GB this runner can use across its jobs. |
-t |
token | The runner token to identify to the server. | |
-f |
file-token | A file containing the token, instead of specifying it with -t. |
|
-n |
name | localhost’s name | The name of the runner. |
-k |
keepFiles | false | If set to true, job files will not be deleted after jobs ended. Note that enabling this feature might use large amount of storage space and should only be used for debugging. |
-e |
executor | LOCAL |
Can bei either LOCAL or DOCKER. |
-x |
tags | jvm,user | Tags for the runner. jvm denotes runners which provide a JVM to run jobs, user denotes runners that can run user-jobs (i.e. MATSim simulations), untrusted if the runner is allowed to run untrusted code (required for executing custom jars). |
--memory-overhead |
fraction | 0.2 |
Fraction (0-1) of the job’s requested RAM granted as extra headroom for JVM and runtime overhead. Applies to DOCKER (container memory limit) and SLURM (--mem directive). Ignored for other executors. |
--container-user |
uid[:gid] | User the Docker container runs as, in uid[:gid] or name[:group] form. When set, the container writes output files with this ownership so the host runner can clean them up. Only applies to DOCKER executor. |
To stop an external runner, just press Ctrl + C or stop the process otherwise.
Runner types Link to this section
Tramola runners currently support four different execution strategies:
- LOCAL: Jobs are run as local processes. This type should only be used if you run only trusted code (e.g. only default MATSim releases or versions you created yourself), as malicious code could read arbitrary files on your system depending on the user rights the runner runs with.
- DOCKER: Jobs are run inside Docker containers. Requires that docker is installed on your system.
This provides an additional level of security when running user-provided MATSim JARs that contain untrusted code,
as jobs can only access files within the docker image and the mounted directory containing the job files.
To support executing user-provided JAR files, add the taguntrustedto a runner. Be very cautious when to use this. - SSH: Jobs are executed on a remote host via SSH/SFTP. The runner connects to the remote server, uploads job files, executes the job directly (not using a scheduler), and downloads results after completion. This is useful for running jobs on dedicated compute servers or clusters where you have SSH access.
- SLURM: Jobs are submitted to a SLURM workload manager on a remote host via SSH. Similar to SSH runners, but jobs are submitted through the SLURM scheduler rather than executed directly. This is ideal for HPC clusters that use SLURM for job scheduling and resource management.
SSH Runners Link to this section
SSH runners require a server configuration block with connection details. SSH credentials must be configured in your
user profile (see SSH Credentials Setup below).
Basic SSH runner configuration:
tramola {
localRunner = [
{
name = "Remote Server"
type = "SSH"
cpu = 4
memory = 16.0
tags = ["jvm", "user"]
server = {
hostname = "compute.example.com"
port = 22
}
}
]
}
Server Configuration Options:
hostname(required): The hostname or IP address of the remote serverport(optional, default:22): The SSH port to connect tojobDir(optional): Remote directory where job files will be stored. If not specified, the user’s home directory is used. You can use${USER}as a placeholder that will be replaced with the SSH username.commands(optional): List of commands to execute in the job script before starting the job. Useful for setting up environment variables, loading modules, or other initialization tasks.progressUpdates(optional, default:PUSH): How progress updates are handled:PUSH: Progress updates are pushed from the job to Tramola (default)PULL: Tramola periodically pulls progress updates from a directory on the remote host
Example with custom job directory and setup commands:
tramola {
localRunner = [
{
name = "Remote Server"
type = "SSH"
cpu = 8
memory = 32.0
tags = ["jvm", "user"]
server = {
hostname = "compute.example.com"
port = 22
jobDir = "/scratch/${USER}/tramola-jobs"
commands = [
"module load java/11",
"export JAVA_HOME=/opt/java/11"
]
progressUpdates = "PULL"
}
}
]
}
Files are cleaned up on the remote host after successful completion (unless keepFiles = true).
Docker Runners Link to this section
Docker runners accept an optional docker configuration block to fine-tune container behavior.
Docker Configuration Options:
image(optional): Container image to use. When set, this image is used instead of the defaulteclipse-temurinimage. The image must be available on the docker host (pull it manually before configuring the runner).memoryOverhead(optional, default:0.2): Fraction (0-1) of the job’s requested RAM granted to the container as extra headroom for JVM and other runtime overhead. A value of0.2means the container memory limit is sized at 120% of the job’s requested RAM.containerUser(optional): User the Docker container runs as, inuid[:gid]orname[:group]form. When set, the container writes output files with this ownership so the host runner can clean them up afterwards. If unset, the image’s default user is used.
Example:
tramola {
localRunner = [
{
name = "Docker Runner"
type = "DOCKER"
cpu = 4
memory = 16.0
tags = ["jvm", "user", "untrusted"]
docker = {
image = "eclipse-temurin:25"
memoryOverhead = 0.25
containerUser = "1000:1000"
}
}
]
}
SLURM Runners Link to this section
SLURM runners require a server configuration block (same as SSH runners) and need to include a slurm configuration block for SLURM-specific settings.
SLURM Configuration Options:
The slurm block allows you to configure SLURM-specific parameters:
time(optional): Time limit for the SLURM job. Format examples:"01:00:00"- 1 hour"2-00:00:00"- 2 days"00:30:00"- 30 minutes
memoryOverhead(optional, default:0.2): Fraction (0-1) of the job’s requested RAM added to the--memdirective as extra headroom for JVM and other runtime overhead. A value of0.2means the SLURM job requests 120% of the configured RAM. The resulting--memvalue is rounded up to the next whole GB.options(optional): Map of additional SLURM options that will be added as#SBATCHdirectives. Common options:partition: SLURM partition name (e.g.,"gpu","long")account: Account to charge resources toqos: Quality of Service levelgres: Generic resources (e.g.,"gpu:1")
Example with SLURM-specific configuration:
tramola {
localRunner = [
{
name = "HPC Cluster"
type = "SLURM"
cpu = -1
memory = -1
tags = ["jvm", "user"]
server = {
hostname = "login.cluster.example.com"
port = 22
jobDir = "/scratch/${USER}/tramola-jobs"
commands = [
"module load java/17",
"module load matsim/1.0"
]
}
slurm = {
time = "24:00:00"
options = {
partition = "compute"
account = "myproject"
qos = "normal"
}
}
}
]
}
How SLURM Directives are Generated:
SLURM runners use unlimited Tramola capacity (cpu = -1, memory = -1) so all matching jobs
are submitted immediately and queued by SLURM. Each submitted job still requests its configured
resources from the cluster. Positive runner values can still be configured manually to limit how
many jobs Tramola submits concurrently.
The runner automatically generates SLURM job scripts with the following directives:
--job-name: Set totramola-job-{jobId}--cpus-per-task: Taken from the job’s CPU requirement--mem: Computed from the job’s RAM requirement asceil(ramInGb × (1 + slurm.memoryOverhead))GB--time: Taken fromslurm.timeif specified- Additional directives from
slurm.optionsare added as--{key}={value}
SSH Credentials Setup Link to this section
SSH and SLURM runners require SSH credentials to connect to remote hosts. These credentials must be configured in your user profile before the runners can be used.
Configuring SSH Credentials Link to this section
- Go to your user profile (typically accessible via your username in the top navigation)
- Navigate to the Credentials section
- Click Add and fill in:
- Type: Select
SSH Password - Hostname: The hostname or IP address of the remote server (must match the
server.hostnamein your runner configuration) - Username: Your SSH username on the remote server
- Password: Your SSH password
- Type: Select
- Click Add to save the credential
Important Notes:
- The credential hostname must exactly match the
server.hostnamevalue in your runner configuration - Only credentials with type
SSH_PASSWORDare used for SSH/SLURM runners - Credentials are encrypted and stored securely in your account
- Each user must configure their own SSH credentials