ipdk-io / ipdk

Infrastructure Programmer Development Kit (IPDK) is an open source, vendor agnostic framework of drivers and APIs for infrastructure offload and management that runs on a CPU, IPU, DPU or switch.
Apache License 2.0
185 stars 68 forks source link

networking_ebpf build: ./ipdk: line 208: docker: command not found #295

Open chrispsommers opened 1 year ago

chrispsommers commented 1 year ago

Following the networking_ebpf instructions at https://github.com/ipdk-io/ipdk/blob/main/build/networking_ebpf/README_DOCKER.md#optional-vagrant-setup yielded the error shown below. SHould the instructions also include this step?

/git/ipdk/build/networking_ebpf/scripts/host_install.sh

Here is the error:

~/ipdk/build/networking_ebpf/vagrant$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'debian/bullseye64' version '11.20220912.1' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default: 
    default: Guest Additions Version: 6.0.0 r127566
    default: VirtualBox Version: 6.1
==> default: Mounting shared folders...
    default: /vagrant => /home/chris/ipdk/build/networking_ebpf/vagrant
    default: /git/ipdk => /home/chris/ipdk
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.

==> default: Machine 'default' has a post `vagrant up` message. This is a message
==> default: from the creator of the Vagrantfile, and not from Vagrant itself:
==> default: 
==> default: Vanilla Debian box. See https://app.vagrantup.com/debian for help and bug reports
chris@chris-z4:~/ipdk/build/networking_ebpf/vagrant$ vagrant ssh
Linux bullseye 5.10.0-18-amd64 #1 SMP Debian 5.10.140-1 (2022-09-02) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Nov 15 19:29:47 2022 from 10.0.2.2
vagrant@bullseye:~$ cd /git/ipdk/build
vagrant@bullseye:/git/ipdk/build$ ./ipdk install ebpf-ubuntu2004
/git/ipdk/build/scripts/ipdk_default.env: line 31: git: command not found
Loaded /git/ipdk/build/scripts/ipdk_default.env
Loaded /home/vagrant/.ipdk/ipdk.env
User changable IPDK configuration file is already defined at 
'~/.ipdk/ipdk.env'.
Changed runtime environment to: ebpf-ubuntu2004

As last step execute:
  export PATH=/git/ipdk/build:$PATH
to add the IPDK CLI to your path in the running environment!
vagrant@bullseye:/git/ipdk/build$ ipdk build
-bash: ipdk: command not found
vagrant@bullseye:/git/ipdk/build$ ./ipdk build
/git/ipdk/build/scripts/ipdk_default.env: line 31: git: command not found
Loaded /git/ipdk/build/scripts/ipdk_default.env
Loaded /home/vagrant/.ipdk/ipdk.env
/git/ipdk/build /git/ipdk/build
Can't find docker. Install first!!
Use old docker build!
/git/ipdk/build/networking_ebpf /git/ipdk/build /git/ipdk/build
./ipdk: line 208: docker: command not found
/git/ipdk/build /git/ipdk/build
/git/ipdk/build
vsureshkumarp commented 1 year ago

Looks like you missed the step to set the PATH variable export PATH=/git/ipdk/build:$PATH before running the ipdk build. Once if you set the PATH you will not see ipdk command error.

./ipdk install ebpf-ubuntu2004 /git/ipdk/build/scripts/ipdk_default.env: line 31: git: command not found Loaded /git/ipdk/build/scripts/ipdk_default.env Loaded /home/vagrant/.ipdk/ipdk.env User changable IPDK configuration file is already defined at '~/.ipdk/ipdk.env'. Changed runtime environment to: ebpf-ubuntu2004

As last step execute: export PATH=/git/ipdk/build:$PATH to add the IPDK CLI to your path in the running environment! vagrant@bullseye:/git/ipdk/build$

vsureshkumarp commented 1 year ago

No issues observed till docker container image creation. But, unable to run the demo "make start-demo" due to missing the folder “go” under /home/vagrant Somehow go folder is getting created under /root/ instead of /home/vagrant Needs further debugging.

chrispsommers commented 1 year ago

Looks like you missed the step to set the PATH variable export PATH=/git/ipdk/build:$PATH before running the ipdk build. Once if you set the PATH you will not see ipdk command error.

./ipdk install ebpf-ubuntu2004 /git/ipdk/build/scripts/ipdk_default.env: line 31: git: command not found Loaded /git/ipdk/build/scripts/ipdk_default.env Loaded /home/vagrant/.ipdk/ipdk.env User changable IPDK configuration file is already defined at '~/.ipdk/ipdk.env'. Changed runtime environment to: ebpf-ubuntu2004

As last step execute: export PATH=/git/ipdk/build:$PATH to add the IPDK CLI to your path in the running environment! vagrant@bullseye:/git/ipdk/build$

Thanks, I confirmed that setting the PATH solved the docker image build issue. Can't this PATH export be done automatically by the build scripts? Why add a manual step?

stolsma commented 1 year ago

Can't this PATH export be done automatically by the build scripts? Why add a manual step?

Unfortunately not... Because the script is running in its own shell environment exporting a extended path will be gone when the script ends. 😢

Starting a new bash shell or logging in again should do the work also...