You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to run melange test fails to make its initial connection to the qemu guest like so, whereas melange build will succeed with the qemu runner:
$ make test/nano MELANGE_EXTRA_OPTS="--runner qemu"
yamlfile is nano.yaml
Testing package nano with version nano-8.3-r0 from file nano.yaml
$HOME/go/bin/melange test nano.yaml --repository-append $HOME/git/wolfi-dev/os/packages --keyring-append local-melange.rsa.pub --arch x86_64 --pipeline-dirs ./pipelines/ --repository-append https://packages.wolfi.dev/os --keyring-append https://packages.wolfi.dev/os/wolfi-signing.rsa.pub --test-package-append wolfi-base --debug --runner qemu --source-dir ./nano/
2025/01/05 23:12:22 INFO evaluating pipelines for package requirements
2025/01/05 23:12:22 INFO building test workspace in: '$HOME/tmp/melange-guest-1343812321-main' with apko
2025/01/05 23:12:22 [DEBUG] GET https://packages.wolfi.dev/os/apk-configuration
2025/01/05 23:12:22 INFO setting apk repositories: [$HOME/git/wolfi-dev/os/packages https://packages.wolfi.dev/os]
2025/01/05 23:12:22 INFO image configuration:
2025/01/05 23:12:22 INFO contents:
2025/01/05 23:12:22 INFO build repositories: []
2025/01/05 23:12:22 INFO runtime repositories: []
2025/01/05 23:12:22 INFO keyring: []
2025/01/05 23:12:22 INFO packages: [nano]
2025/01/05 23:12:24 INFO installing ca-certificates-bundle (20241121-r0)
[...]
2025/01/05 23:12:25 INFO qemu: generating ssh key pairs for ephemeral VM
2025/01/05 23:12:25 INFO qemu: no disk space specified, using default: 50Gi
2025/01/05 23:12:25 INFO qemu: generating disk image, name ./3887205368.img, size 50Gi:
2025/01/05 23:12:25 INFO qemu: executing - qemu-system-x86_64 -machine microvm,rtc=on,pcie=on,pit=off,pic=off,isa-serial=off -bios /usr/share/seabios/bios-microvm.bin -kernel /tmp/kernel/boot/vmlinuz-virt -initrd $HOME/tmp/melange-guest-2983141708.initramfs.cpio -m 8036913k -smp 16 -accel kvm -cpu host -daemonize -display none -no-reboot -no-user-config -nodefaults -parallel none -serial none -vga none -netdev user,id=id1,hostfwd=tcp:127.0.0.1:40755-:22 -device virtio-net-pci,netdev=id1 -device virtio-rng-pci,rng=rng0 -object rng-random,filename=/dev/urandom,id=rng0 -append quiet nomodeset panic=-1 sshkey=ZWNkc2Etc2hhMi1uaXN0cDI1NiBBQUFBRTJWalpITmhMWE5vWVRJdGJtbHpkSEF5TlRZQUFBQUlibWx6ZEhBeU5UWUFBQUJCQkdRN3JydE1PdHcvR2JJVHhlakljblVDUC9Pa1pYSjFOaWRCK3gzYUpqYVZLajJEc0JUeUltWk5YdzNaSnRBRDlnRnZXampYQ2VaNGpZd3BWQmU5azU4PQo= -fsdev local,security_model=mapped,id=fsdev100,path=$HOME/tmp/melange-workspace-1187461383 -device virtio-9p-pci,id=fs100,fsdev=fsdev100,mount_tag=defaultshare -object iothread,id=io1 -device virtio-blk-pci,drive=disk0,iothread=io1 -drive if=none,id=disk0,cache=none,format=raw,aio=threads,werror=report,rerror=report,file=./3887205368.img
2025/01/05 23:12:26 INFO qemu: waiting for ssh to come up, try 1 of 6000
2025/01/05 23:12:33 ERRO Failed to dial: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
2025/01/05 23:12:33 INFO ERROR: failed to test package. the test environment has been preserved:
2025/01/05 23:12:33 INFO workspace dir: $HOME/tmp/melange-workspace-1187461383
2025/01/05 23:12:33 INFO guest dir: $HOME/tmp/melange-guest-1343812321
2025/01/05 23:12:33 ERRO failed to test package: unable to start pod: qemu: could not get VM host key
Note that, when attempting to reproduce, the make test/PKG target in wolfi-dev/os/Makefile does not
honor the $MELANGE_OPTS environment variable as emitted by make fetch-kernel; in order to run the test target with the qemu runner, MELANGE_EXTRA_OPTS="--runner qemu" must be set.
This failure is due to the build user not being created within the guest via the apko, unlike what happens during a build. Qhen the qemu runner tries to capture the ssh host public key from the guest, it tries to connect as the build user at
025/01/05 23:12:22 INFO image configuration:
2025/01/05 23:12:22 INFO contents:
2025/01/05 23:12:22 INFO build repositories: []
2025/01/05 23:12:22 INFO runtime repositories: []
2025/01/05 23:12:22 INFO keyring: []
2025/01/05 23:12:22 INFO packages: [nano]
There is a larger, overarching issue that what user is used in the build environment is inconsistent between the different build environments; qemu runner runs the build as root whereas docker runs it as build.
The text was updated successfully, but these errors were encountered:
Attempting to run
melange test
fails to make its initial connection to the qemu guest like so, whereasmelange build
will succeed with the qemu runner:Note that, when attempting to reproduce, the
make test/PKG
target inwolfi-dev/os/Makefile
does nothonor the
$MELANGE_OPTS
environment variable as emitted bymake fetch-kernel
; in order to run the test target with the qemu runner,MELANGE_EXTRA_OPTS="--runner qemu"
must be set.This failure is due to the
build
user not being created within the guest via the apko, unlike what happens during a build. Qhen the qemu runner tries to capture the ssh host public key from the guest, it tries to connect as thebuild
user atmelange/pkg/container/qemu_runner.go
Lines 656 to 667 in fe10319
Manually editing the above to set
User: "root",
cause the connection to be made and the tests to run.One can see the difference in the apko configuration emitted by melange as part of the build and test output.
melange build for nano:
melange test for nano:
There is a larger, overarching issue that what user is used in the build environment is inconsistent between the different build environments; qemu runner runs the build as
root
whereas docker runs it asbuild
.The text was updated successfully, but these errors were encountered: