kata-containers / govmm

Virtual Machine Manager for Go (govmm) is a suite of packages that provide Go APIs for creating and managing virtual machines.
Apache License 2.0
310 stars 93 forks source link

qemu/qmp: preparation for s390x support cannot pass build with kata runtime #72

Closed teawater closed 2 years ago

teawater commented 5 years ago

https://travis-ci.org/kata-containers/runtime/jobs/461613820

• architecture:
    Host: ppc64le
    golang: ppc64le
    Build: ppc64le
• golang:
    go version go1.10.5 linux/ppc64le
• Summary:
    destination install path (DESTDIR)    : /
    binary installation path (BINDIR)     : /usr/local/bin
    binaries to install                   :
     - /usr/local/bin/kata-runtime
     - /usr/local/bin/containerd-shim-kata-v2
     - /usr/libexec/kata-containers/kata-netmon
     - /usr/local/bin/data/kata-collect-data.sh
    config to install (CONFIG)            : cli/config/configuration.toml
    install path (CONFIG_PATH)            : /usr/share/defaults/kata-containers/configuration.toml
    alternate config path (SYSCONFIG)     : /etc/kata-containers/configuration.toml
    hypervisor path (QEMUPATH)            : /usr/bin/qemu-system-ppc64le
    assets path (PKGDATADIR)              : /usr/share/kata-containers
    proxy+shim path (PKGLIBEXECDIR)       : /usr/libexec/kata-containers
     BUILD   /home/travis/gopath/src/github.com/kata-containers/runtime/kata-runtime
# github.com/kata-containers/runtime/vendor/github.com/intel/govmm/qemu
../vendor/github.com/intel/govmm/qemu/qemu.go:103:6: undefined: isVirtioPCI
../vendor/github.com/intel/govmm/qemu/qemu.go:266:5: undefined: isVirtioPCI
../vendor/github.com/intel/govmm/qemu/qemu.go:358:5: undefined: isVirtioPCI
../vendor/github.com/intel/govmm/qemu/qemu.go:469:5: undefined: isVirtioPCI
../vendor/github.com/intel/govmm/qemu/qemu.go:489:16: netdev.Type.QemuDeviceParam undefined (type NetDeviceType has no field or method QemuDeviceParam)
../vendor/github.com/intel/govmm/qemu/qemu.go:493:74: netdev.Type.QemuDeviceParam undefined (type NetDeviceType has no field or method QemuDeviceParam)
../vendor/github.com/intel/govmm/qemu/qemu.go:516:5: undefined: isVirtioPCI
../vendor/github.com/intel/govmm/qemu/qemu.go:527:16: netdev.Type.QemuNetdevParam undefined (type NetDeviceType has no field or method QemuNetdevParam)
../vendor/github.com/intel/govmm/qemu/qemu.go:531:49: netdev.Type.QemuNetdevParam undefined (type NetDeviceType has no field or method QemuNetdevParam)
../vendor/github.com/intel/govmm/qemu/qemu.go:579:16: netdev.Type.QemuNetdevParam undefined (type NetDeviceType has no field or method QemuNetdevParam)
../vendor/github.com/intel/govmm/qemu/qemu.go:579:16: too many errors
Makefile:342: recipe for target '/home/travis/gopath/src/github.com/kata-containers/runtime/kata-runtime' failed
make: *** [/home/travis/gopath/src/github.com/kata-containers/runtime/kata-runtime] Error 2
The command "make" failed and exited with 2 during .
Your build has been stopped.
devimc commented 5 years ago

cc @alicefr

markdryan commented 5 years ago

Might this be fixed by https://github.com/intel/govmm/pull/68?

rbradford commented 5 years ago

Seems to be limited to ppc64le:

rbradford@parsnip:~$ go version
go version go1.11 linux/arm64
rbradford@parsnip:~$ go get -u github.com/intel/govmm/...
rbradford@parsnip:~$ 
rbradford commented 5 years ago

Looks like it might be a mangled vendored directory update...that git revision doesn't have those function calls at those lines: https://github.com/kata-containers/runtime/pull/957/commits/f72ea58177788b6103b4b06d62bb2b9d19693f05#r237861868

rbradford@parsnip:~/go/src/github.com/intel/govmm$ git checkout 110d2fa0493db5992c3e0ab89d256576bf5ee86d
HEAD is now at 110d2fa... qemu/qmp: add new function ExecuteBlockdevAddWithCache
rbradford@parsnip:~/go/src/github.com/intel/govmm$ grep -n isVirtioPCI qemu/qemu.go 
117:// isVirtioPCI is a map indicating if a DeviceDriver is considered as a
120:var isVirtioPCI = map[DeviceDriver]bool{
292:    if isVirtioPCI[fsdev.Driver] {
384:    if isVirtioPCI[cdev.Driver] {
574:    if isVirtioPCI[netdev.Driver] {
690:    if isVirtioPCI[dev.Driver] {
776:    if isVirtioPCI[blkdev.Driver] {
871:    if isVirtioPCI[driver] {
915:    if isVirtioPCI[driver] {
973:    if isVirtioPCI[driver] {
1061:   if isVirtioPCI[driver] {
1121:   if isVirtioPCI[driver] {
1170:   if isVirtioPCI[driver] {
1217:   if isVirtioPCI[driver] {
markdryan commented 5 years ago

@rbradford I think you're correct. It does look like a vendoring issue. The ppc64le builds are working okay for me, e.g.,

GOARCH=ppc64le go install ./...

builds me a package

alicefr commented 5 years ago

hi, I saw it right now. I opened a PR that updates cid for vsock plus the refactoring I did for the s390 preparation.

markdryan commented 5 years ago

@alicefr This doesn't look like an issue with govmm. It seems to be a vendoring issue with a PR sent to the kata containers project, so nothing for us to worry about. It looks like the original kata PR has been updated. As soon as it passes the Kata CI I'll close this bug.

markdryan commented 5 years ago

@alicefr But it has made me realize that the govmm CI is not actually testing the s390x build. I'm going to submit a small patch for this.

alicefr commented 5 years ago

@markdryan yes you're right!Are you in charge of the CI for govmm?

markdryan commented 5 years ago

@alicefr Yes. I was just planning to check s390x builds, i.e., do a GOARCH=s390x go install ./... There's not much else we can do in travis.

markdryan commented 5 years ago

Are you in charge of the CI for govmm?

There's no one person in charge of CI. I guess collectively all the govmm maintainers are responsible for it. We currently use travis for CI, and the travis file is in the git repo, so anyone can submit a patch for it.

alicefr commented 5 years ago

I just wondering if I can request a test system for s390x also for govmm

markdryan commented 5 years ago

@alicefr How would that work? Could we run a s390x instance inside a VM, e.g., inside qemu?

alicefr commented 5 years ago

you need a s390x VM and run there the go test case. Unfortunately, emulation on s390 is not supported by IBM and I cannot help with that. Just for your info, I tried on my system if user emulation worked with go test and it didn't. I tried to run a s390x/golang docker image and inside the go test command but it didn't work

alicefr commented 5 years ago

The only supported emulator is zpdt https://www.ibm.com/us-en/marketplace/z-systems-development-test-environment. I don't have so much experience, but I could try to make it working or request a test system as for Kata

markdryan commented 5 years ago

@alicefr zpdt doesn't look like a free product. I don't think we could integrate it into the CI system of a open source project. QEMU does seem to have some support for s390x. Is it possible to boot linux running on an s390x qemu instance without any proprietary components? If so we could try this. However, this would be a big change to govmm as we would need to switch CI systems from travis to something like semaphore, which will allow us to run VMs.

alicefr commented 5 years ago

@markdryan there're some qemu version that have s390 support. As I said, I cannot help you because IBM does't support IBM qemu emulation for s390. I also know that other communities have issues with s390 emulation. The alternative could be to add a s390x VM to your CI. I can request one as I have done for Kata

markdryan commented 5 years ago

The alternative could be to add a s390x VM to your CI. I can request one as I have done for Kata

That sounds interesting. How would this work in practice? Would there be some code in the VM that automatically monitors github for PRs and that then runs the tests?

alicefr commented 5 years ago

You might add the s390x VM as slave.I need to check if travis supports s390x. I'm sure for jenkins but not for travis

alicefr commented 5 years ago

sorry, that doesn't work with travis and s390x. Do you test Kata on arm?

markdryan commented 5 years ago

@alicefr I'm not sure what happens on kata, but the good news is that I've come up with a way to allow us to run the s390x tests in travis on linux. The tests don't actually need to run on a s390x. We just need a way to build govmm on linux the same way it would be built on a s390x machine, i.e., create a build that includes qemu_s390x.go. We can do by renaming the files and adding an additional tag which will only be used for testing, e.g., s390x_test. I'll submit a PR for this tomorrow.

alicefr commented 5 years ago

oh nice!you're right :)

fidencio commented 2 years ago

As the GoVMM project has been moved under the Kata Containers project, please, feel free to open a new issue there in case you're still hitting it.

For now I'm closing the issue as there's no activity here since December 2018.