From 5d6a1ba09ae6ace3df2d4daacf626ef08609067e Mon Sep 17 00:00:00 2001 From: Salvador Fuentes Date: Mon, 6 May 2019 16:06:03 -0500 Subject: [PATCH] ci: Add virtio-fs support Add configuration option to use virtio-fs. We will currently use nemu for testing the virtio-fs support. Depends-on: github.com/kata-containers/runtime#1016 Depends-on: github.com/kata-containers/packaging#484 Fixes: #1536. Signed-off-by: Salvador Fuentes --- .ci/install_nemu.sh | 7 ++++++- .ci/install_runtime.sh | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.ci/install_nemu.sh b/.ci/install_nemu.sh index 722129e841..a89f024469 100755 --- a/.ci/install_nemu.sh +++ b/.ci/install_nemu.sh @@ -31,9 +31,14 @@ install_nemu() { ;; esac + local virtiofs_bin="virtiofsd-${arch}" + curl -LO "${nemu_repo}/releases/download/${nemu_version}/${nemu_bin}" + curl -LO "${nemu_repo}/releases/download/${nemu_version}/${virtiofs_bin}" + sudo install -o root -g root -m 0755 "${nemu_bin}" "/usr/local/bin" - rm -rf "${nemu_bin}" + sudo install -o root -g root -m 0755 "${virtiofs_bin}" "/usr/local/bin" + rm -rf "${nemu_bin}" "${virtiofs_bin}" } install_firmware() { diff --git a/.ci/install_runtime.sh b/.ci/install_runtime.sh index b2456b5075..b756f56eab 100755 --- a/.ci/install_runtime.sh +++ b/.ci/install_runtime.sh @@ -121,3 +121,12 @@ if [ "$KATA_EXPERIMENTAL_FEATURES" = true ]; then feature="newstore" sudo sed -i -e "s|^experimental.*$|experimental=[ \"$feature\" ]|" "${runtime_config_path}" fi + +# Enable virtiofs if VIRTIO_FS is set to true +# currently we use nemu for virtiofs testing +if [ "$VIRTIO_FS" = true ] && [ "$KATA_HYPERVISOR" = "nemu" ]; then + echo "Configure virtio-fs on kata-runtime config file" + sudo crudini --set "$runtime_config_path" hypervisor.qemu virtio_fs_daemon "\"/usr/local/bin/virtiofsd-${arch}\"" + sudo crudini --set "$runtime_config_path" hypervisor.qemu shared_fs "\"virtio-fs\"" + sudo crudini --set "$runtime_config_path" hypervisor.qemu enable_hugepages "true" +fi