CairnML Agent
CairnML Agent runs the jobs of a CairnML queue on this machine. It takes one job at a time from its queue, prepares the job's environment, runs it and reports the result back to the server.
Features
- Takes jobs from one or more queues.
- Runs each job in its own Docker container. Docker is required; jobs in a Python virtual environment on the host need
--allow-venv, which is off by default. - Gives the agent the GPUs you choose with
--gpus. - Gives every job its own short-lived token, so a job never receives the agent's own token.
- Is enrolled once by a signed-in user, who signs in when the browser opens.
Prerequisites
- Python 3.9 or newer
- A running CairnML server
- An account on that server: any signed-in user can enrol an agent
- Docker (required; see
--allow-venvfor the exception)
Installation
python3 -m venv .venv
. .venv/bin/activate
pip install cairnml-agent
Connect to your server
cairnml-agent init http://cairnml
The argument is the server's address. The web app is at <address>/cairnml and the API at <address>/cairnml/api, which the command works out itself, so there are no ports to give. Your browser opens the sign-in page: sign in with your account. The browser sign-in receives its reply on 127.0.0.1:8765, the only redirect address the identity provider accepts; if another program holds that port, the command signs in with a code instead. The configuration is stored in ~/.cairnml/agent/cairnml-agent.conf, next to the device key; the earlier ~/cairnml-agent.conf is still read; the agent's git credentials and extra package indexes are set there by hand.
The agent enrols as its own device, with its own key (~/.cairnml/agent/device.key), apart from the SDK's cairnml init. --name names the machine, --force enrols it again (the previous device is revoked) and -F <file> uses another configuration file.
Check the machine
cairnml-agent doctor
It prints one line per check and the next step for each failure: the configuration names a server, the server answers, Docker is installed, the Docker daemon runs for this user, and the server has a GitHub App. A missing GitHub App is a warning: jobs from github.com repositories are refused until it is set up. Warnings do not change the exit status (0 when no check fails, 1 otherwise). The checks change nothing. -F <file> checks another configuration file.
Start the agent
cairnml-agent daemon --queue default
| Option | What it does |
|---|---|
--queue NAME |
The queue to take jobs from |
--docker |
Run each job in a container (required unless --allow-venv is given) |
--allow-venv |
Allow jobs in a Python virtual environment on this host. Off by default: such a job can read the agent's device key |
--gpus 0 |
The GPUs the agent may use |
Run cairnml-agent daemon --help for the rest.
Trust model
The agent runs the code of every job that reaches its queue, so decide who may enqueue jobs before you start it.
- Docker (
--docker) is the isolated mode. A job runs in its own container, which does not see the agent's device key (~/.cairnml/agent/device.key). The job gets its own token, never the agent's. Use it for any setup where jobs come from more than one person. - Virtual environment (
--allow-venv) is not isolated. A job runs as the agent's own user, so it can read the device key, whatever the file permissions. The key signs in as the user who enrolled the agent, with a token that lasts until the device is revoked. The agent prints a warning when it starts this way and still runs the job. Use it only for code you fully trust. - The agent keeps its folder (
~/.cairnml/agent) readable by its owner only (mode 0700), and the key in it is 0600. The agent does not put the key or its folder into a job's environment. - A task's own Docker arguments cannot give its container host access. By default the agent drops switches such as
--privileged,--cap-add,--device, host namespaces (--pid,--ipc,--network), mounts and volumes (-v,--mount), and host files (--env-file,--log-opt). The list isforbidden_docker_argsin the agent configuration. Changing it is an administrator decision, and an empty list turns the check off. - The agent refuses to start a job whose cache or mount folder would contain the device key (the key, its folder or a folder above them, such as the home folder). Choose cache folders outside
~/.cairnml/agent.
Check it
The Workers page of the web app lists this machine once it is running. Send a job to the queue, for example with Task.enqueue from the SDK, and it starts on this machine.
Next steps
Continue with the CairnML examples.
Having problems
- Check the open issues.
- If your problem is not listed, open a new issue with the command you ran and the full error message.
License
Apache License 2.0, see LICENSE. Unofficial fork of ClearML Agent, see DISCLAIMER.md.
Metadata
Release files for cairnml-agent 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cairnml_agent-0.0.4.tar.gz | 1.2 MB | With provenance | Details for cairnml_agent-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cairnml_agent-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for cairnml_agent-0.0.4-py3-none-any.whl |
Total release size: 2.6 MB
Release files / cairnml_agent-0.0.4.tar.gz
| Download URL | cairnml_agent-0.0.4.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
164d9d9d9a0259ce5f0f8eeb49e062c7d38fbe901655171a864b8eacb318d48b
|
|
BLAKE2b-256 checksum How to use checksums |
4f4520802cade552eb5491ec950615cb1b62347894e41e7fcfb8b10fe201082e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logRelease files / cairnml_agent-0.0.4-py3-none-any.whl
| Download URL | cairnml_agent-0.0.4-py3-none-any.whl |
|---|---|
| Size | 1.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78f0a51ca028440c720c804fac905f79601d9958d2a1e2c3820b406c47a44edf
|
|
BLAKE2b-256 checksum How to use checksums |
d103384abd45a03373f42c4b8b12c2627827717e0ee3f9ceb2a4308682c16f78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logSecurity for cairnml-agent 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for cairnml_agent-0.0.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.