aregm / nff-go

NFF-Go -Network Function Framework for GO (former YANFF)
BSD 3-Clause "New" or "Revised" License
1.38k stars 156 forks source link

tutorial not working out-of-the-box #695

Open sitilge opened 4 years ago

sitilge commented 4 years ago

Hi, I am trying to get started with this nice project but I'm stuck in early stages. I am currently trying to follow the examples/tutorial but getting of errors. First, as I read, is due to non-matching ruby version

NOTE: Gem::Specification.default_specifications_dir is deprecated; use Gem.default_specifications_dir instead. It will be removed on or after 2020-02-01.
Gem::Specification.default_specifications_dir called from /opt/vagrant/embedded/gems/gems/vagrant-2.2.7/lib/vagrant/bundler.rb:428.
NOTE: Gem::Specification.default_specifications_dir is deprecated; use Gem.default_specifications_dir instead. It will be removed on or after 2020-02-01.
Gem::Specification.default_specifications_dir called from /opt/vagrant/embedded/gems/gems/vagrant-2.2.7/lib/vagrant/bundler.rb:428.
/opt/vagrant/embedded/gems/gems/vagrant-2.2.7/plugins/kernel_v2/config/vm.rb:379: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/opt/vagrant/embedded/gems/gems/vagrant-2.2.7/plugins/kernel_v2/config/vm_provisioner.rb:95: warning: The called method `add_config' is defined here
/opt/vagrant/embedded/gems/gems/vagrant-2.2.7/lib/vagrant/errors.rb:103: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/opt/vagrant/embedded/gems/gems/i18n-1.8.2/lib/i18n.rb:195: warning: The called method `t' is defined here

The second is that the bindports is apparently pointing to different devices, e.g. 00:08.0 as given by lspci. Is there a convenient automatic way to set the device numbers?

Finally, when running genscripts I get:

./genscripts: error while loading shared libraries: libbpf.so.0: cannot open shared object file: No such file or directory
gshimansky commented 4 years ago

Ruby errors that you see come from vagrant. I cannot reproduce them. If you can provide reproducer maybe we will be able to help.

I don't know how to automatically generate values for virtual network card PCI ids. If they aren't correct for you, just edit line 5 in scripts.sh after you create VMs.

For the last error, if you don't want to setup BPF library, build NFF-Go with environment variable NFF_GO_NO_BPF_SUPPORT set to a nonempty value.

aregm commented 4 years ago

@sitilge What is your Ruby and Vagrant version?

sitilge commented 4 years ago

@sitilge What is your Ruby and Vagrant version?

Ruby version 2.7.0 Vagrant version 2.2.7

sitilge commented 4 years ago

For the last error, if you don't want to setup BPF library, build NFF-Go with environment variable NFF_GO_NO_BPF_SUPPORT set to a nonempty value.

Yes, that was how I built NFF-Go on my local machine. But this is about the VMs generated from Vagrant file. And lines 136 - 150 contain the lines for installing libbpf and NFF-Go with BPF. But the problem is, as described, that BPF is not available on the VMs. The respective lines (136 - 150) from Vagrantfile:

echo Installing libbpf
git clone -b v0.0.4 https://github.com/libbpf/libbpf
make -C libbpf/src all
sudo make -C libbpf/src install
sudo sh -c "echo /usr/lib64 > /etc/ld.so.conf.d/usrlib64.conf"

echo Downloading and building NFF-GO framework
go get -v golang.org/x/tools/cmd/stringer
git clone -b master --recurse-submodules http://github.com/intel-go/nff-go
(cd nff-go; go mod download; make)
echo Downloading and building NFF-GO NAT example and its dependencies
go get github.com/golang/protobuf/protoc-gen-go
git clone -b master --recurse-submodules http://github.com/intel-go/nff-go-nat
(cd nff-go-nat; go mod download; . env.sh; make)
./nff-go-nat/test/httpperfserv/install-systemd-service.sh "-port 8008"