WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
111 changes: 111 additions & 0 deletions .github/workflows/core-build-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Core Build Checks

on:
pull_request:
branches: [ main, PreReleaseMain ]
push:
branches: [ main, PreReleaseMain ]

jobs:
build-core-components:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rust-src

- name: Install BPF dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
clang \
llvm \
libelf-dev \
libpcap-dev \
build-essential \
libbpf-dev \
linux-tools-generic \
linux-tools-common \
protobuf-compiler

- name: Install bindgen-cli and bpf-linker
run: |
cargo install bindgen-cli
cargo install bpf-linker

- name: Setup bpftool symlink
run: |
sudo ln -sf /usr/lib/linux-tools/*/bpftool /usr/local/bin/bpftool || \
sudo ln -sf /usr/lib/linux-tools-*/bpftool /usr/local/bin/bpftool

- name: Build CortexFlow Agent
run: |
cd core
chmod +x agent-api-build.sh
echo "🚀 Starting CortexFlow Agent build..."
./agent-api-build.sh || { echo "❌ Agent build failed"; exit 1; }
echo "✅ Agent build completed"

- name: Build CortexFlow Identity
run: |
cd core/src/components/identity
chmod +x build-identity.sh
echo "🚀 Starting CortexFlow Identity build..."
./build-identity.sh || { echo "❌ Identity build failed"; exit 1; }
echo "✅ Identity build completed"

- name: Build CortexFlow Metrics
run: |
cd core/src/components/metrics
chmod +x build-metrics.sh
echo "🚀 Starting CortexFlow Metrics build..."
./build-metrics.sh || { echo "❌ Metrics build failed"; exit 1; }
echo "✅ Metrics build completed"

- name: Verify Docker images were built
run: |
echo "Listing all Docker images:"
docker images
echo "Checking for core component images..."

# Check cortexflow-agent
if docker images | grep -q "cortexflow-agent"; then
echo "✅ cortexflow-agent image found"
else
echo "❌ cortexflow-agent image not found"
exit 1
fi

# Check identity
if docker images | grep -q "identity"; then
echo "✅ identity image found"
else
echo "❌ identity image not found"
exit 1
fi

# Check metrics
if docker images | grep -q "metrics"; then
echo "✅ metrics image found"
else
echo "❌ metrics image not found"
exit 1
fi

- name: Verify builds completed successfully
run: |
echo "All Docker builds completed successfully!"
echo "CI pipeline focuses on build verification, not tests"

- name: Cleanup build artifacts
run: |
docker system prune -f
4 changes: 2 additions & 2 deletions core/src/components/metrics_tracer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ fn try_metrics_tracer(ctx: ProbeContext) -> Result<u32, i64> {
let sk_err = unsafe { bpf_probe_read_kernel::<i32>(sk_pointer.add(sk_err_offset) as *const i32).map_err(|_| 1)? };
let sk_err_soft = unsafe { bpf_probe_read_kernel::<i32>(sk_pointer.add(sk_err_soft_offset) as *const i32).map_err(|_| 1)? };
let sk_backlog_len = unsafe { bpf_probe_read_kernel::<i32>(sk_pointer.add(sk_backlog_len_offset) as *const i32).map_err(|_| 1)? };
let sk_write_memory_queued = unsafe { bpf_probe_read_kernel::<i32>(sk_pointer.add(sk_wmem_queued_offset) as *const i32).map_err(|_| 1)? };
let sk_receive_buffer_size = unsafe { bpf_probe_read_kernel::<i32>(sk_pointer.add(sk_rcvbuf_offset) as *const i32).map_err(|_| 1)? };
let sk_write_memory_queued = unsafe { bpf_probe_read_kernel::<i32>(sk_pointer.add(sk_write_memory_queued_offset) as *const i32).map_err(|_| 1)? };
let sk_receive_buffer_size = unsafe { bpf_probe_read_kernel::<i32>(sk_pointer.add(sk_receive_buffer_size_offset) as *const i32).map_err(|_| 1)? };
let sk_ack_backlog = unsafe { bpf_probe_read_kernel::<u32>(sk_pointer.add(sk_ack_backlog_offset) as *const u32).map_err(|_| 1)? };
let sk_drops = unsafe { bpf_probe_read_kernel::<i32>(sk_pointer.add(sk_drops_offset) as *const i32).map_err(|_| 1)? };

Expand Down