Agent config.yaml
Introduction
This document describes the required and possible auxillary configuration parameters for the LabScale Agent. These options should be set or modified in the config.yaml file found in the labscale-agent folder.
Required configuration items
The following list of configuration options are generally set automatically at the time the agent is installed. It is best that the values for these options not be modified manually.
agent_id: <AGENT_ID>
broker_url: wss://broker.labscale.com:443/mqtt
loki_push_url: https://broker.labscale.com/loki/v1/push
team_id: <TEAM_ID>
agent_id
The agent_id configuration option is the ID of the agent recorded in the LabScale service. It is automatically set at the time the agent is installed.
broker_url
The broker_url configuration option is the URL required by the agent to communicate with the MQTT broker. This value will be automatically set at the time the agent is installed.
loki_push_url
The loki_push_url configuration option is the URL to the Loki log collection service where log items are uploaded. This option will be automatically set at the time the agent is installed.
team_id
The team_id configuration option is the ID of the team to which the agent belongs. This option will be set automatically at the time the agent is installed.
Optional configuration options
Optional configuration options and their default values can be found in the labscale-agent/config/default_config.yaml file. It is best not to modify these, instead to add the desired change to the main configuration file at labscale-agent/config.yaml, any options in this file will override the default options. Below is a list of the configuration options and their default values:
agent_metric_interval: 300
agent_status_interval: 900
agent_sync_interval: 60
connect_timeout: 60
dialer_timeout: 60
dip_cache: $HOME/.labscale_agent/dips
download_cache: $HOME/.labscale_agent/downloads
download_cache_max_age: 0
download_cache_max_size: 10g
job_dir: /tmp/labscale_agent/jobs
job_dir_max_age: 30
job_dir_max_backups: 100
job_poll_interval: 2
log_compression: true
log_max_age: 30
log_max_backups: 10
log_max_size: 5
loki_level: info
loki_max_age: 15
loki_max_size: 1000
pub_loop_sleep_time: 1
restart_kill_threshold: 1.5
restart_kill_count: 5
s3_presigned_push_url: ""
An explanation of the configuration options is below:
agent_metric_interval
The agent_metric_interval configuration option is the number of seconds between polling devices for their current metrics.
agent_status_interval
The agent_status_interval configuration option is the number of seconds between agent status updates.
agent_sync_interval
The agent_sync_interval configuration option is the number of seconds between polling the devices for their current online/offline state.
connect_timeout
The connect_timeout configuration option is the number of seconds the agent waits on connecting to the MQTT broker.
dialer_timeout
The dialer_timeout configuration option is the number of seconds the agent waits on looking up the broker address.
dip_cache
The dip_cache configuration option is the location where the agent looks for DIPs that have already been downloaded and are ready to use.
download_cache
The download_cache configuration option is the intermediate location where the agent will download and store files. On subsequent downloads of the same file, the agent will first check if an identical copy already exists in cache before downloading it again.
download_cache_max_age
The download_cache_max_age configuration option is the number of seconds to store cached files after download. The current default of 0 indicates this feature is disabled.
download_cache_max_size
The download_cache_max_size configuration option is the combined total size in bytes of files to store in the download cache before which files will be automatically removed, oldest files first. This option allows shorthand suffix g, m, k that represent gigabytes, megabytes, and kilobytes.
job_dir
The job_dir configuration option is the location in the filesystem where workspace folders are created when executing a job.
job_dir_max_age
The job_dir_max_age configuration option is the maximum age in days before a job workspace folder is deleted.
job_dir_max_backups
The job_dir_max_backups configuration option is the maximum number of job workspaces to be create before the agent cleans them up, the oldest getting cleaned up first.
job_poll_interval
The job_poll_interval configuration option is the number of seconds the agent waits until it checks with the backend scheduler for new jobs.
log_compression
The log_compression configuration option is a simple true/false value that tells the agent to compress the agent's rotated log files.
log_max_age
The log_max_age configuration option is the number of seconds to retain an agent's rotated log file.
log_max_backups
The log_max_backups configuration option is the number of total rotated logs files to retain on the host before they are removed, oldest removed first.
log_max_size
The log_max_size configuration option is the total size in megabytes a log file can grow before it is automatically rotated.
loki_level
The loki_level configuration option determines what level of agent log items are sent to the Loki log collection service.
loki_max_age
The loki_max_age configuration option is the maximum number of seconds to wait before buffered log items are pushed to the Loki collection service.
loki_max_size
The loki_max_size configuration option is the maximum number log lines to buffer before they are automatically pushed to the Loki log collection service.
pub_loop_sleep_time
The pub_loop_sleep_time configuration option is the number of seconds to wait before publishing messages.
restart_kill_threshold
The restart_kill_threshold configuration option is the number of seconds between kill/restarts of the agent before the agent is considered to be malfunctioning.
restart_kill_count
THe restart_kill_count configuration option is the number of times the agent is allowed to automatically restart before it is considered to be malfunctioning and killed.
s3_presigned_push_url
The s3_presigned_push_url configuration option is the location to upload artifact files. This may be configured automatically when installed and should not be set manually.