Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
Adding libxdp to the ci-cd
Browse files Browse the repository at this point in the history
Signed-off-by: phansGithub <[email protected]>
  • Loading branch information
phansGithub committed Nov 21, 2023
1 parent 3872797 commit e0b585c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 54 deletions.
42 changes: 4 additions & 38 deletions .github/workflows/public-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,11 @@ jobs:

- name: Install libbpf and libxdp
run: |
sudo apt update
sudo apt install -y wget build-essential golang
sudo wget http://security.ubuntu.com/ubuntu/pool/main/libb/libbpf/libbpf1_1.1.0-1_amd64.deb
sudo wget http://security.ubuntu.com/ubuntu/pool/main/libb/libbpf/libbpf-dev_1.1.0-1_amd64.deb
sudo wget https://mirrors.edge.kernel.org/ubuntu/pool/main/x/xdp-tools/libxdp1_1.3.0-2ubuntu2_amd64.deb
sudo wget https://mirrors.edge.kernel.org/ubuntu/pool/main/x/xdp-tools/libxdp-dev_1.3.0-2ubuntu2_amd64.deb
sudo apt install -y ./libbpf1_1.1.0-1_amd64.deb
sudo apt install -y ./libbpf-dev_1.1.0-1_amd64.deb
sudo apt install -y ./libxdp1_1.3.0-2ubuntu2_amd64.deb
sudo apt install -y ./libxdp-dev_1.3.0-2ubuntu2_amd64.deb
make install-xdp
sudo apt install -y clang
sudo apt install -y llvm
sudo apt install -y gcc-multilib

- name: Run build
run: make build

Expand All @@ -70,17 +59,7 @@ jobs:
go-version: 1.19

- name: Install libbpf and libxdp
run: |
sudo apt update
sudo apt install -y wget build-essential golang
sudo wget http://security.ubuntu.com/ubuntu/pool/main/libb/libbpf/libbpf1_1.1.0-1_amd64.deb
sudo wget http://security.ubuntu.com/ubuntu/pool/main/libb/libbpf/libbpf-dev_1.1.0-1_amd64.deb
sudo wget https://mirrors.edge.kernel.org/ubuntu/pool/main/x/xdp-tools/libxdp1_1.3.0-2ubuntu2_amd64.deb
sudo wget https://mirrors.edge.kernel.org/ubuntu/pool/main/x/xdp-tools/libxdp-dev_1.3.0-2ubuntu2_amd64.deb
sudo apt install -y ./libbpf1_1.1.0-1_amd64.deb
sudo apt install -y ./libbpf-dev_1.1.0-1_amd64.deb
sudo apt install -y ./libxdp1_1.3.0-2ubuntu2_amd64.deb
sudo apt install -y ./libxdp-dev_1.3.0-2ubuntu2_amd64.deb
run: make install-xdp

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
Expand All @@ -99,20 +78,7 @@ jobs:
go-version: 1.19

- name: Install libbpf and libxdp
run: |
sudo apt update
sudo apt install -y wget build-essential golang
sudo wget http://security.ubuntu.com/ubuntu/pool/main/libb/libbpf/libbpf1_1.1.0-1_amd64.deb
sudo wget http://security.ubuntu.com/ubuntu/pool/main/libb/libbpf/libbpf-dev_1.1.0-1_amd64.deb
sudo wget https://mirrors.edge.kernel.org/ubuntu/pool/main/x/xdp-tools/libxdp1_1.3.0-2ubuntu2_amd64.deb
sudo wget https://mirrors.edge.kernel.org/ubuntu/pool/main/x/xdp-tools/libxdp-dev_1.3.0-2ubuntu2_amd64.deb
sudo apt install -y ./libbpf1_1.1.0-1_amd64.deb
sudo apt install -y ./libbpf-dev_1.1.0-1_amd64.deb
sudo apt install -y ./libxdp1_1.3.0-2ubuntu2_amd64.deb
sudo apt install -y ./libxdp-dev_1.3.0-2ubuntu2_amd64.deb
sudo apt install -y clang
sudo apt install -y llvm
sudo apt install -y gcc-multilib
run: make install-xdp

- name: unit-tests
run: make test
35 changes: 20 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ podman: ## Build podman image
@echo

image:
# if $(MAKE) podman; then \
# echo "Podman build succeeded"; \
# else \
# echo "Podman build failed, trying docker.."; \
if $(MAKE) podman; then \
echo "Podman build succeeded"; \
else \
echo "Podman build failed, trying docker.."; \
$(MAKE) docker; \
# fi
fi

undeploy: ## Undeploy the Deamonset
@echo "****** Stop Daemonset ******"
Expand Down Expand Up @@ -138,19 +138,24 @@ install-xdp:
@echo "****** Install libxdp ******"
@echo
sudo apt update && \
sudo apt install -y wget build-essential golang && \
sudo wget http://security.ubuntu.com/ubuntu/pool/main/libb/libbpf/libbpf1_1.1.0-1_amd64.deb && \
sudo wget http://security.ubuntu.com/ubuntu/pool/main/libb/libbpf/libbpf-dev_1.1.0-1_amd64.deb && \
sudo wget https://mirrors.edge.kernel.org/ubuntu/pool/main/x/xdp-tools/libxdp1_1.3.0-2ubuntu2_amd64.deb &&\
sudo wget https://mirrors.edge.kernel.org/ubuntu/pool/main/x/xdp-tools/libxdp-dev_1.3.0-2ubuntu2_amd64.deb && \
sudo apt install -y ./libbpf1_1.1.0-1_amd64.deb && \
sudo apt install -y ./libbpf-dev_1.1.0-1_amd64.deb && \
sudo apt install -y wget build-essential golang;
@if ! apt list | grep libbpf1; then \
sudo wget http://security.ubuntu.com/ubuntu/pool/main/libb/libbpf/libbpf1_1.1.0-1_amd64.deb && \
sudo wget http://security.ubuntu.com/ubuntu/pool/main/libb/libbpf/libbpf-dev_1.1.0-1_amd64.deb &&\
sudo apt install -y ./libbpf1_1.1.0-1_amd64.deb && \
sudo apt install -y ./libbpf-dev_1.1.0-1_amd64.deb &&\
rm ./libbpf1_1.1.0-1_amd64.deb && \
rm ./libbpf-dev_1.1.0-1_amd64.deb; \
else \
echo "Libbpf already found, installing libxdp..."; \
fi
sudo wget https://mirrors.edge.kernel.org/ubuntu/pool/main/x/xdp-tools/libxdp1_1.3.0-2ubuntu2_amd64.deb &&\
sudo wget https://mirrors.edge.kernel.org/ubuntu/pool/main/x/xdp-tools/libxdp-dev_1.3.0-2ubuntu2_amd64.deb &&\
sudo apt install -y ./libxdp1_1.3.0-2ubuntu2_amd64.deb && \
sudo apt install -y ./libxdp-dev_1.3.0-2ubuntu2_amd64.deb
sudo apt install -y ./libxdp-dev_1.3.0-2ubuntu2_amd64.deb;
@echo
@echo "****** Cleanup ******"
rm ./libbpf1_1.1.0-1_amd64.deb && \
rm ./libbpf-dev_1.1.0-1_amd64.deb && \

rm ./libxdp1_1.3.0-2ubuntu2_amd64.deb && \
rm ./libxdp-dev_1.3.0-2ubuntu2_amd64.deb
@echo
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ The following prerequisites are required to build and deploy the plugins from so
- Compiling the bpf progs for Kind.
- Install on Ubuntu: `apt install llvm`
- **libxdp**
- Same as Libbpf, to load and uload the XDP program onto the network device.
- Same as Libbpf, to load and unload the XDP program onto the network device.
- Installation: `make install-xdp`

### Static analysis, linting and formatting
Expand Down

0 comments on commit e0b585c

Please sign in to comment.