Skip to content

Commit e97a7ed

Browse files
committed
feat: add post download hook for ebpf agent type
1 parent 53b2356 commit e97a7ed

6 files changed

Lines changed: 138 additions & 2 deletions

File tree

.github/workflows/component_onhost_e2e.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ permissions:
3030
env:
3131
HOST_E2E_INFRA_AGENT_VERSION: "1.77.1"
3232
HOST_E2E_NRDOT_VERSION: "1.17.0"
33+
HOST_E2E_EBPF_AGENT_VERSION: "1.4.3"
3334

3435
jobs:
3536
build-packages:
@@ -81,7 +82,8 @@ jobs:
8182
--agent-control-version "0.900.${{ github.run_id }}" \
8283
--recipes-repo-branch "main" \
8384
--infra-agent-version "${{ env.HOST_E2E_INFRA_AGENT_VERSION }}" \
84-
--nrdot-version "${{ env.HOST_E2E_NRDOT_VERSION }}"
85+
--nrdot-version "${{ env.HOST_E2E_NRDOT_VERSION }}" \
86+
--ebpf-agent-version "${{ env.HOST_E2E_EBPF_AGENT_VERSION }}"
8587
8688
- name: Report test result to New Relic
8789
if: always()

.github/workflows/on_demand_staging_e2e.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ permissions:
1313
env:
1414
HOST_E2E_INFRA_AGENT_VERSION: "1.72.4"
1515
HOST_E2E_NRDOT_VERSION: "1.8.0"
16+
HOST_E2E_EBPF_AGENT_VERSION: "1.4.3"
1617

1718
jobs:
1819
build-packages:
@@ -64,7 +65,8 @@ jobs:
6465
--agent-control-version "0.600.${{ github.run_id }}" \
6566
--recipes-repo-branch "main" \
6667
--infra-agent-version "${{ env.HOST_E2E_INFRA_AGENT_VERSION }}" \
67-
--nrdot-version "${{ env.HOST_E2E_NRDOT_VERSION }}"
68+
--nrdot-version "${{ env.HOST_E2E_NRDOT_VERSION }}" \
69+
--ebpf-agent-version "${{ env.HOST_E2E_EBPF_AGENT_VERSION }}"
6870
6971
- name: Report test result to New Relic
7072
if: always()

.github/workflows/poc_ebpf.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: eBPF PoC Pipeline
2+
3+
# Runs on push to feat/poc_ebpf_package branch and can be triggered manually
4+
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches:
9+
- add-post-download-in-ebpf-agent-type
10+
- main
11+
pull_request:
12+
branches:
13+
- add-post-download-in-ebpf-agent-type
14+
- main
15+
schedule:
16+
# Scheduled to run at 4 a.m on every day-of-week from Monday through Friday.
17+
- cron: "0 4 * * 1-5"
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
build-packages:
24+
name: Build packages
25+
uses: ./.github/workflows/component_packages.yml
26+
with:
27+
pre-release: false
28+
tag_name: 0.100.${{ github.run_id }}
29+
secrets:
30+
gh_token: ${{ secrets.GITHUB_TOKEN }}
31+
gpg_private_key_base64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }}
32+
gpg_passphrase: ${{ secrets.OHAI_GPG_PASSPHRASE }}
33+
pfx_certificate_base64: ${{ secrets.OHAI_PFX_CERTIFICATE_BASE64 }}
34+
pfx_passphrase: ${{ secrets.OHAI_PFX_PASSPHRASE }}
35+
36+
build-image:
37+
name: Build and Push nightly image
38+
uses: ./.github/workflows/component_image.yml
39+
with:
40+
# the packages are created with 0.100.run_id, however we still push the image with nightly
41+
image-tag: nightly
42+
ac-version: nightly
43+
push: true
44+
secrets: inherit
45+
46+
security-image:
47+
name: Security scan
48+
needs: [ build-image ]
49+
uses: ./.github/workflows/component_image_security.yml
50+
with:
51+
# the packages are created with 0.100.run_id, however we still push the image with nightly
52+
image-tag: nightly
53+
secrets: inherit
54+
55+
security-source-code:
56+
uses: ./.github/workflows/component_security.yml
57+
58+
# This is currently required for canaries
59+
upload-packages-s3:
60+
runs-on: ubuntu-latest
61+
needs: [ build-packages ]
62+
name: Upload packages to testing bucket
63+
steps:
64+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
65+
with:
66+
fetch-depth: 0
67+
68+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
69+
with:
70+
name: built-binaries-0.100.${{ github.run_id }}
71+
path: ./
72+
73+
- name: Publish deb to S3 action
74+
uses: newrelic/infrastructure-publish-action@26d9d8604b2cf2e7343dc287c958e8bbc1a3f750 # v1
75+
with:
76+
tag: 0.100.${{ github.run_id }}
77+
app_name: "newrelic-agent-control"
78+
repo_name: ${{ github.repository }}
79+
schema: "custom-local"
80+
schema_path: "/srv/build/upload-schema-linux-deb-nightly.yml"
81+
aws_access_key_id: ${{ secrets.OHAI_AWS_ACCESS_KEY_ID_TESTING }}
82+
aws_secret_access_key: ${{ secrets.OHAI_AWS_SECRET_ACCESS_KEY_TESTING }}
83+
aws_s3_bucket_name: "nr-downloads-ohai-testing"
84+
aws_s3_lock_bucket_name: "onhost-ci-lock-testing"
85+
access_point_host: "testing"
86+
run_id: ${{ github.run_id }}
87+
aws_region: "us-east-1"
88+
aws_role_session_name: ${{ secrets.OHAI_AWS_ROLE_SESSION_NAME_TESTING }}
89+
aws_role_arn: ${{ secrets.OHAI_AWS_ROLE_ARN_TESTING }}
90+
# used for signing package stuff
91+
gpg_passphrase: ${{ secrets.OHAI_GPG_PASSPHRASE }}
92+
gpg_private_key_base64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded
93+
disable_lock: false
94+
dest_prefix: "poc_ebpf/"
95+
local_packages_path: "/srv/dist/"
96+
apt_skip_mirror: true
97+

agent-control/agent-type-registry/newrelic/host-linux-com.newrelic.ebpf-0.1.0.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,32 @@ variables:
205205
type: bool
206206
required: false
207207
default: false
208+
oci:
209+
repository:
210+
description: "Package repository name"
211+
type: string
212+
required: false
213+
default: vjripoll/newrelic-agent-control-poc
214+
variants:
215+
ac_config_field: "oci_repository_urls"
216+
values: [ "vjripoll/newrelic-agent-control-poc" ]
217+
version:
218+
description: "Agent version"
219+
type: string
220+
required: true
208221
deployment:
209222
enable_file_logging: ${nr-var:enable_file_logging}
223+
packages:
224+
ebpf-agent:
225+
download:
226+
oci:
227+
repository: ${nr-var:oci.repository}
228+
version: ${nr-var:version}
229+
# public_key_url removed for manual POC test (image in ghcr.io/vjripoll is unsigned) — REVERT before merge
230+
post_download_hook:
231+
path: /bin/bash
232+
args:
233+
- post_download.sh
210234
executables:
211235
- id: nr-ebpf-agent-client
212236
path: /usr/bin/nr-ebpf-agent-client

test/e2e-runner/src/common.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ pub struct InstallationArgs {
8989
/// Version of the NRDot OCI image to use in tests
9090
#[arg(long)]
9191
pub nrdot_version: Option<String>,
92+
93+
/// Version of the eBPF agent OCI image to use in tests
94+
#[arg(long)]
95+
pub ebpf_agent_version: Option<String>,
9296
}
9397

9498
/// Arguments for Fleet Control scenarios that also install Agent Control

test/e2e-runner/src/linux/scenarios/ebpf_agent.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ pub fn test_ebpf_agent(args: InstallationArgs) {
2121
.clone()
2222
.expect("--infra-agent-version is required for this scenario");
2323

24+
let ebpf_version = args
25+
.ebpf_agent_version
26+
.clone()
27+
.expect("--ebpf-agent-version is required for this scenario");
28+
2429
let staging = args.nr_region == Region::Staging;
2530

2631
let recipe_data = RecipeData {
@@ -59,13 +64,15 @@ agents:
5964
config_agent:
6065
DEPLOYMENT_NAME: {test_id}
6166
OTLP_ENDPOINT: staging-otlp.nr-data.net:443
67+
version: {ebpf_version}
6268
"#
6369
)
6470
} else {
6571
format!(
6672
r#"
6773
config_agent:
6874
DEPLOYMENT_NAME: {test_id}
75+
version: {ebpf_version}
6976
"#
7077
)
7178
};

0 commit comments

Comments
 (0)