Fistron docs

fistron.io

Install and register an agent

An agent runs your projects’ work inside your own network, next to your CI and your Git platform. It connects to the control plane outbound only, over HTTPS. It reads your platforms with its own tokens, which never leave your network, and uploads the documents it writes to the project.

Before you start

Create a registration token

  1. Open Agents.
  2. Under Register an agent, enter:
    • Name: where it runs, for example runner-ci-01;
    • Projects: tick the projects it serves. None ticked means every project of the organisation;
    • The token holds (hours): 1 to 168 (default 24).
  3. Click Create the registration token.
  4. Copy the token now. It is shown once, registers one agent once, and expires at the time shown. Click I have copied it.

The token appears under Registrations not used yet until an agent uses it. Click Withdraw there to cancel it.

Register the agent on its host

  1. On the agent’s host, put the token into the variable FISTRON_AGENT_REGISTRATION_TOKEN, from a file only the agent’s user can read. Keep it out of the shell’s history.

  2. Register:

    fistron agent register --url https://fistron.example.com --if-missing

    The agent exchanges the token for its own credential and writes it to ~/.config/fistron/agent.json (or the file --credentials or FISTRON_AGENT_CREDENTIALS names), readable by its owner only. With --if-missing, an agent that is already registered keeps its credential and needs no token. Add --ca-file if your control plane’s certificate is signed by a CA the system does not trust.

  3. Remove the token from the environment. It is spent.

Start the agent

As a service that starts with the machine, install the agent as a container with systemd, or with the Helm chart (install-hybrid.md): registering and starting are then one step. By hand:

fistron agent run --workspace /var/lib/fistron --config /etc/fistron/fistron.toml --create-workspace

Stop it with SIGTERM or Ctrl+C: it finishes the work in hand first.

Check that it answers

  1. Open Agents.
  2. Find your agent and check:
    • State: answers (seen within the last five minutes);
    • the number of operations it runs and the models it declared;
    • Version and Credential until. Beside the version, an agent that is not an installation Fistron supports says so: what fistron doctor found at its start (not supported: modified core, not supported: modified source or unknown release) and which part. A supported agent says nothing more.
  3. In a project it serves, open Work, click Start an operation and run a small operation. The work moves from queued to succeeded.

In Kubernetes

The control plane’s Helm chart has the agent as its component agent, with a persistent volume for the workspace and the credentials. An init container registers it with --if-missing from a Secret that holds the registration token: delete the Secret after the first start. With the hosted control plane, install the chart with only the agent. Scheduled work comes from the control plane’s schedules, not from CronJobs.

Several agents for one project

A project can have two agents that reach different things, for example one on a hosted runner for public GitHub and one inside your network for your Jenkins. You do not assign work to them: each agent says what its fistron.toml reaches, and the control plane gives a work to an agent that reaches what the work names.

  1. Register the second agent for the same project and start it with its own fistron.toml (for example only [acquisition.jenkins]).
  2. Open Agents and check the agent’s line reaches: (its platforms, repositories and jobs). The agent registered first shows first agent of the project: it takes the work any of the agents could do.
  3. Start a work: a Jenkins build’s import goes to the agent that reaches Jenkins, and the analysis of that case follows it there. A queued work says on Work which agent it waits for.

If no agent of the project reaches what a work names, starting it is refused with what each agent reaches: add the repository or job to that agent’s allowlist, or register an agent that reaches it.

Change the projects an agent serves

  1. Open Agents.
  2. Click Change under Projects in the agent’s row.
  3. Tick the projects it serves (none ticked: every project of the organisation), then click Save the projects (or Cancel).

The agent takes the new projects’ work from its next request; nothing changes on its host. The change is in the audit log (agent.projects).

Revoke or replace an agent

  1. Open Agents.
  2. Click Revoke in the agent’s row, then Revoke with its name to confirm (or Keep it).

Its work in hand goes back to the queue. To bring the machine back, create a new registration token and register again.

The agent’s credential lives 90 days. The agent renews it by itself when fewer than 30 days are left; you do nothing.

Troubleshooting

Symptom Cause and fix
State silent The agent has not been seen for five minutes: check that it runs, its network, its proxy settings and its CA (--ca-file).
Work stays queued (“not yet: it waits in the queue”) No agent that serves this project answers. Check the agent’s Projects on the Agents page.
Work stays queued and says which agent it waits for Only that agent reaches what the work needs, or the work continues its work: check that it answers.
Work stays queued and says “It waits: N works before it, about M min” and what its agents run The agents that may take it are busy: it is taken in its turn; the wait is estimated from how long the same operations’ works took. A work a person started goes before every queued work of a guided run (a first audit) or a schedule, and says so (“it goes before 13 queued works of an audit or a schedule”). An agent takes one work at a time unless its file says [agent] concurrency = 2 (or more): works of different projects then run at once. A work a person started (an investigation, a fix, a review) does not wait for a long one (a health audit, a history, the Daily CI review, a suite map): the agent runs it beside, even of the same project, and the wait says “ runs health-audit, and a person’s work beside it”; [agent] people_lane = false turns that off. A work that runs longer than its operation’s usual says so instead of a wait that only shrinks.
Starting a work is refused: “No agent of this project reads …” No agent allows what the work names. The refusal says what to add, in which table and of which agent; Add it to the configuration opens that agent’s configuration with it added, to check and save (an agent whose file consents uses it with its next work; otherwise add it to its fistron.toml and restart it). Give its token access to it too. A fork the agent sends fixes to ([actions.github]) but does not read is said so: list it in [acquisition.github] too, e.g. to review a request inside it. What each agent reaches is folded under the refusal.
The agent stops with exit code 1 Its credential was revoked or has expired: register it again with a new token.
HTTP 426 The agent and the control plane are more than one minor version apart: upgrade the older one.
The agent refuses to start The credentials file is inside the workspace, or the workspace is missing (use --create-workspace).
The control plane’s URL is refused Only https:// is allowed, except to the same machine.
401 or 403 from a proxy The agent waits it out and tries again; fix the proxy’s rules.
An operation is not offered Agents do not run operations of a CI job or operations that run the repository’s code. Licensed operations need the closed core where the agent runs.
The control plane does not answer The agent retries after 1, 2, 4 … up to 60 seconds.
A work runs long and you do not know what it does Open the work: What it is doing shows its newest steps (admin-schedules.md). The agent’s log has every step as work <id>: ... (journalctl --user -u fistron-agent -f, or kubectl logs of the agent’s pod).

Details: agent.md.