diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-07-08 14:21:49 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-07-08 14:21:49 +0000 |
commit | 059df6da440b2139881fbadece0d3686f199eec1 (patch) | |
tree | f1bb02bd35dcbaaf884e40c887b26622cea1f31a | |
parent | 45cb23d704812cc2d1077b0d6cd1a8e04805722f (diff) | |
parent | 5a78451ed6a9b1f3b808e1899d04ef151c8459a7 (diff) | |
download | ambient-ci-059df6da440b2139881fbadece0d3686f199eec1.tar.gz |
Merge branch 'liw/vmreq' into 'main'
docs: specify what's expected of the VM
See merge request larswirzenius/ambient-ci!25
-rw-r--r-- | ambient.md | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -248,6 +248,37 @@ amount of memory. We fail the build if it exceeds a pre-determined time limit. We fail the build if the amount of output via the serial console exceeds a pre-determined limit. +# Architecture + +At a very abstract level, the Ambient architecture is as follows: + +* Ambient creates a virtual machine with four block devices (using + `virtio_blk`) in addition to the system disk (`/dev/vda` on Linux): + - `/dev/vdb`: the read-only source device: a tar archive of the + project's source tree + - `/dev/vdc`: the read/write artifact device: for the project to + write a tar archive of any build artifacts it wants to export + - this would be write-only if that was possible + - `/dev/vdd`: the read-only dependencies device: a tar archive of + additional dependencies in a form that the project can use + - `/dev/vde`: the read/write cache device: a tar archive of any + files the project wants to persist across runs; for example, for a + Rust project, this would contains the cargo target directory + contents +* The VM additionally has a serial port where it will write the + build log. On Linux this is `/dev/ttyS0`. +* The VM automatically, on boot, creates + `/workspace/{src,cache,deps}`, and extracts the source, cache, and + dependencies tar archives to those directories. +* The VM then changes current working directory to `/workspace/src` + and runs `./.ambient-script` (if the script isn't executable, the VM + first makes it so). The script's stdout and stderr are redirected to + the serial port. + +The `ambient-build.service` and `ambient-run-script` files in the +Ambient source tree implement this for Linux with systemd, and have +been tested with Debian. + # Acceptance criteria [Subplot]: https://subplot.tech |