fix(ci): ship benches into the edge image and refresh actions
The edge Dockerfile copied Cargo.toml but not benches/, so cargo refused to parse the manifest over the declared [[bench]] hot_paths target and the image build died with exit 101 before compiling anything. Also bump checkout/buildx/build-push to their node24 majors and pin ubuntu-24.04 to clear the runner deprecation notices.
This commit is contained in:
parent
15f3fcb895
commit
1b3ae5e546
2 changed files with 22 additions and 19 deletions
36
.github/workflows/ci.yml
vendored
36
.github/workflows/ci.yml
vendored
|
|
@ -14,9 +14,9 @@ env:
|
||||||
jobs:
|
jobs:
|
||||||
rust-check:
|
rust-check:
|
||||||
name: Rust — check & clippy
|
name: Rust — check & clippy
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
components: clippy, rustfmt
|
components: clippy, rustfmt
|
||||||
|
|
@ -31,29 +31,29 @@ jobs:
|
||||||
- name: XDP — smoke-check BPF compilation (clang)
|
- name: XDP — smoke-check BPF compilation (clang)
|
||||||
run: |
|
run: |
|
||||||
mkdir -p target/xdp
|
mkdir -p target/xdp
|
||||||
# clang with `-target bpf` не смотрит в multiarch-каталог glibc,
|
# clang with `-target bpf` does not search the glibc multiarch directory,
|
||||||
# поэтому asm/types.h из linux/types.h ищем явно.
|
# so the asm/types.h pulled in by linux/types.h needs an explicit -I.
|
||||||
clang -O2 -g -target bpf -I"/usr/include/$(gcc -print-multiarch)" \
|
clang -O2 -g -target bpf -I"/usr/include/$(gcc -print-multiarch)" \
|
||||||
-c xdp/core/universal_filter.c -o target/xdp/universal_filter.o
|
-c xdp/core/universal_filter.c -o target/xdp/universal_filter.o
|
||||||
test -f target/xdp/universal_filter.o
|
test -f target/xdp/universal_filter.o
|
||||||
|
|
||||||
rust-test:
|
rust-test:
|
||||||
name: Rust — test
|
name: Rust — test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
# libbpf-sys собирает vendored libbpf (нужны libelf/zlib), а build.rs
|
# libbpf-sys builds a vendored libbpf (needs libelf/zlib), and build.rs
|
||||||
# компилирует XDP-программу через clang (нужны libbpf-dev/linux-libc-dev)
|
# compiles the XDP program with clang (needs libbpf-dev/linux-libc-dev).
|
||||||
- run: sudo apt-get update && sudo apt-get install -y libelf-dev zlib1g-dev libbpf-dev clang linux-libc-dev
|
- run: sudo apt-get update && sudo apt-get install -y libelf-dev zlib1g-dev libbpf-dev clang linux-libc-dev
|
||||||
- run: cargo test --all-features
|
- run: cargo test --all-features
|
||||||
|
|
||||||
rust-test-no-default-features:
|
rust-test-no-default-features:
|
||||||
name: Rust — test (no default features, protocol-http)
|
name: Rust — test (no default features, protocol-http)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- run: sudo apt-get update && sudo apt-get install -y libelf-dev zlib1g-dev libbpf-dev clang linux-libc-dev
|
- run: sudo apt-get update && sudo apt-get install -y libelf-dev zlib1g-dev libbpf-dev clang linux-libc-dev
|
||||||
|
|
@ -63,9 +63,9 @@ jobs:
|
||||||
|
|
||||||
repo-gates:
|
repo-gates:
|
||||||
name: Repo — module size & default secrets
|
name: Repo — module size & default secrets
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- name: Module size gate
|
- name: Module size gate
|
||||||
run: bash scripts/check_module_size.sh
|
run: bash scripts/check_module_size.sh
|
||||||
- name: Default secrets gate
|
- name: Default secrets gate
|
||||||
|
|
@ -73,22 +73,22 @@ jobs:
|
||||||
|
|
||||||
rust-deny:
|
rust-deny:
|
||||||
name: Rust — cargo-deny
|
name: Rust — cargo-deny
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- uses: EmbarkStudios/cargo-deny-action@v2
|
- uses: EmbarkStudios/cargo-deny-action@v2
|
||||||
with:
|
with:
|
||||||
command: check
|
command: check
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
name: Docker — build edge image
|
name: Docker — build edge image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
needs: [rust-test]
|
needs: [rust-test]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- uses: docker/setup-buildx-action@v3
|
- uses: docker/setup-buildx-action@v4
|
||||||
- name: Build edge
|
- name: Build edge
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: deploy/docker/Dockerfile.edge
|
file: deploy/docker/Dockerfile.edge
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,11 @@ WORKDIR /app
|
||||||
COPY Cargo.toml Cargo.lock rustfmt.toml clippy.toml deny.toml build.rs ./
|
COPY Cargo.toml Cargo.lock rustfmt.toml clippy.toml deny.toml build.rs ./
|
||||||
COPY src/ ./src/
|
COPY src/ ./src/
|
||||||
COPY xdp/ ./xdp/
|
COPY xdp/ ./xdp/
|
||||||
|
# Cargo.toml declares `[[bench]] hot_paths`; the manifest does not parse unless
|
||||||
|
# the target file exists, even though the image only builds the `rampart` bin.
|
||||||
|
COPY benches/ ./benches/
|
||||||
|
|
||||||
# Smoke-check: BPF-программа компилируется clang'ом (не грузится, только сборка)
|
# Smoke-check: the BPF program compiles with clang (build only, never loaded).
|
||||||
RUN if command -v clang >/dev/null; then \
|
RUN if command -v clang >/dev/null; then \
|
||||||
mkdir -p /app/target/xdp && \
|
mkdir -p /app/target/xdp && \
|
||||||
clang -O2 -g -target bpf -I"/usr/include/$(gcc -print-multiarch)" -c xdp/core/universal_filter.c -o /app/target/xdp/universal_filter.o; \
|
clang -O2 -g -target bpf -I"/usr/include/$(gcc -print-multiarch)" -c xdp/core/universal_filter.c -o /app/target/xdp/universal_filter.o; \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue