Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e7e440c
add initial issue
yonch Sep 18, 2025
31bc767
address comments
yonch Sep 18, 2025
b8773ee
address code review
yonch Sep 18, 2025
6f54df3
initial impl
yonch Sep 18, 2025
128706d
move reusable workflows to .github/workflows (subdirectories are not …
yonch Sep 18, 2025
bf8bbfe
fix builder-base references
yonch Sep 18, 2025
4ecea18
fix workdir and path in Containerfile
yonch Sep 18, 2025
7cb7721
migrate builds and fast check to compile on GH runners
yonch Sep 18, 2025
5b5f570
mark cgroup ID test as #ignore so it does not interrupt unit tests --…
yonch Sep 18, 2025
ff2900f
rename ci-fast.yaml -> reusable-fast.yaml
yonch Sep 18, 2025
d17c46e
remove failing (and unhelpful) doc example
yonch Sep 18, 2025
6d59949
rename workflow ci_orchestrator -> ci
yonch Sep 18, 2025
aa5ca52
remove dependency on fast tests
yonch Sep 19, 2025
ec2f10d
refactor awscli installation to github action
yonch Sep 19, 2025
f3416e4
bring back lost test logic
yonch Sep 19, 2025
8889a7e
fix error in job name
yonch Sep 19, 2025
8a721a7
set benchmark to manual trigger only
yonch Sep 19, 2025
3ce470c
refactor NRI socket check to action
yonch Sep 19, 2025
a0799e3
fix prepare runner
yonch Sep 19, 2025
9444947
fix NRI action
yonch Sep 19, 2025
55d2bcd
use our the current run's built images in reusable-test-helm
yonch Sep 19, 2025
812afc9
refactor the fast checks into three jobs for parallelism
yonch Sep 19, 2025
3b12f69
fix typo in volume size in collector tests
yonch Sep 19, 2025
3ba228d
fix NRI test pod yaml
yonch Sep 19, 2025
8804b03
output diagnostics when helm tests fail to get Ready pods
yonch Sep 19, 2025
3d7500b
merge install-prerequisite step into k3s-setup in helm test
yonch Sep 19, 2025
b48d504
build nri-init on older glibc
yonch Sep 19, 2025
604f1c3
remove redundant unit test run in test-resctrl
yonch Sep 19, 2025
bf43ad1
update container base image to trixie
yonch Sep 19, 2025
776c872
split "fast" checks to multiple workflows
yonch Sep 19, 2025
3807188
remove user and group from collector container
yonch Sep 19, 2025
6aa4d13
add component caching for build
yonch Sep 19, 2025
76782f0
remove issue markdown (it's issue #298)
yonch Sep 19, 2025
a012ba0
remove old Dockerfiles -- replaced with single Containerfile
yonch Sep 19, 2025
893eae8
adjust workflow and job names
yonch Sep 19, 2025
cb55b5e
fix test badge
yonch Sep 19, 2025
f4b9c7b
docs: fix workflow name
yonch Sep 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Exclude everything by default to minimize context size
**

# Allow the packaging Containerfile and prebuilt binaries only
!Containerfile
!dist/**
37 changes: 37 additions & 0 deletions .github/actions/nri-socket-exists/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "nri-socket-exists"
description: "Wait until the NRI socket exists or fail on timeout"
inputs:
socket_path:
description: "Path to the NRI socket"
required: false
default: "/var/run/nri/nri.sock"
timeout:
description: "Timeout in seconds"
required: false
default: "30"
runs:
using: "composite"
steps:
- name: Wait for NRI socket
shell: bash
run: |
set -euo pipefail
SOCKET_PATH="${{ inputs.socket_path }}"
TIMEOUT_SEC="${{ inputs.timeout }}"

echo "=== Waiting for NRI socket at ${SOCKET_PATH} (timeout: ${TIMEOUT_SEC}s) ==="
SECS=0
while [ "$SECS" -lt "$TIMEOUT_SEC" ]; do
if sudo test -S "$SOCKET_PATH"; then
echo "✓ NRI socket present: $SOCKET_PATH"
sudo ls -la "$SOCKET_PATH" || true
exit 0
fi
sleep 1
SECS=$((SECS + 1))
done

echo "✗ NRI socket not found at $SOCKET_PATH after ${TIMEOUT_SEC}s"
# Try to provide some helpful logs if k3s is present
(sudo journalctl -u k3s --no-pager -n 200 || true)
exit 1
17 changes: 17 additions & 0 deletions .github/actions/setup-awscli/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: setup-awscli
description: Install AWS CLI v2
runs:
using: composite
steps:
- name: Install awscli
shell: bash
run: |
set -eux;
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip";
python3 -m zipfile -e awscliv2.zip .;
chmod u+x ./aws/install
sudo ./aws/install
echo ls: `ls -l /usr/local/bin/aws` || true
chmod +x /usr/local/bin/aws || true
echo version: `/usr/local/bin/aws --version` || true

21 changes: 1 addition & 20 deletions .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,6 @@ on:
required: false
default: 'ghcr.io/unvariance/collector/collector'
type: string
pull_request:
paths:
- deploy/opentelemetry-demo/values.yaml
- .github/workflows/benchmark.yaml
- '.github/actions/setup-k3s/**'
push:
branches:
- main
paths:
- deploy/opentelemetry-demo/values.yaml
- .github/workflows/benchmark.yaml
- '.github/actions/setup-k3s/**'

permissions:
id-token: write # Required for requesting the JWT
Expand Down Expand Up @@ -180,14 +168,7 @@ jobs:
echo "Installed podman: $podman_version"

- name: (install) Install awscli
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
python3 -m zipfile -e awscliv2.zip .
chmod u+x ./aws/install
sudo ./aws/install
echo ls: `ls -l /usr/local/bin/aws` || true
chmod +x /usr/local/bin/aws || true
echo version: `/usr/local/bin/aws --version` || true
uses: ./.github/actions/setup-awscli

- name: (collector) Pre-fetch Collector Image
run: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build-collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ on:
paths:
- 'crates/**'
- 'Cargo.toml'
- 'Dockerfile.collector'
- 'Dockerfile.nri-init'
- 'Containerfile'
- '.github/workflows/build-collector.yaml'

permissions:
Expand Down
97 changes: 64 additions & 33 deletions .github/workflows/build-component-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ on:
default: true
type: boolean
outputs:
image:
description: "Built image reference (local tag)"
value: ${{ jobs.build.outputs.image }}
image_repo:
description: "Image repository to use for tests (local/<component>)"
value: ${{ jobs.build.outputs.image_repo }}
image_tag:
description: "Image tag to use for tests (build-<sha>-<run_id>)"
value: ${{ jobs.build.outputs.image_tag }}
image_artifact:
description: "Name of the uploaded image artifact"
value: ${{ jobs.build.outputs.image_artifact }}
Expand All @@ -48,20 +51,18 @@ on:

jobs:
build:
name: Build ${{ inputs.component }} image and binary
name: Build ${{ inputs.component }} binary and image
runs-on: ${{ inputs.runner }}
timeout-minutes: 30
outputs:
image: ${{ steps.out.outputs.image }}
image_repo: ${{ steps.out.outputs.image_repo }}
image_tag: ${{ steps.out.outputs.image_tag }}
image_artifact: ${{ steps.names.outputs.image_artifact }}
binary_artifact: ${{ steps.names.outputs.binary_artifact }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Compute variables
id: meta
shell: bash
Expand All @@ -71,13 +72,15 @@ jobs:
case "$comp" in
collector)
image_name="collector"
dockerfile="Dockerfile.collector"
binary_path="/usr/local/bin/collector"
target="collector"
bin_name="collector"
needs_deps=1
;;
nri-init)
image_name="nri-init"
dockerfile="Dockerfile.nri-init"
binary_path="/usr/local/bin/nri-init"
target="nri-init"
bin_name="nri-init"
needs_deps=0
;;
*)
echo "Unsupported component: $comp" >&2
Expand All @@ -89,8 +92,9 @@ jobs:
# Local-only tag to load and save
local_image="local/${image_name}:build-${short_sha}-${{ github.run_id }}"
echo "local_image=$local_image" >> "$GITHUB_OUTPUT"
echo "dockerfile=$dockerfile" >> "$GITHUB_OUTPUT"
echo "binary_path=$binary_path" >> "$GITHUB_OUTPUT"
echo "target=$target" >> "$GITHUB_OUTPUT"
echo "bin_name=$bin_name" >> "$GITHUB_OUTPUT"
echo "needs_deps=$needs_deps" >> "$GITHUB_OUTPUT"

# Publish target (if push=true)
if [ -n "${{ inputs.image-repository }}" ]; then
Expand All @@ -105,6 +109,41 @@ jobs:
fi
echo "publish_image=${repo}:${tag}" >> "$GITHUB_OUTPUT"

- name: Install build dependencies (collector only)
if: steps.meta.outputs.needs_deps == '1'
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: clang libelf-dev make pkg-config unzip
version: 1.0

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ inputs.component }}
cache-on-failure: true

- name: Build release binary
shell: bash
run: |
set -euo pipefail
comp="${{ inputs.component }}"
if [ "$comp" = "collector" ]; then
cargo build --release --bin collector
else
cargo build --release -p nri-init
fi
mkdir -p dist
cp -f "target/release/${{ steps.meta.outputs.bin_name }}" "dist/${{ steps.meta.outputs.bin_name }}"
chmod +x "dist/${{ steps.meta.outputs.bin_name }}"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
if: inputs.push == true
uses: docker/login-action@v3
Expand All @@ -113,11 +152,12 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build (load locally)
- name: Build packaging image (load locally)
uses: docker/build-push-action@v6
with:
context: .
file: ${{ steps.meta.outputs.dockerfile }}
file: Containerfile
target: ${{ steps.meta.outputs.target }}
tags: ${{ steps.meta.outputs.local_image }}
load: true
cache-from: type=gha
Expand All @@ -142,13 +182,16 @@ jobs:
echo "image_artifact=$image_artifact" >> "$GITHUB_OUTPUT"
echo "binary_artifact=$binary_artifact" >> "$GITHUB_OUTPUT"

- name: Select output image
- name: Select output image metadata
id: out
shell: bash
run: |
# Prefer publish image when pushing, otherwise use local tag
image="${{ inputs.push && steps.meta.outputs.publish_image || steps.meta.outputs.local_image }}"
echo "image=$image" >> "$GITHUB_OUTPUT"
# Always use local repo/tag for tests
local_image="${{ steps.meta.outputs.local_image }}"
image_repo="${local_image%%:*}"
image_tag="${local_image##*:}"
echo "image_repo=$image_repo" >> "$GITHUB_OUTPUT"
echo "image_tag=$image_tag" >> "$GITHUB_OUTPUT"

- name: Save image as tar
if: inputs.upload-image-artifact == true
Expand All @@ -165,22 +208,10 @@ jobs:
path: image.tar
retention-days: 7

- name: Extract binary from image
if: inputs.upload-binary-artifact == true
shell: bash
run: |
set -euo pipefail
cid=$(docker create "${{ steps.meta.outputs.local_image }}")
# Extract to ./<component> (flat file for easier reuse)
out="${{ inputs.component }}"
docker cp "$cid":"${{ steps.meta.outputs.binary_path }}" "$out"
docker rm -v "$cid" >/dev/null
chmod +x "$out"

- name: Upload binary artifact
if: inputs.upload-binary-artifact == true
uses: actions/upload-artifact@v4
with:
name: ${{ steps.names.outputs.binary_artifact }}
path: ${{ inputs.component }}
path: dist/${{ steps.meta.outputs.bin_name }}
retention-days: 7
Loading
Loading