Skip to content

Merge pull request #490 from ESWZY/traffic-mgr/map-io-and-weighted-po… #45

Merge pull request #490 from ESWZY/traffic-mgr/map-io-and-weighted-po…

Merge pull request #490 from ESWZY/traffic-mgr/map-io-and-weighted-po… #45

name: Traffic Manager
on:
push:
branches:
- "*"
paths:
- 'eBPF_Supermarket/TrafficManager/**'
- '.github/workflows/net_traffic_manager.yml'
pull_request:
branches:
- "*"
paths:
- 'eBPF_Supermarket/TrafficManager/**'
- '.github/workflows/net_traffic_manager.yml'
jobs:
build-and-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Cache bpftool build directory
id: cache-bpftool
uses: actions/cache@v3
with:
path: bpftool
key: bpftool-v7.2.0-amd64
# - name: Install Docker
# run: |
# sudo snap refresh
# sudo snap install docker
# - name: Install Minikube
# run: |
# curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
# sudo install minikube-linux-amd64 /usr/local/bin/minikube
# sudo minikube start --kubernetes-version=1.26.6 --force
- name: Install eBPF development tools
run: |
sudo ln -s /usr/bin/llvm-strip-14 /usr/bin/llvm-strip
# sudo apt install -y llvm clang
- name: Build bpftool
if: steps.cache-bpftool.outputs.cache-hit != 'true'
run: |
rm -rf bpftool && mkdir bpftool && cd bpftool
wget https://github.com/libbpf/bpftool/releases/download/v7.2.0/bpftool-v7.2.0-amd64.tar.gz
sudo tar -xzf bpftool-v7.2.0-amd64.tar.gz
rm -f bpftool-v7.2.0-amd64.tar.gz
sudo chmod +x bpftool
- name: Install bpftool
run: |
sudo cp bpftool/bpftool /usr/bin/
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: eBPF_Supermarket/TrafficManager/go.mod
cache-dependency-path: eBPF_Supermarket/TrafficManager/go.sum
- name: Load Dependency
run: |
cd eBPF_Supermarket/TrafficManager/
sudo go mod tidy
- name: Build
run: |
cd eBPF_Supermarket/TrafficManager/
sudo make init
sudo make build
- name: Run
run: |
cd eBPF_Supermarket/TrafficManager/
sudo -E timeout 10 ./main || if [[ $? != 124 && $? != 0 ]]; then exit $?; fi