hyperhq / runv

Hypervisor-based Runtime for OCI
Apache License 2.0
827 stars 129 forks source link

How can I try this ? #287

Closed keyolk closed 7 years ago

keyolk commented 7 years ago

I have big interest on this project. But I cant try it : (

Is there any prerequisites ? I built runv version 0.6.0

$ sudo runv --initrd=/var/lib/hyper/hyper-initrd.img start test error rpc error: code = 2 desc = empty bundle path

gao-feng commented 7 years ago

Hello,

Do you have bundle in pwd? please check https://github.com/opencontainers/runc#creating-an-oci-bundle to create bundle.

keyolk commented 7 years ago

Thanks to your comment but I'm sure it is.

$ pwd /home/keyolk/workspace $ ls config.json rootfs $ sudo runv --kernel=/var/lib/hyper/kernel --initrd=/var/lib/hyper/hyper-initrd.img --debug start test error rpc error: code = 2 desc = empty bundle path $ sudo runv --kernel=/var/lib/hyper/kernel --initrd=/var/lib/hyper/hyper-initrd.img --driver=vbox --debug start test error rpc error: code = 2 desc = grpc: the client connection is closing and I do that on archlinux distro.

gao-feng commented 7 years ago

runv doesn't support vbox driver right now, vbox requires the boot.iso which generated by hyperstart(github.com/hyperhq/hyperd),

Can you try with qemu driver?

keyolk commented 7 years ago

Thanks again! but nothing differnece

below is what I did. `$ sudo runv --kernel=/var/lib/hyper/kernel --initrd=/var/lib/hyper/hyper-initrd.img --debug start test error rpc error: code = 2 desc = empty bundle path

$ ls config rootfs

$ ls bin core etc lib media opt root sbin sys usr boot dev home lib64 mnt proc run srv tmp var

$ uname -a Linux keyolk-book 4.4.2-6ph #1 SMP Mon Jun 13 20:01:22 KST 2016 x86_64 GNU/Linux

$ cat /etc/os-release NAME="Apricity OS" ID=apricity PRETTY_NAME="Apricity OS" ANSI_COLOR="0;36" HOME_URL="https://www.apricitylinux.org/" SUPPORT_URL="https://bbs.apricitylinux.org/" BUG_REPORT_URL="https://bugs.apricitylinux.org/"`

and another approach `sudo runv --kernel=/var/lib/hyper/kernel --initrd=/var/lib/hyper/hyper-initrd.img --debug --driver=qemu start test -b $(pwd)

error rpc error: code = 2 desc = StartPod fail`

keyolk commented 7 years ago

I'm not sure whether it is related, I can get some logs from runv-containred when I try ctr with same bulde (config.json & rootfs)

I0713 10:17:05.787065 16837 server.go:31] gRPC handle CreateContainer I0713 10:17:05.787222 16837 hyperpod.go:337] Using kernel: ; Initrd: ; I0713 10:17:05.787276 16837 vm.go:162] hyperHandlePodEvent pod pod-lUYWcwoXaD, vm vm-rzElujgPDI I0713 10:17:05.787381 16837 hypervisor.go:29] vm vm-rzElujgPDI: main event loop got message 21(COMMAND_RUN_POD) I0713 10:17:05.787396 16837 vm_states.go:443] got spec, prepare devices I0713 10:17:05.787423 16837 vm_states.go:67] initial vm spec: { "hostname": "shell", "containers": [], "shareDir": "share_dir" } I0713 10:17:05.787534 16837 context.go:252] VM vm-rzElujgPDI: state change from INIT to 'STARTING' I0713 10:17:05.787549 16837 hypervisor.go:29] vm vm-rzElujgPDI: main event loop got message 10(EVENT_DEV_SKIP) I0713 10:17:05.787562 16837 vm_states.go:470] device ready, could run pod. I0713 10:17:05.787505 16837 qemu_process.go:67] cmdline arguments: -machine pc-i440fx-2.0,accel=kvm,usb=off -global kvm-pit.lost_tick_policy=discard -cpu host -kernel /var/lib/hyper/kernel -initrd /var/lib/hyper/hyper-initrd.img -append console=ttyS0 panic=1 no_timer_check -realtime mlock=off -no-user-config -nodefaults -no-hpet -rtc base=utc,driftfix=slew -no-reboot -display none -boot strict=on -m 128 -smp 1 -qmp unix:/var/run/hyper/vm-rzElujgPDI/qmp.sock,server,nowait -serial unix:/var/run/hyper/vm-rzElujgPDI/console.sock,server,nowait -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x2 -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 -chardev socket,id=charch0,path=/var/run/hyper/vm-rzElujgPDI/hyper.sock,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charch0,id=channel0,name=sh.hyper.channel.0 -chardev socket,id=charch1,path=/var/run/hyper/vm-rzElujgPDI/tty.sock,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charch1,id=channel1,name=sh.hyper.channel.1 -fsdev local,id=virtio9p,path=/var/run/hyper/vm-rzElujgPDI/share_dir,security_model=none -device virtio-9p-pci,fsdev=virtio9p,mount_tag=share_dir I0713 10:17:05.827828 16837 init_comm.go:133] Wating for init messages... I0713 10:17:05.828292 16837 init_comm.go:96] trying to read 8 bytes I0713 10:17:05.827900 16837 tty.go:146] tty socket connected I0713 10:17:05.828331 16837 tty.go:89] tty: trying to read 12 bytes I0713 10:17:05.828244 16837 qmp_handler.go:167] connected to /var/run/hyper/vm-rzElujgPDI/qmp.sock I0713 10:17:05.829368 16837 qmp_handler.go:177] begin qmp init... E0713 10:17:05.830633 16837 qmp_handler.go:181] get qmp welcome failed: read unix @->/var/run/hyper/vm-rzElujgPDI/qmp.sock: read: connection reset by peer E0713 10:17:05.831206 16837 qmp_handler.go:361] QMP initialize failed E0713 10:17:05.831287 16837 init_comm.go:99] read init data failed E0713 10:17:05.832049 16837 init_comm.go:137] read init message failed... read unix @->/var/run/hyper/vm-rzElujgPDI/hyper.sock: read: connection reset by peer E0713 10:17:05.831341 16837 tty.go:92] read tty data failed I0713 10:17:05.832100 16837 tty.go:153] tty socket closed, quit the reading goroutine read unix @->/var/run/hyper/vm-rzElujgPDI/tty.sock: read: connection reset by peer I0713 10:17:05.832132 16837 tty.go:120] tty chan closed, quit sent goroutine I0713 10:17:05.831780 16837 hypervisor.go:29] vm vm-rzElujgPDI: main event loop got message 35(ERROR_INIT_FAIL) E0713 10:17:05.832152 16837 vm_states.go:401] read unix @->/var/run/hyper/vm-rzElujgPDI/qmp.sock: read: connection reset by peer E0713 10:17:05.832167 16837 vm_states.go:278] Shutting down because of an exception: Fail during init pod running environment I0713 10:17:05.832187 16837 context.go:252] VM vm-rzElujgPDI: state change from STARTING to 'TERMINATING' I0713 10:17:05.832222 16837 hypervisor.go:29] vm vm-rzElujgPDI: main event loop got message 35(ERROR_INIT_FAIL) W0713 10:17:05.832235 16837 vm_states.go:392] got unexpected event during terminating I0713 10:17:05.832246 16837 hypervisor.go:29] vm vm-rzElujgPDI: main event loop got message 37(ERROR_INTERRUPTED) I0713 10:17:05.832258 16837 vm_states.go:648] Connection interrupted while terminating I0713 10:17:05.832284 16837 vm.go:275] Get the response from VM, VM id is vm-rzElujgPDI! I0713 10:17:05.832312 16837 hypervisor.go:29] vm vm-rzElujgPDI: main event loop got message 24(COMMAND_SHUTDOWN) I0713 10:17:05.832330 16837 vm.go:82] Got response: 14: unexpected event during terminating E0713 10:17:05.834473 16837 qemu_process.go:87] exit status 1 I0713 10:17:05.834513 16837 hypervisor.go:29] vm vm-rzElujgPDI: main event loop got message 0(EVENT_VM_START_FAILED) W0713 10:17:05.834527 16837 vm_states.go:392] got unexpected event during terminating I0713 10:17:15.832323 16837 hypervisor.go:29] vm vm-rzElujgPDI: main event loop got message 3(EVENT_VM_TIMEOUT) W0713 10:17:15.832350 16837 vm_states.go:645] VM did not exit in time, try to stop it E0713 10:17:15.832360 16837 vm_states.go:287] Shutting down because of an exception: vm terminating timeout I0713 10:17:15.832391 16837 vm.go:82] Got response: 7: vm terminating timeout E0713 10:17:15.876128 16837 init_comm.go:49] failed to connected to /var/run/hyper/vm-rzElujgPDI/console.sock dial unix /var/run/hyper/vm-rzElujgPDI/console.sock: connect: no such file or directory

laijs commented 7 years ago

is there any log on /var/log/hyper/qemu/ ?

keyolk commented 7 years ago

I got below logs

$ cat vm-rzElujgPDI.log ioctl(KVM_CREATE_VM) failed: 16 Device or resource busy failed to initialize KVM: Device or resource busy

$ pwd /var/log/hyper/qemu

I guess it because I'm using virtualbox on my machine.

gnawux commented 7 years ago

Do you have any application using kvm device, such as virtualbox?

keyolk commented 7 years ago

after turn off all of VM, finally ctr works! but when I try runv,

$ sudo runv --debug --kernel=$HYPER_PATH/kernel --initrd=$HYPER_PATH/hyper-initrd.img --driver=qemu start second error rpc error: code = 2 desc = empty bundle path

$ sudo runv --debug --kernel=$HYPER_PATH/kernel --initrd=$HYPER_PATH/hyper-initrd.img --driver=qemu start second -b pwd

like above firs case got error, and second case, it just hang! no any of output

and I got log message under /var/log/hyper

Log file created at: 2016/07/13 11:01:02 Running on machine: keyolk-book Binary: Built with gc go1.6.2 for linux/amd64 Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg E0713 11:01:02.247006 20049 vm_states.go:159] cannot find exec second-init

keyolk commented 7 years ago

and when I try below command with ctr also there is no output

$ sudo ctr --address=$CONTAINERD_SOCK containers exec --id=test --pid=100 --cwd=/ -a ps aux

and I got log from containred below

I0713 11:09:04.689758 24052 init_comm.go:253] get command NEXT I0713 11:09:04.689766 24052 init_comm.go:256] send 112, receive 112 I0713 11:09:04.691208 24052 init_comm.go:68] [console] 0 0 0 6 0 0 0 70 7b 22 63 6f 6e 74 61 69 6e 65 72 22 3a 22 74 65 73 74 22 2c 22 70 72 6f 63 65 73 73 22 3a 7b 22 74 65 72 6d 69 6e 61 6c 22 3a 66 61 6c 73 65 2c 22 73 74 64 69 6f 22 3a 31 2c 22 73 74 64 65 72 72 22 3a 32 2c 22 61 72 67 73 22 3a 5b 22 70 73 22 2c 22 61 75 78 22 5d 2c 22 77 6f 72 6b 64 69 72 22 3a 22 2f 22 7d 7d I0713 11:09:04.691525 24052 init_comm.go:68] [console] hyper_channel_handle, type 6, len 112 I0713 11:09:04.692247 24052 init_comm.go:68] [console] call hyper_exec_cmd, json {"container":"test","process":{"terminal":false,"stdio":1,"stderr":2,"args":["ps","aux"],"workdir":"/"}} , len 104 I0713 11:09:04.692483 24052 init_comm.go:68] [console] jsmn parse failed, n is -1 I0713 11:09:04.692676 24052 init_comm.go:68] [console] get container test I0713 11:09:04.692924 24052 init_comm.go:68] [console] get unknown section process in exec cmd I0713 11:09:04.693136 24052 init_comm.go:68] [console] parse exec cmd failed I0713 11:09:04.693309 24052 init_comm.go:68] [console] hyper send type 10, len 0 I0713 11:09:04.693368 24052 init_comm.go:106] read 8/8 [length = 0] I0713 11:09:04.693376 24052 init_comm.go:110] data length is 8 I0713 11:09:04.693384 24052 init_comm.go:96] trying to read 8 bytes I0713 11:09:04.693393 24052 init_comm.go:190] got cmd:10 I0713 11:09:04.693402 24052 init_comm.go:209] ack got, clear pong timer I0713 11:09:04.693429 24052 container.go:225] add process to container failed: exec command [ps aux] failed: Error: I0713 11:09:04.693435 24052 container.go:238] get exit code failed exec command [ps aux] failed: Error: I0713 11:09:04.693442 24052 events.go:121] notifySubscribers: {test exit 2016-07-13 11:09:04.693432813 +0900 KST 100 -1} I0713 11:09:04.693479 24052 events.go:54] write event log: {test exit 2016-07-13 11:09:04.693432813 +0900 KST 100 -1} I0713 11:09:04.693519 24052 supervisor.go:115] reap container test processId 100 I0713 11:09:34.693546 24052 init_comm.go:216] Send ping message to init I0713 11:09:34.693582 24052 init_comm.go:190] got cmd:12 I0713 11:09:34.693600 24052 init_comm.go:281] send command 12 to init, payload: 'null'. I0713 11:09:34.693623 24052 init_comm.go:294] write 12 to init, payload: '

                                                                        null'.

I0713 11:09:34.693634 24052 init_comm.go:299] message sent, set pong timer

bergwolf commented 7 years ago

Hello,

$ sudo runv --debug --kernel=$HYPER_PATH/kernel --initrd=$HYPER_PATH/hyper-initrd.img --driver=quem start second

The driver option is wrong. Please use "--driver=qemu" instead.

keyolk commented 7 years ago

ah sorry to confusing you I didnt copy-paste it. I'm sure that what I put was exactly "--driver=qemu" I modified my comment above

laijs commented 7 years ago

" get unknown section process in exec cmd" it seams the protocol between runv & hyperstart mismatched. could you use v0.6 of both please, or could you use the latest of both please.

keyolk commented 7 years ago

oh, Thanks alot! I'll try it. Then could anyone can inform me why plain runv doesn't works ?

laijs commented 7 years ago

the default value of --bundle in the runv start was removed accidentally. you need to set it via -bpwd``. we will update it soom. thanks.

keyolk commented 7 years ago

@laijs Thanks! alot! : D Now I'll focus on why hyperstart failed to build.