Applications and requirements
Before work starts, an agent can say what each machine needs: applications at a version, files, free ports. Bodylet checks each machine, and when something is missing, it shows a plan: what it would install or copy, and what it cannot do. Nothing is installed until the plan runs, and by default a person approves each plan first.
Ask for it#
The agent writes the requirements, Bodylet picks a machine and checks it, and the agent tells you what is there and what the plan would install.
A requirements document#
With the command line, write what each role needs in a YAML file. Here build needs two applications on Linux, and run needs the build output, copied from build if it is missing:
version: 1
machines:
build:
os_family: linux
apps:
- name: cmake
version: ">=3.20"
- name: ninja
run:
os_family: windows
apps:
- name: nodejs
optional: true
files:
- path: 'C:\Users\ana\build'
kind: directory
from: {role: build, path: /home/ana/build}Then:
bodylet requirements check build.yaml # holds the machines and checks each role
bodylet requirements apply <session-id> # runs the plans, after their approval
bodylet session close <session-id> # frees the machines when the work is done- Quote every version:
version: ">=3.20",version: "*". A version can be>=3.20,<2,^1.2(same first number),~1.2(same first two numbers), or several joined by commas. optional: truereports the application and never blocks.checkopens a work session: it holds the machines until you close it.
What the check says#
Each role gets one state:
| State | Meaning | What to do |
|---|---|---|
met | Everything required is there, at a good version | Go on |
missing | Something is missing; the plan says what would fix it | Read the plan, then requirements apply |
awaiting_approval | The plan waits for a person | Approve it on the Approvals page |
installing | The plan runs | Wait: apply follows it |
failed | The plan ran and the role is still not met | Read the error. Often a package manager failed |
unknown | It could not be checked | See Why a check can refuse |
Each step of a plan says can: with the package, or cannot: with why. A step that cannot be done is never tried.
What an install may change#
| Machine | How Bodylet installs | What it can change |
|---|---|---|
| Windows | winget, for the account Bodylet runs under | That account only |
| Linux | apt, through a small helper the machine's administrator set up | The whole machine. The package's scripts run as root |
| macOS | No installs |
Bodylet never installs a Windows program that installs only for the whole machine, because nobody would be there to answer the Windows prompt. The plan says needs_admin: a person with administrator rights installs it, then the agent checks again.
Bodylet knows 19 applications: Git, Node.js, npm, Python, pip, Java, Go, rustc, Cargo, rustup, Docker, .NET, CMake, Ninja, GCC, Clang, FFmpeg, 7-Zip and VS Code. For these it knows how to read the version and which package installs them.
Approvals#
By default every plan that installs something waits for a person. The agent's call stops, and the plan appears on the Approvals page, where you choose Approve or Deny. A plan that installs as root on Linux says "Runs as root". requirements apply waits for your decision, then runs the plan.
The owner of the machine can change this, on the machine:
bodylet policy approval apps.install always # every plan (the default)
bodylet policy approval apps.install first_use # the first plan of each agent
bodylet policy approval apps.install never # no approvalTurn it on, on your own machine#
On the machine, its owner allows checks, then installs:
bodylet policy allow apps.check # agents may ask which applications are here
bodylet policy allow apps.install # and ask for installs of the missing ones
bodylet-runtime apps status # what is allowed, and how installs would work here
bodylet-runtime apps check git cmake # check now, on this machineOn Linux, installs need one more step, taken on purpose by an administrator. It installs the helper and lets your account run it, and nothing else:
sudo ~/.local/bin/bodylet-runtime apps enable-system-installs
sudo ~/.local/bin/bodylet-runtime apps disable-system-installs # to turn it offThe first command prints each change it makes. The helper installs only the packages of a list that root owns. Installing a package runs its scripts as root: keep the list to packages you trust.
Then restart the Bodylet service, as your own account (not with sudo), so that it can use the helper. The command prints the line to run:
systemctl --user daemon-reload && systemctl --user restart bodylet-runtimedisable-system-installs asks for the same restart. Until you restart, bodylet-runtime apps status says system_installs: enabled but blocked, with the reason and the fix.
On the agent's token, tick Check applications, and Install applications too to install. The machine's page in the dashboard lists its applications under Applications.
Why a check can refuse#
| You see | Why | What to do |
|---|---|---|
NO_MACHINE_MATCHES | No machine of your fleet has the application, and none can install it. Nothing was held. The message says, machine by machine, why (see below) | Do what the reason says, or mark the application optional: true to go on without it |
A role is unknown | The machine is offline, the token lacks Check applications, or the machine runs a Bodylet older than 0.8.0 | Bring the machine online, fix the token, or update Bodylet on the machine |
cannot: not_allowed | The owner did not turn on installs, or that package | The owner's decision |
cannot: needs_admin | A Windows program that installs only for the whole machine | A person with administrator rights installs it |
cannot: no_source | No package for it on this system | Install it yourself, or use another machine |
cannot: no_capability | The token may not install there | Tick Install applications for the agent |
PLAN_STALE | The plan expired (after 15 minutes) or the machine changed | Check again and apply the new plan |
INSTALL_FAILED | The package manager failed. package_manager_busy means another install was running | Read the end of its output. Try again later for package_manager_busy |
Why a machine cannot take a role#
When no machine can take a role, the refusal gives one line per machine with the reason. For example:
build-box: git is missing and cannot be installed here: it needs a system install (apt, run as root through the runtime's helper), which this machine's owner has not turned on
| The line says | What to do |
|---|---|
| it needs a system install, which this machine's owner has not turned on | On Linux, the owner turns on system installs, then allows apps.install (see Turn it on) |
| this machine's owner has not turned installs on | The owner allows apps.install |
| its only package installs for the whole machine, and this machine installs for the runtime's account only | A person with administrator rights installs it, or use another machine |
| the owner has not turned on apt (or winget), the package manager that has it | The owner's decision |
| this token may not install applications on this machine | Tick Install applications for the agent |
| the catalogue has no package of it for this system | Install it yourself, or use another machine |
| it runs windows, the role needs linux (or another requirement) | Ask for less, or add a machine that fits |
The message names up to three machines. bodylet requirements check prints a line for each machine that an application keeps off. On a machine created by a host, see What a created machine allows.