Skip to content

Latest commit

 

History

History
138 lines (99 loc) · 4.79 KB

setup.md

File metadata and controls

138 lines (99 loc) · 4.79 KB

Setup

From a clone to a running agent.

1. Install

Python 3.10+, and the claude CLI on your PATH and authenticated (claude --version).

pip install -r requirements.txt

The agent runs wherever you start it — a workstation, a login node, a VM. It does not run on the compute system.

2. Get an endpoint running on the compute system

The agent submits work through Globus Compute, so the compute system needs an endpoint. Do this on that machine, over ssh.

Use a Python that is new enough. On many HPC systems the bare python3 is the OS one and can be years old. Check before creating anything:

python3 -V

If your application comes from a module, load it first and build the venv on top of it with --system-site-packages, so the endpoint's workers can see the application:

module load <your-module> && python3 -m venv --system-site-packages ~/venvs/agentlab && source ~/venvs/agentlab/bin/activate && pip install -U globus-compute-endpoint

Confirm the venv can see both the endpoint command and your application:

which globus-compute-endpoint <your-application>

Create the endpoint:

globus-compute-endpoint configure my-endpoint

Replace the generated template with the one from systems/endpoints/ that your system names in endpoint_template — systems/kkt.json names slurm, so systems/endpoints/slurm/. A system with no file yet takes the closest template for its scheduler. Edit the marked lines — account, filesystems, and the worker_init that activates your environment:

~/.globus_compute/my-endpoint/user_config_template.yaml.j2

Start it and note the UUID. The first start may open a browser-based Globus login, which only you can complete:

globus-compute-endpoint start my-endpoint --detach && globus-compute-endpoint list

3. Describe the system

systems/<system>.json holds what is true for everyone on that machine — module line, proxy, cache paths, queue defaults, and endpoint_template, the directory under systems/endpoints/ whose template that machine's endpoint runs. One file per machine, shared by every campaign.

A machine with no batch system says "needs_account": false, since there is nothing to charge, and its users/<you>/<system>.json gives only the endpoint and work_root.

4. Describe your access

users/<you>/<system>.json holds what is yours: the endpoint UUID, the account to charge, and a writable working directory on the compute system.

{
  "endpoint": "<uuid from step 2>",
  "account": "<project>",
  "work_root": "/path/on/compute/system/agentlab_runs"
}

work_root is the directory campaigns sit under: the campaign name is appended, so work_root/<campaign> is where a run's jobs write. Two campaigns on one system then keep their own angles and logs, and a second campaign needs no edit here.

Use work_dir instead to name one exact path, for a campaign that should write somewhere of its own choosing, or two that are meant to share. It wins over work_root. One of the two is required.

Create the directory on the compute system before the first run. The resolved path is printed at preflight and recorded in each run's meta.json.

5. Run

cd campaigns/<name> && ./run.sh

Each campaign's run.sh holds its own settings — job budget, wallclock cap, Slack.

Start it inside tmux. A campaign runs for hours or days, and closing the terminal or dropping an ssh session kills it with jobs in flight and their results uncollected.

tmux new -s agentlab
bin/list_agents.sh --all          every run, and its outcome
bin/kill_agent.sh --drain <run>   stop cleanly, finishing jobs in flight

Preflight checks the task contract, the endpoint status and workspace writability before the agent starts, so most misconfigurations fail immediately with a message rather than mid-run.

Failure signatures

ENDPOINT_NOT_ONLINE on the first submission. The endpoint manager forks a user endpoint process on demand, and the first submit can arrive before it signals readiness. Resubmit; it is a timing effect, not a configuration error.

ManagerLost. The batch allocation reached its walltime while your task was running. Blocks persist between jobs, so a long-lived block eventually expires and takes the in-flight task with it. A job lost this way carries no information about what it was testing — resubmit it. Raise the walltime in systems/<system>.json if it happens often.

Submits succeed and nothing comes back, with no error. The endpoint is online and accepting tasks, but its workers never start — usually a worker_init that fails, or a queue request the scheduler will never satisfy. Offline endpoints and expired allocations both report themselves, so silence points here. Check the endpoint's log on the compute system, and whether a batch job was ever queued.