From 378ea71b9efcd23eab8fe4a09d82864f1ab0fee8 Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 13:35:28 -0700 Subject: [PATCH 01/16] Add job to update amazon 2 in cron workflow --- .github/workflows/cron.yml | 75 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 7adc73b9..1f6a6c0a 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -4,6 +4,81 @@ on: - cron: "0 1 * * *" workflow_dispatch: {} jobs: + amazon-build: + name: Update Amazon 2 BTF Archive + runs-on: + [ + "github-self-hosted_ami-0f4881c8d69684001_${{ github.event.number }}-${{ github.run_id }}", + ] + container: + image: amazonlinux:2 + steps: + - name: Install needed amazon packages + run: | + yum install yum-utils tar gzip xz clang make cmake git libdwarf-devel elfutils-libelf-devel elfutils-devel + yum-config-manager --enable amzn2-core-debuginfo + shell: bash + +# - name: Authenticate +# run: | +# gh auth login --with-token <<<'${{ secrets.PAT_RAFAEL }}' + + - name: Check out BTFHub + uses: actions/checkout@v3 + with: + repository: aquasecurity/btfhub + path: ./btfhub + token: ${{ secrets.PAT_RAFAEL }} + + - name: Checkout BTFHub Archive + uses: actions/checkout@v3 + with: + repository: aquasecurity/btfhub-archive + path: ./btfhub/archive + token: ${{ secrets.PAT_RAFAEL }} + + - uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: build pahole + run: | + cd btfhub + git submodule update --init --recursive 3rdparty/dwarves + 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: Compile BTFHub Tool + run: | + cd btfhub + make + shell: bash + + - name: Fetch and Generate new BTFs (AMAZON 2) + run: | + cd btfhub + ./btfhub -workers 6 -d amzn -r 2 + + - name: Check Status + run: | + cd btfhub/archive + git status + +# - name: Commit and Push to BTFHub Archive +# run: | +# cd btfhub/archive +# git config --local user.name "Rafael David Tinoco" +# git config --local user.email "rafaeldtinoco@gmail.com" +# git add -A +# git diff-index --quiet HEAD || git commit -m "Update BTFHUB Archive from BTFHUB" +# git push + build: name: Update BTF Archive env: From 3017f54628cb7b73333adf1d1492ae3edcf391eb Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 13:37:11 -0700 Subject: [PATCH 02/16] debug with push --- .github/workflows/cron.yml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 1f6a6c0a..c2c15ba6 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -1,5 +1,6 @@ name: Update BTFHub Archive on: + push: schedule: - cron: "0 1 * * *" workflow_dispatch: {} @@ -28,14 +29,14 @@ jobs: with: repository: aquasecurity/btfhub path: ./btfhub - token: ${{ secrets.PAT_RAFAEL }} +# token: ${{ secrets.PAT_RAFAEL }} - name: Checkout BTFHub Archive uses: actions/checkout@v3 with: repository: aquasecurity/btfhub-archive path: ./btfhub/archive - token: ${{ secrets.PAT_RAFAEL }} +# token: ${{ secrets.PAT_RAFAEL }} - uses: actions/setup-go@v4 with: @@ -148,23 +149,23 @@ jobs: --slave /usr/bin/cc cc /usr/bin/clang-14 shell: bash # - - name: Authenticate - run: | - gh auth login --with-token <<<'${{ secrets.PAT_RAFAEL }}' +# - name: Authenticate +# run: | +# gh auth login --with-token <<<'${{ secrets.PAT_RAFAEL }}' # - name: Check out BTFHub uses: actions/checkout@v3 with: repository: aquasecurity/btfhub path: ./btfhub - token: ${{ secrets.PAT_RAFAEL }} +# token: ${{ secrets.PAT_RAFAEL }} # Authenticate - name: Checkout BTFHub Archive uses: actions/checkout@v3 with: repository: aquasecurity/btfhub-archive path: ./btfhub-archive - token: ${{ secrets.PAT_RAFAEL }} +# token: ${{ secrets.PAT_RAFAEL }} # - name: Install pahole run: | @@ -226,11 +227,11 @@ jobs: cd btfhub-archive git status # - - name: Commit and Push to BTFHub Archive - run: | - cd btfhub-archive - git config --local user.name "Rafael David Tinoco" - git config --local user.email "rafaeldtinoco@gmail.com" - git add -A - git diff-index --quiet HEAD || git commit -m "Update BTFHUB Archive from BTFHUB" - git push +# - name: Commit and Push to BTFHub Archive +# run: | +# cd btfhub-archive +# git config --local user.name "Rafael David Tinoco" +# git config --local user.email "rafaeldtinoco@gmail.com" +# git add -A +# git diff-index --quiet HEAD || git commit -m "Update BTFHUB Archive from BTFHUB" +# git push From 7073d3c186d8e84a010b3b7c3278b27380ec80f7 Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 13:43:53 -0700 Subject: [PATCH 03/16] fix push --- .github/workflows/cron.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index c2c15ba6..a00868a4 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -1,6 +1,6 @@ name: Update BTFHub Archive on: - push: + push: {} schedule: - cron: "0 1 * * *" workflow_dispatch: {} From 1ee6912740028d6510389080229ab07d9b5bd676 Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 13:47:02 -0700 Subject: [PATCH 04/16] use normal ubuntu --- .github/workflows/cron.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index a00868a4..438d8e2f 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -7,10 +7,7 @@ on: jobs: amazon-build: name: Update Amazon 2 BTF Archive - runs-on: - [ - "github-self-hosted_ami-0f4881c8d69684001_${{ github.event.number }}-${{ github.run_id }}", - ] + runs-on: ubuntu-latest container: image: amazonlinux:2 steps: @@ -87,10 +84,7 @@ jobs: GOPATH: "/tmp/go" GOCACHE: "/tmp/go-cache" GOROOT: "/usr/local/go" - runs-on: - [ - "github-self-hosted_ami-0f4881c8d69684001_${{ github.event.number }}-${{ github.run_id }}", - ] + runs-on: ubuntu-latest steps: # - name: Setup Swap File From 7e41a8e97f0ab482fc0853dbfb3fbe128afb78ac Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 13:48:51 -0700 Subject: [PATCH 05/16] assumeyes --- .github/workflows/cron.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 438d8e2f..5cbe2c4c 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -13,8 +13,8 @@ jobs: steps: - name: Install needed amazon packages run: | - yum install yum-utils tar gzip xz clang make cmake git libdwarf-devel elfutils-libelf-devel elfutils-devel - yum-config-manager --enable amzn2-core-debuginfo + yum install -y yum-utils tar gzip xz clang make cmake git libdwarf-devel elfutils-libelf-devel elfutils-devel + yum-config-manager -y --enable amzn2-core-debuginfo shell: bash # - name: Authenticate From 6726c4dafe3ab6c8143034595b909a264af0d494 Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 12:20:37 -0700 Subject: [PATCH 06/16] only use sudo when necessary --- .gitignore | 4 +++- pkg/pkg/utils.go | 5 ++--- pkg/repo/rhel.go | 3 ++- pkg/repo/utils.go | 6 ++++-- pkg/utils/btf.go | 8 ++++++++ 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index d888caa2..8b813b6e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ +# binary btfhub # arvhices archive/* custom-archive/* # makefile leftovers .check* -# binary +# JetBrains +.idea/ diff --git a/pkg/pkg/utils.go b/pkg/pkg/utils.go index 6760300c..0f3eb566 100644 --- a/pkg/pkg/utils.go +++ b/pkg/pkg/utils.go @@ -31,9 +31,8 @@ func yumDownload(ctx context.Context, pkg string, destdir string) error { destDirParam := fmt.Sprintf("--downloaddir=%s", destdir) - cmd := exec.CommandContext(ctx, - "sudo", "yum", "install", "-y", "--downloadonly", destDirParam, pkg, - ) + binary, args := utils.SudoCMD("yum", "install", "-y", "--downloadonly", destDirParam, pkg) + cmd := exec.CommandContext(ctx, binary, args...) cmd.Stdout = os.Stdout cmd.Stderr = stderr diff --git a/pkg/repo/rhel.go b/pkg/repo/rhel.go index 9b6833df..098af1fd 100644 --- a/pkg/repo/rhel.go +++ b/pkg/repo/rhel.go @@ -45,7 +45,8 @@ func (d *RHELRepo) GetKernelPackages( ) error { altArch := d.archs[arch] rver := d.releaseVersions[release+":"+altArch] - if err := utils.RunCMD(ctx, "", "sudo", "subscription-manager", "release", fmt.Sprintf("--set=%s", rver)); err != nil { + binary, args := utils.SudoCMD("subscription-manager", "release", fmt.Sprintf("--set=%s", rver)) + if err := utils.RunCMD(ctx, "", binary, args...); err != nil { return err } diff --git a/pkg/repo/utils.go b/pkg/repo/utils.go index 25149fe9..8c679705 100644 --- a/pkg/repo/utils.go +++ b/pkg/repo/utils.go @@ -12,11 +12,12 @@ import ( "path/filepath" "strings" + "golang.org/x/exp/maps" + "github.com/aquasecurity/btfhub/pkg/job" "github.com/aquasecurity/btfhub/pkg/kernel" "github.com/aquasecurity/btfhub/pkg/pkg" "github.com/aquasecurity/btfhub/pkg/utils" - "golang.org/x/exp/maps" ) func parseYumPackages(rdr io.Reader, minVersion kernel.Version) ([]pkg.Package, error) { @@ -62,7 +63,8 @@ func parseYumPackages(rdr io.Reader, minVersion kernel.Version) ([]pkg.Package, func yumSearch(ctx context.Context, pkg string) (*bytes.Buffer, error) { stdout := &bytes.Buffer{} stderr := &bytes.Buffer{} - cmd := exec.CommandContext(ctx, "sudo", "yum", "search", "--showduplicates", pkg) + binary, args := utils.SudoCMD("yum", "search", "--showduplicates", pkg) + cmd := exec.CommandContext(ctx, binary, args...) cmd.Stdout = stdout cmd.Stderr = stderr if err := cmd.Run(); err != nil { diff --git a/pkg/utils/btf.go b/pkg/utils/btf.go index 07dd7801..56b9223f 100644 --- a/pkg/utils/btf.go +++ b/pkg/utils/btf.go @@ -5,6 +5,7 @@ import ( "context" "debug/elf" "fmt" + "os" "os/exec" "strings" ) @@ -34,3 +35,10 @@ func RunCMD(ctx context.Context, cwd string, binary string, args ...string) erro return nil } + +func SudoCMD(binary string, args ...string) (string, []string) { + if os.Getuid() != 0 { + return "sudo", append([]string{binary}, args...) + } + return binary, args +} From 3dda5f79bb207e7dadff161a53034a1a1f917b2a Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 14:17:13 -0700 Subject: [PATCH 07/16] change root detection --- pkg/utils/btf.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/utils/btf.go b/pkg/utils/btf.go index 56b9223f..07f8b0b8 100644 --- a/pkg/utils/btf.go +++ b/pkg/utils/btf.go @@ -5,7 +5,6 @@ import ( "context" "debug/elf" "fmt" - "os" "os/exec" "strings" ) @@ -37,7 +36,8 @@ func RunCMD(ctx context.Context, cwd string, binary string, args ...string) erro } func SudoCMD(binary string, args ...string) (string, []string) { - if os.Getuid() != 0 { + _, err := exec.LookPath("sudo") + if err == nil { return "sudo", append([]string{binary}, args...) } return binary, args From 3593ea71168e19ab56bf4cc9cf6c24c5a2c251be Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 14:35:40 -0700 Subject: [PATCH 08/16] fix checkout --- .github/workflows/cron.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 5cbe2c4c..458afa9b 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -24,7 +24,6 @@ jobs: - name: Check out BTFHub uses: actions/checkout@v3 with: - repository: aquasecurity/btfhub path: ./btfhub # token: ${{ secrets.PAT_RAFAEL }} @@ -150,7 +149,6 @@ jobs: - name: Check out BTFHub uses: actions/checkout@v3 with: - repository: aquasecurity/btfhub path: ./btfhub # token: ${{ secrets.PAT_RAFAEL }} # Authenticate From a380daa6c5605a16695978091ae59e88ef890106 Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 15:09:42 -0700 Subject: [PATCH 09/16] checkout archive once --- .github/workflows/cron.yml | 111 ++++++++++++------------------------- archive/.gitignore | 1 - custom-archive/.gitignore | 1 - 3 files changed, 36 insertions(+), 77 deletions(-) delete mode 100644 archive/.gitignore delete mode 100644 custom-archive/.gitignore diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 458afa9b..b5a8de2b 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -5,11 +5,43 @@ on: - cron: "0 1 * * *" workflow_dispatch: {} jobs: - amazon-build: + archive-checkout: + name: Checkout BTFHub Archive + runs-on: ubuntu-latest + steps: + - name: Checkout BTFHub Archive + uses: actions/checkout@v3 + with: + repository: aquasecurity/btfhub-archive + path: archive + # token: ${{ secrets.PAT_RAFAEL }} + + commit-changes: + name: Commit archive changes + needs: [amazon-update, host-update] + runs-on: ubuntu-latest + steps: + - name: Check Status + run: | + cd archive + git status +# - name: Commit and Push to BTFHub Archive +# run: | +# cd archive +# git config --local user.name "Rafael David Tinoco" +# git config --local user.email "rafaeldtinoco@gmail.com" +# git add -A +# git diff-index --quiet HEAD || git commit -m "Update BTFHUB Archive from BTFHUB" +# git push + + amazon-update: name: Update Amazon 2 BTF Archive + needs: archive-checkout runs-on: ubuntu-latest container: image: amazonlinux:2 + volumes: + - archive:/root/archive steps: - name: Install needed amazon packages run: | @@ -23,15 +55,7 @@ jobs: - name: Check out BTFHub uses: actions/checkout@v3 - with: - path: ./btfhub -# token: ${{ secrets.PAT_RAFAEL }} - - - name: Checkout BTFHub Archive - uses: actions/checkout@v3 - with: - repository: aquasecurity/btfhub-archive - path: ./btfhub/archive +# with: # token: ${{ secrets.PAT_RAFAEL }} - uses: actions/setup-go@v4 @@ -40,7 +64,6 @@ jobs: - name: build pahole run: | - cd btfhub git submodule update --init --recursive 3rdparty/dwarves cd ./3rdparty/dwarves mkdir build @@ -53,31 +76,16 @@ jobs: - name: Compile BTFHub Tool run: | - cd btfhub make shell: bash - name: Fetch and Generate new BTFs (AMAZON 2) run: | - cd btfhub ./btfhub -workers 6 -d amzn -r 2 - - name: Check Status - run: | - cd btfhub/archive - git status - -# - name: Commit and Push to BTFHub Archive -# run: | -# cd btfhub/archive -# git config --local user.name "Rafael David Tinoco" -# git config --local user.email "rafaeldtinoco@gmail.com" -# git add -A -# git diff-index --quiet HEAD || git commit -m "Update BTFHUB Archive from BTFHUB" -# git push - - build: + host-update: name: Update BTF Archive + needs: archive-checkout env: HOME: "/tmp/root" GOPATH: "/tmp/go" @@ -148,82 +156,35 @@ jobs: # - name: Check out BTFHub uses: actions/checkout@v3 - with: - path: ./btfhub -# token: ${{ secrets.PAT_RAFAEL }} - # Authenticate - - name: Checkout BTFHub Archive - uses: actions/checkout@v3 - with: - repository: aquasecurity/btfhub-archive - path: ./btfhub-archive # token: ${{ secrets.PAT_RAFAEL }} # - name: Install pahole run: | - cd btfhub ./3rdparty/pahole.sh shell: bash # - - name: Install bpftool - run: | - cd btfhub - ./3rdparty/bpftool.sh - shell: bash - # - - 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 (UBUNTU) run: | - cd btfhub ./btfhub -workers 6 -d ubuntu # 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 (CENTOS) run: | - cd btfhub ./btfhub -workers 6 -d centos # - 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: 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 -# run: | -# cd btfhub-archive -# git config --local user.name "Rafael David Tinoco" -# git config --local user.email "rafaeldtinoco@gmail.com" -# git add -A -# git diff-index --quiet HEAD || git commit -m "Update BTFHUB Archive from BTFHUB" -# git push diff --git a/archive/.gitignore b/archive/.gitignore deleted file mode 100644 index 72e8ffc0..00000000 --- a/archive/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/custom-archive/.gitignore b/custom-archive/.gitignore deleted file mode 100644 index 72e8ffc0..00000000 --- a/custom-archive/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* From 11bb84da309740cd930a4ed6c7571332706a15a0 Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 15:18:56 -0700 Subject: [PATCH 10/16] use v4 checkout --- .github/workflows/cron.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index b5a8de2b..8e1f4edb 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout BTFHub Archive - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: aquasecurity/btfhub-archive path: archive @@ -54,7 +54,7 @@ jobs: # gh auth login --with-token <<<'${{ secrets.PAT_RAFAEL }}' - name: Check out BTFHub - uses: actions/checkout@v3 + uses: actions/checkout@v4 # with: # token: ${{ secrets.PAT_RAFAEL }} @@ -155,7 +155,7 @@ jobs: # gh auth login --with-token <<<'${{ secrets.PAT_RAFAEL }}' # - name: Check out BTFHub - uses: actions/checkout@v3 + uses: actions/checkout@v4 # token: ${{ secrets.PAT_RAFAEL }} # - name: Install pahole From 57e30665cacd7ee1fb785cf7a14bf21e1ba7d337 Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 15:28:22 -0700 Subject: [PATCH 11/16] v4 doesn't work in a container --- .github/workflows/cron.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 8e1f4edb..d951ed4f 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -54,7 +54,7 @@ jobs: # gh auth login --with-token <<<'${{ secrets.PAT_RAFAEL }}' - name: Check out BTFHub - uses: actions/checkout@v4 + uses: actions/checkout@v3 # with: # token: ${{ secrets.PAT_RAFAEL }} From a6753ce82804d389cb87ed2cbf19f01a80f49762 Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 15:28:35 -0700 Subject: [PATCH 12/16] setup go for host --- .github/workflows/cron.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index d951ed4f..9bc51049 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -86,13 +86,11 @@ jobs: host-update: name: Update BTF Archive needs: archive-checkout - env: - HOME: "/tmp/root" - GOPATH: "/tmp/go" - GOCACHE: "/tmp/go-cache" - GOROOT: "/usr/local/go" runs-on: ubuntu-latest steps: + - uses: actions/setup-go@v4 + with: + go-version: '1.20' # - name: Setup Swap File run: | From de03c74a4e748a81991257c6839e79a8e4d7ffed Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 15:30:22 -0700 Subject: [PATCH 13/16] fix .gitignore --- .gitignore | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8b813b6e..0fe79fff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,7 @@ # binary btfhub -# arvhices -archive/* -custom-archive/* +# archives +archive/ # makefile leftovers .check* # JetBrains From c8012dbc62854a27c1d7fe629ae961fb7e30cfc6 Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 15:38:57 -0700 Subject: [PATCH 14/16] use checkout for submodule --- .github/workflows/cron.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 9bc51049..c247f4dd 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -53,18 +53,18 @@ jobs: # run: | # gh auth login --with-token <<<'${{ secrets.PAT_RAFAEL }}' - - name: Check out BTFHub - uses: actions/checkout@v3 -# with: -# token: ${{ secrets.PAT_RAFAEL }} - - uses: actions/setup-go@v4 with: go-version: '1.20' + - name: Check out BTFHub + uses: actions/checkout@v3 + with: + submodules: 'recursive' +# token: ${{ secrets.PAT_RAFAEL }} + - name: build pahole run: | - git submodule update --init --recursive 3rdparty/dwarves cd ./3rdparty/dwarves mkdir build cd build From a1d124104c30c6ccf468396fa585d11f875f7210 Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 15:49:23 -0700 Subject: [PATCH 15/16] Use user option to fix ownership issue --- .github/workflows/cron.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index c247f4dd..98f14ada 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -40,6 +40,7 @@ jobs: runs-on: ubuntu-latest container: image: amazonlinux:2 + options: --user 1001 volumes: - archive:/root/archive steps: @@ -58,7 +59,7 @@ jobs: go-version: '1.20' - name: Check out BTFHub - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' # token: ${{ secrets.PAT_RAFAEL }} From 1c9869983d421bba339c7ca593a807602e082293 Mon Sep 17 00:00:00 2001 From: Bryce Kahle Date: Thu, 28 Sep 2023 16:12:57 -0700 Subject: [PATCH 16/16] try other fix --- .github/workflows/cron.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 98f14ada..c045dc8e 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -40,7 +40,6 @@ jobs: runs-on: ubuntu-latest container: image: amazonlinux:2 - options: --user 1001 volumes: - archive:/root/archive steps: @@ -64,6 +63,9 @@ jobs: submodules: 'recursive' # token: ${{ secrets.PAT_RAFAEL }} + - run: git config --system --add safe.directory $(pwd) + shell: bash + - name: build pahole run: | cd ./3rdparty/dwarves