19
19
20
20
jobs :
21
21
run_optimizer :
22
- runs-on : ubuntu-latest
22
+ runs-on : ubuntu-20.04
23
+ env :
24
+ GOBCC_BUILDER_IMAGE : ' ghcr.io/sctb512/gobcc-builder:20.04'
25
+ GOBCC_BUILDER_IMAGE_FILE : ' ~/.image/gobcc-builder:20.04.tar'
23
26
steps :
24
- - name : Set up Go
25
- uses : actions/setup-go@v3
26
- with :
27
- go-version : " 1.19.6"
28
27
- name : Checkout repository
29
28
uses : actions/checkout@v3
30
29
- name : cache go mod
46
45
key : ${{ runner.os }}-cargo-${{ hashFiles('tools/optimizer-server/Cargo.lock') }}
47
46
restore-keys : |
48
47
${{ runner.os }}-cargo
48
+ - name : cache go bcc image
49
+ uses : actions/cache@v3
50
+ with :
51
+ path : |
52
+ ${GOBCC_BUILDER_IMAGE_FILE}
53
+ key : ${{ runner.os }}-bogcc-builder-${{ hashFiles('${GOBCC_BUILDER_IMAGE_FILE}') }}
54
+ restore-keys : |
55
+ ${{ runner.os }}-bogcc-builder
56
+ - name : load go bcc image
57
+ run : |
58
+ if [ -f ${GOBCC_BUILDER_IMAGE_FILE} ];then
59
+ sudo docker load < ${GOBCC_BUILDER_IMAGE_FILE}
60
+ else
61
+ sudo docker pull ${GOBCC_BUILDER_IMAGE}
62
+ fi
63
+ - name : Build optimizer
64
+ run : |
65
+ make container-optimizer
66
+ pwd
67
+ ldd bin/*optimizer*
68
+ ls -lh bin/*optimizer*
69
+ - name : Setup bcc for eBPF
70
+ run : |
71
+ sudo apt-get update
72
+ sudo apt install -y zip bison build-essential cmake flex git libedit-dev \
73
+ libllvm12 llvm-12-dev libclang-12-dev python zlib1g-dev libelf-dev libfl-dev python3-setuptools \
74
+ liblzma-dev arping netperf iperf
75
+ git clone https://github.com/iovisor/bcc.git; cd bcc
76
+ git checkout v0.24.0
77
+ mkdir build; cd build
78
+ cmake ..
79
+ make
80
+ sudo make install
81
+ cmake -DPYTHON_CMD=python3 ..
82
+ pushd src/python/
83
+ make
84
+ sudo make install
85
+ popd
49
86
- name : containerd runc and crictl
50
87
run : |
51
88
sudo wget https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.26.0/crictl-v1.26.0-linux-amd64.tar.gz
56
93
sudo tar -zxf ./containerd-static-1.7.0-linux-amd64.tar.gz -C /usr/
57
94
sudo install -D -m 755 misc/optimizer/containerd-config.toml /etc/containerd/config.toml
58
95
sudo systemctl restart containerd
96
+ systemctl status containerd --no-pager -l
59
97
sudo wget https://github.com/opencontainers/runc/releases/download/v1.1.5/runc.amd64 -O /usr/bin/runc
60
98
sudo chmod +x /usr/bin/runc
61
99
- name : Setup CNI
@@ -66,11 +104,6 @@ jobs:
66
104
sudo install -D -m 755 misc/example/10-containerd-net.conflist /etc/cni/net.d/10-containerd-net.conflist
67
105
- name : Build and install optimizer
68
106
run : |
69
- rustup component add rustfmt clippy
70
- make optimizer
71
- sudo chown -R $(id -un):$(id -gn) . ~/.cargo/
72
- pwd
73
- ls -lh bin/*optimizer*
74
107
sudo make install-optimizer
75
108
sudo install -D -m 755 misc/example/optimizer-nri-plugin.conf /etc/nri/conf.d/02-optimizer-nri-plugin.conf
76
109
sudo systemctl restart containerd
@@ -87,14 +120,15 @@ jobs:
87
120
echo "count: $count expected minimum value: $expected"
88
121
if [ $count -lt $expected ]; then
89
122
echo "failed to generate accessed files list for nginx:1.23.3"
90
- cat misc/ optimizer/script/file_list.txt
123
+ cat /opt/nri/ optimizer/results/library/nginx:1.23.3
91
124
exit 1
92
125
fi
93
126
cat /opt/nri/optimizer/results/library/nginx:1.23.3.csv
94
127
- name : Dump logs
95
128
if : failure()
96
129
continue-on-error : true
97
130
run : |
98
- systemctl status containerd --no-pager -l
99
131
journalctl -xeu containerd --no-pager
132
+ journalctl -xeu docker --no-pager
133
+ journalctl -t "optimizer-nri-plugin" --no-pager
100
134
0 commit comments