/tmp. Mirage
shows that same /tmp in the workspace, so a file the agent writes from
Mirage’s shell is the file the machine’s programs read, and a file a
program leaves behind is one the agent can open:
cat writes /tmp/fix.py on the machine, and the machine’s
python3 reads it there. Nothing is copied or synced: the file lives on the
machine. /dev/shm works the same way.
Set up
There is nothing to turn on. Give the workspace a machine and/tmp is that
machine’s:
- YAML
- Python
- TypeScript
workspace.yaml
/tmp of its own. A mount you put at
/tmp yourself (/tmp: {vfs: ram}) replaces the machine’s.
Pick the machine
With several machines,/tmp shows all of their /tmp files together (see
Several machines). To show one machine’s /tmp, name it
with @:
- YAML
- Python
- TypeScript
workspace.yaml
machines:, wherever that section sits in the
file. Anything else stops the workspace from starting, with the names it
knows:
"@gpu" is short for a machine mount block, which also takes these fields:
Where a command runs
A command that only touches/tmp runs on the machine itself, in one go,
and prints exactly what the machine’s own tools print. A command that also
reaches the rest of the workspace runs in Mirage, which still reads and
writes each /tmp file on its machine. With one machine and /data in RAM:
A restricted or read-only mount, a coded file policy and a program the
machine lacks keep a command in Mirage too. /dev is Mirage’s (/dev/null,
/dev/stdin); only /dev/shm is the machine’s.
Several machines
A name on two machines is refused as ambiguous unless the command’s program
runs on one of them.
Behavior
- Caching: none. Programs change these files behind Mirage’s back, so every read and listing asks the machine.
- Snapshots: a snapshot keeps the mount’s config; the files stay on the machines.
- Owners:
statand listings report the machine’s own owners and modes;chmod,chownandtouchapply on the machine. - Tools: the machine needs GNU
find(for-printf),cat,head,tail,ddand the coreutils sums; a stock Debian or Ubuntu image has them. - Daytona: its exec takes no input, so a write to its files is refused
(
Operation not supported), and a command that needs piped input stays with Mirage. - Serving: with
mount_type: ssh, a path the machine holds itself is never served back to it; any other machine mount is served like any mount.
SDK guides
Python
Every config field and the VFS.md.
TypeScript
Every config field and the VFS.md.