Skip to content

Commit b0d1c4a

Browse files
authored
Merge pull request #61 from parca-dev/merge-3-25
Merge upstream changes March 25
2 parents 398dd62 + 8ded5db commit b0d1c4a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1066
-679
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
analyze:
1313
name: Analyze Go (${{ matrix.target_arch }})
14-
if: ${{ github.actor != 'dependabot[bot]' }}
14+
if: ${{ github.actor != 'dependabot[bot]' && github.repository == 'open-telemetry/opentelemetry-ebpf-profiler' }}
1515
runs-on: ubuntu-24.04
1616
strategy:
1717
matrix:

.github/workflows/env/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ runs:
3030
sudo apt-get install -y curl unzip gcc-aarch64-linux-gnu \
3131
libc6-arm64-cross qemu-user-binfmt libc6:arm64 \
3232
musl-dev:amd64 musl-dev:arm64 musl-tools binutils-aarch64-linux-gnu
33+
- name: Set up Go
34+
uses: actions/setup-go@v5
35+
with:
36+
go-version-file: go.mod
37+
cache-dependency-path: go.sum
38+
id: go
3339
- name: Install Rust
3440
uses: dtolnay/rust-toolchain@stable
3541
with:

.github/workflows/fossa.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ permissions:
1111
jobs:
1212
fossa:
1313
runs-on: ubuntu-latest
14+
if: github.repository == 'open-telemetry/opentelemetry-ebpf-profiler'
1415
steps:
1516
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1617

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: OSSF Scorecard
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
schedule:
8+
- cron: "31 6 * * 4" # once a week
9+
workflow_dispatch:
10+
11+
permissions: read-all
12+
13+
jobs:
14+
analysis:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
# Needed for Code scanning upload
18+
security-events: write
19+
# Needed for GitHub OIDC token if publish_results is true
20+
id-token: write
21+
steps:
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
with:
24+
persist-credentials: false
25+
26+
- uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
27+
with:
28+
results_file: results.sarif
29+
results_format: sarif
30+
publish_results: true
31+
32+
# Upload the results as artifacts (optional). Commenting out will disable
33+
# uploads of run results in SARIF format to the repository Actions tab.
34+
# https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
35+
- name: "Upload artifact"
36+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
37+
with:
38+
name: SARIF file
39+
path: results.sarif
40+
retention-days: 5
41+
42+
# Upload the results to GitHub's code scanning dashboard (optional).
43+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
44+
- name: "Upload to code-scanning"
45+
uses: github/codeql-action/upload-sarif@5f8171a638ada777af81d42b55959a643bb29017 # v3.28.12
46+
with:
47+
sarif_file: results.sarif

.github/workflows/push-docker-image.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
build-and-push:
1111
runs-on: ubuntu-latest
12+
if: github.repository == 'open-telemetry/opentelemetry-ebpf-profiler'
1213
steps:
1314
- name: Checkout code
1415
uses: actions/checkout@v4

.github/workflows/unit-test-on-pull-request.yml

Lines changed: 20 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ jobs:
1515
uses: actions/checkout@v4
1616
- name: Set up environment
1717
uses: ./.github/workflows/env
18-
- name: Set up Go
19-
uses: actions/setup-go@v5
20-
with:
21-
go-version-file: go.mod
22-
check-latest: true
23-
cache-dependency-path: go.sum
24-
id: go
2518
- name: Check for changes in licenses of dependencies
2619
run: |
2720
make legal
@@ -41,13 +34,6 @@ jobs:
4134
uses: actions/checkout@v4
4235
- name: Set up environment
4336
uses: ./.github/workflows/env
44-
- name: Set up Go
45-
uses: actions/setup-go@v5
46-
with:
47-
go-version-file: go.mod
48-
check-latest: true
49-
cache-dependency-path: go.sum
50-
id: go
5137
- name: Get linter version
5238
id: linter-version
5339
run: (echo -n "version="; make linter-version) >> "$GITHUB_OUTPUT"
@@ -75,13 +61,6 @@ jobs:
7561
uses: actions/checkout@v4
7662
- name: Set up environment
7763
uses: ./.github/workflows/env
78-
- name: Set up Go
79-
uses: actions/setup-go@v5
80-
with:
81-
go-version-file: go.mod
82-
check-latest: true
83-
cache-dependency-path: go.sum
84-
id: go
8564
- name: Cache coredump modules
8665
uses: actions/cache@v4
8766
with:
@@ -95,45 +74,46 @@ jobs:
9574
- name: Tests
9675
run: make test TARGET_ARCH=${{ matrix.target_arch }}
9776

98-
check-ebpf-blobs:
99-
name: Check for differences in the eBPF binary blobs
77+
check-binary-blobs:
78+
name: Check for differences in the eBPF and Rust binary blobs
10079
runs-on: ubuntu-24.04
10180
container: otel/opentelemetry-ebpf-profiler-dev:latest
81+
defaults:
82+
run:
83+
shell: bash --login {0}
10284
steps:
10385
- name: Clone code
10486
uses: actions/checkout@v4
105-
- name: Hash eBPF blobs
87+
- name: Hash binary blobs
10688
run: |
107-
sha256sum support/ebpf/tracer.ebpf.release.* > ebpf-blobs.hash
89+
sha256sum support/ebpf/tracer.ebpf.release.* > binary-blobs.hash
90+
sha256sum target/x86_64-unknown-linux-musl/release/libsymblib_capi.a >> binary-blobs.hash
91+
sha256sum target/aarch64-unknown-linux-musl/release/libsymblib_capi.a >> binary-blobs.hash
10892
- name: Rebuild eBPF blobs
10993
run: |
11094
rm support/ebpf/tracer.ebpf.release.*
11195
make amd64 -C support/ebpf
11296
make arm64 -C support/ebpf
97+
- name: Rebuild Rust blobs
98+
run: |
99+
rm -rf target/
100+
make rust-components TARGET_ARCH=amd64
101+
make rust-components TARGET_ARCH=arm64
113102
- name: Check for differences
114103
run: |
115-
if ! sha256sum --check ebpf-blobs.hash; then
116-
echo "Please rebuild and commit the updated eBPF binary blobs."
104+
if ! sha256sum --check binary-blobs.hash; then
105+
echo "Please rebuild and commit the updated binary blobs."
117106
exit 1
118107
fi
119108
120-
121109
build-integration-test-binaries:
122-
name: Build integration test binaries (${{ matrix.target_arch }}-${{ matrix.go_version}})
110+
name: Build integration test binaries (${{ matrix.target_arch }})
123111
runs-on: ubuntu-24.04
124112
timeout-minutes: 10
125113
strategy:
126114
matrix:
127115
target_arch: [amd64, arm64]
128-
go_version: [1.23, 1.24]
129116
steps:
130-
- name: Set up Go
131-
uses: actions/setup-go@v5
132-
with:
133-
go-version: ${{ matrix.go_version }}
134-
check-latest: true
135-
cache-dependency-path: go.sum
136-
id: go
137117
- name: Clone code
138118
uses: actions/checkout@v4
139119
- name: Set up environment
@@ -143,17 +123,16 @@ jobs:
143123
- name: Upload integration test binaries
144124
uses: actions/upload-artifact@v4
145125
with:
146-
name: integration-test-binaries-${{ matrix.target_arch }}-${{ matrix.go_version}}
126+
name: integration-test-binaries-${{ matrix.target_arch }}
147127
path: support/*.test
148128

149129
integration-tests:
150-
name: Integration tests (v${{ matrix.kernel }} ${{ matrix.target_arch }} ${{ matrix.go_version}})
130+
name: Integration tests (v${{ matrix.kernel }} ${{ matrix.target_arch }})
151131
runs-on: ubuntu-24.04
152132
needs: build-integration-test-binaries
153133
timeout-minutes: 10
154134
strategy:
155135
matrix:
156-
go_version: [1.23, 1.24]
157136
include:
158137
# List of available kernels here:
159138
# https://github.com/cilium/ci-kernels/pkgs/container/ci-kernels/versions?filters%5Bversion_type%5D=tagged
@@ -177,13 +156,6 @@ jobs:
177156
steps:
178157
- name: Clone code
179158
uses: actions/checkout@v4
180-
- name: Set up Go
181-
uses: actions/setup-go@v5
182-
with:
183-
go-version: ${{ matrix.go_version }}
184-
check-latest: true
185-
cache-dependency-path: go.sum
186-
id: go
187159
- name: Install dependencies
188160
run: |
189161
sudo apt-get update -y
@@ -196,7 +168,7 @@ jobs:
196168
sudo mv ~/go/bin/bluebox /usr/local/bin/.
197169
- name: Fetch integration test binaries
198170
uses: actions/download-artifact@v4
199-
with: { name: "integration-test-binaries-${{ matrix.target_arch }}-${{ matrix.go_version}}" }
171+
with: { name: "integration-test-binaries-${{ matrix.target_arch }}" }
200172
- name: Fetch precompiled kernel
201173
run: |
202174
install -d ci-kernels

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@
55
/go
66
ebpf-profiler
77
ci-kernels
8-
/target
8+
# Ignore target directory
9+
target/*
10+
# But not these specific paths
11+
!target/x86_64-unknown-linux-musl/release/libsymblib_capi.a
12+
!target/aarch64-unknown-linux-musl/release/libsymblib_capi.a

.golangci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ linters:
9191
- wastedassign
9292
- wsl
9393
- wrapcheck
94-
# the following linters are deprecated
95-
- exportloopref
9694
# we don't want to change code to Go 1.22+ yet
9795
- intrange
9896
- copyloopvar

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ FROM debian:testing-20241223-slim
22

33
WORKDIR /agent
44

5+
RUN dpkg --add-architecture amd64 && dpkg --add-architecture arm64
6+
57
# cross_debian_arch: amd64 or arm64
68
# cross_pkg_arch: x86-64 or aarch64
79
RUN cross_debian_arch=$(uname -m | sed -e 's/aarch64/amd64/' -e 's/x86_64/arm64/'); \
810
cross_pkg_arch=$(uname -m | sed -e 's/aarch64/x86-64/' -e 's/x86_64/aarch64/'); \
911
apt-get update -y && \
1012
apt-get dist-upgrade -y && \
1113
apt-get install -y curl wget make git cmake clang-17 unzip libc6-dev g++ gcc pkgconf \
12-
gcc-${cross_pkg_arch}-linux-gnu libc6-${cross_debian_arch}-cross musl-dev && \
14+
gcc-${cross_pkg_arch}-linux-gnu libc6-${cross_debian_arch}-cross \
15+
musl-dev:amd64 musl-dev:arm64 && \
1316
apt-get clean autoclean && \
1417
apt-get autoremove --yes
1518

0 commit comments

Comments
 (0)