Skip to content

Commit 2b5dcd7

Browse files
committed
mantle/kola: make iscsi tests use virtiofs mounted COSA rootfs
In this case we'll run the podman container with --rootfs instead of pulling a full 4+ GiB COSA image from quay for `kola qemuexec`. This saves us quite a bit of time and bandwidth usage during a pipeline run because we have more than 1 iscsi test. This should also take care of coreos/fedora-coreos-tracker#1866 because we are no longer pulling this particular container from quay.
1 parent c6b8fa6 commit 2b5dcd7

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

mantle/cmd/kola/resources/iscsi_butane_setup.yaml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ storage:
5757
# Will return 0 if the discovery yield a valid portal
5858
iscsiadm --mode discovery --type sendtargets --portal 127.0.0.1 | \
5959
grep iqn.2024-05.com.coreos
60-
- path: /var/boot.ipxe
60+
- path: /srv/boot.ipxe
6161
mode: 0644
6262
contents:
6363
inline: |
@@ -87,16 +87,6 @@ storage:
8787
-i /var/nested-ign.json
8888
# Unmount the disk
8989
iscsiadm --mode node --logoutall=all
90-
# Use a separate unit to pull the image so it can be downloading
91-
# in the background while the `coreos-installer install` is running.
92-
- path: /etc/containers/systemd/coreos-assembler.image
93-
contents:
94-
inline: |
95-
[Image]
96-
Image=quay.io/coreos-assembler/coreos-assembler
97-
[Service]
98-
# Extend start time. COSA is a large image we are pulling from quay.
99-
TimeoutStartSec=600
10090
- path: /etc/containers/systemd/coreos-iscsi-vm.container
10191
contents:
10292
inline: |
@@ -108,14 +98,23 @@ storage:
10898
OnFailure=emergency.target
10999
OnFailureJobMode=isolate
110100
[Container]
111-
Image=coreos-assembler.image
112101
ContainerName=iscsiboot
113-
Volume=/var/boot.ipxe:/var/boot.ipxe
114-
Volume=/dev/virtio-ports/testisocompletion:/mnt/serial
102+
# Use the read-only virtiofs shared rootfs from COSA. This
103+
# saves us pulling 4+ GiB COSA container from quay.
104+
# makes it so we don't have to pull down COSA from quay
105+
Rootfs=/var/cosaroot
106+
Volume=/srv/boot.ipxe:/srv/boot.ipxe
107+
AddDevice=/dev/virtio-ports/testisocompletion:/dev/virtio-ports/testisocompletion
108+
# Create a few writable directories from empty volumes. We
109+
# must use named volumes for now so we can pass :nocopy.
110+
# https://github.com/containers/podman/issues/25176
111+
Volume=root:/root/:nocopy
112+
Volume=vartmp:/var/tmp/:nocopy
113+
WorkingDir=/root
115114
PodmanArgs=--privileged
116115
Network=host
117116
LogDriver=passthrough
118-
Exec=shell -- kola qemuexec --netboot /var/boot.ipxe --usernet-addr 10.0.3.0/24 -- -device virtio-serial -chardev file,id=iscsi-completion-virtio,path=/mnt/serial,append=on -device virtserialport,chardev=iscsi-completion-virtio,name=testisocompletion
117+
Exec=kola qemuexec --netboot /srv/boot.ipxe --qemu-swtpm=false --usernet-addr 10.0.3.0/24 -- -device virtio-serial -chardev file,id=iscsi-completion-virtio,path=/dev/virtio-ports/testisocompletion,append=on -device virtserialport,chardev=iscsi-completion-virtio,name=testisocompletion
119118
[Install]
120119
# Start by default on boot
121120
WantedBy=multi-user.target

mantle/cmd/kola/testiso.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,12 @@ func testLiveInstalliscsi(ctx context.Context, inst platform.Install, outdir str
10911091

10921092
builder.SetConfig(config)
10931093

1094+
// Bind mount in the COSA rootfs into the VM so we can use it as a
1095+
// read-only rootfs for quickly starting the container to kola
1096+
// qemuexec the nested VM for the test. See resources/iscsi_butane_setup.yaml
1097+
builder.MountHost("/", "/var/cosaroot", true)
1098+
config.MountHost("/var/cosaroot", true)
1099+
10941100
mach, err := builder.Exec()
10951101
if err != nil {
10961102
return 0, errors.Wrapf(err, "running iso")

0 commit comments

Comments
 (0)