How it works
YOUR COMPUTER DISCOMP SERVER ┌───────────────────────────────────┐ ┌──────────────────────────┐ │ discomp program │ │ live list of computers │ │ check the machine ─► what can I ├──────────►│ and what each can lend │ │ lend now? │ │ │ │ job ─► runs in a locked box │◄──────────┤ hands out jobs │ └───────────────────────────────────┘ └──────────────────────────┘
- You install one program. It keeps checking your machine.
- It tells the discomp server how much it can lend right now: whole CPUs, GB of memory, GB of disk. This slice is a capacity lease — A slice of one machine (whole CPUs, GiB of memory, GiB of disk) given to one job for a limited time..
- Someone else’s job runs inside a microVM — A very small virtual machine that starts in about a second. Work inside it cannot see or touch the host machine. — a small, locked virtual machine. It cannot see your files.
- Your computer only connects out. It never opens a port.
The rule I care about most
A computer must never offer power it does not have. When in doubt, it says no (fail closed — When a reading fails, choose the safe answer. For discomp: if the battery level is unknown, lend nothing.):
- Battery unknown, or at or below your limit (30% by default): lend nothing. Start again only at your limit + 5%, or when it is plugged in.
- Laptop lid closed on battery: lend nothing, unless you allow it.
- Machine too hot, or memory under pressure: lend nothing.
- You always keep at least 2 CPUs and 8 GB (or half your memory) for yourself.
What went wrong
The automated checks (CI) were slow, and not because of the tests. Each test machine runs one job at a time, so jobs waited in a queue. In three runs they waited 471, 857 and 748 seconds for 7 to 9 minutes of real work. I merged the steps so the Linux machine runs 2 jobs per run instead of 6.
Design choices
- Your share comes first. By default the machine lends half its spare CPUs and three quarters of its spare memory, and keeps the rest for you.
- No check compares two machines’ clocks. Clocks drift. The design works without them.
- Every connection is encrypted and both sides prove who they are (mutual TLS — An encrypted connection where both sides prove who they are with a certificate, not only the server.).
- Tests run on real virtual machines, on a real Linux machine and a real Mac. A test that cannot run is reported as skipped, never as passed.