feat: show why units failed, with their last journal lines

Failed jobs keep their kind: units that broke or timed out get a failure
panel entry with the reason systemd reports (exit status, signal, timeout,
start limit, status text) and their last journal lines read through
libsystemd. Units that failed only through a dependency are dimmed and left
out of the panel, and units that crash after starting count as failed.

Restructure the repository around this:
- move the library and binary into bootvine/ and the scripted demos into
  their own unpublished scripted-demos crate, with their VHS tapes
- move the crane builds and NixOS module into nix/
- group each sample VM with its check under vm-tests/, adding text-console,
  scripted-initrd, encrypted-volume and failures machines and a vm-failures
  check
- add docs/guide.md walking through the screen with every recording, keep
  one recording in the README, and re-render all recordings
This commit is contained in:
Willem Vanhulle committed 2026-10-30 14:59:10 +01:00
1 parent f2544a964a
commit 7e95cbd8e9
96 files changed
+2027 -462

No files matched your search

+8 -3
View File
@@ -16,8 +16,8 @@ struct RepoTasks {
#[derive(Subcommand)]
enum Task {
#[command(
about = "Record the README screencasts with vhs and copy the passphrase screenshot into \
recordings/"
about = "Record the screencasts with vhs and copy the passphrase and failures screenshots \
into recordings/"
)]
RecordScreencasts(RecordScreencastsOptions),
#[command(
@@ -30,12 +30,17 @@ enum Task {
struct RecordScreencastsOptions {
#[arg(long, help = "passphrase.png produced by the vm-luks-passphrase check")]
passphrase_png: PathBuf,
#[arg(long, help = "failures.png produced by the vm-failures check")]
failures_png: PathBuf,
}
fn main() -> ExitCode {
let outcome = match RepoTasks::parse().task {
Task::RecordScreencasts(options) => {
record_screencasts::record_screencasts(&options.passphrase_png)
record_screencasts::record_screencasts(&record_screencasts::CheckScreenshots {
passphrase_png: &options.passphrase_png,
failures_png: &options.failures_png,
})
}
Task::SyncDefaultConfig => sync_default_config::sync_default_config(),
};
+30 -13
View File
@@ -8,23 +8,40 @@ use xshell::{Shell, cmd};
use crate::task_error::TaskError;
const TAPES: [&str; 2] = ["boot.tape", "shutdown.tape"];
const TAPES: [&str; 2] = [
"scripted-demos/tapes/scripted-boot.tape",
"scripted-demos/tapes/scripted-shutdown.tape",
];
pub fn record_screencasts(passphrase_png: &Path) -> Result<(), TaskError> {
let recordings = Path::new("recordings");
if !recordings.is_dir() {
return Err(TaskError::NotInRepositoryRoot);
}
let shell = Shell::new()?;
TAPES.iter().try_for_each(|tape| {
let tape_path = recordings.join(tape);
cmd!(shell, "vhs {tape_path}").run()
})?;
let copied_png = recordings.join("passphrase.png");
fs::copy(passphrase_png, &copied_png)
pub struct CheckScreenshots<'a> {
pub passphrase_png: &'a Path,
pub failures_png: &'a Path,
}
fn copy_screenshot(
screenshot: &Path,
recordings: &Path,
published_name: &str,
) -> Result<(), TaskError> {
let copied_png = recordings.join(published_name);
fs::copy(screenshot, &copied_png)
.and_then(|_| fs::set_permissions(&copied_png, Permissions::from_mode(0o644)))
.map_err(|source| TaskError::File {
path: copied_png,
source,
})
}
pub fn record_screencasts(screenshots: &CheckScreenshots) -> Result<(), TaskError> {
let recordings = Path::new("recordings");
if !recordings.is_dir() {
return Err(TaskError::NotInRepositoryRoot);
}
let shell = Shell::new()?;
TAPES.iter().try_for_each(|tape| {
let tape_path = Path::new(tape);
cmd!(shell, "vhs {tape_path}").run()
})?;
copy_screenshot(screenshots.passphrase_png, recordings, "passphrase.png")?;
copy_screenshot(screenshots.failures_png, recordings, "failures.png")
}