Worker configuration
- Workers are used to speed up builds and tests by evenly distributing pipeline load
- The server where Buddy On-Premises is first installed is the default worker (Primary).
- You can install more workers on other nodes for extra performance.
Requirements
Resource | Requirement |
---|---|
CPU | 2.6 GHz |
Memory | 4 GB |
Root disk | 30 GB |
Installing workers
Launch the terminal on the server where you want to install the worker and run the commands below:
curl -sSL https://get.buddy.works | sh buddy install-worker --token="$TOKEN" --standalone-host="$ADDRESS"
$$
Supported flags
Name | Description |
---|---|
--yes | Forces non-interactive configuration mode. |
--drain | Sets the worker to draining mode. |
--config | Fetches the data from a configuration file. Must have the path to the file set. |
--standalone-host | REQUIRED. The new IP address of the main instance. |
--token | REQUIRED. Overwrites the default authorization token. If not provided, Buddy will use the most recently provided token. |
--worker-memory | The amount of RAM in MB allocated for the worker service. |
--name | The name of the worker. Ignored if empty. |
--tag | The new tag applied to the worker. Ignored if empty. |
--memory | The new amount of RAM in MB that can be used by the build actions on the worker. Must be greater than 0 or will be ignored. |
--shm | The new amount of shared memory in MB. Must be greater than 0 or will be ignored. |
--concurrent | The new number of pipeline runners on the worker. Must be greater than 0 or will be ignored.) |
--internal-host | The IP address that will be bound by the worker. Default value: empty (binds to all IP's on the server). Requires restart. |
--external-host | The external IP address of the server as seen by the primary server. Default value: the first detected external IP address. Requires restart. |
--runner-internal-port | The listening port of the runner. Default: 1090 . Can be changed if the port is taken. |
--runner-external-port | The external port of the runner to which Buddy On-Premises is connecting. Default: 1090 . Can be changed if the ports are mapped. |
--registry-internal-port | Registry listening port. Default: 1091 . Can be changed if the port is taken. |
--registry-external-port | Registry external port to which Buddy On-Premises is connecting Default: 1091 . Can be changed if the ports are mapped. |
Updating workers
To update the worker to the newest version of Buddy, sign in to the server that hosts the worker and run:
buddy update
$
Updating worker configuration
To update worker configuration (memory limits, tag, network settings, etc.), run this command on the worker server:
buddy update-worker-config
$
Supported flags
Name | Description |
---|---|
--yes | Forces non-interactive configuration mode. |
--drain | Sets the worker to draining mode. |
--config | Fetches the data from a configuration file. Must have the path to the file set. |
--standalone-host | The new IP address of the main instance. Requires restart. |
--token | Overwrites the default authorization token. If not provided, Buddy will use the most recently provided token. |
--worker-memory | The amount of RAM in MB allocated for the worker service. |
--name | The name of the worker. Ignored if empty. |
--tag | The new tag applied to the worker. Ignored if empty. |
--clear-tag | Clears the current tag applied to the worker. |
--cpus | The new number of CPUs that can be used by the build actions on the worker. Must be greater than 0 or will be ignored. |
--clear-cpus | Clears the limit on the number of CPUs available for the build actions on the worker. |
--memory | The new amount of RAM in MB that can be used by the build actions on the worker. Must be greater than 0 or will be ignored. |
--clear-memory | Clears the RAM limit for build actions on the worker. |
--shm | The new amount of shared memory in MB. Must be greater than 0 or will be ignored. |
--clear-memory | Clears the shared memory limit on the worker. |
--concurrent | The new number of pipeline runners on the worker. Must be greater than 0 or will be ignored.) |
--clear-concurrent | Clears the limit of pipeline runners on the worker. |
--internal-host | The IP address that will be bound by the worker. Default value: empty (binds to all IP's on the server). Requires restart. |
--external-host | The external IP address of the server as seen by the primary server. Default value: the first detected external IP address. Requires restart. |
--runner-internal-port | The listening port of the runner. Default: 1090 . Requires restart. |
--runner-external-port | The external port of the runner to which Buddy On-Premises is connecting. Default: 1090 . Requires restart. |
--registry-internal-port | The listening port of the registry. Default: 1091 . Requires restart. |
--registry-external-port | The external port of the registry to which Buddy On-Premises is connecting. Default: 1091 . Requires restart. |
Scaling workers
Worker-specific variables provide information on average load, the number of free pipeline slots, IP address, and the number of workers, either with or without a specific tag. You can use them in custom scripts to calculate workload and launch or shut down extra nodes in your infrastructure.
Worker variables
Name | Description |
---|---|
BUDDY_WORKERS | The JSON with information about all installed workers |
BUDDY_WORKERS_CONCURRENT_SLOTS | The total number of pipeline slots across all workers |
BUDDY_WORKERS_COUNT_${TAG} | The number of workers tagged with ${TAG} |
BUDDY_WORKERS_COUNT_NOT_TAGGED | The number of untagged workers |
BUDDY_WORKERS_FREE_SLOTS_${TAG} | The number of free pipeline slots on workers tagged with ${TAG} |
BUDDY_WORKERS_FREE_SLOTS_NOT_TAGGED | The number of free pipeline slots on all untagged workers |
BUDDY_WORKERS_AVG_LOAD_${TAG} | The average load from the last minute on all workers tagged with ${TAG} |
BUDDY_WORKERS_AVG_LOAD_NOT_TAGGED | The average load from the last minute on all untagged workers |
BUDDY_WORKER_ADDRESS_${TAG} | The list of IP addresses of workers tagged with ${TAG} |
BUDDY_WORKER_ADDRESS_NOT_TAGGED | The list of IP addresses of untagged workers |
Removing workers
To delete a worker, run buddy delete-worker
or buddy uninstall
on the machine where the worker is installed.
Supported flags
Name | Description |
---|---|
--yes | Forces non-interactive configuration mode. |
--token | Overwrites the default authorization token. If not provided, Buddy will use the most recently provided token. |
Backup
Backing up workers follows the same process as backing up the main Buddy On-Premises instance.
Generating installation command
GUI
- Sign in to your Buddy On-Premises instance as admin.
- Go to the On-Premises Admin panel and switch to the Workers tab.
- Click Add new worker and copy the installation command.
- Proceed to the installation step to continue.
CLI
On the server with the main instance, run the following to generate the installation command and token and save it to an executable file:
buddy install-worker
$
Supported flags
Name | Description |
---|---|
--yes | Forces non-interactive configuration mode. |
--drain | Sets the worker to draining mode. |
--standalone-host | The IP address of the main instance. Must be provided during the installation or in the config file. |
--worker-memory | The amount of RAM in MB allocated for the worker service. |
--name | The name of the worker. |
--tag | The tag applied to the worker. Default value: empty (untagged). |
--cpus | The number of CPUs that cane be used by the build actions on the worker. Default value: 0 (unlimited). |
--memory | The amount of RAM in MB that can be used by the build actions on the worker. Default value: 0 (unlimited). |
--shm | The amount of shared memory in MB. Default value: 0 (unlimited). |
--concurrent | The number of concurrent pipelines running on the worker. Default value: 0 (unlimited). |
--internal-host | The IP address that will be bound by the worker. Default value: empty (binds to all IP's on the server). |
--external-host | The external IP address of the server as seen by the primary server. Default value: the first detected external IP address. |
--runner-internal-port | The listening port of the runner. Default: 1090 . Can be changed if the port is taken. |
--runner-external-port | The external port of the runner to which Buddy On-Premises is connecting. Default: 1090 . Can be changed if the ports are mapped. |
--registry-internal-port | The listening port of the registry. Default: 1091 . Can be changed if the port is taken. |
--registry-external-port | The external port of the registry to which Buddy On-Premises is connecting. Default: 1091 . Can be changed if the ports are mapped. |
Worker authorization token
The authorization token is used to authenticate the worker in the main instance of Buddy On-Premises. To display the token run buddy configure
and select 15. (Worker token)
on the server with the main instance of Buddy On-Premises.
Regenerate
.
bash
buddy update-worker-config --token TOKEN_VALUE
Configuration file
Storing configuration in a file is a convenient way to set up new and update existing workers in non-interactive mode. To fetch the data from the config file, add the --config
flag to the command. For example:
buddy --yes update —config="/home/buddy/config.yml"
$
What you need to know
- providing the
--config
flag requires an existing and parsable YAML file in the provided path - all fields are optional and can be skipped or empty
- all flags overwrite the values from the config file
Supported flags
Name | Type | Description |
---|---|---|
drain | Boolean | Defines whether the worker is set to draining mode. |
standalone-host | String | The IP address of the main instance. Cannot be empty. |
token | String | The authorization token generated by the installation wizard. Can be regenerated with buddy configure |
worker-memory | Number | The amount of RAM in MB allocated for the worker service. |
tag | String | The tag applied to the worker. If set to empty (tag: "" ), the tag is cleared. |
cpus | String | The number of CPUs that can be used by the build actions on the worker. Can be equal to 0 (unlimited) or greater. |
memory | Number | The amount of RAM in MB that can be used by the build actions on the worker. Can be equal to 0 (unlimited) or greater. |
concurrent | String | The number of concurrent pipeline runners on the worker. Can be equal to 0 (unlimited) or greater. |
internal-host | The IP address that will be bound by the worker. Default value: empty (binds to all IP's on the server). | |
external-host | The external IP address of the server as seen by the primary server. Default value: the first detected external IP address. | |
runner-internal-port | Number | The listening port of the runner. Can be changed if the port is taken. Must be > 0 or will be ignored. |
runner-external-port | Number | The external port of the runner to which Buddy On-Premises is connecting. Can be changed if the ports are mapped. Must be > 0 or will be ignored |
registry-internal-port | Number | The listening port of the registry. Can be changed if the port is taken. Must be > 0 or will be ignored. |
registry-external-port | Number | The external port of the registry to which Buddy On-Premises is connecting. Can be changed if the ports are mapped. Must be > 0 or will be ignored. |
Example
standalone-host: "https://192.168.5.114"
name: "Worker-1"
tag: "tag-1"
cpus: 4
memory: 2048
shm: 256
concurrent: 4
token: 1a2b3c4d5e
internal-host: "0.0.0.0"
external-host: "3.3.3.3"
runner-internal-port: 1090
runner-external-port: 1090
registry-internal-port: 1091
registry-external-port: 1091
Management
CLI configuration options
Running buddy configure
on the worker, shows the options listed below. To configure an option, type the corresponding number and press Enter.
- Worker data path – allows to move the application data on the worker to a different partition or disk
IP & ports – allows to set IP & port addresses:
- internal IP – the internal IP address to which the worker is bound
- external host – the external IP address to which the primary instance is connecting to
- registry listening port (default
1090
) - runner listening port (default
1091
) - registry external port (default
1091
)
- Primary instance address – displays the IP address of the primary instance of Buddy.
- Worker token – displays the token used to authenticate in the primary instance of Buddy.
- Application memory management – changes the amount of RAM allocated to the Buddy application on the worker.
Checking worker status
You can view the list of connected workers and their status in the Workers tab of the On-Premises Admin panel:
Workers tab
Possible statuses:
🟢 Running 🟠 Draining 🔘 Drained 🔴 Not running or wrong version
Locking
You can lock a worker and change its name in the worker settings.
Resources
The settings are also the place to adjust the resources consumed by the actions in the pipeline (vCPUs, RAM, and shared memory) and tag workers. If any pipeline is currently assigned to the worker, you will find it at the bottom of the page:
Worker settings
Offline workers
If a worker is offline or in a different version than the main instance, all pipeline executions end with an error. It is also impossible to browse the filesystems and view execution logs of the pipelines assigned to that worker.
You can remove an inactive worker from the worker list. When you remove a worker, pipelines assigned to that worker will be automatically assigned to a different worker on the next execution.
Last modified on April 21, 2023