mirror of
https://codeberg.org/Toasterson/solstice-ci.git
synced 2026-04-10 13:20:41 +00:00
This commit includes: - Adjusted runner logs from `info` to `debug` for reduced deployment log verbosity while retaining visibility in CI. - Added functionality to serve runner binaries directly from the orchestrator via HTTP. - Introduced new `RUNNER_DIR` configuration to specify the binary directory, with default paths and URL composition. - Updated HTTP routing to include runner file serving with validation and logging. - Improved AMQP body logging with a utility for better error debugging. - Updated task scripts for runner cross-building and serving, consolidating configurations and removing redundant files.
49 lines
1.7 KiB
Bash
Executable file
49 lines
1.7 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
# Cross-build the workflow-runner for Linux and Illumos targets.
|
|
# Requires: cross (https://github.com/cross-rs/cross)
|
|
# Builds and stages runner binaries under target/runners for the orchestrator HTTP server.
|
|
# Outputs (staged for serving by orchestrator):
|
|
# - target/runners/solstice-runner-linux
|
|
# - target/runners/solstice-runner-illumos
|
|
# - target/runners/solstice-runner (symlink to -linux by default)
|
|
|
|
ROOT_DIR=$(cd "$(dirname "$0")/../../.." && pwd)
|
|
cd "$ROOT_DIR"
|
|
|
|
if ! command -v cross >/dev/null 2>&1; then
|
|
echo "cross is required. Install with: cargo install cross" >&2
|
|
exit 127
|
|
fi
|
|
|
|
# Build Linux runner
|
|
cross build -p workflow-runner --target x86_64-unknown-linux-gnu --release
|
|
# Build Illumos runner
|
|
cross build -p workflow-runner --target x86_64-unknown-illumos --release
|
|
|
|
LIN_BIN="${ROOT_DIR}/target/x86_64-unknown-linux-gnu/release/solstice-runner"
|
|
ILL_BIN="${ROOT_DIR}/target/x86_64-unknown-illumos/release/solstice-runner"
|
|
SERVE_DIR="${ROOT_DIR}/target/runners"
|
|
mkdir -p "$SERVE_DIR"
|
|
|
|
# Stage with orchestrator-expected filenames
|
|
if [[ -f "$LIN_BIN" ]]; then
|
|
cp -f "$LIN_BIN" "$SERVE_DIR/solstice-runner-linux"
|
|
chmod +x "$SERVE_DIR/solstice-runner-linux" || true
|
|
fi
|
|
if [[ -f "$ILL_BIN" ]]; then
|
|
cp -f "$ILL_BIN" "$SERVE_DIR/solstice-runner-illumos"
|
|
chmod +x "$SERVE_DIR/solstice-runner-illumos" || true
|
|
fi
|
|
|
|
# Provide a generic solstice-runner as a convenience (symlink to linux)
|
|
if [[ -f "$SERVE_DIR/solstice-runner-linux" ]]; then
|
|
ln -sf "solstice-runner-linux" "$SERVE_DIR/solstice-runner"
|
|
fi
|
|
|
|
echo "Built runner binaries:" >&2
|
|
ls -l "$LIN_BIN" 2>/dev/null || true
|
|
ls -l "$ILL_BIN" 2>/dev/null || true
|
|
|
|
echo "Staged for orchestrator serving under $SERVE_DIR:" >&2
|
|
ls -l "$SERVE_DIR" 2>/dev/null || true
|