Skip to content

Commit

Permalink
workflow: add bcc environment for building eBPF optimizer
Browse files Browse the repository at this point in the history
Signed-off-by: Bin Tang <tangbin.bin@bytedance.com>
  • Loading branch information
sctb512 committed Jul 14, 2023
1 parent c8c3417 commit 81db814
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 9 deletions.
63 changes: 57 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ env:
jobs:
build:
name: Build and Lint
timeout-minutes: 10
runs-on: ubuntu-latest
timeout-minutes: 20
runs-on: ubuntu-20.04
steps:
- name: Set up Go
uses: actions/setup-go@v3
Expand All @@ -28,6 +28,23 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go
- name: Setup bcc for eBPF
run: |
sudo apt-get update
sudo apt install -y zip bison build-essential cmake flex git libedit-dev \
libllvm12 llvm-12-dev libclang-12-dev python zlib1g-dev libelf-dev libfl-dev python3-setuptools \
liblzma-dev arping netperf iperf
git clone https://github.com/iovisor/bcc.git; cd bcc
git checkout v0.24.0
mkdir build; cd build
cmake ..
make
sudo make install
cmake -DPYTHON_CMD=python3 ..
pushd src/python/
make
sudo make install
popd
- name: Build
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2
Expand All @@ -37,8 +54,8 @@ jobs:
make check
build-optimizer:
name: Build optimizer
timeout-minutes: 10
runs-on: ubuntu-latest
timeout-minutes: 20
runs-on: ubuntu-20.04
steps:
- name: Set up Go
uses: actions/setup-go@v3
Expand All @@ -53,6 +70,23 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go
- name: Setup bcc for eBPF
run: |
sudo apt-get update
sudo apt install -y zip bison build-essential cmake flex git libedit-dev \
libllvm12 llvm-12-dev libclang-12-dev python zlib1g-dev libelf-dev libfl-dev python3-setuptools \
liblzma-dev arping netperf iperf
git clone https://github.com/iovisor/bcc.git; cd bcc
git checkout v0.24.0
mkdir build; cd build
cmake ..
make
sudo make install
cmake -DPYTHON_CMD=python3 ..
pushd src/python/
make
sudo make install
popd
- name: Build
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2
Expand Down Expand Up @@ -118,8 +152,8 @@ jobs:
coverage:
name: Code coverage
timeout-minutes: 10
runs-on: ubuntu-latest
timeout-minutes: 20
runs-on: ubuntu-20.04
needs: [build]
steps:
- name: Install Go
Expand All @@ -135,6 +169,23 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go
- name: Setup bcc for eBPF
run: |
sudo apt-get update
sudo apt install -y zip bison build-essential cmake flex git libedit-dev \
libllvm12 llvm-12-dev libclang-12-dev python zlib1g-dev libelf-dev libfl-dev python3-setuptools \
liblzma-dev arping netperf iperf
git clone https://github.com/iovisor/bcc.git; cd bcc
git checkout v0.24.0
mkdir build; cd build
cmake ..
make
sudo make install
cmake -DPYTHON_CMD=python3 ..
pushd src/python/
make
sudo make install
popd
- name: Run unit tests.
run: make cover
- name: Upload coverage to Codecov
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/optimizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:

jobs:
run_optimizer:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Set up Go
uses: actions/setup-go@v3
Expand Down Expand Up @@ -64,6 +64,23 @@ jobs:
sudo mkdir -p /opt/cni/bin
sudo tar xzf cni-plugins-linux-amd64-v1.2.0.tgz -C /opt/cni/bin/
sudo install -D -m 755 misc/example/10-containerd-net.conflist /etc/cni/net.d/10-containerd-net.conflist
- name: Setup bcc for eBPF
run: |
sudo apt-get update
sudo apt install -y zip bison build-essential cmake flex git libedit-dev \
libllvm12 llvm-12-dev libclang-12-dev python zlib1g-dev libelf-dev libfl-dev python3-setuptools \
liblzma-dev arping netperf iperf
git clone https://github.com/iovisor/bcc.git; cd bcc
git checkout v0.24.0
mkdir build; cd build
cmake ..
make
sudo make install
cmake -DPYTHON_CMD=python3 ..
pushd src/python/
make
sudo make install
popd
- name: Build and install optimizer
run: |
rustup component add rustfmt clippy
Expand All @@ -87,7 +104,7 @@ jobs:
echo "count: $count expected minimum value: $expected"
if [ $count -lt $expected ]; then
echo "failed to generate accessed files list for nginx:1.23.3"
cat misc/optimizer/script/file_list.txt
cat /opt/nri/optimizer/results/library/nginx:1.23.3
exit 1
fi
cat /opt/nri/optimizer/results/library/nginx:1.23.3.csv
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
Expand All @@ -37,6 +37,23 @@ jobs:
key: ${{ runner.os }}-cargo-${{ hashFiles('tools/optimizer-server/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo
- name: Setup bcc for eBPF
run: |
sudo apt-get update
sudo apt install -y zip bison build-essential cmake flex git libedit-dev \
libllvm12 llvm-12-dev libclang-12-dev python zlib1g-dev libelf-dev libfl-dev python3-setuptools \
liblzma-dev arping netperf iperf
git clone https://github.com/iovisor/bcc.git; cd bcc
git checkout v0.20.0
mkdir build; cd build
cmake ..
make
sudo make install
cmake -DPYTHON_CMD=python3 ..
pushd src/python/
make
sudo make install
popd
- name: build nydus-snapshotter and optimizer
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2
Expand Down

0 comments on commit 81db814

Please sign in to comment.