kubernetes-retired / kpng

[EOL] Reworking kube-proxy's architecture
Apache License 2.0
246 stars 90 forks source link

Add gcc-multilib as eBPF pre-requisite for Ubuntu #506

Closed jaehnri closed 1 year ago

jaehnri commented 1 year ago

What kind of PR is this?

Documentation

Why this PR is needed / What does this PR do?

I had a little trouble compiling the eBPF program in Ubuntu:

$ make bytecode
...
bpf2go -cc clang -cflags -O2 -g -Wall -Werror -I./libbpf/include -I./libbpf/src bpf ./bpf/cgroup_connect4.c
In file included from /home/joao/Github/kpng/backends/ebpf/bpf/cgroup_connect4.c:3:
In file included from ./libbpf/include/uapi/linux/bpf.h:11:
/usr/include/linux/types.h:5:10: fatal error: 'asm/types.h' file not found
#include <asm/types.h>
         ^~~~~~~~~~~~~
1 error generated.
Error: can't execute clang: exit status 1
ebpf.go:45: running "bpf2go": exit status 1
make: *** [Makefile:24: bytecode] Error 1

Looking for a fix, I found https://github.com/xdp-project/xdp-tools/issues/4, that points to https://github.com/xdp-project/xdp-tutorial/issues/44, which then proceeds to recommend the installation of gcc-multilib.

This extra requirement may save someone else's time futurely.

jayunit100 commented 1 year ago

/lgtm /approve

k8s-ci-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jaehnri, jayunit100

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[backends/OWNERS](https://github.com/kubernetes-sigs/kpng/blob/master/backends/OWNERS)~~ [jayunit100] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
aroradaman commented 1 year ago

@jaehnri can you look at https://github.com/kubernetes-sigs/kpng/actions/runs/5067777691/jobs/9099251795 the ci is unable to install gcc-multilib and breaking the tests.

jaehnri commented 1 year ago

@aroradaman this is very weird. gcc-multilib has always been an eBPF dependency, this is just a docs change: https://github.com/kubernetes-sigs/kpng/blame/master/.github/workflows/e2e_tests.yaml#L61

I think a sudo apt update will help. Will open it.