-
Notifications
You must be signed in to change notification settings - Fork 45
221 lines (217 loc) · 6.36 KB
/
cron.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
name: Update BTFHub Archive
on:
schedule:
- cron: "0 1 * * *"
workflow_dispatch: {}
jobs:
amazon-update:
name: Update Amazon 2 BTF Archive
runs-on: ubuntu-latest
container:
image: amazonlinux:2023
steps:
- name: Install needed amazon packages
run: |
yum install -y yum-utils tar gzip xz golang clang make cmake git libdwarf-devel elfutils-libelf-devel elfutils-devel rsync
shell: bash
#
- name: Setup Amazon Debuginfo Repositories
run: |
# disable default debuginfo repositories
yum-config-manager -y --disable amazonlinux-debuginfo
# add Amazon Linux 2 debuginfo repositories
append_repo() {
local arch=$1
local repo_name="amzn2-core-debuginfo-$arch"
echo "[$repo_name]
name=Amazon Linux 2 core repository - debuginfo packages $arch
mirrorlist=http://amazonlinux.default.amazonaws.com/2/core/latest/debuginfo/$arch/mirror.list
enabled=1
"
}
cat << EOF >> /etc/yum.repos.d/amazonlinux.repo
$(append_repo "x86_64")
$(append_repo "aarch64")
EOF
shell: bash
#
- name: Checkout BTFHub
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: aquasecurity/btfhub
submodules: recursive
path: ./btfhub
#
- name: Build and install pahole
run: |
cd btfhub/3rdparty/dwarves
mkdir build
cd build
cmake -D__LIB=lib -DDWARF_INCLUDE_DIR=/usr/include ..
make install
echo "/usr/local/lib" >> /etc/ld.so.conf.d/pahole.conf
ldconfig
shell: bash
#
- name: Build and install bpftool
run: |
cd btfhub/3rdparty/bpftool
make -C src clean
CC=clang make -C src all
cp ./src/bpftool /usr/sbin/bpftool
make -C src clean
shell: bash
#
- name: Compile BTFHub Tool
run: |
cd btfhub
make
shell: bash
#
- name: Checkout BTFHub Archive
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: aquasecurity/btfhub-archive
token: ${{ secrets.GEYSLAN_BTFHUB_PAT }}
persist-credentials: false
fetch-depth: 1
path: ./btfhub-archive
sparse-checkout: |
amzn
#
- name: Bring current BTFHub Archive
run: |
cd btfhub
make bring
shell: bash
#
- name: Fetch and Generate new BTFs (AMAZON 2)
run: |
cd btfhub
./btfhub -workers 6 -d amzn -r 2
#
- name: Take new BTFs to BTFHub Archive
run: |
cd btfhub
make take
#
- name: Check Status
run: |
cd btfhub-archive
git status
#
- name: Commit and Push to BTFHub Archive
uses: actions-js/push@5a7cbd780d82c0c937b5977586e641b2fd94acc5 # v1.5
with:
directory: ./btfhub-archive
author_email: '[email protected]'
author_name: 'Geyslan Gregório'
github_token: ${{ secrets.GEYSLAN_BTFHUB_PAT }}
message: 'Update BTFHUB Archive from BTFHUB'
repository: aquasecurity/btfhub-archive
branch: main
build:
name: Update BTF Archive
env:
HOME: "/tmp/root"
GOPATH: "/tmp/go"
GOCACHE: "/tmp/go-cache"
GOROOT: "/usr/local/go"
runs-on:
- graas_ami-0f4881c8d69684001_${{ github.event.number }}${{ github.run_attempt }}-${{ github.run_id }}
- EXECUTION_TYPE=LONG
steps:
#
- name: Setup Swap File
run: |
fallocate -l 16G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
shell: bash
#
- name: Checkout BTFHub
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: aquasecurity/btfhub
path: ./btfhub
#
- name: "Prepare Image (Fix AMI)"
uses: ./btfhub/.github/actions/build-dependencies
with:
run-on: ./btfhub
from: cron
#
- name: Checkout BTFHub Archive
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: aquasecurity/btfhub-archive
token: ${{ secrets.GEYSLAN_BTFHUB_PAT }}
persist-credentials: false
fetch-depth: 1
path: ./btfhub-archive
sparse-checkout: |
centos
debian
fedora
ol
ubuntu
#
- name: Bring current BTFHub Archive
run: |
cd btfhub
make bring
shell: bash
#
- name: Compile BTFHub Tool
run: |
cd btfhub
make
shell: bash
#
- name: Fetch and Generate new BTFs (CENTOS)
run: |
cd btfhub
./btfhub -workers 6 -d centos
# debian stretch seems to be gone, updates for buster and bullseye only
- name: Fetch and Generate new BTFs (DEBIAN)
run: |
cd btfhub
./btfhub -workers 6 -d debian -r buster
./btfhub -workers 6 -d debian -r bullseye
#
- name: Fetch and Generate new BTFs (FEDORA)
run: |
cd btfhub
./btfhub -workers 6 -d fedora
#
- name: Fetch and Generate new BTFs (ORACLE)
run: |
cd btfhub
./btfhub -workers 6 -d ol
#
- name: Fetch and Generate new BTFs (UBUNTU)
run: |
cd btfhub
./btfhub -workers 6 -d ubuntu
#
- name: Take new BTFs to BTFHub Archive
run: |
cd btfhub
make take
#
- name: Check Status
run: |
cd btfhub-archive
git status
#
- name: Commit and Push to BTFHub Archive
uses: actions-js/push@5a7cbd780d82c0c937b5977586e641b2fd94acc5 # v1.5
with:
directory: ./btfhub-archive
author_email: '[email protected]'
author_name: 'Geyslan Gregório'
github_token: ${{ secrets.GEYSLAN_BTFHUB_PAT }}
message: 'Update BTFHUB Archive from BTFHUB'
repository: aquasecurity/btfhub-archive
branch: main