agentleFS
marshal-orgmarshal-org/runlease/skills/fanout/SKILL.md

fanout

Skill1 starsChanged 17 days agoApache-2.0View on GitHub

Split a job across several Runlease machines and collect the results. Use for test shards, a matrix of versions or configurations, or independent tasks that can run at the same time.

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every machine carries its own lease, so there is no cleanup job to write.

    line 8

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Fan out, then let them all end

Every machine carries its own lease, so there is no cleanup job to write. There is still a bill: decide the number of machines from the work, and tell the person the count and the size before launching more than two.

Before launching

runlease whoami        # the relay's limit: "N of M machines in use"

The free public relay allows two machines at once. Asking for a third fails before anything is created. On the person's own relay the limit is theirs.

Pattern

N=2
for i in $(seq 1 $N); do runlease up -p gcp -n shard-$i --ttl 1h -d; done

# wait until each answers (30-60s after launch); give up on one after 3 minutes
for i in $(seq 1 $N); do
  for try in $(seq 1 18); do
    runlease exec shard-$i -- true 2>/dev/null && break
    [ "$try" -eq 18 ] && echo "shard-$i never answered: see the troubleshoot skill" >&2
    sleep 10
  done
done

# send the work, run the shards at the same time, each writing its own result file
for i in $(seq 1 $N); do
  runlease push shard-$i /tmp/src.tar.gz /tmp/src.tar.gz
  runlease exec shard-$i -- bash -c "mkdir -p ~/src && tar -xzf /tmp/src.tar.gz -C ~/src && cd ~/src && SHARD=$i TOTAL=$N ./test.sh > ~/shard.log 2>&1; echo exit=\$? >> ~/shard.log" &
done
wait

for i in $(seq 1 $N); do runlease pull shard-$i /home/runlease-agent/shard.log ./shard-$i.log; done
for i in $(seq 1 $N); do runlease down shard-$i --yes; done

Rules

  • Name machines by role and index (shard-1, py311), never reuse one name for two machines.
  • One launch that fails must not strand the others: after any failure, run runlease list and take down what was created.
  • Pull each result before deleting its machine. A spot machine can also disappear on its own, so a missing shard is a result to report, not a reason to rerun everything.
  • Report the outcome per machine: passed, failed, or lost.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.