adjusting publish pipeline to cross-compile because rpis are slow
Some checks failed
CI / Rustfmt (push) Successful in 21s
CI / Clippy (push) Failing after 2m3s
CI / Cargo Audit & Deny (push) Successful in 33s
CI / Web Blocking Checks (push) Successful in 51s
CI / Security Blocking Checks (push) Successful in 5s
CI / Web Advisory Checks (push) Successful in 38s
CI / Security Advisory Checks (push) Successful in 36s
Publish Images / Resolve Publish Metadata (push) Successful in 1s
Publish Images / Publish web (arm64) (push) Successful in 3m34s
Publish Images / Build Rust Bundles (amd64) (push) Failing after 4m1s
CI / Tests (push) Successful in 8m47s
Publish Images / Publish web (amd64) (push) Failing after 46s
Publish Images / Build Rust Bundles (arm64) (push) Failing after 4m3s
Publish Images / Publish agent (arm64) (push) Has been skipped
Publish Images / Publish api (arm64) (push) Has been skipped
Publish Images / Publish agent (amd64) (push) Has been skipped
Publish Images / Publish api (amd64) (push) Has been skipped
Publish Images / Publish executor (arm64) (push) Has been skipped
Publish Images / Publish notifier (arm64) (push) Has been skipped
Publish Images / Publish executor (amd64) (push) Has been skipped
Publish Images / Publish notifier (amd64) (push) Has been skipped
Publish Images / Publish manifest attune-agent (push) Has been skipped
Publish Images / Publish manifest attune-api (push) Has been skipped
Publish Images / Publish manifest attune-executor (push) Has been skipped
Publish Images / Publish manifest attune-notifier (push) Has been skipped
Publish Images / Publish manifest attune-web (push) Has been skipped

This commit is contained in:
2026-03-25 10:07:48 -05:00
parent 8e273ec683
commit a057ad5db5

View File

@@ -34,6 +34,7 @@ env:
REGISTRY_NAMESPACE: ${{ vars.CONTAINER_REGISTRY_NAMESPACE }} REGISTRY_NAMESPACE: ${{ vars.CONTAINER_REGISTRY_NAMESPACE }}
REGISTRY_PLAIN_HTTP: ${{ vars.CONTAINER_REGISTRY_INSECURE }} REGISTRY_PLAIN_HTTP: ${{ vars.CONTAINER_REGISTRY_INSECURE }}
ARTIFACT_REPOSITORY: attune-build-artifacts ARTIFACT_REPOSITORY: attune-build-artifacts
GNU_GLIBC_VERSION: "2.28"
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0 CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10 CARGO_NET_RETRY: 10
@@ -133,9 +134,13 @@ jobs:
include: include:
- arch: amd64 - arch: amd64
runner_label: build-amd64 runner_label: build-amd64
service_rust_target: x86_64-unknown-linux-gnu
service_target: x86_64-unknown-linux-gnu.2.28
musl_target: x86_64-unknown-linux-musl musl_target: x86_64-unknown-linux-musl
- arch: arm64 - arch: arm64
runner_label: build-arm64 runner_label: build-amd64
service_rust_target: aarch64-unknown-linux-gnu
service_target: aarch64-unknown-linux-gnu.2.28
musl_target: aarch64-unknown-linux-musl musl_target: aarch64-unknown-linux-musl
steps: steps:
- name: Checkout - name: Checkout
@@ -156,7 +161,9 @@ jobs:
- name: Setup Rust - name: Setup Rust
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
with: with:
targets: ${{ matrix.musl_target }} targets: |
${{ matrix.service_rust_target }}
${{ matrix.musl_target }}
- name: Cache Cargo registry + index - name: Cache Cargo registry + index
uses: actions/cache@v4 uses: actions/cache@v4
@@ -184,22 +191,69 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
apt-get update apt-get update
apt-get install -y pkg-config libssl-dev musl-tools file apt-get install -y pkg-config libssl-dev file binutils python3 python3-pip
- name: Install Zig
shell: bash
run: |
set -euo pipefail
pip3 install --break-system-packages --no-cache-dir ziglang
- name: Install cargo-zigbuild
shell: bash
run: |
set -euo pipefail
if ! command -v cargo-zigbuild >/dev/null 2>&1; then
cargo install --locked cargo-zigbuild
fi
- name: Build release binaries - name: Build release binaries
shell: bash shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
cargo build --release \ cargo zigbuild --release \
--target "${{ matrix.service_target }}" \
--bin attune-api \ --bin attune-api \
--bin attune-executor \ --bin attune-executor \
--bin attune-notifier --bin attune-notifier
- name: Verify minimum glibc requirement
shell: bash
run: |
set -euo pipefail
output_dir="target/${{ matrix.service_rust_target }}/release"
get_min_glibc() {
local file_path="$1"
readelf -W --version-info --dyn-syms "$file_path" \
| grep 'Name: GLIBC_' \
| sed -E 's/.*GLIBC_(.+) Flags.*/\1/' \
| sort -t . -k1,1n -k2,2n \
| tail -n 1
}
version_gt() {
[ "$(printf '%s\n%s\n' "$1" "$2" | sort -V | tail -n 1)" = "$1" ] && [ "$1" != "$2" ]
}
for binary in attune-api attune-executor attune-notifier; do
min_glibc="$(get_min_glibc "${output_dir}/${binary}")"
if [ -z "${min_glibc}" ]; then
echo "Failed to determine glibc requirement for ${binary}"
exit 1
fi
echo "${binary} requires glibc ${min_glibc}"
if version_gt "${min_glibc}" "${GNU_GLIBC_VERSION}"; then
echo "Expected ${binary} to require glibc <= ${GNU_GLIBC_VERSION}, got ${min_glibc}"
exit 1
fi
done
- name: Build static agent binaries - name: Build static agent binaries
shell: bash shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
cargo build --release \ cargo zigbuild --release \
--target "${{ matrix.musl_target }}" \ --target "${{ matrix.musl_target }}" \
--bin attune-agent \ --bin attune-agent \
--bin attune-sensor-agent --bin attune-sensor-agent
@@ -210,11 +264,12 @@ jobs:
set -euo pipefail set -euo pipefail
bundle_root="dist/bundle/${{ matrix.arch }}" bundle_root="dist/bundle/${{ matrix.arch }}"
service_output_dir="target/${{ matrix.service_rust_target }}/release"
mkdir -p "$bundle_root/bin" "$bundle_root/agent" mkdir -p "$bundle_root/bin" "$bundle_root/agent"
cp target/release/attune-api "$bundle_root/bin/" cp "${service_output_dir}/attune-api" "$bundle_root/bin/"
cp target/release/attune-executor "$bundle_root/bin/" cp "${service_output_dir}/attune-executor" "$bundle_root/bin/"
cp target/release/attune-notifier "$bundle_root/bin/" cp "${service_output_dir}/attune-notifier" "$bundle_root/bin/"
cp target/${{ matrix.musl_target }}/release/attune-agent "$bundle_root/agent/" cp target/${{ matrix.musl_target }}/release/attune-agent "$bundle_root/agent/"
cp target/${{ matrix.musl_target }}/release/attune-sensor-agent "$bundle_root/agent/" cp target/${{ matrix.musl_target }}/release/attune-sensor-agent "$bundle_root/agent/"