Skip to content

Commit d40a436

Browse files
committed
workflow: add bcc environment for building eBPF optimizer
Signed-off-by: Bin Tang <[email protected]>
1 parent c8c3417 commit d40a436

File tree

3 files changed

+75
-7
lines changed

3 files changed

+75
-7
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ env:
1212
jobs:
1313
build:
1414
name: Build and Lint
15-
timeout-minutes: 10
16-
runs-on: ubuntu-latest
15+
timeout-minutes: 20
16+
runs-on: ubuntu-20.04
1717
steps:
1818
- name: Set up Go
1919
uses: actions/setup-go@v3
@@ -28,6 +28,23 @@ jobs:
2828
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
2929
restore-keys: |
3030
${{ runner.os }}-go
31+
- name: Setup bcc for eBPF
32+
run: |
33+
sudo apt-get update
34+
sudo apt install -y zip bison build-essential cmake flex git libedit-dev \
35+
libllvm12 llvm-12-dev libclang-12-dev python zlib1g-dev libelf-dev libfl-dev python3-setuptools \
36+
liblzma-dev arping netperf iperf
37+
git clone https://github.com/iovisor/bcc.git; cd bcc
38+
git checkout v0.24.0
39+
mkdir build; cd build
40+
cmake ..
41+
make
42+
sudo make install
43+
cmake -DPYTHON_CMD=python3 ..
44+
pushd src/python/
45+
make
46+
sudo make install
47+
popd
3148
- name: Build
3249
run: |
3350
go install github.com/golangci/golangci-lint/cmd/[email protected]
@@ -37,8 +54,8 @@ jobs:
3754
make check
3855
build-optimizer:
3956
name: Build optimizer
40-
timeout-minutes: 10
41-
runs-on: ubuntu-latest
57+
timeout-minutes: 20
58+
runs-on: ubuntu-20.04
4259
steps:
4360
- name: Set up Go
4461
uses: actions/setup-go@v3
@@ -53,6 +70,23 @@ jobs:
5370
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
5471
restore-keys: |
5572
${{ runner.os }}-go
73+
- name: Setup bcc for eBPF
74+
run: |
75+
sudo apt-get update
76+
sudo apt install -y zip bison build-essential cmake flex git libedit-dev \
77+
libllvm12 llvm-12-dev libclang-12-dev python zlib1g-dev libelf-dev libfl-dev python3-setuptools \
78+
liblzma-dev arping netperf iperf
79+
git clone https://github.com/iovisor/bcc.git; cd bcc
80+
git checkout v0.24.0
81+
mkdir build; cd build
82+
cmake ..
83+
make
84+
sudo make install
85+
cmake -DPYTHON_CMD=python3 ..
86+
pushd src/python/
87+
make
88+
sudo make install
89+
popd
5690
- name: Build
5791
run: |
5892
go install github.com/golangci/golangci-lint/cmd/[email protected]

.github/workflows/optimizer.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919

2020
jobs:
2121
run_optimizer:
22-
runs-on: ubuntu-latest
22+
runs-on: ubuntu-20.04
2323
steps:
2424
- name: Set up Go
2525
uses: actions/setup-go@v3
@@ -64,6 +64,23 @@ jobs:
6464
sudo mkdir -p /opt/cni/bin
6565
sudo tar xzf cni-plugins-linux-amd64-v1.2.0.tgz -C /opt/cni/bin/
6666
sudo install -D -m 755 misc/example/10-containerd-net.conflist /etc/cni/net.d/10-containerd-net.conflist
67+
- name: Setup bcc for eBPF
68+
run: |
69+
sudo apt-get update
70+
sudo apt install -y zip bison build-essential cmake flex git libedit-dev \
71+
libllvm12 llvm-12-dev libclang-12-dev python zlib1g-dev libelf-dev libfl-dev python3-setuptools \
72+
liblzma-dev arping netperf iperf
73+
git clone https://github.com/iovisor/bcc.git; cd bcc
74+
git checkout v0.24.0
75+
mkdir build; cd build
76+
cmake ..
77+
make
78+
sudo make install
79+
cmake -DPYTHON_CMD=python3 ..
80+
pushd src/python/
81+
make
82+
sudo make install
83+
popd
6784
- name: Build and install optimizer
6885
run: |
6986
rustup component add rustfmt clippy
@@ -87,7 +104,7 @@ jobs:
87104
echo "count: $count expected minimum value: $expected"
88105
if [ $count -lt $expected ]; then
89106
echo "failed to generate accessed files list for nginx:1.23.3"
90-
cat misc/optimizer/script/file_list.txt
107+
cat /opt/nri/optimizer/results/library/nginx:1.23.3
91108
exit 1
92109
fi
93110
cat /opt/nri/optimizer/results/library/nginx:1.23.3.csv

.github/workflows/release.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212

1313
jobs:
1414
build:
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-20.04
1616
steps:
1717
- uses: actions/checkout@v3
1818
- uses: actions/setup-go@v3
@@ -37,6 +37,23 @@ jobs:
3737
key: ${{ runner.os }}-cargo-${{ hashFiles('tools/optimizer-server/Cargo.lock') }}
3838
restore-keys: |
3939
${{ runner.os }}-cargo
40+
- name: Setup bcc for eBPF
41+
run: |
42+
sudo apt-get update
43+
sudo apt install -y zip bison build-essential cmake flex git libedit-dev \
44+
libllvm12 llvm-12-dev libclang-12-dev python zlib1g-dev libelf-dev libfl-dev python3-setuptools \
45+
liblzma-dev arping netperf iperf
46+
git clone https://github.com/iovisor/bcc.git; cd bcc
47+
git checkout v0.20.0
48+
mkdir build; cd build
49+
cmake ..
50+
make
51+
sudo make install
52+
cmake -DPYTHON_CMD=python3 ..
53+
pushd src/python/
54+
make
55+
sudo make install
56+
popd
4057
- name: build nydus-snapshotter and optimizer
4158
run: |
4259
go install github.com/golangci/golangci-lint/cmd/[email protected]

0 commit comments

Comments
 (0)