kuasar-io / kuasar

A multi-sandbox container runtime that provides cloud-native, all-scenario multiple sandbox container solutions.
https://kuasar.io
Apache License 2.0
1.27k stars 91 forks source link

make install failed on licheepi4a(riscv) openEuler 23.03 #104

Closed PengXuanyao closed 11 months ago

PengXuanyao commented 11 months ago

What happened?

Hi, I want to run it on my riscv hardware. I add 2 lines in vmm/sandbox/src/qemu/config.rs:46:

#[cfg(target_arch = "riscv64")]
const DEFAULT_QEMU_PATH: &str = "/usr/bin/qemu-system-riscv64";

Add then I want to install kuasar on my riscv hardware licheepi4a using openEuler23.03, by using following instructions:

git clone https://github.com/kuasar-io/kuasar.git
cd kuasar
make all
make install

It stuck at "make all", and output info is:

   Compiling vmm-sandboxer v0.1.0 (/root/Applications/kuasar/vmm/sandbox)
warning: unused import: `collections::HashMap`
  --> src/qemu/config.rs:17:11
   |
17 | use std::{collections::HashMap, os::unix::io::RawFd};
   |           ^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: unreachable statement
   --> src/qemu/config.rs:176:9
    |
173 | /         return Err(Error::Unimplemented(
174 | |             "cpu other than x86 not supported".to_string(),
175 | |         ));
    | |__________- any code following this expression is unreachable
176 | /         if !self.firmware_path.is_empty() {
177 | |             result.bios = Some(self.firmware_path.to_string());
178 | |         }
    | |_________^ unreachable statement
    |
    = note: `#[warn(unreachable_code)]` on by default

warning: `vmm-sandboxer` (lib) generated 2 warnings
    Finished release [optimized] target(s) in 7m 35s
+ exit_flag=0
+ export IMAGE_NAME=centos:7
+ IMAGE_NAME=centos:7
+ export ROOTFS_DIR=/tmp/kuasar-rootfs
+ ROOTFS_DIR=/tmp/kuasar-rootfs
+ export CONTAINER_RUNTIME=containerd
+ CONTAINER_RUNTIME=containerd
+ CONTAINERD_NS=default
+ '[' containerd == containerd ']'
++ awk -F/ '{print NF}'
+ image_parts=1
+ echo 'image_parts 1'
image_parts 1
+ [[ 1 -le 1 ]]
+ IMAGE_NAME=docker.io/library/centos:7
+ echo 'build in docker.io/library/centos:7'
build in docker.io/library/centos:7
+ '[' '!' -n '' ']'
+++ readlink -f vmm/scripts/image/centos/build.sh
++ dirname /root/Applications/kuasar/vmm/scripts/image/centos/build.sh
+ current_dir=/root/Applications/kuasar/vmm/scripts/image/centos
+ pushd /root/Applications/kuasar/vmm/scripts/image/centos/../../../..
~/Applications/kuasar ~/Applications/kuasar
++ pwd
+ REPO_DIR=/root/Applications/kuasar
+ popd
~/Applications/kuasar
+ rm -rf /tmp/kuasar-rootfs
+ mkdir -p /tmp/kuasar-rootfs
+ case "${CONTAINER_RUNTIME}" in
++ ctr -n default images ls
++ grep docker.io/library/centos:7
++ wc -l
ctr: failed to dial "/run/containerd/containerd.sock": context deadline exceeded: connection error: desc = "transport: error while dialing: dial unix:///run/containerd/containerd.sock: timeout"
+ image_count=0
+ [[ 0 -lt 1 ]]
+ ctr -n default images pull docker.io/library/centos:7
ctr: failed to dial "/run/containerd/containerd.sock": context deadline exceeded: connection error: desc = "transport: error while dialing: dial unix:///run/containerd/containerd.sock: timeout"
+ fn_check_result 1 'ctr pull image failed!'
+ '[' 1 '!=' 0 ']'
+ echo 'FAILED: return 1 not as expected! (ctr pull image failed!)'
FAILED: return 1 not as expected! (ctr pull image failed!)
+ (( exit_flag++ ))
++ date +%s
+ container_name=rootfs_builder-1703845538
+ ctr -n default run --rm --net-host --env http_proxy= --env https_proxy= --env ROOTFS_DIR=/tmp/kuasar-rootfs --mount type=bind,src=/root/Applications/kuasar,dst=/kuasar,options=rbind:rw --mount type=bind,src=/tmp/kuasar-rootfs,dst=/tmp/kuasar-rootfs,options=rbind:rw docker.io/library/centos:7 rootfs_builder-1703845538 bash -x /kuasar/vmm/scripts/image/centos/build_rootfs.sh
ctr: failed to dial "/run/containerd/containerd.sock": context deadline exceeded: connection error: desc = "transport: error while dialing: dial unix:///run/containerd/containerd.sock: timeout"
+ fn_check_result 1 'ctr run rootfs_builder-1703845538 return error!'
+ '[' 1 '!=' 0 ']'
+ echo 'FAILED: return 1 not as expected! (ctr run rootfs_builder-1703845538 return error!)'
FAILED: return 1 not as expected! (ctr run rootfs_builder-1703845538 return error!)
+ (( exit_flag++ ))
+ '[' 2 '!=' 0 ']'
+ rm -rf /tmp/kuasar-rootfs
+ exit 2
make: *** [Makefile:30: bin/kuasar.img] Error 2

It successfully compile the rust src, but stuck when running the script above.

The problem seems like FAILED: return 1 not as expected! (ctr pull image failed!) and ctr: failed to dial "/run/containerd/containerd.sock": context deadline exceeded: connection error: desc = "transport: error while dialing: dial unix:///run/containerd/containerd.sock: timeout".

What did you expect to happen?

I expect it can successfully make all and make install

How can we reproduce it (as minimally and precisely as possible)?

install on riscv openEuler23.03:

git clone https://github.com/kuasar-io/kuasar.git
cd kuasar
make all
make install

I didn't try it on qemu, so l'm not sure does it the same on qemu-riscv64

Anything else we need to know?

No response

Dev environment

rustc 1.67.1-dev (d5a82bbd2 2023-02-07) (built from a source tarball)

Burning1020 commented 11 months ago

The guest image for micro-vmm is built in a containerd container, so please install runc, containerd-shim-runc-v2 binaries and run a containerd deamon before building. If you prefer docker, use CONTAINER_RUNTIME=docker make instead.

PengXuanyao commented 11 months ago

The guest image for micro-vmm is built in a containerd container, so please install runc, containerd-shim-runc-v2 binaries and run a containerd deamon before building. If you prefer docker, use CONTAINER_RUNTIME=docker make instead.

Thanks for reply, but there is no RISCV centos:7 image, can I use ubuntu image or any other substitute image? Or any other way to build the guest image for micro-vmm( manually build it ?).

Vanient commented 11 months ago

Hi, I'm afraid that Kuasar not supported running on riscv yet.

PengXuanyao commented 11 months ago

Hi, I'm afraid that Kuasar not supported running on riscv yet.

Oh, thank you. I'm trying to run it on riscv, but it seems not work. I think it needs official support. I'm gonna close this issue. If anybody has the appropriate solution, we can reopen it.