utsaslab / rustfs

A Rust user-space file system [WIP]
Other
28 stars 7 forks source link

Software packaging using Vagrant #9

Open xxks-kkk opened 6 years ago

xxks-kkk commented 6 years ago

The program developed under the repo requires the user to run it under sudo, which can be dangerous especially from the development process perspective. One important reason is that SPDK utilizes DPDK as way to do memory management related work. If the programs on top of SPDK hangs and get killed, the resources allocated to SPDK application via DPDK may not have a chance to reclaim the resources. The worst case can happen in this case is to reboot the machine, which is hard to do (imagine you have to go inside a data center to reboot one machine !physically!)

To handle this issue, we want to use vagrant to provide a VM with NVMe simulator enabled so that we can perform development work on that VM. If something bad happens, we can easily reboot the VM. Now the question is how we can build some tool to automatically setup VM, repo, and development toolchain so that developers can start to work without much overhead.

A good starting point is the vagrant provided by SPDK repo.

djarotech commented 6 years ago

Tried it and it worked for me, here are the steps I took: https://github.com/utsaslab/rustfs/wiki/Vagrant-Set-Up-Steps

xxks-kkk commented 6 years ago

Hello Dan @danielpygo ,

Thanks for the writeup. However, I still think there are some issues when I follow your guide. For example, when I run ./configure --prefix=~/spdk_install, I got the following error message:

Creating CONFIG.local...done.
Type 'make' to build.
vagrant@localhost:~/spdk_repo/spdk$ make
C compiler is gcc but C++ compiler is
This may result in errors
make[3]: Entering directory '/home/vagrant/spdk_repo/spdk/dpdk'
== Build lib
== Build lib/librte_compat
== Build lib/librte_eal
== Build lib/librte_eal/common
== Build lib/librte_eal/linuxapp
== Build lib/librte_eal/linuxapp/eal
  CC eal.o
  CC eal_cpuflags.o
  CC eal_hugepage_info.o
  CC eal_memory.o
/home/vagrant/spdk_repo/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_memory.c:27:18: fatal error: numa.h: No such file or directory
compilation terminated.
/home/vagrant/spdk_repo/spdk/dpdk/mk/internal/rte.compile-pre.mk:114: recipe for target 'eal_memory.o' failed
make[8]: *** [eal_memory.o] Error 1
/home/vagrant/spdk_repo/spdk/dpdk/mk/rte.subdir.mk:35: recipe for target 'eal' failed
make[7]: *** [eal] Error 2
/home/vagrant/spdk_repo/spdk/dpdk/mk/rte.subdir.mk:35: recipe for target 'linuxapp' failed
make[6]: *** [linuxapp] Error 2
/home/vagrant/spdk_repo/spdk/dpdk/mk/rte.subdir.mk:35: recipe for target 'librte_eal' failed
make[5]: *** [librte_eal] Error 2
/home/vagrant/spdk_repo/spdk/dpdk/mk/rte.sdkbuild.mk:49: recipe for target 'lib' failed
make[4]: *** [lib] Error 2
/home/vagrant/spdk_repo/spdk/dpdk/mk/rte.sdkroot.mk:100: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/home/vagrant/spdk_repo/spdk/dpdk'
Makefile:12: recipe for target 'all' failed
make[2]: *** [all] Error 2
Makefile:106: recipe for target 'all' failed
make[1]: *** [all] Error 2
/home/vagrant/spdk_repo/spdk/mk/spdk.subdirs.mk:35: recipe for target 'dpdkbuild' failed
make: *** [dpdkbuild] Error 2

Are there any missing steps?

Thanks!

djarotech commented 6 years ago

Yes there was some missing about setting up the vm. Updated it yesterday but I am having an issue replicating my results from friday, I will get back to you soon.

xxks-kkk commented 5 years ago

Using QEMU with emulated NVMe SSD is possible.