Commit 9a25775
committed
test(qemu): replace Fedora Cloud image with Alpine Linux tiny image
## Motivation
Fedora Cloud qcow2 images used in QEMU driver tests weigh ~556 MB
(x86_64) + ~519 MB (aarch64) = ~1.1 GB total, taking ~1 minute to
download on every CI run. Alpine Linux 3.22.4 UEFI tiny images reduce
that to ~127 MB + ~151 MB = ~278 MB — a 74% reduction — and download
in ~6 s on GitHub Actions runners, making a cache unnecessary.
## Image replacement
x86_64: 556 MB → 127 MB (77%)
aarch64: 519 MB → 151 MB (71%)
Total: ~1076 MB → ~278 MB (74%)
Alpine's nocloud tiny images support UEFI boot on both architectures
and use tiny-cloud (a minimal cloud-init alternative) that reads the
standard NoCloud CIDATA vfat volume the QEMU driver already generates.
## Driver changes (driver.py)
tiny-cloud differs from full cloud-init in two ways:
1. Hostname: tiny-cloud reads @hostname from the YAML key 'hostname'
in meta-data, not 'local-hostname'. Add 'hostname' alongside
'local-hostname' so both implementations set it correctly.
2. Password: tiny-cloud ignores plain_text_passwd in the users stanza.
Add a runcmd entry to set the password via chpasswd. Credentials are
escaped with shlex.quote() so special characters are safe.
Full cloud-init images are unaffected.
hostport=0 support: Hostfwd now allows hostport=0, which tells QEMU's
user-mode networking to pick a free port automatically. After QEMU
starts, the driver queries the actual assigned port via QMP
'human-monitor-command info usernet', logs it at INFO level:
hostfwd 'ssh': resolved port 0 -> 127.0.0.1:<port> (guest port 22)
and stores it in _resolved_hostports so get_hostfwd_port() can return
it to the client side.
## Client changes (client.py)
shell() now checks for an 'ssh' hostfwd entry by calling
get_hostfwd_port('ssh'). If present, it opens a direct fabric
Connection to 127.0.0.1:<resolved_port>, bypassing the jumpstarter
streaming layer entirely. If no ssh hostfwd is configured (KeyError),
it falls back to the original FabricAdapter path over vsock.
This is necessary because Alpine uses OpenRC, not systemd, so
systemd-ssh-generator never runs and sshd only listens on TCP.
Fedora cloud images ship systemd-ssh-generator (systemd >= 256) which
automatically binds sshd to AF_VSOCK port 22 inside VMs — that is why
the original vsock path worked with Fedora but not Alpine.
## Test changes (driver_test.py)
- Pass hostfwd={'ssh': {hostport=0, guestport=22}} so qemu.shell()
uses the TCP path with a QEMU-assigned port; no probe socket needed.
- Wait for 'bootstrap_complete: done' on the serial console before
attempting login, guaranteeing tiny-cloud has set the password and
sshd is ready (avoids the race that existed with Fedora too, where
the extra setenforce console round-trip happened to provide enough
delay).
- Press Enter if the GRUB countdown appears to skip the 10 s wait.
- Update post-login prompt from bash '[user@host ~]$' to Alpine ash
'host:~$'.
- Remove 'sudo setenforce 0' (no SELinux on Alpine).
- Relax 'uname -r' assertion to a non-empty check.
## CI changes (python-tests.yaml)
Remove the actions/cache steps entirely. Alpine images download in ~6 s
on GitHub runners (measured), which is faster than cache restore
overhead for files this size.1 parent ada5fa8 commit 9a25775
4 files changed
Lines changed: 84 additions & 25 deletions
File tree
- .github/workflows
- python/packages/jumpstarter-driver-qemu/jumpstarter_driver_qemu
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 123 | + | |
132 | 124 | | |
133 | 125 | | |
134 | | - | |
135 | | - | |
| 126 | + | |
| 127 | + | |
136 | 128 | | |
137 | 129 | | |
138 | 130 | | |
| |||
Lines changed: 20 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
84 | 98 | | |
85 | 99 | | |
86 | 100 | | |
| |||
Lines changed: 43 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
381 | 382 | | |
382 | 383 | | |
383 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
384 | 405 | | |
385 | 406 | | |
386 | 407 | | |
| |||
410 | 431 | | |
411 | 432 | | |
412 | 433 | | |
413 | | - | |
| 434 | + | |
414 | 435 | | |
415 | 436 | | |
416 | 437 | | |
| |||
440 | 461 | | |
441 | 462 | | |
442 | 463 | | |
| 464 | + | |
| 465 | + | |
443 | 466 | | |
444 | 467 | | |
445 | 468 | | |
| |||
512 | 535 | | |
513 | 536 | | |
514 | 537 | | |
| 538 | + | |
515 | 539 | | |
516 | 540 | | |
517 | 541 | | |
| |||
528 | 552 | | |
529 | 553 | | |
530 | 554 | | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
531 | 563 | | |
532 | 564 | | |
533 | 565 | | |
534 | 566 | | |
535 | 567 | | |
536 | 568 | | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
537 | 579 | | |
538 | 580 | | |
539 | 581 | | |
| |||
Lines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
75 | | - | |
| 80 | + | |
76 | 81 | | |
77 | 82 | | |
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
81 | | - | |
| 86 | + | |
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
| |||
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
91 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
92 | 105 | | |
93 | 106 | | |
94 | 107 | | |
95 | | - | |
96 | | - | |
97 | | - | |
| 108 | + | |
98 | 109 | | |
99 | 110 | | |
100 | | - | |
| 111 | + | |
101 | 112 | | |
102 | 113 | | |
103 | 114 | | |
| |||
0 commit comments