Worker Installation
This guide assumes you completed the installation prerequisites, staged the worker binary (lyftdata-worker), and have the Linux server configured and running.
Set up a new Worker as follows:
-
Create a Worker ID and API key on the Server.
-
Prepare the service account and data directory.
-
Create a
systemdservice unit file. -
Start the Worker.
Generate an API key
A Worker ID and API key are required for the Worker before it can connect to the Server. This can be done either via the web-based UI or the CLI.
Via web-based UI
Log in to the Server. Go to Workers and select Add Worker.
Create a new Worker with a specified name and ID.
The Worker name is a human-readable designation (a label), while the Worker ID will be used in the Worker configuration.
Next, create an API key for the Worker. Go to Settings → API Keys.
Then create a name for the new API key, select Add and copy the key value for later use.
Create systemd files
Create a systemd service unit file:
sudo vi /etc/systemd/system/lyftdata-worker.serviceThe file must contain the following:
[Unit]Description=lyftdata WorkerAfter=network.target auditd.service
[Service] EnvironmentFile=/etc/default/lyftdata-worker User=lyftdata-worker Group=lyftdata-worker ExecStart=/usr/sbin/lyftdata-worker Restart=on-failure RestartSec=60
[Install]WantedBy=multi-user.targetCreate an environment file for the EnvironmentFile setting:
sudo vi /etc/default/lyftdata-workerHere, the Worker is configured through either lyftdata-worker options or environment variables. In this case, we’ll be using the latter.
At a minimum, the Worker needs to know:
-
A unique Worker ID (
LYFTDATA_WORKER_ID). -
An API key to authenticate against a Server (
LYFTDATA_WORKER_API_KEY). -
The Server URL (
LYFTDATA_URL). -
A data directory to store Job definitions and other state data (
LYFTDATA_JOBS_DIR).
Therefore, the file should contain the following:
LYFTDATA_WORKER_ID=worker1LYFTDATA_WORKER_API_KEY=<WORKER-API-KEY>LYFTDATA_JOBS_DIR=/var/lib/lyftdata-workerLYFTDATA_URL=https://<server>:3000LYFTDATA_LICENSE_EULA_ACCEPT=yes# Evaluation only: allow connecting to a self-signed TLS server certificateLYFTDATA_TLS_INSECURE=trueOptional settings
Change the LYFTDATA_WORKER_API_KEY to match the key you previously created.
Change the LYFTDATA_URL to the Server address or hostname (confirm that your DNS is configured). Ensure the scheme matches how the server is configured (https:// by default, http:// only when the server runs with --disable-tls).
If the server is using the default self-signed certificate, keep LYFTDATA_TLS_INSECURE=true for evaluation and remove it once you install a trusted certificate.
Once you have saved the service unit file, reload systemd:
sudo systemctl daemon-reloadTo start the Worker at boot, enable the service with:
sudo systemctl enable lyftdata-workerFinally, start the Worker:
sudo systemctl start lyftdata-workerVerify that the Worker started successfully:
systemctl status lyftdata-workerIt’s a good idea to inspect the startup output, which might contain an error or warn:
journalctl -u lyftdata-workerA Worker should now be running. It will register with the Server, using the specified API key.
The Server should indicate the Worker status on the Dashboard. At this point, the Worker is ready to run received Jobs from the Server.