Skip to content

Commit 8fb3cea

Browse files
Merge pull request #136 from AndreaBozzo/CICD/core-build-checks
Add CI/CD pipeline for core build checks
2 parents c08d6c3 + 39fd40c commit 8fb3cea

File tree

2 files changed

+113
-2
lines changed

2 files changed

+113
-2
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Core Build Checks
2+
3+
on:
4+
pull_request:
5+
branches: [ main, PreReleaseMain ]
6+
push:
7+
branches: [ main, PreReleaseMain ]
8+
9+
jobs:
10+
build-core-components:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v3
19+
20+
- name: Install Rust toolchain
21+
uses: dtolnay/rust-toolchain@master
22+
with:
23+
toolchain: nightly
24+
components: rust-src
25+
26+
- name: Install BPF dependencies
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install -y \
30+
clang \
31+
llvm \
32+
libelf-dev \
33+
libpcap-dev \
34+
build-essential \
35+
libbpf-dev \
36+
linux-tools-generic \
37+
linux-tools-common \
38+
protobuf-compiler
39+
40+
- name: Install bindgen-cli and bpf-linker
41+
run: |
42+
cargo install bindgen-cli
43+
cargo install bpf-linker
44+
45+
- name: Setup bpftool symlink
46+
run: |
47+
sudo ln -sf /usr/lib/linux-tools/*/bpftool /usr/local/bin/bpftool || \
48+
sudo ln -sf /usr/lib/linux-tools-*/bpftool /usr/local/bin/bpftool
49+
50+
- name: Build CortexFlow Agent
51+
run: |
52+
cd core
53+
chmod +x agent-api-build.sh
54+
echo "🚀 Starting CortexFlow Agent build..."
55+
./agent-api-build.sh || { echo "❌ Agent build failed"; exit 1; }
56+
echo "✅ Agent build completed"
57+
58+
- name: Build CortexFlow Identity
59+
run: |
60+
cd core/src/components/identity
61+
chmod +x build-identity.sh
62+
echo "🚀 Starting CortexFlow Identity build..."
63+
./build-identity.sh || { echo "❌ Identity build failed"; exit 1; }
64+
echo "✅ Identity build completed"
65+
66+
- name: Build CortexFlow Metrics
67+
run: |
68+
cd core/src/components/metrics
69+
chmod +x build-metrics.sh
70+
echo "🚀 Starting CortexFlow Metrics build..."
71+
./build-metrics.sh || { echo "❌ Metrics build failed"; exit 1; }
72+
echo "✅ Metrics build completed"
73+
74+
- name: Verify Docker images were built
75+
run: |
76+
echo "Listing all Docker images:"
77+
docker images
78+
echo "Checking for core component images..."
79+
80+
# Check cortexflow-agent
81+
if docker images | grep -q "cortexflow-agent"; then
82+
echo "✅ cortexflow-agent image found"
83+
else
84+
echo "❌ cortexflow-agent image not found"
85+
exit 1
86+
fi
87+
88+
# Check identity
89+
if docker images | grep -q "identity"; then
90+
echo "✅ identity image found"
91+
else
92+
echo "❌ identity image not found"
93+
exit 1
94+
fi
95+
96+
# Check metrics
97+
if docker images | grep -q "metrics"; then
98+
echo "✅ metrics image found"
99+
else
100+
echo "❌ metrics image not found"
101+
exit 1
102+
fi
103+
104+
- name: Verify builds completed successfully
105+
run: |
106+
echo "All Docker builds completed successfully!"
107+
echo "CI pipeline focuses on build verification, not tests"
108+
109+
- name: Cleanup build artifacts
110+
run: |
111+
docker system prune -f

core/src/components/metrics_tracer/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ fn try_metrics_tracer(ctx: ProbeContext) -> Result<u32, i64> {
4141
let sk_err = unsafe { bpf_probe_read_kernel::<i32>(sk_pointer.add(sk_err_offset) as *const i32).map_err(|_| 1)? };
4242
let sk_err_soft = unsafe { bpf_probe_read_kernel::<i32>(sk_pointer.add(sk_err_soft_offset) as *const i32).map_err(|_| 1)? };
4343
let sk_backlog_len = unsafe { bpf_probe_read_kernel::<i32>(sk_pointer.add(sk_backlog_len_offset) as *const i32).map_err(|_| 1)? };
44-
let sk_write_memory_queued = unsafe { bpf_probe_read_kernel::<i32>(sk_pointer.add(sk_wmem_queued_offset) as *const i32).map_err(|_| 1)? };
45-
let sk_receive_buffer_size = unsafe { bpf_probe_read_kernel::<i32>(sk_pointer.add(sk_rcvbuf_offset) as *const i32).map_err(|_| 1)? };
44+
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)? };
45+
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)? };
4646
let sk_ack_backlog = unsafe { bpf_probe_read_kernel::<u32>(sk_pointer.add(sk_ack_backlog_offset) as *const u32).map_err(|_| 1)? };
4747
let sk_drops = unsafe { bpf_probe_read_kernel::<i32>(sk_pointer.add(sk_drops_offset) as *const i32).map_err(|_| 1)? };
4848

0 commit comments

Comments
 (0)