Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

nemu: Enable static nemu for ci #1595

Merged
merged 1 commit into from
May 24, 2019

Conversation

ganeshmaharaj
Copy link

Build NEMU statically for every CI run to make sure we test a setup
similar to the one we are shipping with Kata.

Fixes: #1536
Signed-off-by: Ganesh Maharaj Mahalingam [email protected]

ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this pull request May 18, 2019
virtio-fs is now available in 1.7 release and needs hugepages enabled.
NEMU's machine_type `virt` has issues getting network access when
hugepages is enabled. Temporarily changing type to `pc` to fix this
issue. Accompanying changes to runtime and tests are underway.

Fixes: kata-containers#1709
Depends-on: kata-containers/tests#1595
Depends-on: kata-containers/packaging#522
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this pull request May 18, 2019
virtio-fs is now available in 1.7 release and needs hugepages enabled.
NEMU's machine_type `virt` has issues getting network access when
hugepages is enabled. Temporarily changing type to `pc` to fix this
issue. Accompanying changes to runtime and tests are underway.

Fixes: kata-containers#1709
Depends-on: github.com/kata-containers/tests#1595
Depends-on: github.com/kata-containers/packaging#522
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
@ganeshmaharaj ganeshmaharaj force-pushed the nemu-ci branch 2 times, most recently from da2e4ea to e9a4cd8 Compare May 18, 2019 23:57
.ci/install_nemu.sh Outdated Show resolved Hide resolved
.ci/install_nemu.sh Outdated Show resolved Hide resolved
.ci/install_nemu.sh Outdated Show resolved Hide resolved
case "$arch" in
x86_64)
local nemu_bin="qemu-system-${arch}_virt"
;;
aarch64)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is aarch64 being dropped? Even if we don't provide the static binaries today, NEMU works on arm64 too so can't we leave it as we should endeavor to add test support for that arch at some future point too?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add aarch64 here back, but it does come with some limitations. 1. It is not statically built, so we will need to add more scaffolding to the install scripts to get all the dependent libraries for it to work. It will also only work with xenial and probably fail on other distros. In the current form, it is not really consumable. As stage 2, we can start shipping aarch64 static binaries also along with x86_64 and then re-enable it. I can file a bug for that, if that approach would work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pennyzct @justin-he Is this something that you could help with? We really would like to see support for building nemu on arm.
@ganeshmaharaj Can you open a separate issue for this, and list out what issues you are running into there?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.ci/install_runtime.sh Outdated Show resolved Hide resolved
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this pull request May 20, 2019
virtio-fs is now available in 1.7 release and needs hugepages enabled.
NEMU's machine_type `virt` has issues getting network access when
hugepages is enabled. Temporarily changing type to `pc` to fix this
issue. Accompanying changes to runtime and tests are underway.

Fixes: kata-containers#1709
Depends-on: github.com/kata-containers/tests#1595
Depends-on: github.com/kata-containers/packaging#522
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
@ganeshmaharaj ganeshmaharaj force-pushed the nemu-ci branch 2 times, most recently from bc7bdb2 to 8ae23b7 Compare May 20, 2019 21:30
@Pennyzct
Copy link
Contributor

Hi~ @jongwu we definitely want to lend a hand here. We will firstly try to build static binary on our local machine and make it work. :)

@amshinde
Copy link
Member

Thanks @Pennyzct !

@jongwu
Copy link
Contributor

jongwu commented May 22, 2019

@Pennyzct ok, I will take it.

@ganeshmaharaj ganeshmaharaj force-pushed the nemu-ci branch 2 times, most recently from 642a7de to 9d683c6 Compare May 22, 2019 06:48
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this pull request May 22, 2019
virtio-fs is now available in 1.7 release and needs hugepages enabled.
Updating version of NEMU that ships with kata by default which contains
the fixes for hugepages, machine_type=virt and network access.

Fixes: kata-containers#1709
Depends-on: github.com/kata-containers/tests#1595
Depends-on: github.com/kata-containers/packaging#522
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
@jongwu
Copy link
Contributor

jongwu commented May 22, 2019

@ganeshmaharaj @amshinde @jodh-intel @Pennyzct now I have enabled nemu on arm64 after some modification work. what's next?

@jodh-intel
Copy link
Contributor

@jongwu - I think the next step is for @ganeshmaharaj to undo the aarch64 removal changes on this PR.

@ganeshmaharaj
Copy link
Author

ganeshmaharaj commented May 22, 2019

@jongwu is there a way we can enable the static build of arm64 similar to this one? https://github.com/kata-containers/packaging/pull/522/files#diff-62470642d2b1b882e092c3185db7f88b that would help us generate both the sets of binaries for CI and ship the same with kata for all future releases.

You could use this issue to make the follow on changes? #1620

@chavafg
Copy link
Contributor

chavafg commented May 22, 2019

I think we can re-add arm once the static build for that arch is ready.

@jongwu
Copy link
Contributor

jongwu commented May 23, 2019

@ganeshmaharaj after disable avx2 and modify the source code, nemu can be built as the way in https://github.com/kata-containers/packaging/pull/522/files#diff-62470642d2b1b882e092c3185db7f88b .
@jodh-intel @chavafg how to transfer my patch to nemu? as we can't touch nemu project for the legal issue

ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this pull request May 23, 2019
virtio-fs is now available in 1.7 release and needs hugepages enabled.
Updating version of NEMU that ships with kata by default which contains
the fixes for hugepages, machine_type=virt and network access.

Fixes: kata-containers#1709
Depends-on: github.com/kata-containers/tests#1595
Depends-on: github.com/kata-containers/packaging#522
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
@ganeshmaharaj
Copy link
Author

@jongwu if we can build NEMU for arm64, with the current scripts, can you kindly expand the build_nemu_static.sh script to make builds for both x86 and arm64 and make them both part of the giant tarball? we don't need to modify NEMU sources, just our way of configuring them to build. ohh just out of curiosity, are you able to cross compile it on an x86 machine?

@ganeshmaharaj
Copy link
Author

/test

Build NEMU statically for every CI run to make sure we test a setup
similar to the one we are shipping with Kata.

Fixes: kata-containers#1536
Depends-on: github.com/kata-containers/packaging#522
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
@ganeshmaharaj
Copy link
Author

/test-nemu

@ganeshmaharaj
Copy link
Author

Not sure if i should trigger all the CI given this only touches NEMU. WIll refrain from it unless folks feel otherwise.

@chavafg
Copy link
Contributor

chavafg commented May 24, 2019

lets run them as ubuntu job is required.
/test

@ganeshmaharaj
Copy link
Author

@chavafg i am guessing the failed jobs are all expected and we can proceed merging this change?

@chavafg
Copy link
Contributor

chavafg commented May 24, 2019

yeah, but we need another ack to be able to merge.
@kata-containers/tests, ptal

@chavafg chavafg merged commit 34fdb3e into kata-containers:master May 24, 2019
@jongwu
Copy link
Contributor

jongwu commented May 27, 2019

@ganeshmaharaj for now, I can't build nemu on arm64 only modify build_nemu_static.sh. hid_dev should be enabled which must be done when make, as CONFIG_HID_DEV can not be configured by configure script. so I need change Dockerfile.
All these work are on arm64 machine, so no cross compile on x86.

@ganeshmaharaj
Copy link
Author

@jongwu Aah. I believe it would be easy if we can enable cross compile within a container, this way we can do the build both for CI and for releases on any backend machine. Is there a way we can help to get this enabled from your side?

@jongwu
Copy link
Contributor

jongwu commented May 29, 2019

@ganeshmaharaj I try to cross compile nemu on x86, but building cross compile tool chain blocks me. I find it not easy for me to get all dependency library in. I am appreciate of you that you can involved in and help me to do that.
but another concern is I can't build nemu on arm64 machine by just modify build_nemu_static.sh, I need change Dockerfile, which maybe not make sense from your part.

@jongwu
Copy link
Contributor

jongwu commented May 31, 2019

@ganeshmaharaj I have successfully cross compiled nemu for arm64 on x86 in container.

ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this pull request Jun 3, 2019
virtio-fs is now available in 1.7 release and needs hugepages enabled.
Updating version of NEMU that ships with kata by default which contains
the fixes for hugepages, machine_type=virt and network access.

Fixes: kata-containers#1709
Depends-on: github.com/kata-containers/tests#1595
Depends-on: github.com/kata-containers/packaging#522
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
(cherry picked from commit 722ac5a)
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this pull request Jun 3, 2019
virtio-fs is now available in 1.7 release and needs hugepages enabled.
Updating version of NEMU that ships with kata by default which contains
the fixes for hugepages, machine_type=virt and network access.

Fixes: kata-containers#1709
Depends-on: github.com/kata-containers/tests#1595
Depends-on: github.com/kata-containers/packaging#522
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
(cherry picked from commit 722ac5a)
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add virtiofs support for CI
7 participants