Skip to content

Update BTFHub Archive for Amazon Linux 2 #264

Update BTFHub Archive for Amazon Linux 2

Update BTFHub Archive for Amazon Linux 2 #264

Workflow file for this run

name: Update BTFHub Archive for Amazon Linux 2
on:
schedule:
- cron: "0 1 * * *"
workflow_dispatch: {}
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
jobs:
amazon-update:
name: update amazon linux 2 btfhub-archive
runs-on: ubuntu-22.04
container:
image: amazonlinux:2
steps:
- name: Install needed amazon packages
run: |
yum install -y yum-utils wget tar gzip xz clang make cmake git libdwarf-devel elfutils-libelf-devel elfutils-devel
yum-config-manager -y --enable amzn2-core-debuginfo
yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
yum install -y gh
echo "[amzn2-core-debuginfo-alt]" >> /etc/yum.repos.d/amzn2-core.repo
awk '/^\[/{found=""} /^\[amzn2-core-debuginfo]$/{found=1;next} found && NF' /etc/yum.repos.d/amzn2-core.repo | sed 's/\$basearch/aarch64/g' >> /etc/yum.repos.d/amzn2-core.repo
shell: bash
- name: Authenticate
run: |
gh auth login --with-token <<<'${{ secrets.DD_BTFHUB_BOT_GITHUB_TOKEN }}'
- name: Check out BTFHub
uses: actions/checkout@v3
with:
token: ${{ secrets.DD_BTFHUB_BOT_GITHUB_TOKEN }}
submodules: 'recursive'
- run: git config --system --add safe.directory $(pwd)
shell: bash
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: install newer clang
run: |
yum remove -y clang
wget -nv https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz
tar xf clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz
mv clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu- clang
echo "$GITHUB_WORKSPACE/clang/bin" >> $GITHUB_PATH
- name: build pahole
run: |
cd ./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 bpftool
run: |
cd ./3rdparty/bpftool
make -C src/ V=1 install
shell: bash
- name: build tar
run: |
wget https://ftpmirror.gnu.org/tar/tar-1.35.tar.xz
tar xf tar-1.35.tar.xz
cd tar-1.35
FORCE_UNSAFE_CONFIGURE=1 ./configure --prefix=/usr
make install
- name: Compile BTFHub Tool
run: |
make
shell: bash
- name: Checkout BTFHub Archive
uses: actions/checkout@v3
with:
repository: DataDog/btfhub-archive
ref: main
token: ${{ secrets.DD_BTFHUB_BOT_GITHUB_TOKEN }}
path: archive
sparse-checkout: |
amzn/2
- name: Fetch and Generate new BTFs (AMAZON 2)
run: |
./btfhub -workers 6 -d amzn -r 2 -a x86_64
./btfhub -workers 6 -d amzn -r 2 -a arm64
- name: Check Status
run: |
cd archive
git status
- name: Commit and Push to BTFHub Archive
run: |
cd archive
git config --local user.name "Bryce Kahle"
git config --local user.email "bryce.kahle@datadoghq.com"
git add -A
git diff-index --quiet HEAD || git commit -m "amzn 2 update on $(date -u +%Y-%m-%d)"
git push || (git pull --rebase && git push)