Skip to content
Bodylet AIBodylet AI
All pages

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:

Terminal
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: true reports the application and never blocks.
  • check opens a work session: it holds the machines until you close it.

What the check says#

Each role gets one state:

StateMeaningWhat to do
metEverything required is there, at a good versionGo on
missingSomething is missing; the plan says what would fix itRead the plan, then requirements apply
awaiting_approvalThe plan waits for a personApprove it on the Approvals page
installingThe plan runsWait: apply follows it
failedThe plan ran and the role is still not metRead the error. Often a package manager failed
unknownIt could not be checkedSee 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#

MachineHow Bodylet installsWhat it can change
Windowswinget, for the account Bodylet runs underThat account only
Linuxapt, through a small helper the machine's administrator set upThe whole machine. The package's scripts run as root
macOSNo 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:

Terminal
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 approval

Turn it on, on your own machine#

On the machine, its owner allows checks, then installs:

Terminal
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 machine

On 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:

Terminal
sudo ~/.local/bin/bodylet-runtime apps enable-system-installs
sudo ~/.local/bin/bodylet-runtime apps disable-system-installs   # to turn it off

The 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:

Terminal
systemctl --user daemon-reload && systemctl --user restart bodylet-runtime

disable-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 seeWhyWhat to do
NO_MACHINE_MATCHESNo 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 unknownThe machine is offline, the token lacks Check applications, or the machine runs a Bodylet older than 0.8.0Bring the machine online, fix the token, or update Bodylet on the machine
cannot: not_allowedThe owner did not turn on installs, or that packageThe owner's decision
cannot: needs_adminA Windows program that installs only for the whole machineA person with administrator rights installs it
cannot: no_sourceNo package for it on this systemInstall it yourself, or use another machine
cannot: no_capabilityThe token may not install thereTick Install applications for the agent
PLAN_STALEThe plan expired (after 15 minutes) or the machine changedCheck again and apply the new plan
INSTALL_FAILEDThe package manager failed. package_manager_busy means another install was runningRead 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 saysWhat to do
it needs a system install, which this machine's owner has not turned onOn Linux, the owner turns on system installs, then allows apps.install (see Turn it on)
this machine's owner has not turned installs onThe owner allows apps.install
its only package installs for the whole machine, and this machine installs for the runtime's account onlyA person with administrator rights installs it, or use another machine
the owner has not turned on apt (or winget), the package manager that has itThe owner's decision
this token may not install applications on this machineTick Install applications for the agent
the catalogue has no package of it for this systemInstall 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.